summaryrefslogtreecommitdiff
path: root/connectivity/source
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source')
-rw-r--r--connectivity/source/commontools/AutoRetrievingBase.cxx73
-rw-r--r--connectivity/source/commontools/BlobHelper.cxx72
-rw-r--r--connectivity/source/commontools/CommonTools.cxx375
-rw-r--r--connectivity/source/commontools/ConnectionWrapper.cxx267
-rw-r--r--connectivity/source/commontools/DateConversion.cxx522
-rw-r--r--connectivity/source/commontools/DriversConfig.cxx265
-rw-r--r--connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx905
-rw-r--r--connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx694
-rw-r--r--connectivity/source/commontools/FValue.cxx2380
-rw-r--r--connectivity/source/commontools/ParamterSubstitution.cxx135
-rw-r--r--connectivity/source/commontools/RowFunctionParser.cxx501
-rw-r--r--connectivity/source/commontools/TColumnsHelper.cxx227
-rw-r--r--connectivity/source/commontools/TConnection.cxx108
-rw-r--r--connectivity/source/commontools/TDatabaseMetaDataBase.cxx337
-rw-r--r--connectivity/source/commontools/TIndex.cxx111
-rw-r--r--connectivity/source/commontools/TIndexColumns.cxx129
-rw-r--r--connectivity/source/commontools/TIndexes.cxx264
-rw-r--r--connectivity/source/commontools/TKey.cxx120
-rw-r--r--connectivity/source/commontools/TKeyColumns.cxx146
-rw-r--r--connectivity/source/commontools/TKeys.cxx323
-rw-r--r--connectivity/source/commontools/TPrivilegesResultSet.cxx154
-rw-r--r--connectivity/source/commontools/TSkipDeletedSet.cxx286
-rw-r--r--connectivity/source/commontools/TSortIndex.cxx181
-rw-r--r--connectivity/source/commontools/TTableHelper.cxx635
-rw-r--r--connectivity/source/commontools/conncleanup.cxx247
-rw-r--r--connectivity/source/commontools/dbcharset.cxx234
-rw-r--r--connectivity/source/commontools/dbconversion.cxx492
-rw-r--r--connectivity/source/commontools/dbexception.cxx566
-rw-r--r--connectivity/source/commontools/dbmetadata.cxx451
-rw-r--r--connectivity/source/commontools/dbtools.cxx2173
-rw-r--r--connectivity/source/commontools/dbtools2.cxx975
-rw-r--r--connectivity/source/commontools/filtermanager.cxx189
-rw-r--r--connectivity/source/commontools/formattedcolumnvalue.cxx347
-rwxr-xr-xconnectivity/source/commontools/makefile.mk103
-rw-r--r--connectivity/source/commontools/parameters.cxx1123
-rw-r--r--connectivity/source/commontools/paramwrapper.cxx366
-rw-r--r--connectivity/source/commontools/predicateinput.cxx448
-rw-r--r--connectivity/source/commontools/propertyids.cxx200
-rw-r--r--connectivity/source/commontools/sqlerror.cxx366
-rw-r--r--connectivity/source/commontools/statementcomposer.cxx318
-rw-r--r--connectivity/source/commontools/warningscontainer.cxx126
-rw-r--r--connectivity/source/cpool/ZConnectionPool.cxx335
-rw-r--r--connectivity/source/cpool/ZConnectionPool.hxx157
-rw-r--r--connectivity/source/cpool/ZConnectionWrapper.cxx260
-rw-r--r--connectivity/source/cpool/ZConnectionWrapper.hxx89
-rw-r--r--connectivity/source/cpool/ZDriverWrapper.cxx137
-rw-r--r--connectivity/source/cpool/ZDriverWrapper.hxx91
-rw-r--r--connectivity/source/cpool/ZPoolCollection.cxx581
-rw-r--r--connectivity/source/cpool/ZPoolCollection.hxx150
-rw-r--r--connectivity/source/cpool/ZPooledConnection.cxx88
-rw-r--r--connectivity/source/cpool/ZPooledConnection.hxx70
-rw-r--r--connectivity/source/cpool/Zregistration.cxx75
-rwxr-xr-xconnectivity/source/cpool/dbpool.xml26
-rwxr-xr-xconnectivity/source/cpool/dbpool2.component34
-rwxr-xr-xconnectivity/source/cpool/exports.dxp1
-rwxr-xr-xconnectivity/source/cpool/makefile.mk87
-rwxr-xr-xconnectivity/source/dbtools/dbt.xml14
-rwxr-xr-xconnectivity/source/dbtools/dbtools.component37
-rwxr-xr-xconnectivity/source/dbtools/exports.dxp1
-rwxr-xr-xconnectivity/source/dbtools/makefile.mk108
-rw-r--r--connectivity/source/drivers/adabas/BCatalog.cxx169
-rw-r--r--connectivity/source/drivers/adabas/BColumns.cxx183
-rw-r--r--connectivity/source/drivers/adabas/BConnection.cxx274
-rw-r--r--connectivity/source/drivers/adabas/BDatabaseMetaData.cxx156
-rw-r--r--connectivity/source/drivers/adabas/BDriver.cxx1870
-rw-r--r--connectivity/source/drivers/adabas/BFunctions.cxx256
-rw-r--r--connectivity/source/drivers/adabas/BGroup.cxx93
-rw-r--r--connectivity/source/drivers/adabas/BGroups.cxx94
-rw-r--r--connectivity/source/drivers/adabas/BIndex.cxx105
-rw-r--r--connectivity/source/drivers/adabas/BIndexColumns.cxx123
-rw-r--r--connectivity/source/drivers/adabas/BIndexes.cxx194
-rw-r--r--connectivity/source/drivers/adabas/BKeys.cxx183
-rw-r--r--connectivity/source/drivers/adabas/BPreparedStatement.cxx78
-rw-r--r--connectivity/source/drivers/adabas/BResultSet.cxx225
-rw-r--r--connectivity/source/drivers/adabas/BResultSetMetaData.cxx87
-rw-r--r--connectivity/source/drivers/adabas/BStatement.cxx81
-rw-r--r--connectivity/source/drivers/adabas/BTable.cxx378
-rw-r--r--connectivity/source/drivers/adabas/BTables.cxx523
-rw-r--r--connectivity/source/drivers/adabas/BUser.cxx332
-rw-r--r--connectivity/source/drivers/adabas/BUsers.cxx130
-rw-r--r--connectivity/source/drivers/adabas/BViews.cxx197
-rw-r--r--connectivity/source/drivers/adabas/Bservices.cxx115
-rwxr-xr-xconnectivity/source/drivers/adabas/adabas.component35
-rwxr-xr-xconnectivity/source/drivers/adabas/adabas.mxp.map146
-rw-r--r--connectivity/source/drivers/adabas/adabas.xcu130
-rwxr-xr-xconnectivity/source/drivers/adabas/adabas.xml25
-rwxr-xr-xconnectivity/source/drivers/adabas/exports.dxp1
-rwxr-xr-xconnectivity/source/drivers/adabas/makefile.mk114
-rw-r--r--connectivity/source/drivers/ado/ACallableStatement.cxx237
-rw-r--r--connectivity/source/drivers/ado/ACatalog.cxx127
-rw-r--r--connectivity/source/drivers/ado/AColumn.cxx307
-rw-r--r--connectivity/source/drivers/ado/AColumns.cxx150
-rw-r--r--connectivity/source/drivers/ado/AConnection.cxx633
-rw-r--r--connectivity/source/drivers/ado/ADatabaseMetaData.cxx1086
-rw-r--r--connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx610
-rw-r--r--connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx1219
-rw-r--r--connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx235
-rw-r--r--connectivity/source/drivers/ado/ADriver.cxx306
-rw-r--r--connectivity/source/drivers/ado/AGroup.cxx190
-rw-r--r--connectivity/source/drivers/ado/AGroups.cxx90
-rw-r--r--connectivity/source/drivers/ado/AIndex.cxx159
-rw-r--r--connectivity/source/drivers/ado/AIndexes.cxx92
-rw-r--r--connectivity/source/drivers/ado/AKey.cxx169
-rw-r--r--connectivity/source/drivers/ado/AKeyColumn.cxx71
-rw-r--r--connectivity/source/drivers/ado/AKeyColumns.cxx97
-rw-r--r--connectivity/source/drivers/ado/AKeys.cxx115
-rw-r--r--connectivity/source/drivers/ado/APreparedStatement.cxx566
-rw-r--r--connectivity/source/drivers/ado/AResultSet.cxx1175
-rw-r--r--connectivity/source/drivers/ado/AResultSetMetaData.cxx264
-rw-r--r--connectivity/source/drivers/ado/AStatement.cxx844
-rw-r--r--connectivity/source/drivers/ado/ATable.cxx259
-rw-r--r--connectivity/source/drivers/ado/ATables.cxx117
-rw-r--r--connectivity/source/drivers/ado/AUser.cxx227
-rw-r--r--connectivity/source/drivers/ado/AUsers.cxx89
-rw-r--r--connectivity/source/drivers/ado/AView.cxx125
-rw-r--r--connectivity/source/drivers/ado/AViews.cxx106
-rw-r--r--connectivity/source/drivers/ado/Aolevariant.cxx794
-rw-r--r--connectivity/source/drivers/ado/Aservices.cxx123
-rw-r--r--connectivity/source/drivers/ado/Awrapado.cxx2205
-rwxr-xr-xconnectivity/source/drivers/ado/ado.component35
-rw-r--r--connectivity/source/drivers/ado/ado.xcu269
-rwxr-xr-xconnectivity/source/drivers/ado/ado.xml27
-rwxr-xr-xconnectivity/source/drivers/ado/ado_post_sys_include.h35
-rwxr-xr-xconnectivity/source/drivers/ado/ado_pre_sys_include.h40
-rw-r--r--connectivity/source/drivers/ado/adoimp.cxx339
-rwxr-xr-xconnectivity/source/drivers/ado/exports.dxp2
-rwxr-xr-xconnectivity/source/drivers/ado/makefile.mk124
-rw-r--r--connectivity/source/drivers/calc/CCatalog.cxx82
-rw-r--r--connectivity/source/drivers/calc/CColumns.cxx57
-rw-r--r--connectivity/source/drivers/calc/CConnection.cxx293
-rw-r--r--connectivity/source/drivers/calc/CDatabaseMetaData.cxx470
-rw-r--r--connectivity/source/drivers/calc/CDriver.cxx107
-rw-r--r--connectivity/source/drivers/calc/CPreparedStatement.cxx45
-rw-r--r--connectivity/source/drivers/calc/CResultSet.cxx192
-rw-r--r--connectivity/source/drivers/calc/CStatement.cxx45
-rw-r--r--connectivity/source/drivers/calc/CTable.cxx869
-rw-r--r--connectivity/source/drivers/calc/CTables.cxx62
-rwxr-xr-xconnectivity/source/drivers/calc/CalcDriver.xml30
-rw-r--r--connectivity/source/drivers/calc/Cservices.cxx114
-rwxr-xr-xconnectivity/source/drivers/calc/calc.component35
-rw-r--r--connectivity/source/drivers/calc/calc.xcu63
-rwxr-xr-xconnectivity/source/drivers/calc/exports.dxp1
-rwxr-xr-xconnectivity/source/drivers/calc/makefile.mk99
-rw-r--r--connectivity/source/drivers/dbase/DCatalog.cxx72
-rw-r--r--connectivity/source/drivers/dbase/DCode.cxx133
-rw-r--r--connectivity/source/drivers/dbase/DColumns.cxx92
-rw-r--r--connectivity/source/drivers/dbase/DConnection.cxx133
-rw-r--r--connectivity/source/drivers/dbase/DDatabaseMetaData.cxx415
-rw-r--r--connectivity/source/drivers/dbase/DDriver.cxx129
-rw-r--r--connectivity/source/drivers/dbase/DIndex.cxx645
-rw-r--r--connectivity/source/drivers/dbase/DIndexColumns.cxx96
-rw-r--r--connectivity/source/drivers/dbase/DIndexIter.cxx306
-rw-r--r--connectivity/source/drivers/dbase/DIndexes.cxx136
-rw-r--r--connectivity/source/drivers/dbase/DNoException.cxx623
-rw-r--r--connectivity/source/drivers/dbase/DPreparedStatement.cxx45
-rw-r--r--connectivity/source/drivers/dbase/DResultSet.cxx247
-rw-r--r--connectivity/source/drivers/dbase/DStatement.cxx46
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx2798
-rw-r--r--connectivity/source/drivers/dbase/DTables.cxx146
-rw-r--r--connectivity/source/drivers/dbase/Dservices.cxx114
-rwxr-xr-xconnectivity/source/drivers/dbase/dbase.component35
-rwxr-xr-xconnectivity/source/drivers/dbase/dbase.mxp.map171
-rw-r--r--connectivity/source/drivers/dbase/dbase.xcu100
-rwxr-xr-xconnectivity/source/drivers/dbase/dbase.xml31
-rw-r--r--connectivity/source/drivers/dbase/dindexnode.cxx1016
-rwxr-xr-xconnectivity/source/drivers/dbase/exports.dxp1
-rwxr-xr-xconnectivity/source/drivers/dbase/makefile.mk137
-rw-r--r--connectivity/source/drivers/evoab/LServices.cxx114
-rwxr-xr-xconnectivity/source/drivers/evoab/exports.dxp1
-rw-r--r--connectivity/source/drivers/evoab2/EApi.cxx138
-rwxr-xr-xconnectivity/source/drivers/evoab2/EApi.h145
-rw-r--r--connectivity/source/drivers/evoab2/NCatalog.cxx102
-rw-r--r--connectivity/source/drivers/evoab2/NCatalog.hxx58
-rw-r--r--connectivity/source/drivers/evoab2/NColumns.cxx93
-rw-r--r--connectivity/source/drivers/evoab2/NColumns.hxx60
-rw-r--r--connectivity/source/drivers/evoab2/NConnection.cxx293
-rw-r--r--connectivity/source/drivers/evoab2/NConnection.hxx126
-rw-r--r--connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx1196
-rw-r--r--connectivity/source/drivers/evoab2/NDatabaseMetaData.hxx237
-rw-r--r--connectivity/source/drivers/evoab2/NDebug.cxx43
-rw-r--r--connectivity/source/drivers/evoab2/NDebug.hxx45
-rw-r--r--connectivity/source/drivers/evoab2/NDriver.cxx192
-rw-r--r--connectivity/source/drivers/evoab2/NDriver.hxx101
-rw-r--r--connectivity/source/drivers/evoab2/NPreparedStatement.cxx338
-rw-r--r--connectivity/source/drivers/evoab2/NPreparedStatement.hxx141
-rw-r--r--connectivity/source/drivers/evoab2/NResultSet.cxx1024
-rw-r--r--connectivity/source/drivers/evoab2/NResultSet.hxx186
-rw-r--r--connectivity/source/drivers/evoab2/NResultSetMetaData.cxx197
-rw-r--r--connectivity/source/drivers/evoab2/NResultSetMetaData.hxx91
-rw-r--r--connectivity/source/drivers/evoab2/NServices.cxx116
-rw-r--r--connectivity/source/drivers/evoab2/NStatement.cxx685
-rw-r--r--connectivity/source/drivers/evoab2/NStatement.hxx291
-rw-r--r--connectivity/source/drivers/evoab2/NTable.cxx90
-rw-r--r--connectivity/source/drivers/evoab2/NTable.hxx70
-rw-r--r--connectivity/source/drivers/evoab2/NTables.cxx105
-rw-r--r--connectivity/source/drivers/evoab2/NTables.hxx56
-rwxr-xr-xconnectivity/source/drivers/evoab2/evoab.component34
-rwxr-xr-xconnectivity/source/drivers/evoab2/evoab.xml28
-rw-r--r--connectivity/source/drivers/evoab2/evoab2.xcu76
-rwxr-xr-xconnectivity/source/drivers/evoab2/makefile.mk121
-rw-r--r--connectivity/source/drivers/file/FCatalog.cxx123
-rw-r--r--connectivity/source/drivers/file/FColumns.cxx96
-rw-r--r--connectivity/source/drivers/file/FConnection.cxx463
-rw-r--r--connectivity/source/drivers/file/FDatabaseMetaData.cxx1225
-rw-r--r--connectivity/source/drivers/file/FDateFunctions.cxx292
-rw-r--r--connectivity/source/drivers/file/FDriver.cxx287
-rw-r--r--connectivity/source/drivers/file/FNoException.cxx126
-rw-r--r--connectivity/source/drivers/file/FNumericFunctions.cxx252
-rw-r--r--connectivity/source/drivers/file/FPreparedStatement.cxx635
-rw-r--r--connectivity/source/drivers/file/FResultSet.cxx1872
-rw-r--r--connectivity/source/drivers/file/FResultSetMetaData.cxx221
-rw-r--r--connectivity/source/drivers/file/FStatement.cxx828
-rw-r--r--connectivity/source/drivers/file/FStringFunctions.cxx269
-rw-r--r--connectivity/source/drivers/file/FTable.cxx259
-rw-r--r--connectivity/source/drivers/file/FTables.cxx81
-rw-r--r--connectivity/source/drivers/file/fanalyzer.cxx343
-rw-r--r--connectivity/source/drivers/file/fcode.cxx514
-rw-r--r--connectivity/source/drivers/file/fcomp.cxx925
-rwxr-xr-xconnectivity/source/drivers/file/file.xml30
-rwxr-xr-xconnectivity/source/drivers/file/makefile.mk108
-rw-r--r--connectivity/source/drivers/file/quotedstring.cxx166
-rw-r--r--connectivity/source/drivers/flat/ECatalog.cxx75
-rw-r--r--connectivity/source/drivers/flat/EColumns.cxx58
-rw-r--r--connectivity/source/drivers/flat/EConnection.cxx185
-rw-r--r--connectivity/source/drivers/flat/EDatabaseMetaData.cxx268
-rw-r--r--connectivity/source/drivers/flat/EDriver.cxx147
-rw-r--r--connectivity/source/drivers/flat/EPreparedStatement.cxx46
-rw-r--r--connectivity/source/drivers/flat/EResultSet.cxx190
-rw-r--r--connectivity/source/drivers/flat/EStatement.cxx45
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx926
-rw-r--r--connectivity/source/drivers/flat/ETables.cxx64
-rw-r--r--connectivity/source/drivers/flat/Eservices.cxx114
-rwxr-xr-xconnectivity/source/drivers/flat/exports.dxp1
-rwxr-xr-xconnectivity/source/drivers/flat/flat.component35
-rwxr-xr-xconnectivity/source/drivers/flat/flat.mxp.map139
-rw-r--r--connectivity/source/drivers/flat/flat.xcu120
-rwxr-xr-xconnectivity/source/drivers/flat/flat.xml31
-rwxr-xr-xconnectivity/source/drivers/flat/makefile.mk115
-rw-r--r--connectivity/source/drivers/hsqldb/HCatalog.cxx167
-rw-r--r--connectivity/source/drivers/hsqldb/HColumns.cxx92
-rw-r--r--connectivity/source/drivers/hsqldb/HConnection.cxx386
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx924
-rw-r--r--connectivity/source/drivers/hsqldb/HStorage.hxx120
-rw-r--r--connectivity/source/drivers/hsqldb/HStorageAccess.cxx554
-rw-r--r--connectivity/source/drivers/hsqldb/HStorageMap.cxx365
-rw-r--r--connectivity/source/drivers/hsqldb/HTable.cxx429
-rw-r--r--connectivity/source/drivers/hsqldb/HTables.cxx202
-rw-r--r--connectivity/source/drivers/hsqldb/HTerminateListener.cxx68
-rw-r--r--connectivity/source/drivers/hsqldb/HTerminateListener.hxx67
-rw-r--r--connectivity/source/drivers/hsqldb/HTools.cxx76
-rw-r--r--connectivity/source/drivers/hsqldb/HUser.cxx353
-rw-r--r--connectivity/source/drivers/hsqldb/HUsers.cxx122
-rw-r--r--connectivity/source/drivers/hsqldb/HView.cxx216
-rw-r--r--connectivity/source/drivers/hsqldb/HViews.cxx172
-rw-r--r--connectivity/source/drivers/hsqldb/Hservices.cxx116
-rw-r--r--connectivity/source/drivers/hsqldb/StorageFileAccess.cxx183
-rw-r--r--connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx309
-rw-r--r--connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx222
-rw-r--r--connectivity/source/drivers/hsqldb/accesslog.cxx86
-rw-r--r--connectivity/source/drivers/hsqldb/accesslog.hxx148
-rwxr-xr-xconnectivity/source/drivers/hsqldb/exports.dxp28
-rwxr-xr-xconnectivity/source/drivers/hsqldb/hsqldb.component35
-rwxr-xr-xconnectivity/source/drivers/hsqldb/hsqldb.map33
-rw-r--r--connectivity/source/drivers/hsqldb/hsqldb.xcu78
-rwxr-xr-xconnectivity/source/drivers/hsqldb/hsqldb.xml26
-rwxr-xr-xconnectivity/source/drivers/hsqldb/hsqlui.hrc35
-rw-r--r--connectivity/source/drivers/hsqldb/hsqlui.src48
-rwxr-xr-xconnectivity/source/drivers/hsqldb/makefile.mk126
-rw-r--r--connectivity/source/drivers/jdbc/Array.cxx144
-rw-r--r--connectivity/source/drivers/jdbc/Blob.cxx147
-rw-r--r--connectivity/source/drivers/jdbc/Boolean.cxx54
-rw-r--r--connectivity/source/drivers/jdbc/CallableStatement.cxx360
-rw-r--r--connectivity/source/drivers/jdbc/Class.cxx75
-rw-r--r--connectivity/source/drivers/jdbc/Clob.cxx148
-rw-r--r--connectivity/source/drivers/jdbc/ConnectionLog.cxx137
-rw-r--r--connectivity/source/drivers/jdbc/ContextClassLoader.cxx134
-rw-r--r--connectivity/source/drivers/jdbc/DatabaseMetaData.cxx1465
-rw-r--r--connectivity/source/drivers/jdbc/Date.cxx55
-rw-r--r--connectivity/source/drivers/jdbc/DriverPropertyInfo.cxx143
-rw-r--r--connectivity/source/drivers/jdbc/Exception.cxx50
-rw-r--r--connectivity/source/drivers/jdbc/InputStream.cxx112
-rw-r--r--connectivity/source/drivers/jdbc/JBigDecimal.cxx91
-rw-r--r--connectivity/source/drivers/jdbc/JConnection.cxx876
-rw-r--r--connectivity/source/drivers/jdbc/JDriver.cxx258
-rw-r--r--connectivity/source/drivers/jdbc/JStatement.cxx831
-rw-r--r--connectivity/source/drivers/jdbc/Object.cxx428
-rw-r--r--connectivity/source/drivers/jdbc/PreparedStatement.cxx668
-rw-r--r--connectivity/source/drivers/jdbc/Reader.cxx121
-rw-r--r--connectivity/source/drivers/jdbc/Ref.cxx63
-rw-r--r--connectivity/source/drivers/jdbc/ResultSet.cxx1088
-rw-r--r--connectivity/source/drivers/jdbc/ResultSetMetaData.cxx239
-rw-r--r--connectivity/source/drivers/jdbc/SQLException.cxx101
-rw-r--r--connectivity/source/drivers/jdbc/SQLWarning.cxx50
-rw-r--r--connectivity/source/drivers/jdbc/String.cxx64
-rw-r--r--connectivity/source/drivers/jdbc/Throwable.cxx71
-rw-r--r--connectivity/source/drivers/jdbc/Timestamp.cxx194
-rwxr-xr-xconnectivity/source/drivers/jdbc/exports.dxp1
-rwxr-xr-xconnectivity/source/drivers/jdbc/jdbc.component34
-rwxr-xr-xconnectivity/source/drivers/jdbc/jdbc.mxp.map152
-rw-r--r--connectivity/source/drivers/jdbc/jdbc.xcu219
-rwxr-xr-xconnectivity/source/drivers/jdbc/jdbc.xml28
-rw-r--r--connectivity/source/drivers/jdbc/jservices.cxx117
-rwxr-xr-xconnectivity/source/drivers/jdbc/makefile.mk120
-rw-r--r--connectivity/source/drivers/jdbc/tools.cxx277
-rw-r--r--connectivity/source/drivers/kab/KCatalog.cxx127
-rw-r--r--connectivity/source/drivers/kab/KCatalog.hxx67
-rw-r--r--connectivity/source/drivers/kab/KColumns.cxx101
-rw-r--r--connectivity/source/drivers/kab/KColumns.hxx57
-rw-r--r--connectivity/source/drivers/kab/KConnection.cxx331
-rw-r--r--connectivity/source/drivers/kab/KConnection.hxx142
-rw-r--r--connectivity/source/drivers/kab/KDEInit.cxx158
-rwxr-xr-xconnectivity/source/drivers/kab/KDEInit.h47
-rw-r--r--connectivity/source/drivers/kab/KDatabaseMetaData.cxx1083
-rw-r--r--connectivity/source/drivers/kab/KDatabaseMetaData.hxx216
-rw-r--r--connectivity/source/drivers/kab/KDriver.cxx475
-rw-r--r--connectivity/source/drivers/kab/KDriver.hxx226
-rw-r--r--connectivity/source/drivers/kab/KPreparedStatement.cxx393
-rw-r--r--connectivity/source/drivers/kab/KPreparedStatement.hxx122
-rw-r--r--connectivity/source/drivers/kab/KResultSet.cxx990
-rw-r--r--connectivity/source/drivers/kab/KResultSet.hxx227
-rw-r--r--connectivity/source/drivers/kab/KResultSetMetaData.cxx190
-rw-r--r--connectivity/source/drivers/kab/KResultSetMetaData.hxx95
-rw-r--r--connectivity/source/drivers/kab/KServices.cxx117
-rw-r--r--connectivity/source/drivers/kab/KStatement.cxx587
-rw-r--r--connectivity/source/drivers/kab/KStatement.hxx173
-rw-r--r--connectivity/source/drivers/kab/KTable.cxx99
-rw-r--r--connectivity/source/drivers/kab/KTable.hxx71
-rw-r--r--connectivity/source/drivers/kab/KTables.cxx93
-rw-r--r--connectivity/source/drivers/kab/KTables.hxx64
-rwxr-xr-xconnectivity/source/drivers/kab/exports.dxp1
-rw-r--r--connectivity/source/drivers/kab/kab.xcu46
-rwxr-xr-xconnectivity/source/drivers/kab/kab.xml77
-rwxr-xr-xconnectivity/source/drivers/kab/kab1.component34
-rwxr-xr-xconnectivity/source/drivers/kab/kabdrv.map9
-rw-r--r--connectivity/source/drivers/kab/kcondition.cxx232
-rw-r--r--connectivity/source/drivers/kab/kcondition.hxx163
-rw-r--r--connectivity/source/drivers/kab/kfields.cxx97
-rw-r--r--connectivity/source/drivers/kab/kfields.hxx50
-rw-r--r--connectivity/source/drivers/kab/korder.cxx91
-rw-r--r--connectivity/source/drivers/kab/korder.hxx77
-rwxr-xr-xconnectivity/source/drivers/kab/makefile.mk149
-rw-r--r--connectivity/source/drivers/macab/MacabAddressBook.cxx258
-rw-r--r--connectivity/source/drivers/macab/MacabAddressBook.hxx75
-rw-r--r--connectivity/source/drivers/macab/MacabCatalog.cxx127
-rw-r--r--connectivity/source/drivers/macab/MacabCatalog.hxx67
-rw-r--r--connectivity/source/drivers/macab/MacabColumns.cxx101
-rw-r--r--connectivity/source/drivers/macab/MacabColumns.hxx57
-rw-r--r--connectivity/source/drivers/macab/MacabConnection.cxx326
-rw-r--r--connectivity/source/drivers/macab/MacabConnection.hxx134
-rw-r--r--connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx1127
-rw-r--r--connectivity/source/drivers/macab/MacabDatabaseMetaData.hxx215
-rw-r--r--connectivity/source/drivers/macab/MacabDriver.cxx350
-rw-r--r--connectivity/source/drivers/macab/MacabDriver.hxx199
-rw-r--r--connectivity/source/drivers/macab/MacabGroup.cxx104
-rw-r--r--connectivity/source/drivers/macab/MacabGroup.hxx53
-rw-r--r--connectivity/source/drivers/macab/MacabHeader.cxx346
-rw-r--r--connectivity/source/drivers/macab/MacabHeader.hxx74
-rw-r--r--connectivity/source/drivers/macab/MacabPreparedStatement.cxx410
-rw-r--r--connectivity/source/drivers/macab/MacabPreparedStatement.hxx122
-rw-r--r--connectivity/source/drivers/macab/MacabRecord.cxx350
-rw-r--r--connectivity/source/drivers/macab/MacabRecord.hxx80
-rw-r--r--connectivity/source/drivers/macab/MacabRecords.cxx1215
-rw-r--r--connectivity/source/drivers/macab/MacabRecords.hxx139
-rw-r--r--connectivity/source/drivers/macab/MacabResultSet.cxx1076
-rw-r--r--connectivity/source/drivers/macab/MacabResultSet.hxx229
-rw-r--r--connectivity/source/drivers/macab/MacabResultSetMetaData.cxx227
-rw-r--r--connectivity/source/drivers/macab/MacabResultSetMetaData.hxx97
-rw-r--r--connectivity/source/drivers/macab/MacabServices.cxx117
-rw-r--r--connectivity/source/drivers/macab/MacabStatement.cxx614
-rw-r--r--connectivity/source/drivers/macab/MacabStatement.hxx177
-rw-r--r--connectivity/source/drivers/macab/MacabTable.cxx99
-rw-r--r--connectivity/source/drivers/macab/MacabTable.hxx71
-rw-r--r--connectivity/source/drivers/macab/MacabTables.cxx93
-rw-r--r--connectivity/source/drivers/macab/MacabTables.hxx64
-rwxr-xr-xconnectivity/source/drivers/macab/exports.dxp1
-rw-r--r--connectivity/source/drivers/macab/macab.xcu46
-rwxr-xr-xconnectivity/source/drivers/macab/macab.xml77
-rwxr-xr-xconnectivity/source/drivers/macab/macab1.component34
-rw-r--r--connectivity/source/drivers/macab/macabcondition.cxx253
-rw-r--r--connectivity/source/drivers/macab/macabcondition.hxx170
-rw-r--r--connectivity/source/drivers/macab/macaborder.cxx89
-rw-r--r--connectivity/source/drivers/macab/macaborder.hxx77
-rw-r--r--connectivity/source/drivers/macab/macabutilities.hxx152
-rwxr-xr-xconnectivity/source/drivers/macab/makefile.mk138
-rw-r--r--connectivity/source/drivers/mozab/MCatalog.cxx128
-rw-r--r--connectivity/source/drivers/mozab/MCatalog.hxx65
-rw-r--r--connectivity/source/drivers/mozab/MColumnAlias.cxx195
-rw-r--r--connectivity/source/drivers/mozab/MColumnAlias.hxx88
-rw-r--r--connectivity/source/drivers/mozab/MColumns.cxx101
-rw-r--r--connectivity/source/drivers/mozab/MColumns.hxx60
-rw-r--r--connectivity/source/drivers/mozab/MConfigAccess.cxx271
-rw-r--r--connectivity/source/drivers/mozab/MConfigAccess.hxx41
-rw-r--r--connectivity/source/drivers/mozab/MConnection.cxx607
-rw-r--r--connectivity/source/drivers/mozab/MConnection.hxx233
-rw-r--r--connectivity/source/drivers/mozab/MDatabaseMetaData.cxx1033
-rw-r--r--connectivity/source/drivers/mozab/MDatabaseMetaData.hxx207
-rw-r--r--connectivity/source/drivers/mozab/MDriver.cxx333
-rw-r--r--connectivity/source/drivers/mozab/MDriver.hxx113
-rw-r--r--connectivity/source/drivers/mozab/MExtConfigAccess.hxx48
-rw-r--r--connectivity/source/drivers/mozab/MPreparedStatement.cxx546
-rw-r--r--connectivity/source/drivers/mozab/MPreparedStatement.hxx170
-rw-r--r--connectivity/source/drivers/mozab/MResultSet.cxx1980
-rw-r--r--connectivity/source/drivers/mozab/MResultSet.hxx369
-rw-r--r--connectivity/source/drivers/mozab/MResultSetMetaData.cxx214
-rw-r--r--connectivity/source/drivers/mozab/MResultSetMetaData.hxx101
-rw-r--r--connectivity/source/drivers/mozab/MServices.cxx160
-rw-r--r--connectivity/source/drivers/mozab/MStatement.cxx564
-rw-r--r--connectivity/source/drivers/mozab/MStatement.hxx214
-rw-r--r--connectivity/source/drivers/mozab/MTable.cxx97
-rw-r--r--connectivity/source/drivers/mozab/MTable.hxx72
-rw-r--r--connectivity/source/drivers/mozab/MTables.cxx104
-rw-r--r--connectivity/source/drivers/mozab/MTables.hxx57
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx283
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.hxx104
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx156
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx43
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx141
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx87
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx347
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSInit.hxx47
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx635
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfile.hxx76
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileDirServiceProvider.cxx243
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileDirServiceProvider.hxx85
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx422
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx125
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.cxx116
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.hxx74
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSRunnable.cxx100
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSRunnable.hxx69
-rwxr-xr-xconnectivity/source/drivers/mozab/bootstrap/makefile.mk95
-rwxr-xr-xconnectivity/source/drivers/mozab/bootstrap/mozbootstrap.component34
-rwxr-xr-xconnectivity/source/drivers/mozab/bootstrap/mozilla_nsinit.h57
-rwxr-xr-xconnectivity/source/drivers/mozab/bootstrap/mozilla_nsprofile.h92
-rwxr-xr-xconnectivity/source/drivers/mozab/bootstrap/mozilla_nsprofiledirserviceprovider.h44
-rwxr-xr-xconnectivity/source/drivers/mozab/bootstrap/mozilla_profile_discover.h49
-rwxr-xr-xconnectivity/source/drivers/mozab/bootstrap/mozilla_profilemanager.h87
-rwxr-xr-xconnectivity/source/drivers/mozab/bootstrap/post_include_windows.h33
-rwxr-xr-xconnectivity/source/drivers/mozab/bootstrap/pre_include_windows.h34
-rwxr-xr-xconnectivity/source/drivers/mozab/exports.dxp1
-rwxr-xr-xconnectivity/source/drivers/mozab/makefile.mk194
-rwxr-xr-xconnectivity/source/drivers/mozab/makefile_mozab.mk127
-rwxr-xr-xconnectivity/source/drivers/mozab/mozab.component37
-rw-r--r--connectivity/source/drivers/mozab/mozab.xcu154
-rwxr-xr-xconnectivity/source/drivers/mozab/mozab.xml80
-rw-r--r--connectivity/source/drivers/mozab/mozab2.xcu118
-rwxr-xr-xconnectivity/source/drivers/mozab/mozabdrv.map8
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx805
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.hxx78
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MErrorResource.hxx80
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx453
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.hxx78
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MNSDeclares.hxx54
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx84
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.cxx407
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.hxx116
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener.cxx88
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener.hxx60
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx143
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MNameMapper.hxx86
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx826
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx282
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx637
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx137
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx134
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.hxx68
-rwxr-xr-xconnectivity/source/drivers/mozab/mozillasrc/makefile.mk77
-rwxr-xr-xconnectivity/source/drivers/mozab/post_include_mozilla.h61
-rwxr-xr-xconnectivity/source/drivers/mozab/pre_include_mozilla.h65
-rw-r--r--connectivity/source/drivers/mysql/YCatalog.cxx176
-rw-r--r--connectivity/source/drivers/mysql/YColumns.cxx92
-rw-r--r--connectivity/source/drivers/mysql/YDriver.cxx484
-rw-r--r--connectivity/source/drivers/mysql/YTable.cxx387
-rw-r--r--connectivity/source/drivers/mysql/YTables.cxx246
-rw-r--r--connectivity/source/drivers/mysql/YUser.cxx352
-rw-r--r--connectivity/source/drivers/mysql/YUsers.cxx120
-rw-r--r--connectivity/source/drivers/mysql/YViews.cxx165
-rw-r--r--connectivity/source/drivers/mysql/Yservices.cxx115
-rwxr-xr-xconnectivity/source/drivers/mysql/exports.dxp1
-rwxr-xr-xconnectivity/source/drivers/mysql/makefile.mk92
-rwxr-xr-xconnectivity/source/drivers/mysql/mysql.component35
-rw-r--r--connectivity/source/drivers/mysql/mysql.xcu258
-rwxr-xr-xconnectivity/source/drivers/mysql/mysql.xml27
-rw-r--r--connectivity/source/drivers/odbc/OFunctions.cxx249
-rw-r--r--connectivity/source/drivers/odbc/ORealDriver.cxx371
-rw-r--r--connectivity/source/drivers/odbc/ORealDriver.hxx53
-rwxr-xr-xconnectivity/source/drivers/odbc/makefile.mk87
-rwxr-xr-xconnectivity/source/drivers/odbc/odbc.component34
-rw-r--r--connectivity/source/drivers/odbc/odbc.xcu180
-rwxr-xr-xconnectivity/source/drivers/odbc/odbc.xml26
-rw-r--r--connectivity/source/drivers/odbc/oservices.cxx116
-rw-r--r--connectivity/source/drivers/odbcbase/OConnection.cxx672
-rw-r--r--connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx1744
-rw-r--r--connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx1340
-rw-r--r--connectivity/source/drivers/odbcbase/ODriver.cxx231
-rw-r--r--connectivity/source/drivers/odbcbase/OPreparedStatement.cxx978
-rw-r--r--connectivity/source/drivers/odbcbase/OResultSet.cxx1768
-rw-r--r--connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx318
-rw-r--r--connectivity/source/drivers/odbcbase/OStatement.cxx1162
-rw-r--r--connectivity/source/drivers/odbcbase/OTools.cxx908
-rwxr-xr-xconnectivity/source/drivers/odbcbase/makefile.mk90
-rw-r--r--connectivity/source/inc/AutoRetrievingBase.hxx61
-rw-r--r--connectivity/source/inc/FDatabaseMetaDataResultSet.hxx281
-rw-r--r--connectivity/source/inc/FDatabaseMetaDataResultSetMetaData.hxx117
-rw-r--r--connectivity/source/inc/OColumn.hxx148
-rw-r--r--connectivity/source/inc/OSubComponent.hxx94
-rw-r--r--connectivity/source/inc/OTypeInfo.hxx94
-rw-r--r--connectivity/source/inc/ParameterSubstitution.hxx74
-rw-r--r--connectivity/source/inc/RowFunctionParser.hxx153
-rw-r--r--connectivity/source/inc/TConnection.hxx94
-rw-r--r--connectivity/source/inc/TDatabaseMetaDataBase.hxx145
-rw-r--r--connectivity/source/inc/TKeyValue.hxx84
-rw-r--r--connectivity/source/inc/TPrivilegesResultSet.hxx57
-rw-r--r--connectivity/source/inc/TResultSetHelper.hxx60
-rw-r--r--connectivity/source/inc/TSkipDeletedSet.hxx107
-rw-r--r--connectivity/source/inc/TSortIndex.hxx142
-rw-r--r--connectivity/source/inc/UStringDescription_Impl.hxx108
-rw-r--r--connectivity/source/inc/adabas/BCatalog.hxx79
-rw-r--r--connectivity/source/inc/adabas/BColumn.hxx56
-rw-r--r--connectivity/source/inc/adabas/BColumns.hxx63
-rw-r--r--connectivity/source/inc/adabas/BConnection.hxx80
-rw-r--r--connectivity/source/inc/adabas/BDatabaseMetaData.hxx57
-rw-r--r--connectivity/source/inc/adabas/BDriver.hxx178
-rw-r--r--connectivity/source/inc/adabas/BGroup.hxx52
-rw-r--r--connectivity/source/inc/adabas/BGroups.hxx68
-rw-r--r--connectivity/source/inc/adabas/BIndex.hxx60
-rw-r--r--connectivity/source/inc/adabas/BIndexColumn.hxx60
-rw-r--r--connectivity/source/inc/adabas/BIndexColumns.hxx60
-rw-r--r--connectivity/source/inc/adabas/BIndexes.hxx60
-rw-r--r--connectivity/source/inc/adabas/BKeys.hxx57
-rw-r--r--connectivity/source/inc/adabas/BPreparedStatement.hxx54
-rw-r--r--connectivity/source/inc/adabas/BResultSet.hxx62
-rw-r--r--connectivity/source/inc/adabas/BResultSetMetaData.hxx59
-rw-r--r--connectivity/source/inc/adabas/BStatement.hxx62
-rw-r--r--connectivity/source/inc/adabas/BTable.hxx112
-rw-r--r--connectivity/source/inc/adabas/BTables.hxx82
-rw-r--r--connectivity/source/inc/adabas/BUser.hxx84
-rw-r--r--connectivity/source/inc/adabas/BUsers.hxx68
-rw-r--r--connectivity/source/inc/adabas/BViews.hxx66
-rw-r--r--connectivity/source/inc/ado/ACallableStatement.hxx90
-rw-r--r--connectivity/source/inc/ado/ACatalog.hxx63
-rw-r--r--connectivity/source/inc/ado/ACollection.hxx233
-rw-r--r--connectivity/source/inc/ado/AColumn.hxx72
-rw-r--r--connectivity/source/inc/ado/AColumns.hxx70
-rw-r--r--connectivity/source/inc/ado/AConnection.hxx153
-rw-r--r--connectivity/source/inc/ado/ADatabaseMetaData.hxx232
-rw-r--r--connectivity/source/inc/ado/ADatabaseMetaDataResultSet.hxx226
-rw-r--r--connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx117
-rw-r--r--connectivity/source/inc/ado/ADriver.hxx95
-rw-r--r--connectivity/source/inc/ado/AGroup.hxx78
-rw-r--r--connectivity/source/inc/ado/AGroups.hxx71
-rw-r--r--connectivity/source/inc/ado/AIndex.hxx67
-rw-r--r--connectivity/source/inc/ado/AIndexColumn.hxx60
-rw-r--r--connectivity/source/inc/ado/AIndexColumns.hxx57
-rw-r--r--connectivity/source/inc/ado/AIndexes.hxx68
-rw-r--r--connectivity/source/inc/ado/AKey.hxx75
-rw-r--r--connectivity/source/inc/ado/AKeyColumn.hxx60
-rw-r--r--connectivity/source/inc/ado/AKeyColumns.hxx57
-rw-r--r--connectivity/source/inc/ado/AKeys.hxx68
-rw-r--r--connectivity/source/inc/ado/APreparedStatement.hxx124
-rw-r--r--connectivity/source/inc/ado/AResultSet.hxx236
-rw-r--r--connectivity/source/inc/ado/AResultSetMetaData.hxx95
-rw-r--r--connectivity/source/inc/ado/AStatement.hxx203
-rw-r--r--connectivity/source/inc/ado/ATable.hxx90
-rw-r--r--connectivity/source/inc/ado/ATables.hxx67
-rw-r--r--connectivity/source/inc/ado/AUser.hxx104
-rw-r--r--connectivity/source/inc/ado/AUsers.hxx72
-rw-r--r--connectivity/source/inc/ado/AView.hxx68
-rw-r--r--connectivity/source/inc/ado/AViews.hxx66
-rw-r--r--connectivity/source/inc/ado/Aolevariant.hxx177
-rw-r--r--connectivity/source/inc/ado/Aolewrap.hxx247
-rw-r--r--connectivity/source/inc/ado/Awrapado.hxx400
-rw-r--r--connectivity/source/inc/ado/Awrapadox.hxx151
-rw-r--r--connectivity/source/inc/ado/WrapCatalog.hxx61
-rw-r--r--connectivity/source/inc/ado/WrapColumn.hxx75
-rw-r--r--connectivity/source/inc/ado/WrapIndex.hxx63
-rw-r--r--connectivity/source/inc/ado/WrapKey.hxx65
-rw-r--r--connectivity/source/inc/ado/WrapTable.hxx68
-rw-r--r--connectivity/source/inc/ado/WrapTypeDefs.hxx56
-rw-r--r--connectivity/source/inc/ado/adoimp.hxx114
-rw-r--r--connectivity/source/inc/calc/CCatalog.hxx52
-rw-r--r--connectivity/source/inc/calc/CColumns.hxx55
-rw-r--r--connectivity/source/inc/calc/CConnection.hxx99
-rw-r--r--connectivity/source/inc/calc/CDatabaseMetaData.hxx63
-rw-r--r--connectivity/source/inc/calc/CDriver.hxx67
-rw-r--r--connectivity/source/inc/calc/CPreparedStatement.hxx52
-rw-r--r--connectivity/source/inc/calc/CResultSet.hxx92
-rw-r--r--connectivity/source/inc/calc/CStatement.hxx52
-rw-r--r--connectivity/source/inc/calc/CTable.hxx109
-rw-r--r--connectivity/source/inc/calc/CTables.hxx54
-rw-r--r--connectivity/source/inc/dbase/DCatalog.hxx51
-rw-r--r--connectivity/source/inc/dbase/DCode.hxx71
-rw-r--r--connectivity/source/inc/dbase/DColumns.hxx57
-rw-r--r--connectivity/source/inc/dbase/DConnection.hxx60
-rw-r--r--connectivity/source/inc/dbase/DDatabaseMetaData.hxx70
-rw-r--r--connectivity/source/inc/dbase/DDatabaseMetaDataResultSet.hxx196
-rw-r--r--connectivity/source/inc/dbase/DDatabaseMetaDataResultSetMetaData.hxx110
-rw-r--r--connectivity/source/inc/dbase/DDriver.hxx63
-rw-r--r--connectivity/source/inc/dbase/DIndex.hxx162
-rw-r--r--connectivity/source/inc/dbase/DIndexColumns.hxx62
-rw-r--r--connectivity/source/inc/dbase/DIndexIter.hxx87
-rw-r--r--connectivity/source/inc/dbase/DIndexPage.hxx38
-rw-r--r--connectivity/source/inc/dbase/DIndexes.hxx63
-rw-r--r--connectivity/source/inc/dbase/DPreparedStatement.hxx52
-rw-r--r--connectivity/source/inc/dbase/DResultSet.hxx92
-rw-r--r--connectivity/source/inc/dbase/DStatement.hxx52
-rw-r--r--connectivity/source/inc/dbase/DTable.hxx187
-rw-r--r--connectivity/source/inc/dbase/DTables.hxx60
-rw-r--r--connectivity/source/inc/dbase/dindexnode.hxx349
-rwxr-xr-xconnectivity/source/inc/diagnose_ex.h49
-rw-r--r--connectivity/source/inc/file/FCatalog.hxx73
-rw-r--r--connectivity/source/inc/file/FColumns.hxx61
-rw-r--r--connectivity/source/inc/file/FConnection.hxx162
-rw-r--r--connectivity/source/inc/file/FDatabaseMetaData.hxx199
-rw-r--r--connectivity/source/inc/file/FDateFunctions.hxx244
-rw-r--r--connectivity/source/inc/file/FDriver.hxx89
-rw-r--r--connectivity/source/inc/file/FNumericFunctions.hxx378
-rw-r--r--connectivity/source/inc/file/FPreparedStatement.hxx136
-rw-r--r--connectivity/source/inc/file/FResultSet.hxx343
-rw-r--r--connectivity/source/inc/file/FResultSetMetaData.hxx93
-rw-r--r--connectivity/source/inc/file/FStatement.hxx225
-rw-r--r--connectivity/source/inc/file/FStringFunctions.hxx285
-rw-r--r--connectivity/source/inc/file/FTable.hxx120
-rw-r--r--connectivity/source/inc/file/FTables.hxx63
-rw-r--r--connectivity/source/inc/file/fanalyzer.hxx98
-rw-r--r--connectivity/source/inc/file/fcode.hxx398
-rw-r--r--connectivity/source/inc/file/fcomp.hxx122
-rw-r--r--connectivity/source/inc/file/filedllapi.hxx43
-rw-r--r--connectivity/source/inc/file/quotedstring.hxx58
-rw-r--r--connectivity/source/inc/flat/ECatalog.hxx51
-rw-r--r--connectivity/source/inc/flat/EColumns.hxx54
-rw-r--r--connectivity/source/inc/flat/EConnection.hxx75
-rw-r--r--connectivity/source/inc/flat/EDatabaseMetaData.hxx57
-rw-r--r--connectivity/source/inc/flat/EDriver.hxx63
-rw-r--r--connectivity/source/inc/flat/EPreparedStatement.hxx52
-rw-r--r--connectivity/source/inc/flat/EResultSet.hxx83
-rw-r--r--connectivity/source/inc/flat/EStatement.hxx52
-rw-r--r--connectivity/source/inc/flat/ETable.hxx109
-rw-r--r--connectivity/source/inc/flat/ETables.hxx54
-rw-r--r--connectivity/source/inc/hsqldb/HCatalog.hxx74
-rw-r--r--connectivity/source/inc/hsqldb/HColumns.hxx72
-rw-r--r--connectivity/source/inc/hsqldb/HConnection.hxx160
-rw-r--r--connectivity/source/inc/hsqldb/HDriver.hxx147
-rwxr-xr-xconnectivity/source/inc/hsqldb/HStorageAccess.h98
-rw-r--r--connectivity/source/inc/hsqldb/HStorageAccess.hxx46
-rw-r--r--connectivity/source/inc/hsqldb/HStorageMap.hxx94
-rw-r--r--connectivity/source/inc/hsqldb/HTable.hxx130
-rw-r--r--connectivity/source/inc/hsqldb/HTables.hxx80
-rw-r--r--connectivity/source/inc/hsqldb/HTools.hxx68
-rw-r--r--connectivity/source/inc/hsqldb/HUser.hxx84
-rw-r--r--connectivity/source/inc/hsqldb/HUsers.hxx64
-rw-r--r--connectivity/source/inc/hsqldb/HView.hxx100
-rw-r--r--connectivity/source/inc/hsqldb/HViews.hxx65
-rwxr-xr-xconnectivity/source/inc/hsqldb/StorageFileAccess.h40
-rwxr-xr-xconnectivity/source/inc/hsqldb/StorageNativeInputStream.h73
-rw-r--r--connectivity/source/inc/internalnode.hxx63
-rw-r--r--connectivity/source/inc/java/ContextClassLoader.hxx106
-rw-r--r--connectivity/source/inc/java/GlobalRef.hxx125
-rw-r--r--connectivity/source/inc/java/LocalRef.hxx109
-rw-r--r--connectivity/source/inc/java/io/InputStream.hxx62
-rw-r--r--connectivity/source/inc/java/io/Reader.hxx62
-rw-r--r--connectivity/source/inc/java/lang/Boolean.hxx55
-rw-r--r--connectivity/source/inc/java/lang/Class.hxx57
-rw-r--r--connectivity/source/inc/java/lang/Exception.hxx53
-rw-r--r--connectivity/source/inc/java/lang/Object.hxx169
-rw-r--r--connectivity/source/inc/java/lang/String.hxx55
-rw-r--r--connectivity/source/inc/java/lang/Throwable.hxx56
-rw-r--r--connectivity/source/inc/java/math/BigDecimal.hxx55
-rw-r--r--connectivity/source/inc/java/sql/Array.hxx65
-rw-r--r--connectivity/source/inc/java/sql/Blob.hxx65
-rw-r--r--connectivity/source/inc/java/sql/CallableStatement.hxx93
-rw-r--r--connectivity/source/inc/java/sql/Clob.hxx65
-rw-r--r--connectivity/source/inc/java/sql/Connection.hxx153
-rw-r--r--connectivity/source/inc/java/sql/ConnectionLog.hxx145
-rw-r--r--connectivity/source/inc/java/sql/DatabaseMetaData.hxx226
-rw-r--r--connectivity/source/inc/java/sql/Driver.hxx78
-rw-r--r--connectivity/source/inc/java/sql/DriverPropertyInfo.hxx63
-rw-r--r--connectivity/source/inc/java/sql/JStatement.hxx221
-rw-r--r--connectivity/source/inc/java/sql/PreparedStatement.hxx114
-rw-r--r--connectivity/source/inc/java/sql/Ref.hxx60
-rw-r--r--connectivity/source/inc/java/sql/ResultSet.hxx210
-rw-r--r--connectivity/source/inc/java/sql/ResultSetMetaData.hxx84
-rw-r--r--connectivity/source/inc/java/sql/SQLException.hxx70
-rw-r--r--connectivity/source/inc/java/sql/SQLWarning.hxx63
-rw-r--r--connectivity/source/inc/java/sql/Timestamp.hxx99
-rw-r--r--connectivity/source/inc/java/tools.hxx92
-rw-r--r--connectivity/source/inc/java/util/Date.hxx56
-rw-r--r--connectivity/source/inc/java/util/Property.hxx52
-rw-r--r--connectivity/source/inc/mysql/YCatalog.hxx75
-rw-r--r--connectivity/source/inc/mysql/YColumns.hxx72
-rw-r--r--connectivity/source/inc/mysql/YDriver.hxx128
-rw-r--r--connectivity/source/inc/mysql/YTable.hxx130
-rw-r--r--connectivity/source/inc/mysql/YTables.hxx90
-rw-r--r--connectivity/source/inc/mysql/YUser.hxx84
-rw-r--r--connectivity/source/inc/mysql/YUsers.hxx64
-rw-r--r--connectivity/source/inc/mysql/YViews.hxx66
-rw-r--r--connectivity/source/inc/odbc/OBoundParam.hxx224
-rw-r--r--connectivity/source/inc/odbc/OConnection.hxx162
-rw-r--r--connectivity/source/inc/odbc/ODatabaseMetaData.hxx226
-rw-r--r--connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx244
-rw-r--r--connectivity/source/inc/odbc/ODefs3.hxx94
-rw-r--r--connectivity/source/inc/odbc/ODriver.hxx92
-rw-r--r--connectivity/source/inc/odbc/OFunctiondefs.hxx167
-rw-r--r--connectivity/source/inc/odbc/OFunctions.hxx558
-rw-r--r--connectivity/source/inc/odbc/OPreparedStatement.hxx173
-rw-r--r--connectivity/source/inc/odbc/OResultSet.hxx329
-rw-r--r--connectivity/source/inc/odbc/OResultSetMetaData.hxx128
-rw-r--r--connectivity/source/inc/odbc/OStatement.hxx250
-rw-r--r--connectivity/source/inc/odbc/OTools.hxx278
-rw-r--r--connectivity/source/inc/odbc/odbcbasedllapi.hxx43
-rw-r--r--connectivity/source/inc/propertyids.hxx162
-rwxr-xr-xconnectivity/source/inc/resource/adabas_res.hrc43
-rwxr-xr-xconnectivity/source/inc/resource/ado_res.hrc50
-rwxr-xr-xconnectivity/source/inc/resource/calc_res.hrc41
-rwxr-xr-xconnectivity/source/inc/resource/common_res.hrc78
-rwxr-xr-xconnectivity/source/inc/resource/conn_shared_res.hrc73
-rwxr-xr-xconnectivity/source/inc/resource/dbase_res.hrc61
-rwxr-xr-xconnectivity/source/inc/resource/evoab2_res.hrc42
-rwxr-xr-xconnectivity/source/inc/resource/file_res.hrc48
-rwxr-xr-xconnectivity/source/inc/resource/hsqldb_res.hrc47
-rwxr-xr-xconnectivity/source/inc/resource/jdbc_log.hrc90
-rwxr-xr-xconnectivity/source/inc/resource/kab_res.hrc43
-rwxr-xr-xconnectivity/source/inc/resource/macab_res.hrc41
-rwxr-xr-xconnectivity/source/inc/resource/mozab_res.hrc74
-rw-r--r--connectivity/source/inc/resource/sharedresources.hxx166
-rw-r--r--connectivity/source/inc/sqlscan.hxx93
-rwxr-xr-xconnectivity/source/manager/exports.dxp1
-rwxr-xr-xconnectivity/source/manager/makefile.mk85
-rw-r--r--connectivity/source/manager/mdrivermanager.cxx714
-rw-r--r--connectivity/source/manager/mdrivermanager.hxx148
-rw-r--r--connectivity/source/manager/mregistration.cxx75
-rwxr-xr-xconnectivity/source/manager/sdbc.mxp.map51
-rwxr-xr-xconnectivity/source/manager/sdbc2.component34
-rw-r--r--connectivity/source/parse/PColumn.cxx298
-rw-r--r--connectivity/source/parse/internalnode.cxx88
-rwxr-xr-xconnectivity/source/parse/makefile.mk67
-rwxr-xr-xconnectivity/source/parse/sqlbison.y4828
-rwxr-xr-xconnectivity/source/parse/sqlflex.l836
-rw-r--r--connectivity/source/parse/sqliterator.cxx2249
-rw-r--r--connectivity/source/parse/sqlnode.cxx2838
-rw-r--r--connectivity/source/parse/wrap_sqlbison.cxx34
-rw-r--r--connectivity/source/parse/wrap_sqlflex.cxx38
-rw-r--r--connectivity/source/resource/conn_error_message.src99
-rw-r--r--connectivity/source/resource/conn_log_res.src312
-rw-r--r--connectivity/source/resource/conn_shared_res.src649
-rwxr-xr-xconnectivity/source/resource/makefile.mk107
-rw-r--r--connectivity/source/resource/sharedresources.cxx244
-rw-r--r--connectivity/source/sdbcx/VCatalog.cxx243
-rw-r--r--connectivity/source/sdbcx/VCollection.cxx605
-rw-r--r--connectivity/source/sdbcx/VColumn.cxx231
-rw-r--r--connectivity/source/sdbcx/VDescriptor.cxx157
-rw-r--r--connectivity/source/sdbcx/VGroup.cxx185
-rw-r--r--connectivity/source/sdbcx/VIndex.cxx225
-rw-r--r--connectivity/source/sdbcx/VIndexColumn.cxx122
-rw-r--r--connectivity/source/sdbcx/VKey.cxx230
-rw-r--r--connectivity/source/sdbcx/VKeyColumn.cxx127
-rw-r--r--connectivity/source/sdbcx/VTable.cxx339
-rw-r--r--connectivity/source/sdbcx/VUser.cxx196
-rw-r--r--connectivity/source/sdbcx/VView.cxx152
-rwxr-xr-xconnectivity/source/sdbcx/makefile.mk63
-rw-r--r--connectivity/source/simpledbt/charset_s.cxx75
-rw-r--r--connectivity/source/simpledbt/charset_s.hxx70
-rw-r--r--connectivity/source/simpledbt/dbtfactory.cxx116
-rw-r--r--connectivity/source/simpledbt/dbtfactory.hxx83
-rwxr-xr-xconnectivity/source/simpledbt/makefile.mk53
-rw-r--r--connectivity/source/simpledbt/parsenode_s.cxx95
-rw-r--r--connectivity/source/simpledbt/parsenode_s.hxx83
-rw-r--r--connectivity/source/simpledbt/parser_s.cxx88
-rw-r--r--connectivity/source/simpledbt/parser_s.hxx76
-rw-r--r--connectivity/source/simpledbt/refbase.cxx66
-rw-r--r--connectivity/source/simpledbt/refbase.hxx63
-rw-r--r--connectivity/source/simpledbt/staticdbtools_s.cxx214
-rw-r--r--connectivity/source/simpledbt/staticdbtools_s.hxx208
773 files changed, 0 insertions, 172763 deletions
diff --git a/connectivity/source/commontools/AutoRetrievingBase.cxx b/connectivity/source/commontools/AutoRetrievingBase.cxx
deleted file mode 100644
index 047a30b39d..0000000000
--- a/connectivity/source/commontools/AutoRetrievingBase.cxx
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "AutoRetrievingBase.hxx"
-
-namespace connectivity
-{
- ::rtl::OUString OAutoRetrievingBase::getTransformedGeneratedStatement(const ::rtl::OUString& _sInsertStatement) const
- {
- ::rtl::OUString sStmt = _sInsertStatement;
- OSL_ENSURE( m_bAutoRetrievingEnabled,"Illegal call here. isAutoRetrievingEnabled is false!");
- sStmt = sStmt.toAsciiUpperCase();
- ::rtl::OUString sStatement;
- if ( sStmt.compareToAscii("INSERT",6) == 0 )
- {
- sStatement = m_sGeneratedValueStatement;
- static const ::rtl::OUString sColumn(RTL_CONSTASCII_USTRINGPARAM("$column"));
- static const ::rtl::OUString sTable(RTL_CONSTASCII_USTRINGPARAM("$table"));
- sal_Int32 nIndex = 0;
- nIndex = sStatement.indexOf(sColumn,nIndex);
- if ( -1 != nIndex )
- { // we need a column
- }
- nIndex = 0;
- nIndex = sStatement.indexOf(sTable,nIndex);
- if ( -1 != nIndex )
- { // we need a table name
- sal_Int32 nIntoIndex = sStmt.indexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INTO ")));
- sStmt = sStmt.copy(nIntoIndex+5);
- do
- {
- if ( sStmt.indexOf(' ') == 0 )
- sStmt = sStmt.copy(1);
- }
- while (sStmt.indexOf(' ') == 0 );
-
- nIntoIndex = 0;
- ::rtl::OUString sTableName = sStmt.getToken(0,' ',nIntoIndex);
- sStatement = sStatement.replaceAt(nIndex,sTable.getLength(),sTableName);
- }
- }
- return sStatement;
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/BlobHelper.cxx b/connectivity/source/commontools/BlobHelper.cxx
deleted file mode 100644
index 7de16e76d2..0000000000
--- a/connectivity/source/commontools/BlobHelper.cxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/BlobHelper.hxx"
-#include <comphelper/seqstream.hxx>
-#include "connectivity/dbexception.hxx"
-
-using namespace connectivity;
-using namespace dbtools;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::uno;
-
-BlobHelper::BlobHelper(const ::com::sun::star::uno::Sequence< sal_Int8 >& _val) : m_aValue(_val)
-{
-}
-// -----------------------------------------------------------------------------
-::sal_Int64 SAL_CALL BlobHelper::length( ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return m_aValue.getLength();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL BlobHelper::getBytes( ::sal_Int64 pos, ::sal_Int32 _length ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- if ( sal_Int32(pos + _length) > m_aValue.getLength() )
- throw ::com::sun::star::sdbc::SQLException();
- return ::com::sun::star::uno::Sequence< ::sal_Int8 >(m_aValue.getConstArray() + sal_Int32(pos),_length);
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL BlobHelper::getBinaryStream( ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return new ::comphelper::SequenceInputStream(m_aValue);
-}
-// -----------------------------------------------------------------------------
-::sal_Int64 SAL_CALL BlobHelper::position( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& /*pattern*/, ::sal_Int64 /*start*/ ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XBlob::position", *this );
- return 0;
-}
-// -----------------------------------------------------------------------------
-::sal_Int64 SAL_CALL BlobHelper::positionOfBlob( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& /*pattern*/, ::sal_Int64 /*start*/ ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XBlob::positionOfBlob", *this );
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx
deleted file mode 100644
index 5b00cbb155..0000000000
--- a/connectivity/source/commontools/CommonTools.cxx
+++ /dev/null
@@ -1,375 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include "connectivity/CommonTools.hxx"
-#include "connectivity/dbtools.hxx"
-#include <com/sun/star/util/Date.hpp>
-#include <com/sun/star/util/Time.hpp>
-#include <com/sun/star/util/DateTime.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <comphelper/extract.hxx>
-#include <cppuhelper/interfacecontainer.h>
-#include "TConnection.hxx"
-#include <comphelper/types.hxx>
-#include <com/sun/star/java/XJavaVM.hpp>
-#include <rtl/process.h>
-
-using namespace ::comphelper;
-inline sal_Unicode rtl_ascii_toUpperCase( sal_Unicode ch )
-{
- return ch >= 0x0061 && ch <= 0x007a ? ch + 0x20 : ch;
-}
-
-namespace connectivity
-{
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::beans;
- using namespace dbtools;
- namespace starjava = com::sun::star::java;
- //------------------------------------------------------------------------------
- const sal_Unicode CHAR_PLACE = '_';
- const sal_Unicode CHAR_WILD = '%';
- // -------------------------------------------------------------------------
- sal_Bool match(const sal_Unicode* pWild, const sal_Unicode* pStr, const sal_Unicode cEscape)
- {
- int pos=0;
- int flag=0;
-
- while ( *pWild || flag )
- {
- switch (*pWild)
- {
- case CHAR_PLACE:
- if ( *pStr == 0 )
- return sal_False;
- break;
- default:
- if (*pWild && (*pWild == cEscape) && ((*(pWild+1)== CHAR_PLACE) || (*(pWild+1) == CHAR_WILD)) )
- pWild++;
- if ( rtl_ascii_toUpperCase(*pWild) != rtl_ascii_toUpperCase(*pStr) )
- if ( !pos )
- return sal_False;
- else
- pWild += pos;
- else
- break; // WARNING in certain circumstances
- // it will run into the next 'case'!!
- case CHAR_WILD:
- while ( *pWild == CHAR_WILD )
- pWild++;
- if ( *pWild == 0 )
- return sal_True;
- flag = 1;
- pos = 0;
- if ( *pStr == 0 )
- return ( *pWild == 0 );
- while ( *pStr && *pStr != *pWild )
- {
- if ( *pWild == CHAR_PLACE ) {
- pWild++;
- while ( *pWild == CHAR_WILD )
- pWild++;
- }
- pStr++;
- if ( *pStr == 0 )
- return ( *pWild == 0 );
- }
- break;
- }
- if ( *pWild != 0 )
- pWild++;
- if ( *pStr != 0 )
- pStr++;
- else
- flag = 0;
- if ( flag )
- pos--;
- }
- return ( *pStr == 0 ) && ( *pWild == 0 );
- }
- //------------------------------------------------------------------
- rtl::OUString toDateString(const ::com::sun::star::util::Date& rDate)
- {
- sal_Char s[11];
- snprintf(s,
- sizeof(s),
- "%04d-%02d-%02d",
- (int)rDate.Year,
- (int)rDate.Month,
- (int)rDate.Day);
- s[10] = 0;
- return rtl::OUString::createFromAscii(s);
- }
-
- //------------------------------------------------------------------
- rtl::OUString toTimeString(const ::com::sun::star::util::Time& rTime)
- {
- sal_Char s[9];
- snprintf(s,
- sizeof(s),
- "%02d:%02d:%02d",
- (int)rTime.Hours,
- (int)rTime.Minutes,
- (int)rTime.Seconds);
- s[8] = 0;
- return rtl::OUString::createFromAscii(s);
- }
-
- //------------------------------------------------------------------
- rtl::OUString toDateTimeString(const ::com::sun::star::util::DateTime& rDateTime)
- {
- sal_Char s[21];
- snprintf(s,
- sizeof(s),
- "%04d-%02d-%02d %02d:%02d:%02d",
- (int)rDateTime.Year,
- (int)rDateTime.Month,
- (int)rDateTime.Day,
- (int)rDateTime.Hours,
- (int)rDateTime.Minutes,
- (int)rDateTime.Seconds);
- s[20] = 0;
- return rtl::OUString::createFromAscii(s);
- }
-
-
- //--------------------------------------------------------------------------------------------------
- rtl::OUString toString(const Any& rValue)
- {
- rtl::OUString aRes;
- TypeClass aDestinationClass = rValue.getValueType().getTypeClass();
-
- switch (aDestinationClass)
- {
- case TypeClass_CHAR:
- aRes = ::rtl::OUString::valueOf(*(sal_Unicode*)rValue.getValue());
- break;
- case TypeClass_FLOAT:
- aRes = ::rtl::OUString::valueOf(*(float*)rValue.getValue());
- break;
- case TypeClass_DOUBLE:
- aRes = ::rtl::OUString::valueOf(*(double*)rValue.getValue());
- break;
- case TypeClass_BOOLEAN:
- aRes = ::rtl::OUString::valueOf((sal_Int32)*(sal_Bool*)rValue.getValue());
- break;
- case TypeClass_BYTE:
- case TypeClass_SHORT:
- case TypeClass_LONG:
- aRes = ::rtl::OUString::valueOf(*(sal_Int32*)rValue.getValue());
- break;
- case TypeClass_HYPER:
- {
- sal_Int64 nValue = 0;
- OSL_VERIFY( rValue >>= nValue );
- aRes = ::rtl::OUString::valueOf(nValue);
- }
- case TypeClass_STRING:
- rValue >>= aRes;
- break;
- case TypeClass_STRUCT:
- if (rValue.getValueType() == ::getCppuType((const ::com::sun::star::util::Date*)0))
- {
- ::com::sun::star::util::Date aDate;
- rValue >>= aDate;
- aRes = toDateString(aDate);
- }
- else if (rValue.getValueType() == ::getCppuType((const ::com::sun::star::util::DateTime*)0))
- {
- ::com::sun::star::util::DateTime aDT;
- rValue >>= aDT;
- aRes = toDateTimeString(aDT);
- }
- else if (rValue.getValueType() == ::getCppuType((const ::com::sun::star::util::Time*)0))
- {
- ::com::sun::star::util::Time aTime;
- rValue >>= aTime;
- aRes = toTimeString(aTime);
- }
-
- break;
- default:
- ;
- }
- return aRes;
- }
-
- // -----------------------------------------------------------------------------
- ::rtl::Reference< jvmaccess::VirtualMachine > getJavaVM(const Reference<XMultiServiceFactory >& _rxFactory)
- {
- ::rtl::Reference< jvmaccess::VirtualMachine > aRet;
- OSL_ENSURE(_rxFactory.is(),"No XMultiServiceFactory a.v.!");
- if(!_rxFactory.is())
- return aRet;
-
- try
- {
- Reference< starjava::XJavaVM > xVM(_rxFactory->createInstance(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine"))), UNO_QUERY);
-
- OSL_ENSURE(_rxFactory.is(),"InitJava: I have no factory!");
- if (!xVM.is() || !_rxFactory.is())
- throw Exception(); // -2;
-
- Sequence<sal_Int8> processID(16);
- rtl_getGlobalProcessId( (sal_uInt8*) processID.getArray() );
- processID.realloc(17);
- processID[16] = 0;
-
- Any uaJVM = xVM->getJavaVM( processID );
-
- if (!uaJVM.hasValue())
- throw Exception(); // -5
- else
- {
- sal_Int32 nValue = 0;
- jvmaccess::VirtualMachine* pJVM = NULL;
- if ( uaJVM >>= nValue )
- pJVM = reinterpret_cast< jvmaccess::VirtualMachine* > (nValue);
- else
- {
- sal_Int64 nTemp = 0;
- uaJVM >>= nTemp;
- pJVM = reinterpret_cast< jvmaccess::VirtualMachine* > (nTemp);
- }
- aRet = pJVM;
- }
- }
- catch (Exception&)
- {
- }
-
- return aRet;
- }
- //------------------------------------------------------------------------------
- sal_Bool existsJavaClassByName( const ::rtl::Reference< jvmaccess::VirtualMachine >& _pJVM,const ::rtl::OUString& _sClassName )
- {
- sal_Bool bRet = sal_False;
-#ifdef SOLAR_JAVA
- if ( _pJVM.is() )
- {
- jvmaccess::VirtualMachine::AttachGuard aGuard(_pJVM);
- JNIEnv* pEnv = aGuard.getEnvironment();
- if( pEnv )
- {
- ::rtl::OString sClassName = ::rtl::OUStringToOString(_sClassName, RTL_TEXTENCODING_ASCII_US);
- sClassName = sClassName.replace('.','/');
- jobject out = pEnv->FindClass(sClassName.getStr());
- bRet = out != NULL;
- pEnv->DeleteLocalRef( out );
- }
- }
-#else
- (void)_pJVM;
- (void)_sClassName;
-#endif
- return bRet;
- }
-
-}
-
-#include <ctype.h> //isdigit
-namespace dbtools
-{
-//------------------------------------------------------------------
-sal_Bool isCharOk(sal_Unicode c,const ::rtl::OUString& _rSpecials)
-{
-
- return ( ((c >= 97) && (c <= 122)) || ((c >= 65) && (c <= 90)) || ((c >= 48) && (c <= 57)) ||
- c == '_' || _rSpecials.indexOf(c) != -1);
-}
-
-//------------------------------------------------------------------------------
-sal_Bool isValidSQLName(const ::rtl::OUString& rName,const ::rtl::OUString& _rSpecials)
-{
- // Test for correct naming (in SQL sense)
- // This is important for table names for example
- const sal_Unicode* pStr = rName.getStr();
- if (*pStr > 127 || isdigit(*pStr))
- return sal_False;
-
- for (; *pStr; ++pStr )
- if(!isCharOk(*pStr,_rSpecials))
- return sal_False;
-
- if ( rName.getLength()
- && ( (rName.toChar() == '_')
- || ( (rName.toChar() >= '0')
- && (rName.toChar() <= '9')
- )
- )
- )
- return sal_False;
- // the SQL-Standard requires the first character to be an alphabetic character, which
- // isn't easy to decide in UniCode ...
- // So we just prohibit the characters which already lead to problems ....
- // 11.04.00 - 74902 - FS
-
- return sal_True;
-}
-//------------------------------------------------------------------
-// Creates a new name if necessary
-::rtl::OUString convertName2SQLName(const ::rtl::OUString& rName,const ::rtl::OUString& _rSpecials)
-{
- if(isValidSQLName(rName,_rSpecials))
- return rName;
- ::rtl::OUString aNewName(rName);
- const sal_Unicode* pStr = rName.getStr();
- sal_Int32 nLength = rName.getLength();
- sal_Bool bValid(*pStr < 128 && !isdigit(*pStr));
- for (sal_Int32 i=0; bValid && i < nLength; ++pStr,++i )
- if(!isCharOk(*pStr,_rSpecials))
- {
- aNewName = aNewName.replace(*pStr,'_');
- pStr = aNewName.getStr() + i;
- }
-
- if ( !bValid )
- aNewName = ::rtl::OUString();
-
- return aNewName;
-}
-//------------------------------------------------------------------------------
-::rtl::OUString quoteName(const ::rtl::OUString& _rQuote, const ::rtl::OUString& _rName)
-{
- ::rtl::OUString sName = _rName;
- if(_rQuote.getLength() && _rQuote.toChar() != ' ')
- sName = _rQuote + _rName + _rQuote;
- return sName;
-}
-
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx b/connectivity/source/commontools/ConnectionWrapper.cxx
deleted file mode 100644
index 591429eebb..0000000000
--- a/connectivity/source/commontools/ConnectionWrapper.cxx
+++ /dev/null
@@ -1,267 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/ConnectionWrapper.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/uno3.hxx>
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
-#include <rtl/digest.h>
-#include <algorithm>
-
-#include <algorithm>
-
-using namespace connectivity;
-//------------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace ::com::sun::star::reflection;
-// --------------------------------------------------------------------------------
-OConnectionWrapper::OConnectionWrapper()
-{
-
-}
-// -----------------------------------------------------------------------------
-void OConnectionWrapper::setDelegation(Reference< XAggregation >& _rxProxyConnection,oslInterlockedCount& _rRefCount)
-{
- OSL_ENSURE(_rxProxyConnection.is(),"OConnectionWrapper: Connection must be valid!");
- osl_incrementInterlockedCount( &_rRefCount );
- if (_rxProxyConnection.is())
- {
- // transfer the (one and only) real ref to the aggregate to our member
- m_xProxyConnection = _rxProxyConnection;
- _rxProxyConnection = NULL;
- ::comphelper::query_aggregation(m_xProxyConnection,m_xConnection);
- m_xTypeProvider.set(m_xConnection,UNO_QUERY);
- m_xUnoTunnel.set(m_xConnection,UNO_QUERY);
- m_xServiceInfo.set(m_xConnection,UNO_QUERY);
-
- // set ourself as delegator
- Reference<XInterface> xIf = static_cast< XUnoTunnel* >( this );
- m_xProxyConnection->setDelegator( xIf );
-
- }
- osl_decrementInterlockedCount( &_rRefCount );
-}
-// -----------------------------------------------------------------------------
-void OConnectionWrapper::setDelegation(const Reference< XConnection >& _xConnection
- ,const Reference< XMultiServiceFactory>& _xORB
- ,oslInterlockedCount& _rRefCount)
-{
- OSL_ENSURE(_xConnection.is(),"OConnectionWrapper: Connection must be valid!");
- osl_incrementInterlockedCount( &_rRefCount );
-
- m_xConnection = _xConnection;
- m_xTypeProvider.set(m_xConnection,UNO_QUERY);
- m_xUnoTunnel.set(m_xConnection,UNO_QUERY);
- m_xServiceInfo.set(m_xConnection,UNO_QUERY);
-
- Reference< XProxyFactory > xProxyFactory(_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory"))),UNO_QUERY);
- Reference< XAggregation > xConProxy = xProxyFactory->createProxy(_xConnection);
- if (xConProxy.is())
- {
- // transfer the (one and only) real ref to the aggregate to our member
- m_xProxyConnection = xConProxy;
-
- // set ourself as delegator
- Reference<XInterface> xIf = static_cast< XUnoTunnel* >( this );
- m_xProxyConnection->setDelegator( xIf );
-
- }
- osl_decrementInterlockedCount( &_rRefCount );
-}
-// -----------------------------------------------------------------------------
-void OConnectionWrapper::disposing()
-{
-m_xConnection.clear();
-}
-//-----------------------------------------------------------------------------
-OConnectionWrapper::~OConnectionWrapper()
-{
- if (m_xProxyConnection.is())
- m_xProxyConnection->setDelegator(NULL);
-}
-
-// XServiceInfo
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConnectionWrapper::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException)
-{
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbc.drivers.OConnectionWrapper" ) );
-}
-
-// --------------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OConnectionWrapper::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException)
-{
- // first collect the services which are supported by our aggregate
- Sequence< ::rtl::OUString > aSupported;
- if ( m_xServiceInfo.is() )
- aSupported = m_xServiceInfo->getSupportedServiceNames();
-
- // append our own service, if necessary
- ::rtl::OUString sConnectionService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbc.Connection" ) );
- if ( 0 == ::comphelper::findValue( aSupported, sConnectionService, sal_True ).getLength() )
- {
- sal_Int32 nLen = aSupported.getLength();
- aSupported.realloc( nLen + 1 );
- aSupported[ nLen ] = sConnectionService;
- }
-
- // outta here
- return aSupported;
-}
-
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnectionWrapper::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::comphelper::findValue( getSupportedServiceNames(), _rServiceName, sal_True ).getLength() != 0;
-}
-
-// --------------------------------------------------------------------------------
-Any SAL_CALL OConnectionWrapper::queryInterface( const Type& _rType ) throw (RuntimeException)
-{
- Any aReturn = OConnection_BASE::queryInterface(_rType);
- return aReturn.hasValue() ? aReturn : (m_xProxyConnection.is() ? m_xProxyConnection->queryAggregation(_rType) : aReturn);
-}
-// --------------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OConnectionWrapper::getTypes( ) throw (::com::sun::star::uno::RuntimeException)
-{
- return ::comphelper::concatSequences(
- OConnection_BASE::getTypes(),
- m_xTypeProvider->getTypes()
- );
-}
-// -----------------------------------------------------------------------------
-// com::sun::star::lang::XUnoTunnel
-sal_Int64 SAL_CALL OConnectionWrapper::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException)
-{
- if (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- return reinterpret_cast< sal_Int64 >( this );
-
- if(m_xUnoTunnel.is())
- return m_xUnoTunnel->getSomething(rId);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-Sequence< sal_Int8 > OConnectionWrapper::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-// -----------------------------------------------------------------------------
-namespace
-{
- class TPropertyValueLessFunctor : public ::std::binary_function< ::com::sun::star::beans::PropertyValue,::com::sun::star::beans::PropertyValue,bool>
- {
- public:
- TPropertyValueLessFunctor()
- {}
- bool operator() (const ::com::sun::star::beans::PropertyValue& lhs, const ::com::sun::star::beans::PropertyValue& rhs) const
- {
- return !!(lhs.Name.equalsIgnoreAsciiCase( rhs.Name ));
- }
- };
-
-}
-
-// -----------------------------------------------------------------------------
-// creates a unique id out of the url and sequence of properties
-void OConnectionWrapper::createUniqueId( const ::rtl::OUString& _rURL
- ,Sequence< PropertyValue >& _rInfo
- ,sal_uInt8* _pBuffer
- ,const ::rtl::OUString& _rUserName
- ,const ::rtl::OUString& _rPassword)
-{
- // first we create the digest we want to have
- rtlDigest aDigest = rtl_digest_create( rtl_Digest_AlgorithmSHA1 );
- rtl_digest_update(aDigest,_rURL.getStr(),_rURL.getLength()*sizeof(sal_Unicode));
- if ( _rUserName.getLength() )
- rtl_digest_update(aDigest,_rUserName.getStr(),_rUserName.getLength()*sizeof(sal_Unicode));
- if ( _rPassword.getLength() )
- rtl_digest_update(aDigest,_rPassword.getStr(),_rPassword.getLength()*sizeof(sal_Unicode));
- // now we need to sort the properties
- PropertyValue* pBegin = _rInfo.getArray();
- PropertyValue* pEnd = pBegin + _rInfo.getLength();
- ::std::sort(pBegin,pEnd,TPropertyValueLessFunctor());
-
- pBegin = _rInfo.getArray();
- pEnd = pBegin + _rInfo.getLength();
- for (; pBegin != pEnd; ++pBegin)
- {
- // we only include strings an integer values
- ::rtl::OUString sValue;
- if ( pBegin->Value >>= sValue )
- ;
- else
- {
- sal_Int32 nValue = 0;
- if ( pBegin->Value >>= nValue )
- sValue = ::rtl::OUString::valueOf(nValue);
- else
- {
- Sequence< ::rtl::OUString> aSeq;
- if ( pBegin->Value >>= aSeq )
- {
- const ::rtl::OUString* pSBegin = aSeq.getConstArray();
- const ::rtl::OUString* pSEnd = pSBegin + aSeq.getLength();
- for(;pSBegin != pSEnd;++pSBegin)
- rtl_digest_update(aDigest,pSBegin->getStr(),pSBegin->getLength()*sizeof(sal_Unicode));
- }
- }
- }
- if ( sValue.getLength() > 0 )
- {
- // we don't have to convert this into UTF8 because we don't store on a file system
- rtl_digest_update(aDigest,sValue.getStr(),sValue.getLength()*sizeof(sal_Unicode));
- }
- }
-
- rtl_digest_get(aDigest,_pBuffer,RTL_DIGEST_LENGTH_SHA1);
- // we have to destroy the digest
- rtl_digest_destroy(aDigest);
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx
deleted file mode 100644
index 282524366a..0000000000
--- a/connectivity/source/commontools/DateConversion.cxx
+++ /dev/null
@@ -1,522 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include "connectivity/dbconversion.hxx"
-#include <connectivity/dbtools.hxx>
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/util/NumberFormat.hpp>
-#include <com/sun/star/util/XNumberFormatTypes.hpp>
-#include <com/sun/star/sdb/XColumnUpdate.hpp>
-#include <com/sun/star/sdb/XColumn.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <comphelper/extract.hxx>
-#include "TConnection.hxx"
-#include "diagnose_ex.h"
-#include <comphelper/numbers.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <tools/diagnose_ex.h>
-
-
-using namespace ::connectivity;
-using namespace ::comphelper;
-using namespace ::com::sun::star::script;
-using namespace ::com::sun::star::sdb;
-using namespace ::com::sun::star::sdbc;
-using namespace ::dbtools;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::beans;
-// -----------------------------------------------------------------------------
-::rtl::OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, sal_Bool bQuote,
- const Reference< XTypeConverter >& _rxTypeConverter)
-{
- ::rtl::OUStringBuffer aRet;
- if (_rVal.hasValue())
- {
- try
- {
- switch (eType)
- {
- case DataType::INTEGER:
- case DataType::BIT:
- case DataType::BOOLEAN:
- case DataType::TINYINT:
- case DataType::SMALLINT:
- if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_BOOLEAN)
- {
- if (::cppu::any2bool(_rVal))
- aRet.appendAscii("1");
- else
- aRet.appendAscii("0");
- }
- else
- {
- ::rtl::OUString sTemp;
- _rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= sTemp;
- aRet.append(sTemp);
- }
- break;
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- if (bQuote)
- aRet.appendAscii("'");
- {
- ::rtl::OUString aTemp;
- _rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= aTemp;
- sal_Int32 nIndex = (sal_Int32)-1;
- const ::rtl::OUString sQuot(RTL_CONSTASCII_USTRINGPARAM("\'"));
- const ::rtl::OUString sQuotToReplace(RTL_CONSTASCII_USTRINGPARAM("\'\'"));
- do
- {
- nIndex += 2;
- nIndex = aTemp.indexOf(sQuot,nIndex);
- if(nIndex != -1)
- aTemp = aTemp.replaceAt(nIndex,sQuot.getLength(),sQuotToReplace);
- } while (nIndex != -1);
-
- aRet.append(aTemp);
- }
- if (bQuote)
- aRet.appendAscii("'");
- break;
- case DataType::REAL:
- case DataType::DOUBLE:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::BIGINT:
- default:
- {
- ::rtl::OUString sTemp;
- _rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= sTemp;
- aRet.append(sTemp);
- }
- break;
- case DataType::TIMESTAMP:
- {
- DateTime aDateTime;
- bool bOk = false;
- if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_DOUBLE)
- {
- double nValue = 0.0;
- _rVal >>= nValue;
- aDateTime = DBTypeConversion::toDateTime(nValue);
- bOk = true;
- }
- else if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_STRING)
- {
- ::rtl::OUString sValue;
- _rVal >>= sValue;
- aDateTime = DBTypeConversion::toDateTime(sValue);
- bOk = true;
- }
- else
- bOk = _rVal >>= aDateTime;
-
- OSL_VERIFY_RES( bOk, "DBTypeConversion::toSQLString: _rVal is not datetime!");
- // check if this is really a timestamp or only a date
- if ( bOk )
- {
- if (bQuote)
- aRet.appendAscii("{TS '");
- aRet.append(DBTypeConversion::toDateTimeString(aDateTime));
- if (bQuote)
- aRet.appendAscii("'}");
- break;
- }
- break;
- }
- case DataType::DATE:
- {
- Date aDate;
- bool bOk = false;
- if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_DOUBLE)
- {
- double nValue = 0.0;
- _rVal >>= nValue;
- aDate = DBTypeConversion::toDate(nValue);
- bOk = true;
- }
- else if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_STRING)
- {
- ::rtl::OUString sValue;
- _rVal >>= sValue;
- aDate = DBTypeConversion::toDate(sValue);
- bOk = true;
- }
- else
- bOk = _rVal >>= aDate;
- OSL_VERIFY_RES( bOk, "DBTypeConversion::toSQLString: _rVal is not date!");
- if (bQuote)
- aRet.appendAscii("{D '");
- aRet.append(DBTypeConversion::toDateString(aDate));
- if (bQuote)
- aRet.appendAscii("'}");
- } break;
- case DataType::TIME:
- {
- Time aTime;
- bool bOk = false;
- if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_DOUBLE)
- {
- double nValue = 0.0;
- _rVal >>= nValue;
- aTime = DBTypeConversion::toTime(nValue);
- bOk = true;
- }
- else if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_STRING)
- {
- ::rtl::OUString sValue;
- _rVal >>= sValue;
- aTime = DBTypeConversion::toTime(sValue);
- bOk = true;
- }
- else
- bOk = _rVal >>= aTime;
- OSL_VERIFY_RES( bOk,"DBTypeConversion::toSQLString: _rVal is not time!");
- if (bQuote)
- aRet.appendAscii("{T '");
- aRet.append(DBTypeConversion::toTimeString(aTime));
- if (bQuote)
- aRet.appendAscii("'}");
- } break;
- }
- }
- catch ( const Exception& )
- {
- OSL_FAIL("TypeConversion Error");
- }
- }
- else
- aRet.appendAscii(" NULL ");
- return aRet.makeStringAndClear();
-}
-// -----------------------------------------------------------------------------
-Date DBTypeConversion::getNULLDate(const Reference< XNumberFormatsSupplier > &xSupplier)
-{
- OSL_ENSURE(xSupplier.is(), "getNULLDate : the formatter doesn't implement a supplier !");
- if (xSupplier.is())
- {
- try
- {
- // get the null date
- Date aDate;
- xSupplier->getNumberFormatSettings()->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NullDate"))) >>= aDate;
- return aDate;
- }
- catch ( const Exception& )
- {
- }
- }
-
- return getStandardDate();
-}
-// -----------------------------------------------------------------------------
-void DBTypeConversion::setValue(const Reference<XColumnUpdate>& xVariant,
- const Reference<XNumberFormatter>& xFormatter,
- const Date& rNullDate,
- const ::rtl::OUString& rString,
- sal_Int32 nKey,
- sal_Int16 nFieldType,
- sal_Int16 nKeyType) throw(::com::sun::star::lang::IllegalArgumentException)
-{
- if (rString.getLength())
- {
- // Does the String need to be formatted?
- sal_Int16 nTypeClass = nKeyType & ~NumberFormat::DEFINED;
- sal_Bool bTextFormat = nTypeClass == NumberFormat::TEXT;
- sal_Int32 nKeyToUse = bTextFormat ? 0 : nKey;
- sal_Int16 nRealUsedTypeClass = nTypeClass;
- // for a Text-Format the formatter needs some more freedom, otherwise
- // convertStringToNumber will throw a NotNumericException
- try
- {
- double fValue = xFormatter->convertStringToNumber(nKeyToUse, rString);
- sal_Int32 nRealUsedKey = xFormatter->detectNumberFormat(0, rString);
- if (nRealUsedKey != nKeyToUse)
- nRealUsedTypeClass = getNumberFormatType(xFormatter, nRealUsedKey) & ~NumberFormat::DEFINED;
-
- // and again a special treatment, this time for percent formats
- if ((NumberFormat::NUMBER == nRealUsedTypeClass) && (NumberFormat::PERCENT == nTypeClass))
- { // formatting should be "percent", but the String provides just a simple number -> adjust
- ::rtl::OUString sExpanded(rString);
- static ::rtl::OUString s_sPercentSymbol( RTL_CONSTASCII_USTRINGPARAM( "%" ));
- // need a method to add a sal_Unicode to a string, 'til then we use a static string
- sExpanded += s_sPercentSymbol;
- fValue = xFormatter->convertStringToNumber(nKeyToUse, sExpanded);
- }
-
- switch (nRealUsedTypeClass)
- {
- case NumberFormat::DATE:
- case NumberFormat::DATETIME:
- case NumberFormat::TIME:
- DBTypeConversion::setValue(xVariant,rNullDate,fValue,nRealUsedTypeClass);
- // xVariant->updateDouble(toStandardDbDate(rNullDate, fValue));
- break;
- case NumberFormat::CURRENCY:
- case NumberFormat::NUMBER:
- case NumberFormat::SCIENTIFIC:
- case NumberFormat::FRACTION:
- case NumberFormat::PERCENT:
- xVariant->updateDouble(fValue);
- break;
- default:
- xVariant->updateString(rString);
- }
- }
- catch(const Exception& )
- {
- xVariant->updateString(rString);
- }
- }
- else
- {
- switch (nFieldType)
- {
- case ::com::sun::star::sdbc::DataType::CHAR:
- case ::com::sun::star::sdbc::DataType::VARCHAR:
- case ::com::sun::star::sdbc::DataType::LONGVARCHAR:
- xVariant->updateString(rString);
- break;
- default:
- xVariant->updateNull();
- }
- }
-}
-
-//------------------------------------------------------------------------------
-void DBTypeConversion::setValue(const Reference<XColumnUpdate>& xVariant,
- const Date& rNullDate,
- const double& rValue,
- sal_Int16 nKeyType) throw(::com::sun::star::lang::IllegalArgumentException)
-{
- switch (nKeyType & ~NumberFormat::DEFINED)
- {
- case NumberFormat::DATE:
- xVariant->updateDate(toDate( rValue, rNullDate));
- break;
- case NumberFormat::DATETIME:
- xVariant->updateTimestamp(toDateTime(rValue,rNullDate));
- break;
- case NumberFormat::TIME:
- xVariant->updateTime(toTime(rValue));
- break;
- default:
- {
- double nValue = rValue;
-// Reference<XPropertySet> xProp(xVariant,UNO_QUERY);
-// if ( xProp.is()
-// && xProp->getPropertySetInfo()->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISSIGNED))
-// && !::comphelper::getBOOL(xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISSIGNED))) )
-// {
-// switch (::comphelper::getINT32(xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))))
-// {
-// case DataType::TINYINT:
-// nValue = static_cast<sal_uInt8>(rValue);
-// break;
-// case DataType::SMALLINT:
-// nValue = static_cast<sal_uInt16>(rValue);
-// break;
-// case DataType::INTEGER:
-// nValue = static_cast<sal_uInt32>(rValue);
-// break;
-// case DataType::BIGINT:
-// nValue = static_cast<sal_uInt64>(rValue);
-// break;
-// }
-// }
- xVariant->updateDouble(nValue);
- }
- }
-}
-
-//------------------------------------------------------------------------------
-double DBTypeConversion::getValue( const Reference< XColumn >& i_column, const Date& i_relativeToNullDate )
-{
- try
- {
- const Reference< XPropertySet > xProp( i_column, UNO_QUERY_THROW );
-
- const sal_Int32 nColumnType = ::comphelper::getINT32( xProp->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_TYPE ) ) );
- switch ( nColumnType )
- {
- case DataType::DATE:
- return toDouble( i_column->getDate(), i_relativeToNullDate );
-
- case DataType::TIME:
- return toDouble( i_column->getTime() );
-
- case DataType::TIMESTAMP:
- return toDouble( i_column->getTimestamp(), i_relativeToNullDate );
-
- default:
- {
- sal_Bool bIsSigned = sal_True;
- OSL_VERIFY( xProp->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_ISSIGNED ) ) >>= bIsSigned );
- if ( !bIsSigned )
- {
- switch ( nColumnType)
- {
- case DataType::TINYINT:
- return static_cast<double>(static_cast<sal_uInt8>(i_column->getByte()));
- case DataType::SMALLINT:
- return static_cast<double>(static_cast<sal_uInt16>(i_column->getShort()));
- case DataType::INTEGER:
- return static_cast<double>(static_cast<sal_uInt32>(i_column->getInt()));
- case DataType::BIGINT:
- return static_cast<double>(static_cast<sal_uInt64>(i_column->getLong()));
- }
- }
- }
- return i_column->getDouble();
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- return 0.0;
- }
-}
-//------------------------------------------------------------------------------
-::rtl::OUString DBTypeConversion::getFormattedValue(const Reference< XPropertySet>& _xColumn,
- const Reference<XNumberFormatter>& _xFormatter,
- const ::com::sun::star::lang::Locale& _rLocale,
- const Date& _rNullDate)
-{
- OSL_ENSURE(_xColumn.is() && _xFormatter.is(), "DBTypeConversion::getFormattedValue: invalid arg !");
- if (!_xColumn.is() || !_xFormatter.is())
- return ::rtl::OUString();
-
- sal_Int32 nKey(0);
- try
- {
- _xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FORMATKEY)) >>= nKey;
- }
- catch (const Exception& )
- {
- OSL_FAIL("DBTypeConversion::getValue: caught an exception while asking for the format key!");
- }
-
- if (!nKey)
- {
- Reference<XNumberFormats> xFormats( _xFormatter->getNumberFormatsSupplier()->getNumberFormats() );
- Reference<XNumberFormatTypes> xTypeList(_xFormatter->getNumberFormatsSupplier()->getNumberFormats(), UNO_QUERY);
-
- nKey = ::dbtools::getDefaultNumberFormat(_xColumn,
- Reference< XNumberFormatTypes > (xFormats, UNO_QUERY),
- _rLocale);
-
- }
-
- sal_Int16 nKeyType = getNumberFormatType(_xFormatter, nKey) & ~NumberFormat::DEFINED;
-
- return DBTypeConversion::getFormattedValue(Reference< XColumn > (_xColumn, UNO_QUERY), _xFormatter, _rNullDate, nKey, nKeyType);
-}
-
-//------------------------------------------------------------------------------
-::rtl::OUString DBTypeConversion::getFormattedValue(const Reference<XColumn>& xVariant,
- const Reference<XNumberFormatter>& xFormatter,
- const Date& rNullDate,
- sal_Int32 nKey,
- sal_Int16 nKeyType)
-{
- ::rtl::OUString aString;
- if (xVariant.is())
- {
- try
- {
- switch (nKeyType & ~NumberFormat::DEFINED)
- {
- case NumberFormat::DATE:
- case NumberFormat::DATETIME:
- {
- // get a value which represents the given date, relative to the given null date
- double fValue = getValue( xVariant, rNullDate );
- if ( !xVariant->wasNull() )
- {
- // get the null date of the formatter
- Date aFormatterNullDate( rNullDate );
- try
- {
- Reference< XNumberFormatsSupplier > xSupplier( xFormatter->getNumberFormatsSupplier(), UNO_SET_THROW );
- Reference< XPropertySet > xFormatterSettings( xSupplier->getNumberFormatSettings(), UNO_SET_THROW );
- OSL_VERIFY( xFormatterSettings->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NullDate" ) ) ) >>= aFormatterNullDate );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- // get a value which represents the given date, relative to the null date of the formatter
- fValue -= toDays( rNullDate, aFormatterNullDate );
- // format this value
- aString = xFormatter->convertNumberToString( nKey, fValue );
- }
- }
- break;
- case NumberFormat::TIME:
- case NumberFormat::NUMBER:
- case NumberFormat::SCIENTIFIC:
- case NumberFormat::FRACTION:
- case NumberFormat::PERCENT:
- {
- double fValue = xVariant->getDouble();
- if (!xVariant->wasNull())
- aString = xFormatter->convertNumberToString(nKey, fValue);
- } break;
- case NumberFormat::CURRENCY:
- {
- double fValue = xVariant->getDouble();
- if (!xVariant->wasNull())
- aString = xFormatter->getInputString(nKey, fValue);
- } break;
- case NumberFormat::TEXT:
- aString = xFormatter->formatString(nKey, xVariant->getString());
- break;
- default:
- aString = xVariant->getString();
- }
- }
- catch(const Exception& )
- {
- aString = xVariant->getString();
- }
- }
- return aString;
-}
-//------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx
deleted file mode 100644
index 12564203dd..0000000000
--- a/connectivity/source/commontools/DriversConfig.cxx
+++ /dev/null
@@ -1,265 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "connectivity/DriversConfig.hxx"
-#include <tools/wldcrd.hxx>
-
-using namespace connectivity;
-using namespace utl;
-using namespace ::com::sun::star;
-
-namespace
-{
- void lcl_convert(const uno::Sequence< ::rtl::OUString >& _aSource,uno::Any& _rDest)
- {
- uno::Sequence<uno::Any> aRet(_aSource.getLength());
- uno::Any* pAny = aRet.getArray();
- const ::rtl::OUString* pIter = _aSource.getConstArray();
- const ::rtl::OUString* pEnd = pIter + _aSource.getLength();
- for (;pIter != pEnd ; ++pIter,++pAny)
- {
- *pAny <<= *pIter;
- }
- _rDest <<= aRet;
- }
- void lcl_fillValues(const ::utl::OConfigurationNode& _aURLPatternNode,const ::rtl::OUString& _sNode,::comphelper::NamedValueCollection& _rValues)
- {
- const ::utl::OConfigurationNode aPropertiesNode = _aURLPatternNode.openNode(_sNode);
- if ( aPropertiesNode.isValid() )
- {
- uno::Sequence< ::rtl::OUString > aStringSeq;
- static const ::rtl::OUString s_sValue(RTL_CONSTASCII_USTRINGPARAM("/Value"));
- const uno::Sequence< ::rtl::OUString > aProperties = aPropertiesNode.getNodeNames();
- const ::rtl::OUString* pPropertiesIter = aProperties.getConstArray();
- const ::rtl::OUString* pPropertiesEnd = pPropertiesIter + aProperties.getLength();
- for (;pPropertiesIter != pPropertiesEnd ; ++pPropertiesIter)
- {
- uno::Any aValue = aPropertiesNode.getNodeValue(*pPropertiesIter + s_sValue);
- if ( aValue >>= aStringSeq )
- {
- lcl_convert(aStringSeq,aValue);
- }
- _rValues.put(*pPropertiesIter,aValue);
- } // for (;pPropertiesIter != pPropertiesEnd ; ++pPropertiesIter,++pNamedIter)
- } // if ( aPropertiesNode.isValid() )
- }
- void lcl_readURLPatternNode(const ::utl::OConfigurationTreeRoot& _aInstalled,const ::rtl::OUString& _sEntry,TInstalledDriver& _rInstalledDriver)
- {
- const ::utl::OConfigurationNode aURLPatternNode = _aInstalled.openNode(_sEntry);
- if ( aURLPatternNode.isValid() )
- {
- static const ::rtl::OUString s_sParentURLPattern(RTL_CONSTASCII_USTRINGPARAM("ParentURLPattern"));
- static const ::rtl::OUString s_sDriver(RTL_CONSTASCII_USTRINGPARAM("Driver"));
- static const ::rtl::OUString s_sDriverTypeDisplayName(RTL_CONSTASCII_USTRINGPARAM("DriverTypeDisplayName"));
- static const ::rtl::OUString s_sProperties(RTL_CONSTASCII_USTRINGPARAM("Properties"));
- static const ::rtl::OUString s_sFeatures(RTL_CONSTASCII_USTRINGPARAM("Features"));
- static const ::rtl::OUString s_sMetaData(RTL_CONSTASCII_USTRINGPARAM("MetaData"));
- ::rtl::OUString sParentURLPattern;
- aURLPatternNode.getNodeValue(s_sParentURLPattern) >>= sParentURLPattern;
- if ( sParentURLPattern.getLength() )
- lcl_readURLPatternNode(_aInstalled,sParentURLPattern,_rInstalledDriver);
-
- ::rtl::OUString sDriverFactory;
- aURLPatternNode.getNodeValue(s_sDriver) >>= sDriverFactory;
- if ( sDriverFactory.getLength() )
- _rInstalledDriver.sDriverFactory = sDriverFactory;
-
- ::rtl::OUString sDriverTypeDisplayName;
- aURLPatternNode.getNodeValue(s_sDriverTypeDisplayName) >>= sDriverTypeDisplayName;
- OSL_ENSURE(sDriverTypeDisplayName.getLength(),"No valid DriverTypeDisplayName property!");
- if ( sDriverTypeDisplayName.getLength() )
- _rInstalledDriver.sDriverTypeDisplayName = sDriverTypeDisplayName;
-
- lcl_fillValues(aURLPatternNode,s_sProperties,_rInstalledDriver.aProperties);
- lcl_fillValues(aURLPatternNode,s_sFeatures,_rInstalledDriver.aFeatures);
- lcl_fillValues(aURLPatternNode,s_sMetaData,_rInstalledDriver.aMetaData);
- }
- }
-}
-// -----------------------------------------------------------------------------
-DriversConfigImpl::DriversConfigImpl()
-{
-}
-// -----------------------------------------------------------------------------
-void DriversConfigImpl::Load(const uno::Reference< lang::XMultiServiceFactory >& _rxORB) const
-{
- if ( m_aDrivers.empty() )
- {
- if ( !m_aInstalled.isValid() )
- {
- static const ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess.Drivers/Installed")); ///Installed
- m_aInstalled = ::utl::OConfigurationTreeRoot::createWithServiceFactory(_rxORB, s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY);
- }
-
- if ( m_aInstalled.isValid() )
- {
- const uno::Sequence< ::rtl::OUString > aURLPatterns = m_aInstalled.getNodeNames();
- const ::rtl::OUString* pPatternIter = aURLPatterns.getConstArray();
- const ::rtl::OUString* pPatternEnd = pPatternIter + aURLPatterns.getLength();
- for (;pPatternIter != pPatternEnd ; ++pPatternIter)
- {
- TInstalledDriver aInstalledDriver;
- lcl_readURLPatternNode(m_aInstalled,*pPatternIter,aInstalledDriver);
- if ( aInstalledDriver.sDriverFactory.getLength() )
- m_aDrivers.insert(TInstalledDrivers::value_type(*pPatternIter,aInstalledDriver));
- }
- } // if ( m_aInstalled.isValid() )
- }
-}
-// -----------------------------------------------------------------------------
-DriversConfig::DriversConfig(const uno::Reference< lang::XMultiServiceFactory >& _rxORB)
-:m_xORB(_rxORB)
-{
-}
-
-// -----------------------------------------------------------------------------
-DriversConfig::~DriversConfig()
-{
-}
-
-// -----------------------------------------------------------------------------
-DriversConfig::DriversConfig( const DriversConfig& _rhs )
-{
- *this = _rhs;
-}
-
-// -----------------------------------------------------------------------------
-DriversConfig& DriversConfig::operator=( const DriversConfig& _rhs )
-{
- if ( this != &_rhs )
- {
- m_aNode = _rhs.m_aNode;
- }
- return *this;
-}
-
-// -----------------------------------------------------------------------------
-::rtl::OUString DriversConfig::getDriverFactoryName(const ::rtl::OUString& _sURL) const
-{
- const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
- ::rtl::OUString sRet;
- ::rtl::OUString sOldPattern;
- TInstalledDrivers::const_iterator aIter = rDrivers.begin();
- TInstalledDrivers::const_iterator aEnd = rDrivers.end();
- for(;aIter != aEnd;++aIter)
- {
- WildCard aWildCard(aIter->first);
- if ( sOldPattern.getLength() < aIter->first.getLength() && aWildCard.Matches(_sURL) )
- {
- sRet = aIter->second.sDriverFactory;
- sOldPattern = aIter->first;
- }
- }
-
- return sRet;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString DriversConfig::getDriverTypeDisplayName(const ::rtl::OUString& _sURL) const
-{
- const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
- ::rtl::OUString sRet;
- ::rtl::OUString sOldPattern;
- TInstalledDrivers::const_iterator aIter = rDrivers.begin();
- TInstalledDrivers::const_iterator aEnd = rDrivers.end();
- for(;aIter != aEnd;++aIter)
- {
- WildCard aWildCard(aIter->first);
- if ( sOldPattern.getLength() < aIter->first.getLength() && aWildCard.Matches(_sURL) )
- {
- sRet = aIter->second.sDriverTypeDisplayName;
- sOldPattern = aIter->first;
- }
- }
-
- return sRet;
-}
-// -----------------------------------------------------------------------------
-const ::comphelper::NamedValueCollection& DriversConfig::getProperties(const ::rtl::OUString& _sURL) const
-{
- return impl_get(_sURL,1);
-}
-// -----------------------------------------------------------------------------
-const ::comphelper::NamedValueCollection& DriversConfig::getFeatures(const ::rtl::OUString& _sURL) const
-{
- return impl_get(_sURL,0);
-}
-// -----------------------------------------------------------------------------
-const ::comphelper::NamedValueCollection& DriversConfig::getMetaData(const ::rtl::OUString& _sURL) const
-{
- return impl_get(_sURL,2);
-}
-// -----------------------------------------------------------------------------
-const ::comphelper::NamedValueCollection& DriversConfig::impl_get(const ::rtl::OUString& _sURL,sal_Int32 _nProps) const
-{
- const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
- const ::comphelper::NamedValueCollection* pRet = NULL;
- ::rtl::OUString sOldPattern;
- TInstalledDrivers::const_iterator aIter = rDrivers.begin();
- TInstalledDrivers::const_iterator aEnd = rDrivers.end();
- for(;aIter != aEnd;++aIter)
- {
- WildCard aWildCard(aIter->first);
- if ( sOldPattern.getLength() < aIter->first.getLength() && aWildCard.Matches(_sURL) )
- {
- switch(_nProps)
- {
- case 0:
- pRet = &aIter->second.aFeatures;
- break;
- case 1:
- pRet = &aIter->second.aProperties;
- break;
- case 2:
- pRet = &aIter->second.aMetaData;
- break;
- }
- sOldPattern = aIter->first;
- }
- } // for(;aIter != aEnd;++aIter)
- if ( pRet == NULL )
- {
- static const ::comphelper::NamedValueCollection s_sEmpty;
- pRet = &s_sEmpty;
- }
- return *pRet;
-}
-// -----------------------------------------------------------------------------
-uno::Sequence< ::rtl::OUString > DriversConfig::getURLs() const
-{
- const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
- uno::Sequence< ::rtl::OUString > aRet(rDrivers.size());
- ::rtl::OUString* pIter = aRet.getArray();
- TInstalledDrivers::const_iterator aIter = rDrivers.begin();
- TInstalledDrivers::const_iterator aEnd = rDrivers.end();
- for(;aIter != aEnd;++aIter,++pIter)
- {
- *pIter = aIter->first;
- }
- return aRet;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
deleted file mode 100644
index a569f7e5b8..0000000000
--- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
+++ /dev/null
@@ -1,905 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "ParameterSubstitution.hxx"
-#include "FDatabaseMetaDataResultSet.hxx"
-#include "FDatabaseMetaDataResultSetMetaData.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnSearch.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbc/ProcedureResult.hpp>
-#include <com/sun/star/sdbc/IndexType.hpp>
-#include <comphelper/property.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
-#include "connectivity/dbexception.hxx"
-#include "TConnection.hxx"
-
-using namespace connectivity;
-using namespace dbtools;
-using namespace cppu;
-//------------------------------------------------------------------------------
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -------------------------------------------------------------------------
-ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet()
- :ODatabaseMetaDataResultSet_BASE(m_aMutex)
- ,::comphelper::OPropertyContainer(ODatabaseMetaDataResultSet_BASE::rBHelper)
- ,m_aStatement(NULL)
- ,m_xMetaData(NULL)
- ,m_bBOF(sal_True)
- ,m_bEOF(sal_True)
-{
- construct();
-}
-
-// -------------------------------------------------------------------------
-ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet( MetaDataResultSetType _eType )
- :ODatabaseMetaDataResultSet_BASE(m_aMutex)
- ,::comphelper::OPropertyContainer(ODatabaseMetaDataResultSet_BASE::rBHelper)
- ,m_aStatement(NULL)
- ,m_xMetaData(NULL)
- ,m_bBOF(sal_True)
- ,m_bEOF(sal_True)
-{
- construct();
-
- setType(_eType);
-}
-
-// -------------------------------------------------------------------------
-ODatabaseMetaDataResultSet::~ODatabaseMetaDataResultSet()
-{
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::construct()
-{
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHSIZE), PROPERTY_ID_FETCHSIZE, 0,&m_nFetchSize, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETTYPE), PROPERTY_ID_RESULTSETTYPE, PropertyAttribute::READONLY,&m_nResultSetType, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHDIRECTION), PROPERTY_ID_FETCHDIRECTION, 0, &m_nFetchDirection, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETCONCURRENCY), PROPERTY_ID_RESULTSETCONCURRENCY, PropertyAttribute::READONLY,&m_nResultSetConcurrency, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
-}
-// -----------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setType(MetaDataResultSetType _eType)
-{
- switch( _eType )
- {
- case eCatalogs: setCatalogsMap(); break;
- case eSchemas: setSchemasMap(); break;
- case eColumnPrivileges: setColumnPrivilegesMap(); break;
- case eColumns: setColumnsMap(); break;
- case eTables: setTablesMap(); break;
- case eTableTypes: setTableTypes(); break;
- case eProcedureColumns: setProcedureColumnsMap(); break;
- case eProcedures: setProceduresMap(); break;
- case eExportedKeys: setExportedKeysMap(); break;
- case eImportedKeys: setImportedKeysMap(); break;
- case ePrimaryKeys: setPrimaryKeysMap(); break;
- case eIndexInfo: setIndexInfoMap(); break;
- case eTablePrivileges: setTablePrivilegesMap(); break;
- case eCrossReference: setCrossReferenceMap(); break;
- case eTypeInfo: setTypeInfoMap(); break;
- case eBestRowIdentifier: setBestRowIdentifierMap(); break;
- case eVersionColumns: setVersionColumnsMap(); break;
- default:
- OSL_FAIL("Wrong type!");
- }
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::disposing(void)
-{
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
- m_aStatement = NULL;
-m_xMetaData.clear();
- m_aRowsIter = m_aRows.end();
- m_aRows.clear();
- m_aRowsIter = m_aRows.end();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::acquire() throw()
-{
- ODatabaseMetaDataResultSet_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::release() throw()
-{
- ODatabaseMetaDataResultSet_BASE::release();
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL ODatabaseMetaDataResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OPropertySetHelper::queryInterface(rType);
- return aRet.hasValue() ? aRet : ODatabaseMetaDataResultSet_BASE::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL ODatabaseMetaDataResultSet::getTypes( ) throw(RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const Reference< ::com::sun::star::beans::XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XFastPropertySet > *)0 ),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XPropertySet > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),ODatabaseMetaDataResultSet_BASE::getTypes());
-}
-// -----------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setRows(const ORows& _rRows)
-{
- m_aRows = _rRows;
- m_bBOF = sal_True;
- m_bEOF = m_aRows.empty();
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
-
-
- Reference< XResultSetMetaData > xMeta = getMetaData();
- sal_Int32 nLen = xMeta->getColumnCount();
- sal_Int32 i = 1;
- for(;i<=nLen;++i)
- if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
- columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i))
- )
- break;
- return i;
-}
-// -----------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::checkIndex(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException)
-{
- if(columnIndex >= (sal_Int32)(*m_aRowsIter).size() || columnIndex < 1)
- ::dbtools::throwInvalidIndexException(*this);
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResultSet::getBinaryStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResultSet::getCharacterStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Int8 SAL_CALL ODatabaseMetaDataResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-::com::sun::star::util::Date SAL_CALL ODatabaseMetaDataResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-double SAL_CALL ODatabaseMetaDataResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-float SAL_CALL ODatabaseMetaDataResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getRow( ) throw(SQLException, RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-
-sal_Int64 SAL_CALL ODatabaseMetaDataResultSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSetMetaData > SAL_CALL ODatabaseMetaDataResultSet::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
-
-
- if(!m_xMetaData.is())
- m_xMetaData = new ODatabaseMetaDataResultSetMetaData();
-
- return m_xMetaData;
-}
-// -------------------------------------------------------------------------
-Reference< XArray > SAL_CALL ODatabaseMetaDataResultSet::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-
-Reference< XClob > SAL_CALL ODatabaseMetaDataResultSet::getClob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XBlob > SAL_CALL ODatabaseMetaDataResultSet::getBlob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Reference< XRef > SAL_CALL ODatabaseMetaDataResultSet::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL ODatabaseMetaDataResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex).makeAny();
-}
-// -------------------------------------------------------------------------
-
-sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-
-// -------------------------------------------------------------------------
-
-
-::com::sun::star::util::Time SAL_CALL ODatabaseMetaDataResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-
-::com::sun::star::util::DateTime SAL_CALL ODatabaseMetaDataResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isAfterLast( ) throw(SQLException, RuntimeException)
-{
- return m_bEOF;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isFirst( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionSequenceException(*this);
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isLast( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionSequenceException(*this);
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionSequenceException(*this);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::afterLast( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionSequenceException(*this);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL ODatabaseMetaDataResultSet::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
-
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::first( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionSequenceException(*this);
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::last( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionSequenceException(*this);
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::absolute( sal_Int32 /*row*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionSequenceException(*this);
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::relative( sal_Int32 /*row*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionSequenceException(*this);
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::previous( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionSequenceException(*this);
- return sal_False;
-}
-// -------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL ODatabaseMetaDataResultSet::getStatement( ) throw(SQLException, RuntimeException)
-{
- return m_aStatement.get();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowDeleted( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionSequenceException(*this);
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowInserted( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionSequenceException(*this);
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionSequenceException(*this);
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException)
-{
- return m_bBOF;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::next( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
-
- if ( m_bBOF )
- {
- m_aRowsIter = m_aRows.begin();
- m_bBOF = sal_False;
- }
- else
- {
- if ( m_bEOF )
- throwFunctionSequenceException( *this );
- else
- if ( m_aRowsIter != m_aRows.end() )
- ++m_aRowsIter;
- }
-
- bool bSuccess = m_aRowsIter != m_aRows.end();
- if ( !bSuccess )
- {
- m_bEOF = sal_True;
- m_bBOF = m_aRows.empty();
- }
- return bSuccess;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::wasNull( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
-
-
- if(m_aRowsIter == m_aRows.end() || !(*m_aRowsIter)[m_nColPos].is())
- return sal_True;
-
- return (*m_aRowsIter)[m_nColPos]->getValue().isNull();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::refreshRow( ) throw(SQLException, RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL ODatabaseMetaDataResultSet::cancel( ) throw(RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL ODatabaseMetaDataResultSet::getWarnings( ) throw(SQLException, RuntimeException)
-{
- return Any();
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* ODatabaseMetaDataResultSet::createArrayHelper( ) const
-{
- Sequence< Property > aProps;
- describeProperties(aProps);
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & ODatabaseMetaDataResultSet::getInfoHelper()
-{
- return *const_cast<ODatabaseMetaDataResultSet*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setProceduresMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setProceduresMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setCatalogsMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setCatalogsMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setSchemasMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setSchemasMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setColumnPrivilegesMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setColumnPrivilegesMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setColumnsMap()
-{
-
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setColumnsMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setTablesMap()
-{
-
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setTablesMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setProcedureColumnsMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setProcedureColumnsMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setPrimaryKeysMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setPrimaryKeysMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setIndexInfoMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setIndexInfoMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setTablePrivilegesMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setTablePrivilegesMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setCrossReferenceMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setCrossReferenceMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setVersionColumnsMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setVersionColumnsMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setBestRowIdentifierMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setBestRowIdentifierMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setTypeInfoMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setTypeInfoMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setTableTypes()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setTableTypes();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setExportedKeysMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setExportedKeysMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setImportedKeysMap()
-{
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
- pMetaData->setImportedKeysMap();
- m_xMetaData = pMetaData;
-}
-// -----------------------------------------------------------------------------
-Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL ODatabaseMetaDataResultSet::getPropertySetInfo( ) throw(RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-ORowSetValueDecorator& ORowSetValueDecorator::operator=(const ORowSetValue& _aValue)
-{
- m_aValue = _aValue;
- return *this;
-}
-// -----------------------------------------------------------------------------
-const ORowSetValue& ODatabaseMetaDataResultSet::getValue(sal_Int32 columnIndex)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
-
- if ( isBeforeFirst() || isAfterLast() )
- ::dbtools::throwFunctionSequenceException( *this );
-
- checkIndex(columnIndex );
- m_nColPos = columnIndex;
-
- if(m_aRowsIter != m_aRows.end() && (*m_aRowsIter)[columnIndex].is())
- return *(*m_aRowsIter)[columnIndex];
- return m_aEmptyValue;
-}
-// -----------------------------------------------------------------------------
-/// return an empty ORowSetValueDecorator
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::getEmptyValue()
-{
- static ORowSetValueDecoratorRef aEmptyValueRef = new ORowSetValueDecorator();
- return aEmptyValueRef;
-}
-// -----------------------------------------------------------------------------
-/// return an ORowSetValueDecorator with 0 as value
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::get0Value()
-{
- static ORowSetValueDecoratorRef a0ValueRef = new ORowSetValueDecorator((sal_Int32)0);
- return a0ValueRef;
-}
-// -----------------------------------------------------------------------------
-/// return an ORowSetValueDecorator with 1 as value
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::get1Value()
-{
- static ORowSetValueDecoratorRef a1ValueRef = new ORowSetValueDecorator((sal_Int32)1);
- return a1ValueRef;
-}
-// -----------------------------------------------------------------------------
-/// return an ORowSetValueDecorator with ColumnSearch::BASIC as value
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::getBasicValue()
-{
- static ORowSetValueDecoratorRef aValueRef = new ORowSetValueDecorator(ColumnSearch::BASIC);
- return aValueRef;
-}
-// -----------------------------------------------------------------------------
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::getSelectValue()
-{
- static ORowSetValueDecoratorRef aValueRef = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT")));
- return aValueRef;
-}
-// -----------------------------------------------------------------------------
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::getInsertValue()
-{
- static ORowSetValueDecoratorRef aValueRef = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INSERT")));
- return aValueRef;
-}
-// -----------------------------------------------------------------------------
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::getDeleteValue()
-{
- static ORowSetValueDecoratorRef aValueRef = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DELETE")));
- return aValueRef;
-}
-// -----------------------------------------------------------------------------
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::getUpdateValue()
-{
- static ORowSetValueDecoratorRef aValueRef = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UPDATE")));
- return aValueRef;
-}
-// -----------------------------------------------------------------------------
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::getCreateValue()
-{
- static ORowSetValueDecoratorRef aValueRef = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CREATE")));
- return aValueRef;
-}
-// -----------------------------------------------------------------------------
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::getReadValue()
-{
- static ORowSetValueDecoratorRef aValueRef = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("READ")));
- return aValueRef;
-}
-// -----------------------------------------------------------------------------
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::getAlterValue()
-{
- static ORowSetValueDecoratorRef aValueRef = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER")));
- return aValueRef;
-}
-// -----------------------------------------------------------------------------
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::getDropValue()
-{
- static ORowSetValueDecoratorRef aValueRef = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DROP")));
- return aValueRef;
-}
-// -----------------------------------------------------------------------------
-ORowSetValueDecoratorRef ODatabaseMetaDataResultSet::getQuoteValue()
-{
- static ORowSetValueDecoratorRef aValueRef = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'")));
- return aValueRef;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::initialize( const Sequence< Any >& _aArguments ) throw (Exception, RuntimeException)
-{
- if ( _aArguments.getLength() == 2 )
- {
- sal_Int32 nResultSetType = 0;
- if ( _aArguments[0] >>= nResultSetType)
- {
- setType(static_cast<MetaDataResultSetType>(nResultSetType));
- Sequence< Sequence<Any> > aRows;
- if ( _aArguments[1] >>= aRows )
- {
- ORows aRowsToSet;
- const Sequence<Any>* pRowsIter = aRows.getConstArray();
- const Sequence<Any>* pRowsEnd = pRowsIter + aRows.getLength();
- for (; pRowsIter != pRowsEnd;++pRowsIter)
- {
- ORow aRowToSet;
- const Any* pRowIter = pRowsIter->getConstArray();
- const Any* pRowEnd = pRowIter + pRowsIter->getLength();
- for (; pRowIter != pRowEnd;++pRowIter)
- {
- ORowSetValueDecoratorRef aValue;
- switch( pRowIter->getValueTypeClass() )
- {
- case TypeClass_BOOLEAN:
- {
- sal_Bool bValue = sal_False;
- *pRowIter >>= bValue;
- aValue = new ORowSetValueDecorator(ORowSetValue(bValue));
- }
- break;
- case TypeClass_BYTE:
- {
- sal_Int8 nValue(0);
- *pRowIter >>= nValue;
- aValue = new ORowSetValueDecorator(ORowSetValue(nValue));
- }
- break;
- case TypeClass_SHORT:
- case TypeClass_UNSIGNED_SHORT:
- {
- sal_Int16 nValue(0);
- *pRowIter >>= nValue;
- aValue = new ORowSetValueDecorator(ORowSetValue(nValue));
- }
- break;
- case TypeClass_LONG:
- case TypeClass_UNSIGNED_LONG:
- {
- sal_Int32 nValue(0);
- *pRowIter >>= nValue;
- aValue = new ORowSetValueDecorator(ORowSetValue(nValue));
- }
- break;
- case TypeClass_HYPER:
- case TypeClass_UNSIGNED_HYPER:
- {
- sal_Int64 nValue(0);
- *pRowIter >>= nValue;
- aValue = new ORowSetValueDecorator(ORowSetValue(nValue));
- }
- break;
- case TypeClass_FLOAT:
- {
- float nValue(0.0);
- *pRowIter >>= nValue;
- aValue = new ORowSetValueDecorator(ORowSetValue(nValue));
- }
- break;
- case TypeClass_DOUBLE:
- {
- double nValue(0.0);
- *pRowIter >>= nValue;
- aValue = new ORowSetValueDecorator(ORowSetValue(nValue));
- }
- break;
- case TypeClass_STRING:
- {
- ::rtl::OUString sValue;
- *pRowIter >>= sValue;
- aValue = new ORowSetValueDecorator(ORowSetValue(sValue));
- }
- break;
- default:
- break;
- }
- aRowToSet.push_back(aValue);
- }
- aRowsToSet.push_back(aRowToSet);
- } // for (; pRowsIter != pRowsEnd;++pRowsIter
- setRows(aRowsToSet);
- }
- }
- }
-}
-// XServiceInfo
- // --------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- rtl::OUString ODatabaseMetaDataResultSet::getImplementationName_Static( ) throw(RuntimeException)
- {
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"));
- }
- //------------------------------------------------------------------------------
- Sequence< ::rtl::OUString > ODatabaseMetaDataResultSet::getSupportedServiceNames_Static( ) throw (RuntimeException)
- {
- Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.ResultSet"));
- return aSNS;
- }
- //------------------------------------------------------------------
- ::rtl::OUString SAL_CALL ODatabaseMetaDataResultSet::getImplementationName( ) throw(RuntimeException)
- {
- return getImplementationName_Static();
- }
-
- //------------------------------------------------------------------
- sal_Bool SAL_CALL ODatabaseMetaDataResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
- {
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
- }
- //------------------------------------------------------------------
- Sequence< ::rtl::OUString > SAL_CALL ODatabaseMetaDataResultSet::getSupportedServiceNames( ) throw(RuntimeException)
- {
- return getSupportedServiceNames_Static();
- }
- // -------------------------------------------------------------------------
- namespace connectivity
- {
- Reference< XInterface > SAL_CALL ODatabaseMetaDataResultSet_CreateInstance(const Reference< XComponentContext >& ) throw( Exception )
- {
- return *(new ODatabaseMetaDataResultSet());
- }
- }
-
-// -----------------------------------------------------------------------------
-namespace
-{
- cppu::ImplementationEntry entries[] = {
- { &ODatabaseMetaDataResultSet_CreateInstance, &ODatabaseMetaDataResultSet::getImplementationName_Static, &ODatabaseMetaDataResultSet::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, 0, 0 },
- { &ParameterSubstitution::create, &ParameterSubstitution::getImplementationName_Static, &ParameterSubstitution::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, 0, 0 },
- { 0, 0, 0, 0, 0, 0 }
- };
-}
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
-using ::com::sun::star::registry::InvalidRegistryException;
-using ::com::sun::star::registry::InvalidValueException;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-//==========================================================================
-//= registration
-//==========================================================================
-extern "C"
-{
-
-//---------------------------------------------------------------------------------------
-SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* implName, ::com::sun::star::lang::XMultiServiceFactory* serviceManager, void* registryKey)
-{
- return cppu::component_getFactoryHelper(implName, serviceManager, registryKey, entries);
-}
-
-} // extern "C"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx
deleted file mode 100644
index 5d86317f88..0000000000
--- a/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx
+++ /dev/null
@@ -1,694 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "FDatabaseMetaDataResultSetMetaData.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ProcedureResult.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-
-using namespace connectivity;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -------------------------------------------------------------------------
-ODatabaseMetaDataResultSetMetaData::~ODatabaseMetaDataResultSetMetaData()
-{
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getColumnDisplaySize();
-
- return 0;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getColumnType();
- return 1;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnCount( ) throw(SQLException, RuntimeException)
-{
- return m_mColumns.size();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isCaseSensitive();
- return sal_True;
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getSchemaName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getColumnName();
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getTableName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getTableName();
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getCatalogName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnTypeName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getColumnTypeName();
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnLabel( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getColumnLabel();
- return getColumnName(column);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnServiceName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getColumnServiceName();
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isCurrency( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isCurrency();
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isAutoIncrement();
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isSigned( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isSigned();
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getPrecision( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getPrecision();
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getScale();
-
- return 0;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isNullable();
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isSearchable();
- return sal_True;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isReadOnly( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
-// if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
-// return (*m_mColumnsIter).second.isReadOnly();
-
- return sal_True;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isDefinitelyWritable( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
-// if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
-// return (*m_mColumnsIter).second.isDefinitelyWritable();
-
- return sal_False;
-;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
-// if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
-// return (*m_mColumnsIter).second.isWritable();
- return isDefinitelyWritable(column);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setColumnPrivilegesMap()
-{
- setColumnMap();
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GRANTOR")),
- ColumnValue::NULLABLE,
- 3,3,0,
- DataType::VARCHAR);
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GRANTEE")),
- ColumnValue::NULLABLE,
- 3,3,0,
- DataType::VARCHAR);
- m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRIVILEGE")),
- ColumnValue::NULLABLE,
- 3,3,0,
- DataType::VARCHAR);
- m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IS_GRANTABLE")),
- ColumnValue::NULLABLE,
- 3,3,0,
- DataType::VARCHAR);
-}
-// -----------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setTableNameMap()
-{
- m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_CAT")),
- ColumnValue::NULLABLE,
- 3,3,0,
- DataType::VARCHAR);
- m_mColumns[2] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_SCHEM")),
- ColumnValue::NULLABLE,
- 3,3,0,
- DataType::VARCHAR);
- m_mColumns[3] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_NAME")),
- ColumnValue::NO_NULLS,
- 3,3,0,
- DataType::VARCHAR);
-}
-// -----------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setColumnMap()
-{
- setTableNameMap();
- m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("COLUMN_NAME")),
- ColumnValue::NO_NULLS,
- 3,3,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setColumnsMap()
-{
- setColumnMap();
-
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA_TYPE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TYPE_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("COLUMN_SIZE")),
- ColumnValue::NO_NULLS,
- 3,3,0,
- DataType::INTEGER);
- m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BUFFER_LENGTH")),
- ColumnValue::NULLABLE,
- 3,3,0,
- DataType::INTEGER);
- m_mColumns[9] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DECIMAL_DIGITS")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[10] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NUM_PREC_RADIX")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[11] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NULLABLE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REMARKS")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[13] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("COLUMN_DEF")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[14] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_DATA_TYPE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[15] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_DATETIME_SUB")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[16] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CHAR_OCTET_LENGTH")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[17] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ORDINAL_POSITION")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[18] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IS_NULLABLE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setTablesMap()
-{
- setTableNameMap();
- m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_TYPE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REMARKS")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setProcedureNameMap()
-{
- m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PROCEDURE_CAT")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[2] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PROCEDURE_SCHEM")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[3] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PROCEDURE_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setProcedureColumnsMap()
-{
- setProcedureNameMap();
- m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("COLUMN_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("COLUMN_TYPE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA_TYPE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TYPE_NAME")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRECISION")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[9] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LENGTH")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[10] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SCALE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[11] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RADIX")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NULLABLE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[13] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REMARKS")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setPrimaryKeysMap()
-{
- setColumnMap();
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KEY_SEQ")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PK_NAME")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setIndexInfoMap()
-{
- setTableNameMap();
- m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NON_UNIQUE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::BIT);
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INDEX_QUALIFIER")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INDEX_NAME")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TYPE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ORDINAL_POSITION")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[9] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("COLUMN_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[10] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ASC_OR_DESC")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[11] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CARDINALITY")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PAGES")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[13] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FILTER_CONDITION")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setTablePrivilegesMap()
-{
- setTableNameMap();
- m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GRANTOR")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GRANTEE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRIVILEGE")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IS_GRANTABLE")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setCrossReferenceMap()
-{
- m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PKTABLE_CAT")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[2] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PKTABLE_SCHEM")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[3] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PKTABLE_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PKCOLUMN_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FKTABLE_CAT")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FKTABLE_SCHEM")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FKTABLE_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FKCOLUMN_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
-
- m_mColumns[9] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KEY_SEQ")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[10] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UPDATE_RULE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[11] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DELETE_RULE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FK_NAME")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[13] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PK_NAME")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[14] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DEFERRABILITY")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setTypeInfoMap()
-{
- m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TYPE_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[2] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA_TYPE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[3] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRECISION")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LITERAL_PREFIX")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LITERAL_SUFFIX")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CREATE_PARAMS")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NULLABLE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CASE_SENSITIVE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::BIT);
- m_mColumns[9] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SEARCHABLE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[10] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UNSIGNED_ATTRIBUTE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::BIT);
- m_mColumns[11] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FIXED_PREC_SCALE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::BIT);
- m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AUTO_INCREMENT")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::BIT);
- m_mColumns[13] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LOCAL_TYPE_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[14] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MINIMUM_SCALE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[15] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MAXIMUM_SCALE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[16] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_DATA_TYPE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[17] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_DATETIME_SUB")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[18] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NUM_PREC_RADIX")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setProceduresMap()
-{
- setProcedureNameMap();
- m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RESERVED1")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RESERVED2")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RESERVED3")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REMARKS")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PROCEDURE_TYPE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setTableTypes()
-{
- m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_TYPE")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setCatalogsMap()
-{
- m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_CAT")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setSchemasMap()
-{
- m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_SCHEM")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setVersionColumnsMap()
-{
- m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SCOPE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[2] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("COLUMN_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[3] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA_TYPE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TYPE_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("COLUMN_SIZE")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BUFFER_LENGTH")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DECIMAL_DIGITS")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::INTEGER);
- m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PSEUDO_COLUMN")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::INTEGER);
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
deleted file mode 100644
index 1f49fc64d0..0000000000
--- a/connectivity/source/commontools/FValue.cxx
+++ /dev/null
@@ -1,2380 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include "connectivity/FValue.hxx"
-#include "connectivity/CommonTools.hxx"
-#include <connectivity/dbconversion.hxx>
-#include <comphelper/extract.hxx>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <rtl/ustrbuf.hxx>
-#include <rtl/logfile.hxx>
-
-using namespace ::dbtools;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdb;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::io;
-
-namespace connectivity
-{
-
-namespace {
- static sal_Bool isStorageCompatible(sal_Int32 _eType1, sal_Int32 _eType2)
- {
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::isStorageCompatible" );
- sal_Bool bIsCompatible = sal_True;
-
- if (_eType1 != _eType2)
- {
- RTL_LOGFILE_CONTEXT_TRACE( aLogger, "ORowSetValue::isStorageCompatible _eType1 != _eType2" );
- switch (_eType1)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- bIsCompatible = (DataType::CHAR == _eType2)
- || (DataType::VARCHAR == _eType2)
- || (DataType::DECIMAL == _eType2)
- || (DataType::NUMERIC == _eType2)
- || (DataType::LONGVARCHAR == _eType2);
- break;
-
- case DataType::DOUBLE:
- case DataType::REAL:
- bIsCompatible = (DataType::DOUBLE == _eType2)
- || (DataType::REAL == _eType2);
- break;
-
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- bIsCompatible = (DataType::BINARY == _eType2)
- || (DataType::VARBINARY == _eType2)
- || (DataType::LONGVARBINARY == _eType2);
- break;
-
- case DataType::INTEGER:
- bIsCompatible = (DataType::SMALLINT == _eType2)
- || (DataType::TINYINT == _eType2)
- || (DataType::BIT == _eType2)
- || (DataType::BOOLEAN == _eType2);
- break;
- case DataType::SMALLINT:
- bIsCompatible = (DataType::TINYINT == _eType2)
- || (DataType::BIT == _eType2)
- || (DataType::BOOLEAN == _eType2);
- break;
- case DataType::TINYINT:
- bIsCompatible = (DataType::BIT == _eType2)
- || (DataType::BOOLEAN == _eType2);
- break;
-
- case DataType::BLOB:
- case DataType::CLOB:
- case DataType::OBJECT:
- bIsCompatible = (DataType::BLOB == _eType2)
- || (DataType::CLOB == _eType2)
- || (DataType::OBJECT == _eType2);
- break;
-
- default:
- bIsCompatible = sal_False;
- }
- }
- return bIsCompatible;
- }
-}
-
-// -----------------------------------------------------------------------------
-#ifdef DBG_UTIL
-
-#include <vector>
-#include <rtl/string.h>
-
-namespace tracing
-{
- struct AllocationType
- {
- const sal_Char* pName;
- sal_Int32 nAllocatedUnits;
-
- AllocationType( ) : pName( NULL ), nAllocatedUnits( 0 ) { }
- };
-
- // =============================================================================
- class AllocationTracer
- {
- public:
- typedef ::std::vector< AllocationType > AllocationState;
- static AllocationState s_aAllocated;
- static ::osl::Mutex s_aMutex;
-
- public:
- static void registerUnit( const sal_Char* _pName );
- static void revokeUnit( const sal_Char* _pName );
-
- private:
- static AllocationState::iterator getLocation( const sal_Char* _pName );
- };
-
- // =============================================================================
- AllocationTracer::AllocationState::iterator AllocationTracer::getLocation( const sal_Char* _pName )
- {
- AllocationState::iterator aLookFor = s_aAllocated.begin();
- for ( ;
- aLookFor != s_aAllocated.end();
- ++aLookFor
- )
- {
- if ( 0 == rtl_str_compare( aLookFor->pName, _pName ) )
- // found
- return aLookFor;
- }
- // not found
- s_aAllocated.push_back( AllocationType() );
- aLookFor = s_aAllocated.end(); --aLookFor;
- aLookFor->pName = _pName; // note that this assumes that _pName is a constant string ....
- return aLookFor;
- }
-
- // =============================================================================
- AllocationTracer::AllocationState AllocationTracer::s_aAllocated;
- ::osl::Mutex AllocationTracer::s_aMutex;
-
- // =============================================================================
- void AllocationTracer::registerUnit( const sal_Char* _pName )
- {
- ::osl::MutexGuard aGuard( s_aMutex );
-
- AllocationState::iterator aPos = getLocation( _pName );
- ++aPos->nAllocatedUnits;
- }
-
- // =============================================================================
- void AllocationTracer::revokeUnit( const sal_Char* _pName )
- {
- ::osl::MutexGuard aGuard( s_aMutex );
-
- AllocationState::iterator aPos = getLocation( _pName );
- --aPos->nAllocatedUnits;
- }
-
-#define TRACE_ALLOC( type ) tracing::AllocationTracer::registerUnit( #type );
-#define TRACE_FREE( type ) tracing::AllocationTracer::revokeUnit( #type );
-}
-#else
-#define TRACE_ALLOC( type )
-#define TRACE_FREE( type )
-#endif
-
-// -----------------------------------------------------------------------------
-void ORowSetValue::setTypeKind(sal_Int32 _eType)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::setTypeKind" );
- if ( !m_bNull && !isStorageCompatible(_eType, m_eTypeKind) )
- {
- switch(_eType)
- {
- case DataType::VARCHAR:
- case DataType::CHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- (*this) = getString();
- break;
- case DataType::BIGINT:
- (*this) = getLong();
- break;
-
- case DataType::FLOAT:
- (*this) = getFloat();
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- (*this) = getDouble();
- break;
- case DataType::TINYINT:
- (*this) = getInt8();
- break;
- case DataType::SMALLINT:
- (*this) = getInt16();
- break;
- case DataType::INTEGER:
- (*this) = getInt32();
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- (*this) = getBool();
- break;
- case DataType::DATE:
- (*this) = getDate();
- break;
- case DataType::TIME:
- (*this) = getTime();
- break;
- case DataType::TIMESTAMP:
- (*this) = getDateTime();
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- (*this) = getSequence();
- break;
- case DataType::BLOB:
- case DataType::CLOB:
- case DataType::OBJECT:
- case DataType::OTHER:
- (*this) = getAny();
- break;
- default:
- (*this) = getAny();
- OSL_FAIL("ORowSetValue:operator==(): UNSPUPPORTED TYPE!");
- }
- }
-
- m_eTypeKind = _eType;
-}
-
-// -----------------------------------------------------------------------------
-void ORowSetValue::free()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::free" );
- if(!m_bNull)
- {
- switch(m_eTypeKind)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- OSL_ENSURE(m_aValue.m_pString,"String pointer is null!");
- rtl_uString_release(m_aValue.m_pString);
- m_aValue.m_pString = NULL;
- break;
- case DataType::INTEGER:
- if ( !m_bSigned )
- {
- delete (sal_Int64*)m_aValue.m_pValue;
- TRACE_FREE( sal_Int64 )
- m_aValue.m_pValue = NULL;
- }
- break;
- case DataType::BIGINT:
- if ( m_bSigned )
- {
- delete (sal_Int64*)m_aValue.m_pValue;
- TRACE_FREE( sal_Int64 )
- m_aValue.m_pValue = NULL;
- }
- else
- {
- OSL_ENSURE(m_aValue.m_pString,"String pointer is null!");
- rtl_uString_release(m_aValue.m_pString);
- m_aValue.m_pString = NULL;
- }
- break;
- case DataType::FLOAT:
- delete (float*)m_aValue.m_pValue;
- TRACE_FREE( float )
- m_aValue.m_pValue = NULL;
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- delete (double*)m_aValue.m_pValue;
- TRACE_FREE( double )
- m_aValue.m_pValue = NULL;
- break;
- case DataType::DATE:
- delete (::com::sun::star::util::Date*)m_aValue.m_pValue;
- TRACE_FREE( Date )
- m_aValue.m_pValue = NULL;
- break;
- case DataType::TIME:
- delete (::com::sun::star::util::Time*)m_aValue.m_pValue;
- TRACE_FREE( Time )
- m_aValue.m_pValue = NULL;
- break;
- case DataType::TIMESTAMP:
- delete (::com::sun::star::util::DateTime*)m_aValue.m_pValue;
- TRACE_FREE( DateTime )
- m_aValue.m_pValue = NULL;
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- delete (Sequence<sal_Int8>*)m_aValue.m_pValue;
- TRACE_FREE( Sequence_sal_Int8 )
- m_aValue.m_pValue = NULL;
- break;
- case DataType::BLOB:
- case DataType::CLOB:
- case DataType::OBJECT:
- delete (Any*)m_aValue.m_pValue;
- TRACE_FREE( Any )
- m_aValue.m_pValue = NULL;
- break;
- case DataType::BIT:
- case DataType::TINYINT:
- case DataType::SMALLINT:
- case DataType::BOOLEAN:
- break;
- default:
- if ( m_aValue.m_pValue )
- {
- delete (Any*)m_aValue.m_pValue;
- TRACE_FREE( Any )
- m_aValue.m_pValue = NULL;
- }
- break;
-
- }
- m_bNull = sal_True;
- }
-}
-// -----------------------------------------------------------------------------
-ORowSetValue& ORowSetValue::operator=(const ORowSetValue& _rRH)
-{
- if(&_rRH == this)
- return *this;
-
- if ( m_eTypeKind != _rRH.m_eTypeKind || (_rRH.m_bNull && !m_bNull) || m_bSigned != _rRH.m_bSigned)
- free();
-
- m_bBound = _rRH.m_bBound;
- m_eTypeKind = _rRH.m_eTypeKind;
- m_bSigned = _rRH.m_bSigned;
-
- if(m_bNull && !_rRH.m_bNull)
- {
- switch(_rRH.m_eTypeKind)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- rtl_uString_acquire(_rRH.m_aValue.m_pString);
- m_aValue.m_pString = _rRH.m_aValue.m_pString;
- break;
- case DataType::BIGINT:
- if ( _rRH.m_bSigned )
- {
- m_aValue.m_pValue = new sal_Int64(*(sal_Int64*)_rRH.m_aValue.m_pValue);
- TRACE_ALLOC( sal_Int64 )
- }
- else
- {
- rtl_uString_acquire(_rRH.m_aValue.m_pString);
- m_aValue.m_pString = _rRH.m_aValue.m_pString;
- }
- break;
- case DataType::FLOAT:
- m_aValue.m_pValue = new float(*(float*)_rRH.m_aValue.m_pValue);
- TRACE_ALLOC( float )
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- m_aValue.m_pValue = new double(*(double*)_rRH.m_aValue.m_pValue);
- TRACE_ALLOC( double )
- break;
- case DataType::DATE:
- m_aValue.m_pValue = new Date(*(Date*)_rRH.m_aValue.m_pValue);
- TRACE_ALLOC( Date )
- break;
- case DataType::TIME:
- m_aValue.m_pValue = new Time(*(Time*)_rRH.m_aValue.m_pValue);
- TRACE_ALLOC( Time )
- break;
- case DataType::TIMESTAMP:
- m_aValue.m_pValue = new DateTime(*(DateTime*)_rRH.m_aValue.m_pValue);
- TRACE_ALLOC( DateTime )
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- m_aValue.m_pValue = new Sequence<sal_Int8>(*(Sequence<sal_Int8>*)_rRH.m_aValue.m_pValue);
- TRACE_ALLOC( Sequence_sal_Int8 )
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- m_aValue.m_bBool = _rRH.m_aValue.m_bBool;
- break;
- case DataType::TINYINT:
- if ( _rRH.m_bSigned )
- m_aValue.m_nInt8 = _rRH.m_aValue.m_nInt8;
- else
- m_aValue.m_nInt16 = _rRH.m_aValue.m_nInt16;
- break;
- case DataType::SMALLINT:
- if ( _rRH.m_bSigned )
- m_aValue.m_nInt16 = _rRH.m_aValue.m_nInt16;
- else
- m_aValue.m_nInt32 = _rRH.m_aValue.m_nInt32;
- break;
- case DataType::INTEGER:
- if ( _rRH.m_bSigned )
- m_aValue.m_nInt32 = _rRH.m_aValue.m_nInt32;
- else
- {
- m_aValue.m_pValue = new sal_Int64(*(sal_Int64*)_rRH.m_aValue.m_pValue);
- TRACE_ALLOC( sal_Int64 )
- }
- break;
- default:
- m_aValue.m_pValue = new Any(*(Any*)_rRH.m_aValue.m_pValue);
- TRACE_ALLOC( Any )
- }
- }
- else if(!_rRH.m_bNull)
- {
- switch(_rRH.m_eTypeKind)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- (*this) = ::rtl::OUString(_rRH.m_aValue.m_pString);
- break;
- case DataType::BIGINT:
- if ( _rRH.m_bSigned )
- (*this) = *(sal_Int64*)_rRH.m_aValue.m_pValue;
- else
- (*this) = ::rtl::OUString(_rRH.m_aValue.m_pString);
- break;
- case DataType::FLOAT:
- (*this) = *(float*)_rRH.m_aValue.m_pValue;
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- (*this) = *(double*)_rRH.m_aValue.m_pValue;
- break;
- case DataType::DATE:
- (*this) = *(Date*)_rRH.m_aValue.m_pValue;
- break;
- case DataType::TIME:
- (*this) = *(Time*)_rRH.m_aValue.m_pValue;
- break;
- case DataType::TIMESTAMP:
- (*this) = *(DateTime*)_rRH.m_aValue.m_pValue;
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- (*this) = *(Sequence<sal_Int8>*)_rRH.m_aValue.m_pValue;
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- m_aValue.m_bBool = _rRH.m_aValue.m_bBool;
- break;
- case DataType::TINYINT:
- if ( _rRH.m_bSigned )
- m_aValue.m_nInt8 = _rRH.m_aValue.m_nInt8;
- else
- m_aValue.m_nInt16 = _rRH.m_aValue.m_nInt16;
- break;
- case DataType::SMALLINT:
- if ( _rRH.m_bSigned )
- m_aValue.m_nInt16 = _rRH.m_aValue.m_nInt16;
- else
- m_aValue.m_nInt32 = _rRH.m_aValue.m_nInt32;
- break;
- case DataType::INTEGER:
- if ( _rRH.m_bSigned )
- m_aValue.m_nInt32 = _rRH.m_aValue.m_nInt32;
- else
- *static_cast<sal_Int64*>(m_aValue.m_pValue) = *(sal_Int64*)_rRH.m_aValue.m_pValue;
- break;
- default:
- (*(Any*)m_aValue.m_pValue) = (*(Any*)_rRH.m_aValue.m_pValue);
- }
- }
-
- m_bNull = _rRH.m_bNull;
- // OJ: BUGID: 96277
- m_eTypeKind = _rRH.m_eTypeKind;
-
- return *this;
-}
-// -------------------------------------------------------------------------
-
-ORowSetValue& ORowSetValue::operator=(const Date& _rRH)
-{
- if(m_eTypeKind != DataType::DATE)
- free();
-
- if(m_bNull)
- {
- m_aValue.m_pValue = new Date(_rRH);
- TRACE_ALLOC( Date )
- m_eTypeKind = DataType::DATE;
- m_bNull = sal_False;
- }
- else
- *(Date*)m_aValue.m_pValue = _rRH;
-
- return *this;
-}
-// -------------------------------------------------------------------------
-ORowSetValue& ORowSetValue::operator=(const Time& _rRH)
-{
- if(m_eTypeKind != DataType::TIME)
- free();
-
- if(m_bNull)
- {
- m_aValue.m_pValue = new Time(_rRH);
- TRACE_ALLOC( Time )
- m_eTypeKind = DataType::TIME;
- m_bNull = sal_False;
- }
- else
- *(Time*)m_aValue.m_pValue = _rRH;
-
- return *this;
-}
-// -------------------------------------------------------------------------
-ORowSetValue& ORowSetValue::operator=(const DateTime& _rRH)
-{
- if(m_eTypeKind != DataType::TIMESTAMP)
- free();
- if(m_bNull)
- {
- m_aValue.m_pValue = new DateTime(_rRH);
- TRACE_ALLOC( DateTime )
- m_eTypeKind = DataType::TIMESTAMP;
- m_bNull = sal_False;
- }
- else
- *(DateTime*)m_aValue.m_pValue = _rRH;
-
- return *this;
-}
-// -------------------------------------------------------------------------
-
-ORowSetValue& ORowSetValue::operator=(const ::rtl::OUString& _rRH)
-{
- if(m_eTypeKind != DataType::VARCHAR || m_aValue.m_pString != _rRH.pData)
- {
- free();
- m_bNull = sal_False;
-
- m_aValue.m_pString = _rRH.pData;
- rtl_uString_acquire(m_aValue.m_pString);
- m_eTypeKind = DataType::VARCHAR;
- }
-
- return *this;
-}
-// -------------------------------------------------------------------------
-
-ORowSetValue& ORowSetValue::operator=(const double& _rRH)
-{
- if( !isStorageCompatible(m_eTypeKind,DataType::DOUBLE) )
- free();
-
- if(m_bNull)
- {
- m_aValue.m_pValue = new double(_rRH);
- TRACE_ALLOC( double )
- m_eTypeKind = DataType::DOUBLE;
- m_bNull = sal_False;
- }
- else
- *(double*)m_aValue.m_pValue = _rRH;
-
- return *this;
-}
-// -----------------------------------------------------------------------------
-ORowSetValue& ORowSetValue::operator=(const float& _rRH)
-{
- if(m_eTypeKind != DataType::FLOAT)
- free();
-
- if(m_bNull)
- {
- m_aValue.m_pValue = new float(_rRH);
- TRACE_ALLOC( float )
- m_eTypeKind = DataType::FLOAT;
- m_bNull = sal_False;
- }
- else
- *(float*)m_aValue.m_pValue = _rRH;
-
- return *this;
-}
-// -------------------------------------------------------------------------
-
-ORowSetValue& ORowSetValue::operator=(const sal_Int8& _rRH)
-{
- if(m_eTypeKind != DataType::TINYINT )
- free();
-
- m_aValue.m_nInt8 = _rRH;
- m_eTypeKind = DataType::TINYINT;
- m_bNull = sal_False;
- return *this;
-}
-// -------------------------------------------------------------------------
-
-ORowSetValue& ORowSetValue::operator=(const sal_Int16& _rRH)
-{
- if(m_eTypeKind != DataType::SMALLINT )
- free();
-
- m_aValue.m_nInt16 = _rRH;
- m_eTypeKind = DataType::SMALLINT;
- m_bNull = sal_False;
-
- return *this;
-}
-// -------------------------------------------------------------------------
-
-ORowSetValue& ORowSetValue::operator=(const sal_Int32& _rRH)
-{
- if(m_eTypeKind != DataType::INTEGER )
- free();
-
- if ( m_bSigned )
- m_aValue.m_nInt32 = _rRH;
- else
- {
- if ( m_bNull )
- {
- m_aValue.m_pValue = new sal_Int64(_rRH);
- TRACE_ALLOC( sal_Int64 )
- }
- else
- *static_cast<sal_Int64*>(m_aValue.m_pValue) = static_cast<sal_Int64>(_rRH);
- }
-
- m_eTypeKind = DataType::INTEGER;
- m_bNull = sal_False;
-
- return *this;
-}
-// -------------------------------------------------------------------------
-
-ORowSetValue& ORowSetValue::operator=(const sal_Bool _rRH)
-{
- if(m_eTypeKind != DataType::BIT && DataType::BOOLEAN != m_eTypeKind )
- free();
-
- m_aValue.m_bBool = _rRH;
- m_eTypeKind = DataType::BIT;
- m_bNull = sal_False;
-
- return *this;
-}
-// -------------------------------------------------------------------------
-ORowSetValue& ORowSetValue::operator=(const sal_Int64& _rRH)
-{
- if ( DataType::BIGINT != m_eTypeKind || !m_bSigned )
- free();
-
- if ( m_bSigned )
- {
- if(m_bNull)
- {
- m_aValue.m_pValue = new sal_Int64(_rRH);
- TRACE_ALLOC( sal_Int64 )
- }
- else
- *static_cast<sal_Int64*>(m_aValue.m_pValue) = _rRH;
- }
- else
- {
- ::rtl::OUString aVal = ::rtl::OUString::valueOf(_rRH);
- m_aValue.m_pString = aVal.pData;
- rtl_uString_acquire(m_aValue.m_pString);
- }
-
- m_eTypeKind = DataType::BIGINT;
- m_bNull = sal_False;
-
- return *this;
-}
-// -------------------------------------------------------------------------
-ORowSetValue& ORowSetValue::operator=(const Sequence<sal_Int8>& _rRH)
-{
- if (!isStorageCompatible(DataType::LONGVARBINARY,m_eTypeKind))
- free();
-
- if (m_bNull)
- {
- m_aValue.m_pValue = new Sequence<sal_Int8>(_rRH);
- TRACE_ALLOC( Sequence_sal_Int8 )
- }
- else
- *static_cast< Sequence< sal_Int8 >* >(m_aValue.m_pValue) = _rRH;
-
- m_eTypeKind = DataType::LONGVARBINARY;
- m_bNull = sal_False;
-
- return *this;
-}
-// -------------------------------------------------------------------------
-ORowSetValue& ORowSetValue::operator=(const Any& _rAny)
-{
- if (!isStorageCompatible(DataType::OBJECT,m_eTypeKind))
- free();
-
- if ( m_bNull )
- {
- m_aValue.m_pValue = new Any(_rAny);
- TRACE_ALLOC( Any )
- }
- else
- *static_cast<Any*>(m_aValue.m_pValue) = _rAny;
-
- m_eTypeKind = DataType::OBJECT;
- m_bNull = sal_False;
-
- return *this;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool operator==(const Date& _rLH,const Date& _rRH)
-{
- return _rLH.Day == _rRH.Day && _rLH.Month == _rRH.Month && _rLH.Year == _rRH.Year;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool operator==(const Time& _rLH,const Time& _rRH)
-{
- return _rLH.Minutes == _rRH.Minutes && _rLH.Hours == _rRH.Hours && _rLH.Seconds == _rRH.Seconds && _rLH.HundredthSeconds == _rRH.HundredthSeconds;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool operator==(const DateTime& _rLH,const DateTime& _rRH)
-{
- return _rLH.Day == _rRH.Day && _rLH.Month == _rRH.Month && _rLH.Year == _rRH.Year &&
- _rLH.Minutes == _rRH.Minutes && _rLH.Hours == _rRH.Hours && _rLH.Seconds == _rRH.Seconds && _rLH.HundredthSeconds == _rRH.HundredthSeconds;
-}
-// -------------------------------------------------------------------------
-
-bool ORowSetValue::operator==(const ORowSetValue& _rRH) const
-{
- if ( m_eTypeKind != _rRH.m_eTypeKind )
- {
- switch(m_eTypeKind)
- {
- case DataType::FLOAT:
- case DataType::DOUBLE:
- case DataType::REAL:
- return getDouble() == _rRH.getDouble();
- default:
- switch(_rRH.m_eTypeKind)
- {
- case DataType::FLOAT:
- case DataType::DOUBLE:
- case DataType::REAL:
- return getDouble() == _rRH.getDouble();
- default:
- break;
- }
- break;
- }
- return false;
- }
- if ( m_bNull != _rRH.isNull() )
- return false;
- if(m_bNull && _rRH.isNull())
- return true;
-
- bool bRet = false;
- OSL_ENSURE(!m_bNull,"SHould not be null!");
- switch(m_eTypeKind)
- {
- case DataType::VARCHAR:
- case DataType::CHAR:
- case DataType::LONGVARCHAR:
- {
- ::rtl::OUString aVal1(m_aValue.m_pString);
- ::rtl::OUString aVal2(_rRH.m_aValue.m_pString);
- return aVal1 == aVal2;
- }
- default:
- if ( m_bSigned != _rRH.m_bSigned )
- return false;
- break;
- }
-
- switch(m_eTypeKind)
- {
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- {
- ::rtl::OUString aVal1(m_aValue.m_pString);
- ::rtl::OUString aVal2(_rRH.m_aValue.m_pString);
- bRet = aVal1 == aVal2;
- }
- break;
- case DataType::FLOAT:
- bRet = *(float*)m_aValue.m_pValue == *(float*)_rRH.m_aValue.m_pValue;
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- bRet = *(double*)m_aValue.m_pValue == *(double*)_rRH.m_aValue.m_pValue;
- break;
- case DataType::TINYINT:
- bRet = m_bSigned ? ( m_aValue.m_nInt8 == _rRH.m_aValue.m_nInt8 ) : (m_aValue.m_nInt16 == _rRH.m_aValue.m_nInt16);
- break;
- case DataType::SMALLINT:
- bRet = m_bSigned ? ( m_aValue.m_nInt16 == _rRH.m_aValue.m_nInt16 ) : (m_aValue.m_nInt32 == _rRH.m_aValue.m_nInt32);
- break;
- case DataType::INTEGER:
- bRet = m_bSigned ? ( m_aValue.m_nInt32 == _rRH.m_aValue.m_nInt32 ) : (*(sal_Int64*)m_aValue.m_pValue == *(sal_Int64*)_rRH.m_aValue.m_pValue);
- break;
- case DataType::BIGINT:
- if ( m_bSigned )
- bRet = *(sal_Int64*)m_aValue.m_pValue == *(sal_Int64*)_rRH.m_aValue.m_pValue;
- else
- {
- ::rtl::OUString aVal1(m_aValue.m_pString);
- ::rtl::OUString aVal2(_rRH.m_aValue.m_pString);
- bRet = aVal1 == aVal2;
- }
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- bRet = m_aValue.m_bBool == _rRH.m_aValue.m_bBool;
- break;
- case DataType::DATE:
- bRet = *(Date*)m_aValue.m_pValue == *(Date*)_rRH.m_aValue.m_pValue;
- break;
- case DataType::TIME:
- bRet = *(Time*)m_aValue.m_pValue == *(Time*)_rRH.m_aValue.m_pValue;
- break;
- case DataType::TIMESTAMP:
- bRet = *(DateTime*)m_aValue.m_pValue == *(DateTime*)_rRH.m_aValue.m_pValue;
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- bRet = false;
- break;
- case DataType::BLOB:
- case DataType::CLOB:
- case DataType::OBJECT:
- case DataType::OTHER:
- bRet = false;
- break;
- default:
- bRet = false;
- OSL_FAIL("ORowSetValue::operator==(): UNSPUPPORTED TYPE!");
- break;
- }
- return bRet;
-}
-// -------------------------------------------------------------------------
-Any ORowSetValue::makeAny() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::makeAny" );
- Any rValue;
- if(isBound() && !isNull())
- {
- switch(getTypeKind())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- OSL_ENSURE(m_aValue.m_pString,"Value is null!");
- rValue <<= (::rtl::OUString)m_aValue.m_pString;
- break;
- case DataType::BIGINT:
- if ( m_bSigned )
- {
- OSL_ENSURE(m_aValue.m_pValue,"Value is null!");
- rValue <<= *(sal_Int64*)m_aValue.m_pValue;
- }
- else
- {
- OSL_ENSURE(m_aValue.m_pString,"Value is null!");
- rValue <<= (::rtl::OUString)m_aValue.m_pString;
- }
- break;
- case DataType::FLOAT:
- OSL_ENSURE(m_aValue.m_pValue,"Value is null!");
- rValue <<= *(float*)m_aValue.m_pValue;
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- OSL_ENSURE(m_aValue.m_pValue,"Value is null!");
- rValue <<= *(double*)m_aValue.m_pValue;
- break;
- case DataType::DATE:
- OSL_ENSURE(m_aValue.m_pValue,"Value is null!");
- rValue <<= *(Date*)m_aValue.m_pValue;
- break;
- case DataType::TIME:
- OSL_ENSURE(m_aValue.m_pValue,"Value is null!");
- rValue <<= *(Time*)m_aValue.m_pValue;
- break;
- case DataType::TIMESTAMP:
- OSL_ENSURE(m_aValue.m_pValue,"Value is null!");
- rValue <<= *(DateTime*)m_aValue.m_pValue;
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- OSL_ENSURE(m_aValue.m_pValue,"Value is null!");
- rValue <<= *(Sequence<sal_Int8>*)m_aValue.m_pValue;
- break;
- case DataType::BLOB:
- case DataType::CLOB:
- case DataType::OBJECT:
- case DataType::OTHER:
- rValue = getAny();
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- rValue.setValue( &m_aValue.m_bBool, ::getCppuBooleanType() );
- break;
- case DataType::TINYINT:
- if ( m_bSigned )
- rValue <<= m_aValue.m_nInt8;
- else
- rValue <<= m_aValue.m_nInt16;
- break;
- case DataType::SMALLINT:
- if ( m_bSigned )
- rValue <<= m_aValue.m_nInt16;
- else
- rValue <<= m_aValue.m_nInt32;
- break;
- case DataType::INTEGER:
- if ( m_bSigned )
- rValue <<= m_aValue.m_nInt32;
- else
- {
- OSL_ENSURE(m_aValue.m_pValue,"Value is null!");
- rValue <<= *(sal_Int64*)m_aValue.m_pValue;
- }
- break;
- default:
- OSL_FAIL("ORowSetValue::makeAny(): UNSPUPPORTED TYPE!");
- rValue = getAny();
- break;
- }
- }
- return rValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString ORowSetValue::getString( ) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getString" );
- ::rtl::OUString aRet;
- if(!m_bNull)
- {
- switch(getTypeKind())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- aRet = m_aValue.m_pString;
- break;
- case DataType::BIGINT:
- if ( m_bSigned )
- aRet = ::rtl::OUString::valueOf((sal_Int64)*this);
- else
- aRet = m_aValue.m_pString;
- break;
- case DataType::FLOAT:
- aRet = ::rtl::OUString::valueOf((float)*this);
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- aRet = ::rtl::OUString::valueOf((double)*this);
- break;
- case DataType::DATE:
- aRet = connectivity::toDateString(*this);
- break;
- case DataType::TIME:
- aRet = connectivity::toTimeString(*this);
- break;
- case DataType::TIMESTAMP:
- aRet = connectivity::toDateTimeString(*this);
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- {
- ::rtl::OUStringBuffer sVal(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0x")));
- Sequence<sal_Int8> aSeq(getSequence());
- const sal_Int8* pBegin = aSeq.getConstArray();
- const sal_Int8* pEnd = pBegin + aSeq.getLength();
- for(;pBegin != pEnd;++pBegin)
- sVal.append((sal_Int32)*pBegin,16);
- aRet = sVal.makeStringAndClear();
- }
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- aRet = ::rtl::OUString::valueOf((sal_Int32)(sal_Bool)*this);
- break;
- case DataType::TINYINT:
- if ( m_bSigned )
- aRet = ::rtl::OUString::valueOf((sal_Int32)(sal_Int8)*this);
- else
- aRet = ::rtl::OUString::valueOf((sal_Int32)(sal_Int16)*this);
- break;
- case DataType::SMALLINT:
- if ( m_bSigned )
- aRet = ::rtl::OUString::valueOf((sal_Int32)(sal_Int16)*this);
- else
- aRet = ::rtl::OUString::valueOf((sal_Int32)*this);
- break;
- case DataType::INTEGER:
- if ( m_bSigned )
- aRet = ::rtl::OUString::valueOf((sal_Int32)*this);
- else
- aRet = ::rtl::OUString::valueOf((sal_Int64)*this);
- break;
- case DataType::CLOB:
- {
- Any aValue( getAny() );
- Reference< XClob > xClob;
- if ( aValue >>= xClob )
- {
- if ( xClob.is() )
- {
- aRet = xClob->getSubString(1,(sal_Int32)xClob->length() );
- }
- }
- }
- break;
- default:
- {
- Any aValue = getAny();
- aValue >>= aRet;
- break;
- }
- }
- }
- return aRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool ORowSetValue::getBool() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getBool" );
- sal_Bool bRet = sal_False;
- if(!m_bNull)
- {
- switch(getTypeKind())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- {
- const ::rtl::OUString sValue(m_aValue.m_pString);
- const static ::rtl::OUString s_sTrue(RTL_CONSTASCII_USTRINGPARAM("true"));
- const static ::rtl::OUString s_sFalse(RTL_CONSTASCII_USTRINGPARAM("false"));
- if ( sValue.equalsIgnoreAsciiCase(s_sTrue) )
- {
- bRet = sal_True;
- break;
- }
- else if ( sValue.equalsIgnoreAsciiCase(s_sFalse) )
- {
- bRet = sal_False;
- break;
- }
- }
- // run through
- case DataType::DECIMAL:
- case DataType::NUMERIC:
-
- bRet = ::rtl::OUString(m_aValue.m_pString).toInt32() != 0;
- break;
- case DataType::BIGINT:
- if ( m_bSigned )
- bRet = *(sal_Int64*)m_aValue.m_pValue != 0;
- else
- bRet = ::rtl::OUString(m_aValue.m_pString).toInt64() != 0;
- break;
- case DataType::FLOAT:
- bRet = *(float*)m_aValue.m_pValue != 0.0;
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- bRet = *(double*)m_aValue.m_pValue != 0.0;
- break;
- case DataType::DATE:
- case DataType::TIME:
- case DataType::TIMESTAMP:
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- OSL_ASSERT(!"getBool() for this type is not allowed!");
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- bRet = m_aValue.m_bBool;
- break;
- case DataType::TINYINT:
- bRet = m_bSigned ? (m_aValue.m_nInt8 != 0) : (m_aValue.m_nInt16 != 0);
- break;
- case DataType::SMALLINT:
- bRet = m_bSigned ? (m_aValue.m_nInt16 != 0) : (m_aValue.m_nInt32 != 0);
- break;
- case DataType::INTEGER:
- bRet = m_bSigned ? (m_aValue.m_nInt32 != 0) : (*static_cast<sal_Int64*>(m_aValue.m_pValue) != sal_Int64(0));
- break;
- default:
- {
- Any aValue = getAny();
- aValue >>= bRet;
- break;
- }
- }
- }
- return bRet;
-}
-// -------------------------------------------------------------------------
-sal_Int8 ORowSetValue::getInt8() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getInt8" );
-
-
- sal_Int8 nRet = 0;
- if(!m_bNull)
- {
- switch(getTypeKind())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- nRet = sal_Int8(::rtl::OUString(m_aValue.m_pString).toInt32());
- break;
- case DataType::BIGINT:
- if ( m_bSigned )
- nRet = sal_Int8(*(sal_Int64*)m_aValue.m_pValue);
- else
- nRet = sal_Int8(::rtl::OUString(m_aValue.m_pString).toInt32());
- break;
- case DataType::FLOAT:
- nRet = sal_Int8(*(float*)m_aValue.m_pValue);
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- nRet = sal_Int8(*(double*)m_aValue.m_pValue);
- break;
- case DataType::DATE:
- case DataType::TIME:
- case DataType::TIMESTAMP:
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- case DataType::CLOB:
- OSL_ASSERT(!"getInt8() for this type is not allowed!");
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- nRet = m_aValue.m_bBool;
- break;
- case DataType::TINYINT:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt8;
- else
- nRet = static_cast<sal_Int8>(m_aValue.m_nInt16);
- break;
- case DataType::SMALLINT:
- if ( m_bSigned )
- nRet = static_cast<sal_Int8>(m_aValue.m_nInt16);
- else
- nRet = static_cast<sal_Int8>(m_aValue.m_nInt32);
- break;
- case DataType::INTEGER:
- if ( m_bSigned )
- nRet = static_cast<sal_Int8>(m_aValue.m_nInt32);
- else
- nRet = static_cast<sal_Int8>(*static_cast<sal_Int64*>(m_aValue.m_pValue));
- break;
- default:
- {
- Any aValue = getAny();
- aValue >>= nRet;
- break;
- }
- }
- }
- return nRet;
-}
-// -------------------------------------------------------------------------
-sal_Int16 ORowSetValue::getInt16() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getInt16" );
-
-
- sal_Int16 nRet = 0;
- if(!m_bNull)
- {
- switch(getTypeKind())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- nRet = sal_Int16(::rtl::OUString(m_aValue.m_pString).toInt32());
- break;
- case DataType::BIGINT:
- if ( m_bSigned )
- nRet = sal_Int16(*(sal_Int64*)m_aValue.m_pValue);
- else
- nRet = sal_Int16(::rtl::OUString(m_aValue.m_pString).toInt32());
- break;
- case DataType::FLOAT:
- nRet = sal_Int16(*(float*)m_aValue.m_pValue);
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- nRet = sal_Int16(*(double*)m_aValue.m_pValue);
- break;
- case DataType::DATE:
- case DataType::TIME:
- case DataType::TIMESTAMP:
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- case DataType::CLOB:
- OSL_ASSERT(!"getInt16() for this type is not allowed!");
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- nRet = m_aValue.m_bBool;
- break;
- case DataType::TINYINT:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt8;
- else
- nRet = m_aValue.m_nInt16;
- break;
- case DataType::SMALLINT:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt16;
- else
- nRet = static_cast<sal_Int16>(m_aValue.m_nInt32);
- break;
- case DataType::INTEGER:
- if ( m_bSigned )
- nRet = static_cast<sal_Int16>(m_aValue.m_nInt32);
- else
- nRet = static_cast<sal_Int16>(*static_cast<sal_Int64*>(m_aValue.m_pValue));
- break;
- default:
- {
- Any aValue = getAny();
- aValue >>= nRet;
- break;
- }
- }
- }
- return nRet;
-}
-// -------------------------------------------------------------------------
-sal_Int32 ORowSetValue::getInt32() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getInt32" );
- sal_Int32 nRet = 0;
- if(!m_bNull)
- {
- switch(getTypeKind())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- nRet = ::rtl::OUString(m_aValue.m_pString).toInt32();
- break;
- case DataType::BIGINT:
- if ( m_bSigned )
- nRet = sal_Int32(*(sal_Int64*)m_aValue.m_pValue);
- else
- nRet = ::rtl::OUString(m_aValue.m_pString).toInt32();
- break;
- case DataType::FLOAT:
- nRet = sal_Int32(*(float*)m_aValue.m_pValue);
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- nRet = sal_Int32(*(double*)m_aValue.m_pValue);
- break;
- case DataType::DATE:
- nRet = dbtools::DBTypeConversion::toDays(*(::com::sun::star::util::Date*)m_aValue.m_pValue);
- break;
- case DataType::TIME:
- case DataType::TIMESTAMP:
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- case DataType::CLOB:
- OSL_ASSERT(!"getInt32() for this type is not allowed!");
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- nRet = m_aValue.m_bBool;
- break;
- case DataType::TINYINT:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt8;
- else
- nRet = m_aValue.m_nInt16;
- break;
- case DataType::SMALLINT:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt16;
- else
- nRet = m_aValue.m_nInt32;
- break;
- case DataType::INTEGER:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt32;
- else
- nRet = static_cast<sal_Int32>(*static_cast<sal_Int64*>(m_aValue.m_pValue));
- break;
- default:
- {
- Any aValue = getAny();
- aValue >>= nRet;
- break;
- }
- }
- }
- return nRet;
-}
-// -------------------------------------------------------------------------
-sal_Int64 ORowSetValue::getLong() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getLong" );
- sal_Int64 nRet = 0;
- if(!m_bNull)
- {
- switch(getTypeKind())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- nRet = ::rtl::OUString(m_aValue.m_pString).toInt64();
- break;
- case DataType::BIGINT:
- if ( m_bSigned )
- nRet = *(sal_Int64*)m_aValue.m_pValue;
- else
- nRet = ::rtl::OUString(m_aValue.m_pString).toInt64();
- break;
- case DataType::FLOAT:
- nRet = sal_Int64(*(float*)m_aValue.m_pValue);
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- nRet = sal_Int64(*(double*)m_aValue.m_pValue);
- break;
- case DataType::DATE:
- nRet = dbtools::DBTypeConversion::toDays(*(::com::sun::star::util::Date*)m_aValue.m_pValue);
- break;
- case DataType::TIME:
- case DataType::TIMESTAMP:
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- case DataType::CLOB:
- OSL_ASSERT(!"getInt32() for this type is not allowed!");
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- nRet = m_aValue.m_bBool;
- break;
- case DataType::TINYINT:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt8;
- else
- nRet = m_aValue.m_nInt16;
- break;
- case DataType::SMALLINT:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt16;
- else
- nRet = m_aValue.m_nInt32;
- break;
- case DataType::INTEGER:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt32;
- else
- nRet = *(sal_Int64*)m_aValue.m_pValue;
- break;
- default:
- {
- Any aValue = getAny();
- aValue >>= nRet;
- break;
- }
- }
- }
- return nRet;
-}
-// -------------------------------------------------------------------------
-float ORowSetValue::getFloat() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getFloat" );
- float nRet = 0;
- if(!m_bNull)
- {
- switch(getTypeKind())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- nRet = ::rtl::OUString(m_aValue.m_pString).toFloat();
- break;
- case DataType::BIGINT:
- if ( m_bSigned )
- nRet = float(*(sal_Int64*)m_aValue.m_pValue);
- else
- nRet = ::rtl::OUString(m_aValue.m_pString).toFloat();
- break;
- case DataType::FLOAT:
- nRet = *(float*)m_aValue.m_pValue;
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- nRet = (float)*(double*)m_aValue.m_pValue;
- break;
- case DataType::DATE:
- nRet = (float)dbtools::DBTypeConversion::toDouble(*(::com::sun::star::util::Date*)m_aValue.m_pValue);
- break;
- case DataType::TIME:
- nRet = (float)dbtools::DBTypeConversion::toDouble(*(::com::sun::star::util::Time*)m_aValue.m_pValue);
- break;
- case DataType::TIMESTAMP:
- nRet = (float)dbtools::DBTypeConversion::toDouble(*(::com::sun::star::util::DateTime*)m_aValue.m_pValue);
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- case DataType::CLOB:
- OSL_ASSERT(!"getDouble() for this type is not allowed!");
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- nRet = m_aValue.m_bBool;
- break;
- case DataType::TINYINT:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt8;
- else
- nRet = m_aValue.m_nInt16;
- break;
- case DataType::SMALLINT:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt16;
- else
- nRet = (float)m_aValue.m_nInt32;
- break;
- case DataType::INTEGER:
- if ( m_bSigned )
- nRet = (float)m_aValue.m_nInt32;
- else
- nRet = float(*(sal_Int64*)m_aValue.m_pValue);
- break;
- default:
- {
- Any aValue = getAny();
- aValue >>= nRet;
- break;
- }
- }
- }
- return nRet;
-}
-// -------------------------------------------------------------------------
-double ORowSetValue::getDouble() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getDouble" );
-
-
- double nRet = 0;
- if(!m_bNull)
- {
- switch(getTypeKind())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- nRet = ::rtl::OUString(m_aValue.m_pString).toDouble();
- break;
- case DataType::BIGINT:
- if ( m_bSigned )
- nRet = double(*(sal_Int64*)m_aValue.m_pValue);
- else
- nRet = ::rtl::OUString(m_aValue.m_pString).toDouble();
- break;
- case DataType::FLOAT:
- nRet = *(float*)m_aValue.m_pValue;
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- nRet = *(double*)m_aValue.m_pValue;
- break;
- case DataType::DATE:
- nRet = dbtools::DBTypeConversion::toDouble(*(::com::sun::star::util::Date*)m_aValue.m_pValue);
- break;
- case DataType::TIME:
- nRet = dbtools::DBTypeConversion::toDouble(*(::com::sun::star::util::Time*)m_aValue.m_pValue);
- break;
- case DataType::TIMESTAMP:
- nRet = dbtools::DBTypeConversion::toDouble(*(::com::sun::star::util::DateTime*)m_aValue.m_pValue);
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- case DataType::CLOB:
- OSL_ASSERT(!"getDouble() for this type is not allowed!");
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- nRet = m_aValue.m_bBool;
- break;
- case DataType::TINYINT:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt8;
- else
- nRet = m_aValue.m_nInt16;
- break;
- case DataType::SMALLINT:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt16;
- else
- nRet = m_aValue.m_nInt32;
- break;
- case DataType::INTEGER:
- if ( m_bSigned )
- nRet = m_aValue.m_nInt32;
- else
- nRet = double(*(sal_Int64*)m_aValue.m_pValue);
- break;
- default:
- {
- Any aValue = getAny();
- aValue >>= nRet;
- break;
- }
- }
- }
- return nRet;
-}
-// -------------------------------------------------------------------------
-void ORowSetValue::setFromDouble(const double& _rVal,sal_Int32 _nDatatype)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::setFromDouble" );
- free();
-
- m_bNull = sal_False;
- switch(_nDatatype)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- {
- ::rtl::OUString aVal = ::rtl::OUString::valueOf(_rVal);
- m_aValue.m_pString = aVal.pData;
- rtl_uString_acquire(m_aValue.m_pString);
- }
- break;
- case DataType::BIGINT:
- if ( m_bSigned )
- {
- m_aValue.m_pValue = new sal_Int64((sal_Int64)_rVal);
- TRACE_ALLOC( sal_Int64 )
- }
- else
- {
- ::rtl::OUString aVal = ::rtl::OUString::valueOf(_rVal);
- m_aValue.m_pString = aVal.pData;
- rtl_uString_acquire(m_aValue.m_pString);
- }
- break;
- case DataType::FLOAT:
- m_aValue.m_pValue = new float((float)_rVal);
- TRACE_ALLOC( float )
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- m_aValue.m_pValue = new double(_rVal);
- TRACE_ALLOC( double )
- break;
- case DataType::DATE:
- m_aValue.m_pValue = new Date(dbtools::DBTypeConversion::toDate(_rVal));
- TRACE_ALLOC( Date )
- break;
- case DataType::TIME:
- m_aValue.m_pValue = new Time(dbtools::DBTypeConversion::toTime(_rVal));
- TRACE_ALLOC( Time )
- break;
- case DataType::TIMESTAMP:
- m_aValue.m_pValue = new DateTime(dbtools::DBTypeConversion::toDateTime(_rVal));
- TRACE_ALLOC( DateTime )
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- case DataType::CLOB:
- OSL_ASSERT(!"setFromDouble() for this type is not allowed!");
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- m_aValue.m_bBool = _rVal != 0.0;
- break;
- case DataType::TINYINT:
- if ( m_bSigned )
- m_aValue.m_nInt8 = sal_Int8(_rVal);
- else
- m_aValue.m_nInt16 = sal_Int16(_rVal);
- break;
- case DataType::SMALLINT:
- if ( m_bSigned )
- m_aValue.m_nInt16 = sal_Int16(_rVal);
- else
- m_aValue.m_nInt32 = sal_Int32(_rVal);
- break;
- case DataType::INTEGER:
- if ( m_bSigned )
- m_aValue.m_nInt32 = sal_Int32(_rVal);
- else
- {
- m_aValue.m_pValue = new sal_Int64((sal_Int64)_rVal);
- TRACE_ALLOC( sal_Int64 )
- }
- break;
- default:
- {
- m_aValue.m_pValue = new Any(_rVal);
- break;
- }
- }
- m_eTypeKind = _nDatatype;
-}
-// -----------------------------------------------------------------------------
-Sequence<sal_Int8> ORowSetValue::getSequence() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getSequence" );
- Sequence<sal_Int8> aSeq;
- if (!m_bNull)
- {
- switch(m_eTypeKind)
- {
- case DataType::OBJECT:
- case DataType::CLOB:
- case DataType::BLOB:
- {
- Reference<XInputStream> xStream;
- const Any aValue = makeAny();
- if(aValue.hasValue())
- {
- Reference<XBlob> xBlob(aValue,UNO_QUERY);
- if ( xBlob.is() )
- xStream = xBlob->getBinaryStream();
- else
- {
- Reference<XClob> xClob(aValue,UNO_QUERY);
- if ( xClob.is() )
- xStream = xClob->getCharacterStream();
- }
- if(xStream.is())
- {
- const sal_uInt32 nBytesToRead = 65535;
- sal_uInt32 nRead;
-
- do
- {
- ::com::sun::star::uno::Sequence< sal_Int8 > aReadSeq;
-
- nRead = xStream->readSomeBytes( aReadSeq, nBytesToRead );
-
- if( nRead )
- {
- const sal_uInt32 nOldLength = aSeq.getLength();
- aSeq.realloc( nOldLength + nRead );
- rtl_copyMemory( aSeq.getArray() + nOldLength, aReadSeq.getConstArray(), aReadSeq.getLength() );
- }
- }
- while( nBytesToRead == nRead );
- xStream->closeInput();
- }
- }
- }
- break;
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- {
- ::rtl::OUString sVal(m_aValue.m_pString);
- aSeq = Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(sVal.getStr()),sizeof(sal_Unicode)*sVal.getLength());
- }
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- aSeq = *static_cast< Sequence<sal_Int8>*>(m_aValue.m_pValue);
- break;
- default:
- {
- Any aValue = getAny();
- aValue >>= aSeq;
- break;
- }
- }
- }
- return aSeq;
-
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::util::Date ORowSetValue::getDate() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getDate" );
- ::com::sun::star::util::Date aValue;
- if(!m_bNull)
- {
- switch(m_eTypeKind)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- aValue = DBTypeConversion::toDate(getString());
- break;
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::FLOAT:
- case DataType::DOUBLE:
- case DataType::REAL:
- aValue = DBTypeConversion::toDate((double)*this);
- break;
-
- case DataType::DATE:
- aValue = *static_cast< ::com::sun::star::util::Date*>(m_aValue.m_pValue);
- break;
- case DataType::TIMESTAMP:
- {
- ::com::sun::star::util::DateTime* pDateTime = static_cast< ::com::sun::star::util::DateTime*>(m_aValue.m_pValue);
- aValue.Day = pDateTime->Day;
- aValue.Month = pDateTime->Month;
- aValue.Year = pDateTime->Year;
- }
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- case DataType::TINYINT:
- case DataType::SMALLINT:
- case DataType::INTEGER:
- case DataType::BIGINT:
- aValue = DBTypeConversion::toDate( double( sal_Int64( *this ) ) );
- break;
-
- case DataType::BLOB:
- case DataType::CLOB:
- case DataType::OBJECT:
- default:
- OSL_ENSURE( false, "ORowSetValue::getDate: cannot retrieve the data!" );
- // NO break!
-
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- case DataType::TIME:
- aValue = DBTypeConversion::toDate( (double)0 );
- break;
- }
- }
- return aValue;
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::util::Time ORowSetValue::getTime() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getTime" );
- ::com::sun::star::util::Time aValue;
- if(!m_bNull)
- {
- switch(m_eTypeKind)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- aValue = DBTypeConversion::toTime(getString());
- break;
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- aValue = DBTypeConversion::toTime((double)*this);
- break;
- case DataType::FLOAT:
- case DataType::DOUBLE:
- case DataType::REAL:
- aValue = DBTypeConversion::toTime((double)*this);
- break;
- case DataType::TIMESTAMP:
- {
- ::com::sun::star::util::DateTime* pDateTime = static_cast< ::com::sun::star::util::DateTime*>(m_aValue.m_pValue);
- aValue.HundredthSeconds = pDateTime->HundredthSeconds;
- aValue.Seconds = pDateTime->Seconds;
- aValue.Minutes = pDateTime->Minutes;
- aValue.Hours = pDateTime->Hours;
- }
- break;
- case DataType::TIME:
- aValue = *static_cast< ::com::sun::star::util::Time*>(m_aValue.m_pValue);
- break;
- default:
- {
- Any aAnyValue = getAny();
- aAnyValue >>= aValue;
- break;
- }
- }
- }
- return aValue;
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::util::DateTime ORowSetValue::getDateTime() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getDateTime" );
- ::com::sun::star::util::DateTime aValue;
- if(!m_bNull)
- {
- switch(m_eTypeKind)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- aValue = DBTypeConversion::toDateTime(getString());
- break;
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- aValue = DBTypeConversion::toDateTime((double)*this);
- break;
- case DataType::FLOAT:
- case DataType::DOUBLE:
- case DataType::REAL:
- aValue = DBTypeConversion::toDateTime((double)*this);
- break;
- case DataType::DATE:
- {
- ::com::sun::star::util::Date* pDate = static_cast< ::com::sun::star::util::Date*>(m_aValue.m_pValue);
- aValue.Day = pDate->Day;
- aValue.Month = pDate->Month;
- aValue.Year = pDate->Year;
- }
- break;
- case DataType::TIME:
- {
- ::com::sun::star::util::Time* pTime = static_cast< ::com::sun::star::util::Time*>(m_aValue.m_pValue);
- aValue.HundredthSeconds = pTime->HundredthSeconds;
- aValue.Seconds = pTime->Seconds;
- aValue.Minutes = pTime->Minutes;
- aValue.Hours = pTime->Hours;
- }
- break;
- case DataType::TIMESTAMP:
- aValue = *static_cast< ::com::sun::star::util::DateTime*>(m_aValue.m_pValue);
- break;
- default:
- {
- Any aAnyValue = getAny();
- aAnyValue >>= aValue;
- break;
- }
- }
- }
- return aValue;
-}
-// -----------------------------------------------------------------------------
-void ORowSetValue::setSigned(sal_Bool _bMod)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::setSigned" );
- if ( m_bSigned != _bMod )
- {
- m_bSigned = _bMod;
- if ( !m_bNull )
- {
- sal_Int32 nType = m_eTypeKind;
- switch(m_eTypeKind)
- {
- case DataType::BIGINT:
- if ( m_bSigned ) // now we are signed, so we were unsigned and need to call getString()
- {
- m_bSigned = !m_bSigned;
- const ::rtl::OUString sValue = getString();
- free();
- m_bSigned = !m_bSigned;
- (*this) = sValue;
- }
- else
- {
- m_bSigned = !m_bSigned;
- const sal_Int64 nValue = getLong();
- free();
- m_bSigned = !m_bSigned;
- (*this) = nValue;
- }
- break;
- case DataType::TINYINT:
- if ( m_bSigned )
- (*this) = getInt8();
- else
- {
- m_bSigned = !m_bSigned;
- (*this) = getInt16();
- m_bSigned = !m_bSigned;
- }
- break;
- case DataType::SMALLINT:
- if ( m_bSigned )
- (*this) = getInt16();
- else
- {
- m_bSigned = !m_bSigned;
- (*this) = getInt32();
- m_bSigned = !m_bSigned;
- }
- break;
- case DataType::INTEGER:
- if ( m_bSigned )
- (*this) = getInt32();
- else
- {
- m_bSigned = !m_bSigned;
- (*this) = getLong();
- m_bSigned = !m_bSigned;
- }
- break;
- }
- m_eTypeKind = nType;
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-namespace detail
-{
- class SAL_NO_VTABLE IValueSource
- {
- public:
- virtual ::rtl::OUString getString() const = 0;
- virtual sal_Bool getBoolean() const = 0;
- virtual sal_Int8 getByte() const = 0;
- virtual sal_Int16 getShort() const = 0;
- virtual sal_Int32 getInt() const = 0;
- virtual sal_Int64 getLong() const = 0;
- virtual float getFloat() const = 0;
- virtual double getDouble() const = 0;
- virtual Date getDate() const = 0;
- virtual Time getTime() const = 0;
- virtual DateTime getTimestamp() const = 0;
- virtual Sequence< sal_Int8 > getBytes() const = 0;
- virtual Reference< XInputStream > getBinaryStream() const = 0;
- virtual Reference< XInputStream > getCharacterStream() const = 0;
- virtual Reference< XBlob > getBlob() const = 0;
- virtual Reference< XClob > getClob() const = 0;
- virtual Any getObject() const = 0;
- virtual sal_Bool wasNull() const = 0;
-
- virtual ~IValueSource() { }
- };
-
- class RowValue : public IValueSource
- {
- public:
- RowValue( const Reference< XRow >& _xRow, const sal_Int32 _nPos )
- :m_xRow( _xRow )
- ,m_nPos( _nPos )
- {
- }
-
- // IValueSource
- virtual ::rtl::OUString getString() const { return m_xRow->getString( m_nPos ); };
- virtual sal_Bool getBoolean() const { return m_xRow->getBoolean( m_nPos ); };
- virtual sal_Int8 getByte() const { return m_xRow->getByte( m_nPos ); };
- virtual sal_Int16 getShort() const { return m_xRow->getShort( m_nPos ); }
- virtual sal_Int32 getInt() const { return m_xRow->getInt( m_nPos ); }
- virtual sal_Int64 getLong() const { return m_xRow->getLong( m_nPos ); }
- virtual float getFloat() const { return m_xRow->getFloat( m_nPos ); };
- virtual double getDouble() const { return m_xRow->getDouble( m_nPos ); };
- virtual Date getDate() const { return m_xRow->getDate( m_nPos ); };
- virtual Time getTime() const { return m_xRow->getTime( m_nPos ); };
- virtual DateTime getTimestamp() const { return m_xRow->getTimestamp( m_nPos ); };
- virtual Sequence< sal_Int8 > getBytes() const { return m_xRow->getBytes( m_nPos ); };
- virtual Reference< XInputStream > getBinaryStream() const { return m_xRow->getBinaryStream( m_nPos ); };
- virtual Reference< XInputStream > getCharacterStream() const { return m_xRow->getCharacterStream( m_nPos ); };
- virtual Reference< XBlob > getBlob() const { return m_xRow->getBlob( m_nPos ); };
- virtual Reference< XClob > getClob() const { return m_xRow->getClob( m_nPos ); };
- virtual Any getObject() const { return m_xRow->getObject( m_nPos ,NULL); };
- virtual sal_Bool wasNull() const { return m_xRow->wasNull( ); };
-
- private:
- const Reference< XRow > m_xRow;
- const sal_Int32 m_nPos;
- };
-
- class ColumnValue : public IValueSource
- {
- public:
- ColumnValue( const Reference< XColumn >& _rxColumn )
- :m_xColumn( _rxColumn )
- {
- }
-
- // IValueSource
- virtual ::rtl::OUString getString() const { return m_xColumn->getString(); };
- virtual sal_Bool getBoolean() const { return m_xColumn->getBoolean(); };
- virtual sal_Int8 getByte() const { return m_xColumn->getByte(); };
- virtual sal_Int16 getShort() const { return m_xColumn->getShort(); }
- virtual sal_Int32 getInt() const { return m_xColumn->getInt(); }
- virtual sal_Int64 getLong() const { return m_xColumn->getLong(); }
- virtual float getFloat() const { return m_xColumn->getFloat(); };
- virtual double getDouble() const { return m_xColumn->getDouble(); };
- virtual Date getDate() const { return m_xColumn->getDate(); };
- virtual Time getTime() const { return m_xColumn->getTime(); };
- virtual DateTime getTimestamp() const { return m_xColumn->getTimestamp(); };
- virtual Sequence< sal_Int8 > getBytes() const { return m_xColumn->getBytes(); };
- virtual Reference< XInputStream > getBinaryStream() const { return m_xColumn->getBinaryStream(); };
- virtual Reference< XInputStream > getCharacterStream() const { return m_xColumn->getCharacterStream(); };
- virtual Reference< XBlob > getBlob() const { return m_xColumn->getBlob(); };
- virtual Reference< XClob > getClob() const { return m_xColumn->getClob(); };
- virtual Any getObject() const { return m_xColumn->getObject( NULL ); };
- virtual sal_Bool wasNull() const { return m_xColumn->wasNull( ); };
-
- private:
- const Reference< XColumn > m_xColumn;
- };
-}
-
-// -----------------------------------------------------------------------------
-void ORowSetValue::fill( const sal_Int32 _nType, const Reference< XColumn >& _rxColumn )
-{
- detail::ColumnValue aColumnValue( _rxColumn );
- impl_fill( _nType, sal_True, aColumnValue );
-}
-
-// -----------------------------------------------------------------------------
-void ORowSetValue::fill( sal_Int32 _nPos, sal_Int32 _nType, sal_Bool _bNullable, const Reference< XRow>& _xRow )
-{
- detail::RowValue aRowValue( _xRow, _nPos );
- impl_fill( _nType, _bNullable, aRowValue );
-}
-
-// -----------------------------------------------------------------------------
-void ORowSetValue::fill(sal_Int32 _nPos,
- sal_Int32 _nType,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill (1)" );
- fill(_nPos,_nType,sal_True,_xRow);
-}
-
-// -----------------------------------------------------------------------------
-void ORowSetValue::impl_fill( const sal_Int32 _nType, sal_Bool _bNullable, const detail::IValueSource& _rValueSource )
-
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill (2)" );
- sal_Bool bReadData = sal_True;
- switch(_nType)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- (*this) = _rValueSource.getString();
- break;
- case DataType::BIGINT:
- if ( isSigned() )
- (*this) = _rValueSource.getLong();
- else
- (*this) = _rValueSource.getString();
- break;
- case DataType::FLOAT:
- (*this) = _rValueSource.getFloat();
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- (*this) = _rValueSource.getDouble();
- break;
- case DataType::DATE:
- (*this) = _rValueSource.getDate();
- break;
- case DataType::TIME:
- (*this) = _rValueSource.getTime();
- break;
- case DataType::TIMESTAMP:
- (*this) = _rValueSource.getTimestamp();
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- (*this) = _rValueSource.getBytes();
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- (*this) = _rValueSource.getBoolean();
- break;
- case DataType::TINYINT:
- if ( isSigned() )
- (*this) = _rValueSource.getByte();
- else
- (*this) = _rValueSource.getShort();
- break;
- case DataType::SMALLINT:
- if ( isSigned() )
- (*this) = _rValueSource.getShort();
- else
- (*this) = _rValueSource.getInt();
- break;
- case DataType::INTEGER:
- if ( isSigned() )
- (*this) = _rValueSource.getInt();
- else
- (*this) = _rValueSource.getLong();
- break;
- case DataType::CLOB:
- (*this) = ::com::sun::star::uno::makeAny(_rValueSource.getClob());
- setTypeKind(DataType::CLOB);
- break;
- case DataType::BLOB:
- (*this) = ::com::sun::star::uno::makeAny(_rValueSource.getBlob());
- setTypeKind(DataType::BLOB);
- break;
- case DataType::OTHER:
- (*this) = _rValueSource.getObject();
- setTypeKind(DataType::OTHER);
- break;
- default:
- OSL_FAIL( "ORowSetValue::fill: unsupported type!" );
- (*this) = _rValueSource.getObject();
- break;
- }
- if ( bReadData && _bNullable && _rValueSource.wasNull() )
- setNull();
- setTypeKind(_nType);
-}
-// -----------------------------------------------------------------------------
-void ORowSetValue::fill(const Any& _rValue)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill (3)" );
- switch (_rValue.getValueType().getTypeClass())
- {
- case TypeClass_VOID:
- setNull();
- break;
- case TypeClass_BOOLEAN:
- {
- sal_Bool bValue( sal_False );
- _rValue >>= bValue;
- (*this) = bValue;
- break;
- }
- case TypeClass_CHAR:
- {
- sal_Unicode aDummy(0);
- _rValue >>= aDummy;
- (*this) = ::rtl::OUString(aDummy);
- break;
- }
- case TypeClass_STRING:
- {
- ::rtl::OUString sDummy;
- _rValue >>= sDummy;
- (*this) = sDummy;
- break;
- }
- case TypeClass_FLOAT:
- {
- float aDummy(0.0);
- _rValue >>= aDummy;
- (*this) = aDummy;
- break;
- }
- case TypeClass_DOUBLE:
- {
- double aDummy(0.0);
- _rValue >>= aDummy;
- (*this) = aDummy;
- break;
- }
- case TypeClass_BYTE:
- {
- sal_Int8 aDummy(0);
- _rValue >>= aDummy;
- (*this) = aDummy;
- break;
- }
- case TypeClass_SHORT:
- {
- sal_Int16 aDummy(0);
- _rValue >>= aDummy;
- (*this) = aDummy;
- break;
- }
- case TypeClass_LONG:
- {
- sal_Int32 aDummy(0);
- _rValue >>= aDummy;
- (*this) = aDummy;
- break;
- }
- case TypeClass_UNSIGNED_SHORT:
- {
- sal_uInt16 nValue(0);
- _rValue >>= nValue;
- (*this) = static_cast<sal_Int32>(nValue);
- setSigned(sal_False);
- break;
- }
- case TypeClass_HYPER:
- {
- sal_Int64 nValue(0);
- _rValue >>= nValue;
- (*this) = nValue;
- break;
- }
- case TypeClass_UNSIGNED_HYPER:
- {
- sal_uInt64 nValue(0);
- _rValue >>= nValue;
- (*this) = static_cast<sal_Int64>(nValue);
- setSigned(sal_False);
- break;
- }
- case TypeClass_UNSIGNED_LONG:
- {
- sal_uInt32 nValue(0);
- _rValue >>= nValue;
- (*this) = static_cast<sal_Int64>(nValue);
- setSigned(sal_False);
- break;
- }
- case TypeClass_ENUM:
- {
- sal_Int32 enumValue( 0 );
- ::cppu::enum2int( enumValue, _rValue );
- (*this) = enumValue;
- }
- break;
-
- case TypeClass_SEQUENCE:
- {
- Sequence<sal_Int8> aDummy;
- if ( _rValue >>= aDummy )
- (*this) = aDummy;
- else
- OSL_FAIL( "ORowSetValue::fill: unsupported sequence type!" );
- break;
- }
-
- case TypeClass_STRUCT:
- {
- ::com::sun::star::util::Date aDate;
- ::com::sun::star::util::Time aTime;
- ::com::sun::star::util::DateTime aDateTime;
- if ( _rValue >>= aDate )
- {
- (*this) = aDate;
- }
- else if ( _rValue >>= aTime )
- {
- (*this) = aTime;
- }
- else if ( _rValue >>= aDateTime )
- {
- (*this) = aDateTime;
- }
- else
- OSL_FAIL( "ORowSetValue::fill: unsupported structure!" );
-
- break;
- }
- case TypeClass_INTERFACE:
- {
- Reference< XClob > xClob;
- if ( _rValue >>= xClob )
- {
- (*this) = _rValue;
- setTypeKind(DataType::CLOB);
- }
- else
- {
- Reference< XBlob > xBlob;
- if ( _rValue >>= xBlob )
- {
- (*this) = _rValue;
- setTypeKind(DataType::BLOB);
- }
- else
- {
- (*this) = _rValue;
- }
- }
- }
- break;
-
- default:
- OSL_FAIL("Unknown type");
- break;
- }
-}
-
-} // namespace connectivity
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/ParamterSubstitution.cxx b/connectivity/source/commontools/ParamterSubstitution.cxx
deleted file mode 100644
index 6f6501f32a..0000000000
--- a/connectivity/source/commontools/ParamterSubstitution.cxx
+++ /dev/null
@@ -1,135 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "precompiled_connectivity.hxx"
-#include "ParameterSubstitution.hxx"
-#include "connectivity/sqlparse.hxx"
-#include <comphelper/sequenceashashmap.hxx>
-
-namespace connectivity
-{
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star;
-
- ParameterSubstitution::ParameterSubstitution(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ) : m_xContext(_rxContext)
- {
- }
- void SAL_CALL ParameterSubstitution::initialize( const uno::Sequence< uno::Any >& _aArguments ) throw (uno::Exception, uno::RuntimeException)
- {
- ::osl::MutexGuard aGuard(m_aMutex);
- comphelper::SequenceAsHashMap aArgs(_aArguments);
- uno::Reference< sdbc::XConnection > xConnection;
- xConnection = aArgs.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveConnection")),xConnection);
- m_xConnection = xConnection;
- }
- //------------------------------------------------------------------------------
- rtl::OUString ParameterSubstitution::getImplementationName_Static( ) throw(RuntimeException)
- {
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.ParameterSubstitution"));
- }
- //------------------------------------------------------------------------------
- ::rtl::OUString SAL_CALL ParameterSubstitution::getImplementationName( ) throw(RuntimeException)
- {
- return getImplementationName_Static();
- }
- //------------------------------------------------------------------
- sal_Bool SAL_CALL ParameterSubstitution::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
- {
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
- }
- //------------------------------------------------------------------
- Sequence< ::rtl::OUString > SAL_CALL ParameterSubstitution::getSupportedServiceNames( ) throw(RuntimeException)
- {
- return getSupportedServiceNames_Static();
- }
- //------------------------------------------------------------------
- Sequence< ::rtl::OUString > ParameterSubstitution::getSupportedServiceNames_Static( ) throw (RuntimeException)
- {
- Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.ParameterSubstitution"));
- return aSNS;
- }
-
- //------------------------------------------------------------------
- Reference< XInterface > ParameterSubstitution::create(const Reference< XComponentContext >& _xContext)
- {
- return *(new ParameterSubstitution(_xContext));
- }
- //------------------------------------------------------------------
- ::rtl::OUString SAL_CALL ParameterSubstitution::substituteVariables( const ::rtl::OUString& _sText, ::sal_Bool /*bSubstRequired*/ ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException)
- {
- ::rtl::OUString sRet = _sText;
- uno::Reference< sdbc::XConnection > xConnection = m_xConnection;
- if ( xConnection.is() )
- {
- try
- {
- uno::Reference< XMultiServiceFactory> xFac(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW);
- OSQLParser aParser( xFac );
- ::rtl::OUString sErrorMessage;
- ::rtl::OUString sNewSql;
- OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_sText);
- if(pNode)
- { // special handling for parameters
- OSQLParseNode::substituteParameterNames(pNode);
- pNode->parseNodeToStr( sNewSql, xConnection );
- delete pNode;
- sRet = sNewSql;
- }
- }
- catch(const Exception&)
- {
- }
- }
- return sRet;
- }
- //------------------------------------------------------------------
- ::rtl::OUString SAL_CALL ParameterSubstitution::reSubstituteVariables( const ::rtl::OUString& _sText ) throw (::com::sun::star::uno::RuntimeException)
- {
- return _sText;
- }
- //------------------------------------------------------------------
- ::rtl::OUString SAL_CALL ParameterSubstitution::getSubstituteVariableValue( const ::rtl::OUString& /*variable*/ ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException)
- {
- throw container::NoSuchElementException();
- }
- //------------------------------------------------------------------
-
-
-// ==================================
-} // connectivity
-// ==================================
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/RowFunctionParser.cxx b/connectivity/source/commontools/RowFunctionParser.cxx
deleted file mode 100644
index 590cfb6489..0000000000
--- a/connectivity/source/commontools/RowFunctionParser.cxx
+++ /dev/null
@@ -1,501 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-// Makes parser a static resource,
-// we're synchronized externally.
-// But watch out, the parser might have
-// state not visible to this code!
-#define BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE
-#if defined(VERBOSE) && defined(DBG_UTIL)
-#include <typeinfo>
-#define BOOST_SPIRIT_DEBUG
-#endif
-#include <boost/spirit/include/classic_core.hpp>
-#include "RowFunctionParser.hxx"
-#include <rtl/ustring.hxx>
-#include <tools/fract.hxx>
-
-
-
-#if (OSL_DEBUG_LEVEL > 0)
-#include <iostream>
-#endif
-#include <functional>
-#include <algorithm>
-#include <stack>
-
-namespace connectivity
-{
-using namespace com::sun::star;
-
-namespace
-{
-//////////////////////
-//////////////////////
-// EXPRESSION NODES
-//////////////////////
-//////////////////////
-class ConstantValueExpression : public ExpressionNode
-{
- ORowSetValueDecoratorRef maValue;
-
-public:
-
- ConstantValueExpression( ORowSetValueDecoratorRef rValue ) :
- maValue( rValue )
- {
- }
- virtual ORowSetValueDecoratorRef evaluate(const ODatabaseMetaDataResultSet::ORow& /*_aRow*/ ) const
- {
- return maValue;
- }
- virtual void fill(const ODatabaseMetaDataResultSet::ORow& /*_aRow*/ ) const
- {
- }
- virtual ExpressionFunct getType() const
- {
- return FUNC_CONST;
- }
- virtual ODatabaseMetaDataResultSet::ORow fillNode( std::vector< RowEquation >& /*rEquations*/, ExpressionNode* /* pOptionalArg */, sal_uInt32 /* nFlags */ )
- {
- ODatabaseMetaDataResultSet::ORow aRet;
- return aRet;
- }
-};
-
-
-/** ExpressionNode implementation for unary
- function over two ExpressionNodes
- */
-class BinaryFunctionExpression : public ExpressionNode
-{
- const ExpressionFunct meFunct;
- ExpressionNodeSharedPtr mpFirstArg;
- ExpressionNodeSharedPtr mpSecondArg;
-
-public:
-
- BinaryFunctionExpression( const ExpressionFunct eFunct, const ExpressionNodeSharedPtr& rFirstArg, const ExpressionNodeSharedPtr& rSecondArg ) :
- meFunct( eFunct ),
- mpFirstArg( rFirstArg ),
- mpSecondArg( rSecondArg )
- {
- }
- virtual ORowSetValueDecoratorRef evaluate(const ODatabaseMetaDataResultSet::ORow& _aRow ) const
- {
- ORowSetValueDecoratorRef aRet;
- switch(meFunct)
- {
- case ENUM_FUNC_EQUATION:
- aRet = new ORowSetValueDecorator(sal_Bool(mpFirstArg->evaluate(_aRow )->getValue() == mpSecondArg->evaluate(_aRow )->getValue()) );
- break;
- case ENUM_FUNC_AND:
- aRet = new ORowSetValueDecorator( sal_Bool(mpFirstArg->evaluate(_aRow )->getValue().getBool() && mpSecondArg->evaluate(_aRow )->getValue().getBool()) );
- break;
- case ENUM_FUNC_OR:
- aRet = new ORowSetValueDecorator( sal_Bool(mpFirstArg->evaluate(_aRow )->getValue().getBool() || mpSecondArg->evaluate(_aRow )->getValue().getBool()) );
- break;
- default:
- break;
- }
- return aRet;
- }
- virtual void fill(const ODatabaseMetaDataResultSet::ORow& _aRow ) const
- {
- switch(meFunct)
- {
- case ENUM_FUNC_EQUATION:
- (*mpFirstArg->evaluate(_aRow )) = mpSecondArg->evaluate(_aRow )->getValue();
- break;
- default:
- break;
- }
- }
- virtual ExpressionFunct getType() const
- {
- return meFunct;
- }
- virtual ODatabaseMetaDataResultSet::ORow fillNode( std::vector< RowEquation >& /*rEquations*/, ExpressionNode* /*pOptionalArg*/, sal_uInt32 /*nFlags*/ )
- {
- ODatabaseMetaDataResultSet::ORow aRet;
- return aRet;
- }
-};
-
-
-////////////////////////
-////////////////////////
-// FUNCTION PARSER
-////////////////////////
-////////////////////////
-
-typedef const sal_Char* StringIteratorT;
-
-struct ParserContext
-{
- typedef ::std::stack< ExpressionNodeSharedPtr > OperandStack;
-
- // stores a stack of not-yet-evaluated operands. This is used
- // by the operators (i.e. '+', '*', 'sin' etc.) to pop their
- // arguments from. If all arguments to an operator are constant,
- // the operator pushes a precalculated result on the stack, and
- // a composite ExpressionNode otherwise.
- OperandStack maOperandStack;
-};
-
-typedef ::boost::shared_ptr< ParserContext > ParserContextSharedPtr;
-
-/** Generate apriori constant value
- */
-
-class ConstantFunctor
-{
- ParserContextSharedPtr mpContext;
-
-public:
-
- ConstantFunctor( const ParserContextSharedPtr& rContext ) :
- mpContext( rContext )
- {
- }
- void operator()( StringIteratorT rFirst,StringIteratorT rSecond) const
- {
- rtl::OUString sVal( rFirst, rSecond - rFirst, RTL_TEXTENCODING_UTF8 );
- mpContext->maOperandStack.push( ExpressionNodeSharedPtr( new ConstantValueExpression( new ORowSetValueDecorator( sVal ) ) ) );
- }
-};
-
-/** Generate parse-dependent-but-then-constant value
- */
-class IntConstantFunctor
-{
- ParserContextSharedPtr mpContext;
-
-public:
- IntConstantFunctor( const ParserContextSharedPtr& rContext ) :
- mpContext( rContext )
- {
- }
- void operator()( sal_Int32 n ) const
- {
- mpContext->maOperandStack.push( ExpressionNodeSharedPtr( new ConstantValueExpression( new ORowSetValueDecorator( n ) ) ) );
- }
- void operator()( StringIteratorT rFirst,StringIteratorT rSecond) const
- {
- rtl::OUString sVal( rFirst, rSecond - rFirst, RTL_TEXTENCODING_UTF8 );
- (void)sVal;
- }
-};
-
-/** Implements a binary function over two ExpressionNodes
-
- @tpl Generator
- Generator functor, to generate an ExpressionNode of
- appropriate type
-
- */
-class BinaryFunctionFunctor
-{
- const ExpressionFunct meFunct;
- ParserContextSharedPtr mpContext;
-
-public:
-
- BinaryFunctionFunctor( const ExpressionFunct eFunct, const ParserContextSharedPtr& rContext ) :
- meFunct( eFunct ),
- mpContext( rContext )
- {
- }
-
- void operator()( StringIteratorT, StringIteratorT ) const
- {
- ParserContext::OperandStack& rNodeStack( mpContext->maOperandStack );
-
- if( rNodeStack.size() < 2 )
- throw ParseError( "Not enough arguments for binary operator" );
-
- // retrieve arguments
- ExpressionNodeSharedPtr pSecondArg( rNodeStack.top() );
- rNodeStack.pop();
- ExpressionNodeSharedPtr pFirstArg( rNodeStack.top() );
- rNodeStack.pop();
-
- // create combined ExpressionNode
- ExpressionNodeSharedPtr pNode = ExpressionNodeSharedPtr( new BinaryFunctionExpression( meFunct, pFirstArg, pSecondArg ) );
- // check for constness
- rNodeStack.push( pNode );
- }
-};
-/** ExpressionNode implementation for unary
- function over one ExpressionNode
- */
-class UnaryFunctionExpression : public ExpressionNode
-{
- const ExpressionFunct meFunct;
- ExpressionNodeSharedPtr mpArg;
-
-public:
- UnaryFunctionExpression( const ExpressionFunct eFunct, const ExpressionNodeSharedPtr& rArg ) :
- meFunct( eFunct ),
- mpArg( rArg )
- {
- }
- virtual ORowSetValueDecoratorRef evaluate(const ODatabaseMetaDataResultSet::ORow& _aRow ) const
- {
- return _aRow[mpArg->evaluate(_aRow )->getValue().getInt32()];
- }
- virtual void fill(const ODatabaseMetaDataResultSet::ORow& /*_aRow*/ ) const
- {
- }
- virtual ExpressionFunct getType() const
- {
- return meFunct;
- }
- virtual ODatabaseMetaDataResultSet::ORow fillNode( std::vector< RowEquation >& /*rEquations*/, ExpressionNode* /* pOptionalArg */, sal_uInt32 /* nFlags */ )
- {
- ODatabaseMetaDataResultSet::ORow aRet;
- return aRet;
- }
-};
-
-class UnaryFunctionFunctor
-{
- const ExpressionFunct meFunct;
- ParserContextSharedPtr mpContext;
-
-public :
-
- UnaryFunctionFunctor( const ExpressionFunct eFunct, const ParserContextSharedPtr& rContext ) :
- meFunct( eFunct ),
- mpContext( rContext )
- {
- }
- void operator()( StringIteratorT, StringIteratorT ) const
- {
-
- ParserContext::OperandStack& rNodeStack( mpContext->maOperandStack );
-
- if( rNodeStack.size() < 1 )
- throw ParseError( "Not enough arguments for unary operator" );
-
- // retrieve arguments
- ExpressionNodeSharedPtr pArg( rNodeStack.top() );
- rNodeStack.pop();
-
- rNodeStack.push( ExpressionNodeSharedPtr( new UnaryFunctionExpression( meFunct, pArg ) ) );
- }
-};
-
-/* This class implements the following grammar (more or
- less literally written down below, only slightly
- obfuscated by the parser actions):
-
- basic_expression =
- number |
- '(' additive_expression ')'
-
- unary_expression =
- basic_expression
-
- multiplicative_expression =
- unary_expression ( ( '*' unary_expression )* |
- ( '/' unary_expression )* )
-
- additive_expression =
- multiplicative_expression ( ( '+' multiplicative_expression )* |
- ( '-' multiplicative_expression )* )
-
- */
-class ExpressionGrammar : public ::boost::spirit::grammar< ExpressionGrammar >
-{
-public:
- /** Create an arithmetic expression grammar
-
- @param rParserContext
- Contains context info for the parser
- */
- ExpressionGrammar( const ParserContextSharedPtr& rParserContext ) :
- mpParserContext( rParserContext )
- {
- }
-
- template< typename ScannerT > class definition
- {
- public:
- // grammar definition
- definition( const ExpressionGrammar& self )
- {
- using ::boost::spirit::str_p;
- using ::boost::spirit::space_p;
- using ::boost::spirit::range_p;
- using ::boost::spirit::lexeme_d;
- using ::boost::spirit::real_parser;
- using ::boost::spirit::chseq_p;
- using ::boost::spirit::ch_p;
- using ::boost::spirit::int_p;
- using ::boost::spirit::as_lower_d;
- using ::boost::spirit::strlit;
- using ::boost::spirit::inhibit_case;
-
-
- typedef inhibit_case<strlit<> > token_t;
- token_t COLUMN = as_lower_d[ "column" ];
- token_t OR_ = as_lower_d[ "or" ];
- token_t AND_ = as_lower_d[ "and" ];
-
- integer =
- int_p
- [IntConstantFunctor(self.getContext())];
-
- argument =
- integer
- | lexeme_d[ +( range_p('a','z') | range_p('A','Z') | range_p('0','9') ) ]
- [ ConstantFunctor(self.getContext()) ]
- ;
-
- unaryFunction =
- (COLUMN >> '(' >> integer >> ')' )
- [ UnaryFunctionFunctor( UNARY_FUNC_COLUMN, self.getContext()) ]
- ;
-
- assignment =
- unaryFunction >> ch_p('=') >> argument
- [ BinaryFunctionFunctor( ENUM_FUNC_EQUATION, self.getContext()) ]
- ;
-
- andExpression =
- assignment
- | ( '(' >> orExpression >> ')' )
- | ( assignment >> AND_ >> assignment ) [ BinaryFunctionFunctor( ENUM_FUNC_AND, self.getContext()) ]
- ;
-
- orExpression =
- andExpression
- | ( orExpression >> OR_ >> andExpression ) [ BinaryFunctionFunctor( ENUM_FUNC_OR, self.getContext()) ]
- ;
-
- basicExpression =
- orExpression
- ;
-
- BOOST_SPIRIT_DEBUG_RULE(basicExpression);
- BOOST_SPIRIT_DEBUG_RULE(unaryFunction);
- BOOST_SPIRIT_DEBUG_RULE(assignment);
- BOOST_SPIRIT_DEBUG_RULE(argument);
- BOOST_SPIRIT_DEBUG_RULE(integer);
- BOOST_SPIRIT_DEBUG_RULE(orExpression);
- BOOST_SPIRIT_DEBUG_RULE(andExpression);
- }
-
- const ::boost::spirit::rule< ScannerT >& start() const
- {
- return basicExpression;
- }
-
- private:
- // the constituents of the Spirit arithmetic expression grammar.
- // For the sake of readability, without 'ma' prefix.
- ::boost::spirit::rule< ScannerT > basicExpression;
- ::boost::spirit::rule< ScannerT > unaryFunction;
- ::boost::spirit::rule< ScannerT > assignment;
- ::boost::spirit::rule< ScannerT > integer,argument;
- ::boost::spirit::rule< ScannerT > orExpression,andExpression;
- };
-
- const ParserContextSharedPtr& getContext() const
- {
- return mpParserContext;
- }
-
-private:
- ParserContextSharedPtr mpParserContext; // might get modified during parsing
-};
-
-#ifdef BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE
-const ParserContextSharedPtr& getParserContext()
-{
- static ParserContextSharedPtr lcl_parserContext( new ParserContext() );
-
- // clear node stack (since we reuse the static object, that's
- // the whole point here)
- while( !lcl_parserContext->maOperandStack.empty() )
- lcl_parserContext->maOperandStack.pop();
-
- return lcl_parserContext;
-}
-#endif
-}
-
-ExpressionNodeSharedPtr FunctionParser::parseFunction( const ::rtl::OUString& _sFunction)
-{
- // TODO(Q1): Check if a combination of the RTL_UNICODETOTEXT_FLAGS_*
- // gives better conversion robustness here (we might want to map space
- // etc. to ASCII space here)
- const ::rtl::OString& rAsciiFunction(
- rtl::OUStringToOString( _sFunction, RTL_TEXTENCODING_ASCII_US ) );
-
- StringIteratorT aStart( rAsciiFunction.getStr() );
- StringIteratorT aEnd( rAsciiFunction.getStr()+rAsciiFunction.getLength() );
-
- ParserContextSharedPtr pContext;
-
-#ifdef BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE
- // static parser context, because the actual
- // Spirit parser is also a static object
- pContext = getParserContext();
-#else
- pContext.reset( new ParserContext() );
-#endif
-
- ExpressionGrammar aExpressionGrammer( pContext );
-
- const ::boost::spirit::parse_info<StringIteratorT> aParseInfo(
- ::boost::spirit::parse( aStart,
- aEnd,
- aExpressionGrammer,
- ::boost::spirit::space_p ) );
-
- OSL_DEBUG_ONLY(::std::cout.flush()); // needed to keep stdout and cout in sync
-
- // input fully congested by the parser?
- if( !aParseInfo.full )
- throw ParseError( "RowFunctionParser::parseFunction(): string not fully parseable" );
-
- // parser's state stack now must contain exactly _one_ ExpressionNode,
- // which represents our formula.
- if( pContext->maOperandStack.size() != 1 )
- throw ParseError( "RowFunctionParser::parseFunction(): incomplete or empty expression" );
-
- return pContext->maOperandStack.top();
-}
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TColumnsHelper.cxx b/connectivity/source/commontools/TColumnsHelper.cxx
deleted file mode 100644
index 20e6c6b2ac..0000000000
--- a/connectivity/source/commontools/TColumnsHelper.cxx
+++ /dev/null
@@ -1,227 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/TColumnsHelper.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
-#include <comphelper/types.hxx>
-#include "connectivity/dbtools.hxx"
-#include "TConnection.hxx"
-#include "connectivity/TTableHelper.hxx"
-#include <comphelper/property.hxx>
-
-using namespace ::comphelper;
-
-
-using namespace connectivity::sdbcx;
-using namespace connectivity;
-using namespace dbtools;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-namespace connectivity
-{
- class OColumnsHelperImpl
- {
- public:
- OColumnsHelperImpl(sal_Bool _bCase)
- : m_aColumnInfo(_bCase)
- {
- }
- ColumnInformationMap m_aColumnInfo;
- };
-}
-
-OColumnsHelper::OColumnsHelper( ::cppu::OWeakObject& _rParent
- ,sal_Bool _bCase
- ,::osl::Mutex& _rMutex
- ,const TStringVector &_rVector
- ,sal_Bool _bUseHardRef
- ) : OCollection(_rParent,_bCase,_rMutex,_rVector,sal_False,_bUseHardRef)
- ,m_pImpl(NULL)
- ,m_pTable(NULL)
-{
-}
-// -----------------------------------------------------------------------------
-OColumnsHelper::~OColumnsHelper()
-{
- delete m_pImpl;
- m_pImpl = NULL;
-}
-// -----------------------------------------------------------------------------
-
-sdbcx::ObjectType OColumnsHelper::createObject(const ::rtl::OUString& _rName)
-{
- OSL_ENSURE(m_pTable,"NO Table set. Error!");
- Reference<XConnection> xConnection = m_pTable->getConnection();
-
- if ( !m_pImpl )
- m_pImpl = new OColumnsHelperImpl(isCaseSensitive());
-
- sal_Bool bQueryInfo = sal_True;
- sal_Bool bAutoIncrement = sal_False;
- sal_Bool bIsCurrency = sal_False;
- sal_Int32 nDataType = DataType::OTHER;
-
- ColumnInformationMap::iterator aFind = m_pImpl->m_aColumnInfo.find(_rName);
- if ( aFind == m_pImpl->m_aColumnInfo.end() ) // we have to fill it
- {
- ::rtl::OUString sComposedName = ::dbtools::composeTableNameForSelect( xConnection, m_pTable );
- collectColumnInformation(xConnection,sComposedName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")) ,m_pImpl->m_aColumnInfo);
- aFind = m_pImpl->m_aColumnInfo.find(_rName);
- }
- if ( aFind != m_pImpl->m_aColumnInfo.end() )
- {
- bQueryInfo = sal_False;
- bAutoIncrement = aFind->second.first.first;
- bIsCurrency = aFind->second.first.second;
- nDataType = aFind->second.second;
- } // if ( aFind != m_pImpl->m_aColumnInfo.end() )
-
- sdbcx::ObjectType xRet;
- const ColumnDesc* pColDesc = m_pTable->getColumnDescription(_rName);
- if ( pColDesc )
- {
- Reference<XPropertySet> xPr = m_pTable;
- const Reference<XNameAccess> xPrimaryKeyColumns = getPrimaryKeyColumns_throw(xPr);
- sal_Int32 nField11 = pColDesc->nField11;
- if ( nField11 != ColumnValue::NO_NULLS && xPrimaryKeyColumns.is() && xPrimaryKeyColumns->hasByName(_rName) )
- {
- nField11 = ColumnValue::NO_NULLS;
- } // if ( xKeys.is() )
- connectivity::sdbcx::OColumn* pRet = new connectivity::sdbcx::OColumn(_rName,
- pColDesc->aField6,
- pColDesc->sField13,
- pColDesc->sField12,
- nField11,
- pColDesc->nField7,
- pColDesc->nField9,
- pColDesc->nField5,
- bAutoIncrement,
- sal_False,
- bIsCurrency,
- isCaseSensitive());
-
- xRet = pRet;
- }
- else
- {
-
- xRet.set(::dbtools::createSDBCXColumn( m_pTable,
- xConnection,
- _rName,
- isCaseSensitive(),
- bQueryInfo,
- bAutoIncrement,
- bIsCurrency,
- nDataType),UNO_QUERY);
- }
- return xRet;
-}
-
-// -------------------------------------------------------------------------
-void OColumnsHelper::impl_refresh() throw(RuntimeException)
-{
- if ( m_pTable )
- {
- m_pImpl->m_aColumnInfo.clear();
- m_pTable->refreshColumns();
- }
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OColumnsHelper::createDescriptor()
-{
- return new OColumn(sal_True);
-}
-// -----------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OColumnsHelper::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- ::osl::MutexGuard aGuard(m_rMutex);
- OSL_ENSURE(m_pTable,"OColumnsHelper::appendByDescriptor: Table is null!");
- if ( !m_pTable || m_pTable->isNew() )
- return cloneDescriptor( descriptor );
-
- Reference<XDatabaseMetaData> xMetaData = m_pTable->getConnection()->getMetaData();
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "ALTER TABLE " ));
- ::rtl::OUString aQuote = xMetaData->getIdentifierQuoteString( );
-
- aSql += ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::eInTableDefinitions, false, false, true );
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ADD "));
- aSql += ::dbtools::createStandardColumnPart(descriptor,m_pTable->getConnection(),NULL,m_pTable->getTypeCreatePattern());
-
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OColumnsHelper::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- OSL_ENSURE(m_pTable,"OColumnsHelper::dropByName: Table is null!");
- if ( m_pTable && !m_pTable->isNew() )
- {
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "ALTER TABLE " ));
- Reference<XDatabaseMetaData> xMetaData = m_pTable->getConnection()->getMetaData();
- ::rtl::OUString aQuote = xMetaData->getIdentifierQuoteString( );
-
- aSql += ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::eInTableDefinitions, false, false, true );
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP "));
- aSql += ::dbtools::quoteName( aQuote,_sElementName);
-
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TConnection.cxx b/connectivity/source/commontools/TConnection.cxx
deleted file mode 100644
index 497cacaf3d..0000000000
--- a/connectivity/source/commontools/TConnection.cxx
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "TConnection.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/types.hxx>
-#include <comphelper/officeresourcebundle.hxx>
-#include <connectivity/dbexception.hxx>
-
-using namespace connectivity;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::beans;
-using namespace ::osl;
-
-//------------------------------------------------------------------------------
-OMetaConnection::OMetaConnection()
- : OMetaConnection_BASE(m_aMutex)
- , m_nTextEncoding(RTL_TEXTENCODING_MS_1252)
-{
-}
-//------------------------------------------------------------------------------
-void OMetaConnection::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- m_xMetaData = WeakReference< XDatabaseMetaData>();
- for (OWeakRefArray::iterator i = m_aStatements.begin(); m_aStatements.end() != i; ++i)
- {
- try
- {
- Reference< XInterface > xStatement( i->get() );
- ::comphelper::disposeComponent( xStatement );
- }
- catch (const DisposedException&)
- {
- }
- }
- m_aStatements.clear();
-}
-//XUnoTunnel
-sal_Int64 SAL_CALL OMetaConnection::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw (::com::sun::star::uno::RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : (sal_Int64)0;
-}
-// -----------------------------------------------------------------------------
-Sequence< sal_Int8 > OMetaConnection::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-// -----------------------------------------------------------------------------
-::dbtools::OPropertyMap& OMetaConnection::getPropMap()
-{
- static ::dbtools::OPropertyMap s_aPropertyNameMap;
- return s_aPropertyNameMap;
-}
-// -----------------------------------------------------------------------------
-void OMetaConnection::throwGenericSQLException( sal_uInt16 _nErrorResourceId,const Reference< XInterface>& _xContext )
-{
- ::rtl::OUString sErrorMessage;
- if ( _nErrorResourceId )
- sErrorMessage = m_aResources.getResourceString( _nErrorResourceId );
- Reference< XInterface> xContext = _xContext;
- if ( !xContext.is() )
- xContext = *this;
- ::dbtools::throwGenericSQLException( sErrorMessage, xContext);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
deleted file mode 100644
index 407cdc8fb0..0000000000
--- a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
+++ /dev/null
@@ -1,337 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "TDatabaseMetaDataBase.hxx"
-#include "RowFunctionParser.hxx"
-
-#include <comphelper/sequenceashashmap.hxx>
-#include <comphelper/evtlistenerhlp.hxx>
-#include <com/sun/star/lang/XComponent.hpp>
-#include "resource/sharedresources.hxx"
-#include "resource/common_res.hrc"
-#include <connectivity/dbexception.hxx>
-#include <sal/macros.h>
-
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace comphelper;
-using namespace connectivity;
-
-
-ODatabaseMetaDataBase::ODatabaseMetaDataBase(const Reference< XConnection >& _rxConnection,const Sequence< PropertyValue >& _rInfo)
- : m_aConnectionInfo(_rInfo)
- ,m_isCatalogAtStart(false,sal_False)
- ,m_sCatalogSeparator(false,::rtl::OUString())
- ,m_sIdentifierQuoteString(false,::rtl::OUString())
- ,m_supportsCatalogsInTableDefinitions(false,sal_False)
- ,m_supportsSchemasInTableDefinitions(false,sal_False)
- ,m_supportsCatalogsInDataManipulation(false,sal_False)
- ,m_supportsSchemasInDataManipulation(false,sal_False)
- ,m_supportsMixedCaseQuotedIdentifiers(false,sal_False)
- ,m_supportsAlterTableWithAddColumn(false,sal_False)
- ,m_supportsAlterTableWithDropColumn(false,sal_False)
- ,m_MaxStatements(false,0)
- ,m_MaxTablesInSelect(false,0)
- ,m_storesMixedCaseQuotedIdentifiers(false,sal_False)
- , m_xConnection(_rxConnection)
-{
- osl_incrementInterlockedCount( &m_refCount );
- {
- m_xListenerHelper = new OEventListenerHelper(this);
- Reference<XComponent> xCom(m_xConnection,UNO_QUERY);
- if(xCom.is())
- xCom->addEventListener(m_xListenerHelper);
- }
- osl_decrementInterlockedCount( &m_refCount );
-}
-// -------------------------------------------------------------------------
-ODatabaseMetaDataBase::~ODatabaseMetaDataBase()
-{
-}
-
-// -----------------------------------------------------------------------------
-Sequence< PropertyValue > SAL_CALL ODatabaseMetaDataBase::getConnectionInfo( ) throw (RuntimeException)
-{
- return m_aConnectionInfo;
-}
-
-// -----------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataBase::disposing( const EventObject& /*Source*/ ) throw(RuntimeException)
-{
- // cut off all references to the connection
-m_xConnection.clear();
-m_xListenerHelper.clear();
-}
-// -----------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( m_aTypeInfoRows.empty() )
- {
- Reference< XResultSet > xRet = impl_getTypeInfo_throw();
- Reference< XRow > xRow(xRet,UNO_QUERY);
- ::comphelper::SequenceAsHashMap aMap(m_aConnectionInfo);
- Sequence< Any > aTypeInfoSettings;
- aTypeInfoSettings = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TypeInfoSettings")),aTypeInfoSettings);
-
- if ( xRow.is() )
- {
- static sal_Int32 pTypes[] = {
- DataType::VARCHAR
- ,DataType::INTEGER
- ,DataType::INTEGER
- ,DataType::VARCHAR
- ,DataType::VARCHAR
- ,DataType::VARCHAR
- ,DataType::INTEGER
- ,DataType::BOOLEAN
- ,DataType::INTEGER
- ,DataType::BOOLEAN
- ,DataType::BOOLEAN
- ,DataType::BOOLEAN
- ,DataType::VARCHAR
- ,DataType::INTEGER
- ,DataType::INTEGER
- ,DataType::INTEGER
- ,DataType::INTEGER
- ,DataType::INTEGER
- };
- ::std::vector<ExpressionNodeSharedPtr> aConditions;
- if ( aTypeInfoSettings.getLength() > 1 && ((aTypeInfoSettings.getLength() % 2) == 0) )
- {
- const Any* pIter = aTypeInfoSettings.getConstArray();
- const Any* pEnd = pIter + aTypeInfoSettings.getLength();
- try
- {
- for(;pIter != pEnd;++pIter)
- aConditions.push_back(FunctionParser::parseFunction(::comphelper::getString(*pIter)));
- }
- catch(ParseError&)
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(STR_FORMULA_WRONG));
- ::dbtools::throwGenericSQLException(sError,*this);
- }
- }
-
- ::connectivity::ODatabaseMetaDataResultSet::ORows aTypeInfoRows;
- while( xRet->next() )
- {
- ::connectivity::ODatabaseMetaDataResultSet::ORow aRow;
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- sal_Int32* pType = pTypes;
- for (sal_Int32 i = 1; i <= sal_Int32(SAL_N_ELEMENTS(pTypes)); ++i,++pType)
- {
- ORowSetValue aValue;
- aValue.fill(i,*pType,xRow);
- aRow.push_back(new ORowSetValueDecorator(aValue));
- }
-
- ::std::vector<ExpressionNodeSharedPtr>::iterator aIter = aConditions.begin();
- ::std::vector<ExpressionNodeSharedPtr>::iterator aEnd = aConditions.end();
- for (; aIter != aEnd; ++aIter)
- {
- if ( (*aIter)->evaluate(aRow)->getValue().getBool() )
- {
- ++aIter;
- (*aIter)->fill(aRow);
- }
- else
- ++aIter;
- }
- aTypeInfoRows.push_back(aRow);
- }
- m_aTypeInfoRows = aTypeInfoRows;
- }
- }
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
- Reference< XResultSet > xRet = pResult;
- pResult->setRows(m_aTypeInfoRows);
- return xRet;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getExportedKeys(
- const Any& /*catalog*/, const ::rtl::OUString& /*schema*/, const ::rtl::OUString& /*table*/ ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eExportedKeys );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getImportedKeys(
- const Any& /*catalog*/, const ::rtl::OUString& /*schema*/, const ::rtl::OUString& /*table*/ ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eImportedKeys );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getPrimaryKeys(
- const Any& /*catalog*/, const ::rtl::OUString& /*schema*/, const ::rtl::OUString& /*table*/ ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::ePrimaryKeys );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getIndexInfo(
- const Any& /*catalog*/, const ::rtl::OUString& /*schema*/, const ::rtl::OUString& /*table*/,
- sal_Bool /*unique*/, sal_Bool /*approximate*/ ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eIndexInfo );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getBestRowIdentifier(
- const Any& /*catalog*/, const ::rtl::OUString& /*schema*/, const ::rtl::OUString& /*table*/, sal_Int32 /*scope*/,
- sal_Bool /*nullable*/ ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eBestRowIdentifier );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getCrossReference(
- const Any& /*primaryCatalog*/, const ::rtl::OUString& /*primarySchema*/,
- const ::rtl::OUString& /*primaryTable*/, const Any& /*foreignCatalog*/,
- const ::rtl::OUString& /*foreignSchema*/, const ::rtl::OUString& /*foreignTable*/ ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eCrossReference );
-}
-// -------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL ODatabaseMetaDataBase::getConnection( ) throw(SQLException, RuntimeException)
-{
- return m_xConnection;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getProcedureColumns(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/,
- const ::rtl::OUString& /*procedureNamePattern*/, const ::rtl::OUString& /*columnNamePattern*/ ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eProcedureColumns );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getProcedures(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/,
- const ::rtl::OUString& /*procedureNamePattern*/ ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eProcedures );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getVersionColumns(
- const Any& /*catalog*/, const ::rtl::OUString& /*schema*/, const ::rtl::OUString& /*table*/ ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eVersionColumns );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getSchemas( ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eSchemas );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getColumnPrivileges(
- const Any& /*catalog*/, const ::rtl::OUString& /*schema*/, const ::rtl::OUString& /*table*/,
- const ::rtl::OUString& /*columnNamePattern*/ ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eColumnPrivileges );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTablePrivileges(
- const Any& /*catalog*/, const ::rtl::OUString& /*schema*/, const ::rtl::OUString& /*table*/) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getCatalogs( ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eCatalogs );
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaDataBase::getIdentifierQuoteString( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_sIdentifierQuoteString,::std::mem_fun_t< ::rtl::OUString ,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_getIdentifierQuoteString_throw));
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataBase::isCatalogAtStart( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_isCatalogAtStart,::std::mem_fun_t< sal_Bool,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_isCatalogAtStart_throw));
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaDataBase::getCatalogSeparator( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_sCatalogSeparator,::std::mem_fun_t< ::rtl::OUString,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_getCatalogSeparator_throw));
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataBase::supportsCatalogsInTableDefinitions( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_supportsCatalogsInTableDefinitions,::std::mem_fun_t< sal_Bool,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_supportsCatalogsInTableDefinitions_throw));
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataBase::supportsSchemasInTableDefinitions( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_supportsSchemasInTableDefinitions,::std::mem_fun_t< sal_Bool,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_supportsSchemasInTableDefinitions_throw));
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataBase::supportsCatalogsInDataManipulation( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_supportsCatalogsInDataManipulation,::std::mem_fun_t< sal_Bool,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_supportsCatalogsInDataManipulation_throw));
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataBase::supportsSchemasInDataManipulation( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_supportsSchemasInDataManipulation,::std::mem_fun_t< sal_Bool,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_supportsSchemasInDataManipulation_throw));
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataBase::supportsMixedCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_supportsMixedCaseQuotedIdentifiers,::std::mem_fun_t< sal_Bool,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_supportsMixedCaseQuotedIdentifiers_throw));
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataBase::supportsAlterTableWithAddColumn( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_supportsAlterTableWithAddColumn,::std::mem_fun_t< sal_Bool,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_supportsAlterTableWithAddColumn_throw));
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataBase::supportsAlterTableWithDropColumn( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_supportsAlterTableWithDropColumn,::std::mem_fun_t< sal_Bool,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_supportsAlterTableWithDropColumn_throw));
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaDataBase::getMaxStatements( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_MaxStatements,::std::mem_fun_t< sal_Int32,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_getMaxStatements_throw));
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaDataBase::getMaxTablesInSelect( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_MaxTablesInSelect,::std::mem_fun_t< sal_Int32,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_getMaxTablesInSelect_throw));
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataBase::storesMixedCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return callImplMethod(m_storesMixedCaseQuotedIdentifiers,::std::mem_fun_t< sal_Bool,ODatabaseMetaDataBase>(&ODatabaseMetaDataBase::impl_storesMixedCaseQuotedIdentifiers_throw));
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TIndex.cxx b/connectivity/source/commontools/TIndex.cxx
deleted file mode 100644
index 91cf307320..0000000000
--- a/connectivity/source/commontools/TIndex.cxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/TIndex.hxx"
-#include "connectivity/TIndexColumns.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "connectivity/TTableHelper.hxx"
-#include "TConnection.hxx"
-
-using namespace connectivity;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -------------------------------------------------------------------------
-OIndexHelper::OIndexHelper( OTableHelper* _pTable) : connectivity::sdbcx::OIndex(sal_True)
- , m_pTable(_pTable)
-{
- construct();
- ::std::vector< ::rtl::OUString> aVector;
- m_pColumns = new OIndexColumns(this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-OIndexHelper::OIndexHelper( OTableHelper* _pTable,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Catalog,
- sal_Bool _isUnique,
- sal_Bool _isPrimaryKeyIndex,
- sal_Bool _isClustered
- ) : connectivity::sdbcx::OIndex(_Name,
- _Catalog,
- _isUnique,
- _isPrimaryKeyIndex,
- _isClustered,sal_True)
- ,m_pTable(_pTable)
-{
- construct();
- refreshColumns();
-}
-// -------------------------------------------------------------------------
-
-void OIndexHelper::refreshColumns()
-{
- if ( !m_pTable )
- return;
-
- ::std::vector< ::rtl::OUString> aVector;
- if ( !isNew() )
- {
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- ::rtl::OUString aSchema,aTable;
- m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
- m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
-
- Reference< XResultSet > xResult = m_pTable->getMetaData()->getIndexInfo(
- m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)),
- aSchema,aTable,sal_False,sal_False);
-
- if ( xResult.is() )
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- ::rtl::OUString aColName;
- while( xResult->next() )
- {
- if ( xRow->getString(6) == m_Name )
- {
- aColName = xRow->getString(9);
- if ( !xRow->wasNull() )
- aVector.push_back(aColName);
- }
- }
- }
- }
- if(m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new OIndexColumns(this,m_aMutex,aVector);
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TIndexColumns.cxx b/connectivity/source/commontools/TIndexColumns.cxx
deleted file mode 100644
index a0ce77e192..0000000000
--- a/connectivity/source/commontools/TIndexColumns.cxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/TIndexColumns.hxx"
-#include "connectivity/sdbcx/VIndexColumn.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <comphelper/property.hxx>
-#include "connectivity/TIndex.hxx"
-#include "connectivity/TTableHelper.hxx"
-#include "TConnection.hxx"
-
-using namespace connectivity;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -------------------------------------------------------------------------
-OIndexColumns::OIndexColumns( OIndexHelper* _pIndex,
- ::osl::Mutex& _rMutex,
- const ::std::vector< ::rtl::OUString> &_rVector)
- : connectivity::sdbcx::OCollection(*_pIndex,sal_True,_rMutex,_rVector)
- ,m_pIndex(_pIndex)
-{
-}
-// -------------------------------------------------------------------------
-sdbcx::ObjectType OIndexColumns::createObject(const ::rtl::OUString& _rName)
-{
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- ::rtl::OUString aSchema,aTable;
- m_pIndex->getTable()->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
- m_pIndex->getTable()->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
-
- Reference< XResultSet > xResult = m_pIndex->getTable()->getConnection()->getMetaData()->getIndexInfo(
- m_pIndex->getTable()->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)),
- aSchema,aTable,sal_False,sal_False);
-
- sal_Bool bAsc = sal_True;
- if ( xResult.is() )
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- ::rtl::OUString aD(RTL_CONSTASCII_USTRINGPARAM("D"));
- while( xResult->next() )
- {
- if(xRow->getString(9) == _rName)
- bAsc = xRow->getString(10) != aD;
- }
- }
-
- xResult = m_pIndex->getTable()->getConnection()->getMetaData()->getColumns(
- m_pIndex->getTable()->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)),
- aSchema,aTable,_rName);
-
- sdbcx::ObjectType xRet;
- if ( xResult.is() )
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while( xResult->next() )
- {
- if ( xRow->getString(4) == _rName )
- {
- sal_Int32 nDataType = xRow->getInt(5);
- ::rtl::OUString aTypeName(xRow->getString(6));
- sal_Int32 nSize = xRow->getInt(7);
- sal_Int32 nDec = xRow->getInt(9);
- sal_Int32 nNull = xRow->getInt(11);
- ::rtl::OUString aColumnDef(xRow->getString(13));
-
- OIndexColumn* pRet = new OIndexColumn(bAsc,
- _rName,
- aTypeName,
- aColumnDef,
- nNull,
- nSize,
- nDec,
- nDataType,
- sal_False,sal_False,sal_False,sal_True);
- xRet = pRet;
- break;
- }
- }
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OIndexColumns::createDescriptor()
-{
- return new OIndexColumn(sal_True);
-}
-// -------------------------------------------------------------------------
-void OIndexColumns::impl_refresh() throw(RuntimeException)
-{
- m_pIndex->refreshColumns();
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx
deleted file mode 100644
index d1237bd789..0000000000
--- a/connectivity/source/commontools/TIndexes.cxx
+++ /dev/null
@@ -1,264 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/TIndexes.hxx"
-#include "connectivity/TIndex.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/IndexType.hpp>
-#include <connectivity/dbtools.hxx>
-#include "connectivity/TTableHelper.hxx"
-#include "TConnection.hxx"
-#include <comphelper/extract.hxx>
-#include <rtl/ustrbuf.hxx>
-using namespace connectivity;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace cppu;
-
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-// -----------------------------------------------------------------------------
-OIndexesHelper::OIndexesHelper(OTableHelper* _pTable,
- ::osl::Mutex& _rMutex,
- const ::std::vector< ::rtl::OUString> &_rVector
- )
- : OCollection(*_pTable,sal_True,_rMutex,_rVector)
- ,m_pTable(_pTable)
-{
-}
-// -----------------------------------------------------------------------------
-
-sdbcx::ObjectType OIndexesHelper::createObject(const ::rtl::OUString& _rName)
-{
- Reference< XConnection> xConnection = m_pTable->getConnection();
- if ( !xConnection.is() )
- return NULL;
-
- sdbcx::ObjectType xRet;
- ::rtl::OUString aName,aQualifier;
- sal_Int32 nLen = _rName.indexOf('.');
- if ( nLen != -1 )
- {
- aQualifier = _rName.copy(0,nLen);
- aName = _rName.copy(nLen+1);
- }
- else
- aName = _rName;
-
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- ::rtl::OUString aSchema,aTable;
- m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
- m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
-
- Any aCatalog = m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME));
- Reference< XResultSet > xResult = m_pTable->getMetaData()->getIndexInfo(aCatalog,aSchema,aTable,sal_False,sal_False);
-
- if ( xResult.is() )
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while( xResult->next() )
- {
- sal_Bool bUnique = !xRow->getBoolean(4);
- if((!aQualifier.getLength() || xRow->getString(5) == aQualifier ) && xRow->getString(6) == aName)
- {
- sal_Int32 nClustered = xRow->getShort(7);
- sal_Bool bPrimarKeyIndex = sal_False;
- xRow.clear();
- xResult.clear();
- try
- {
- xResult = m_pTable->getMetaData()->getPrimaryKeys(aCatalog,aSchema,aTable);
- xRow.set(xResult,UNO_QUERY);
-
- if ( xRow.is() && xResult->next() ) // there can be only one primary key
- {
- bPrimarKeyIndex = xRow->getString(6) == aName;
- }
- }
- catch(const Exception&)
- {
- }
- OIndexHelper* pRet = new OIndexHelper(m_pTable,aName,aQualifier,bUnique,
- bPrimarKeyIndex,
- nClustered == IndexType::CLUSTERED);
- xRet = pRet;
- break;
- }
- }
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void OIndexesHelper::impl_refresh() throw(RuntimeException)
-{
- m_pTable->refreshIndexes();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OIndexesHelper::createDescriptor()
-{
- return new OIndexHelper(m_pTable);
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OIndexesHelper::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- Reference< XConnection> xConnection = m_pTable->getConnection();
- if ( !xConnection.is() )
- return NULL;
- if ( m_pTable->isNew() )
- return cloneDescriptor( descriptor );
-
- if ( m_pTable->getIndexService().is() )
- {
- m_pTable->getIndexService()->addIndex(m_pTable,descriptor);
- }
- else
- {
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- ::rtl::OUStringBuffer aSql( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CREATE ")));
- ::rtl::OUString aQuote = m_pTable->getMetaData()->getIdentifierQuoteString( );
- ::rtl::OUString aDot( RTL_CONSTASCII_USTRINGPARAM( "." ));
-
- if(comphelper::getBOOL(descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISUNIQUE))))
- aSql.appendAscii("UNIQUE ");
- aSql.appendAscii("INDEX ");
-
-
- ::rtl::OUString aCatalog,aSchema,aTable;
- dbtools::qualifiedNameComponents(m_pTable->getMetaData(),m_pTable->getName(),aCatalog,aSchema,aTable,::dbtools::eInDataManipulation);
- ::rtl::OUString aComposedName;
-
- aComposedName = dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable,sal_True,::dbtools::eInIndexDefinitions);
- if ( _rForName.getLength() )
- {
- aSql.append( ::dbtools::quoteName( aQuote, _rForName ) );
- aSql.appendAscii(" ON ");
- aSql.append(aComposedName);
- aSql.appendAscii(" ( ");
-
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
- sal_Bool bAddIndexAppendix = ::dbtools::getBooleanDataSourceSetting( m_pTable->getConnection(), "AddIndexAppendix" );
- sal_Int32 nCount = xColumns->getCount();
- for(sal_Int32 i = 0 ; i < nCount; ++i)
- {
- xColProp.set(xColumns->getByIndex(i),UNO_QUERY);
- aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))));
-
- if ( bAddIndexAppendix )
- {
-
- aSql.appendAscii(any2bool(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISASCENDING)))
- ?
- " ASC"
- :
- " DESC");
- }
- aSql.appendAscii(",");
- }
- aSql.setCharAt(aSql.getLength()-1,')');
- }
- else
- {
- aSql.append(aComposedName);
-
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
- if(xColumns->getCount() != 1)
- throw SQLException();
-
- xColumns->getByIndex(0) >>= xColProp;
-
- aSql.append(aDot);
- aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))));
- }
-
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- ::rtl::OUString sSql = aSql.makeStringAndClear();
- xStmt->execute(sSql);
- ::comphelper::disposeComponent(xStmt);
- }
- }
-
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OIndexesHelper::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- Reference< XConnection> xConnection = m_pTable->getConnection();
- if( xConnection.is() && !m_pTable->isNew())
- {
- if ( m_pTable->getIndexService().is() )
- {
- m_pTable->getIndexService()->dropIndex(m_pTable,_sElementName);
- }
- else
- {
- ::rtl::OUString aName,aSchema;
- sal_Int32 nLen = _sElementName.indexOf('.');
- if(nLen != -1)
- aSchema = _sElementName.copy(0,nLen);
- aName = _sElementName.copy(nLen+1);
-
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "DROP INDEX " ));
-
- ::rtl::OUString aComposedName = dbtools::composeTableName( m_pTable->getMetaData(), m_pTable, ::dbtools::eInIndexDefinitions, false, false, true );
- ::rtl::OUString sIndexName,sTemp;
- sIndexName = dbtools::composeTableName( m_pTable->getMetaData(), sTemp, aSchema, aName, sal_True, ::dbtools::eInIndexDefinitions );
-
- aSql += sIndexName
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "))
- + aComposedName;
-
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TKey.cxx b/connectivity/source/commontools/TKey.cxx
deleted file mode 100644
index 93f46ee661..0000000000
--- a/connectivity/source/commontools/TKey.cxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include "connectivity/TKey.hxx"
-#include "connectivity/TKeyColumns.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "TConnection.hxx"
-#include "connectivity/TTableHelper.hxx"
-
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -------------------------------------------------------------------------
-OTableKeyHelper::OTableKeyHelper(OTableHelper* _pTable) : connectivity::sdbcx::OKey(sal_True)
- ,m_pTable(_pTable)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-OTableKeyHelper::OTableKeyHelper( OTableHelper* _pTable
- ,const ::rtl::OUString& _Name
- ,const sdbcx::TKeyProperties& _rProps
- ) : connectivity::sdbcx::OKey(_Name,_rProps,sal_True)
- ,m_pTable(_pTable)
-{
- construct();
- refreshColumns();
-}
-// -------------------------------------------------------------------------
-void OTableKeyHelper::refreshColumns()
-{
- if ( !m_pTable )
- return;
-
- ::std::vector< ::rtl::OUString> aVector;
- if ( !isNew() )
- {
- aVector = m_aProps->m_aKeyColumnNames;
- if ( aVector.empty() )
- {
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- ::rtl::OUString aSchema,aTable;
- m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
- m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
-
- if ( m_Name.getLength() ) // foreign key
- {
-
- Reference< XResultSet > xResult = m_pTable->getMetaData()->getImportedKeys(m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)),
- aSchema,aTable);
-
- if ( xResult.is() )
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while( xResult->next() )
- {
- ::rtl::OUString aForeignKeyColumn = xRow->getString(8);
- if(xRow->getString(12) == m_Name)
- aVector.push_back(aForeignKeyColumn);
- }
- }
- }
-
- if ( aVector.empty() )
- {
- const Reference< XResultSet > xResult = m_pTable->getMetaData()->getPrimaryKeys(m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)),
- aSchema,aTable);
-
- if ( xResult.is() )
- {
- const Reference< XRow > xRow(xResult,UNO_QUERY);
- while( xResult->next() )
- aVector.push_back(xRow->getString(4));
- } // if ( xResult.is() )
- }
- }
- }
-
-
- if ( m_pColumns )
- m_pColumns ->reFill(aVector);
- else
- m_pColumns = new OKeyColumnsHelper(this,m_aMutex,aVector);
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TKeyColumns.cxx b/connectivity/source/commontools/TKeyColumns.cxx
deleted file mode 100644
index 8dda6eae08..0000000000
--- a/connectivity/source/commontools/TKeyColumns.cxx
+++ /dev/null
@@ -1,146 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/TKeyColumns.hxx"
-#include "connectivity/sdbcx/VKeyColumn.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <comphelper/extract.hxx>
-#include <comphelper/property.hxx>
-#include "TConnection.hxx"
-#include "connectivity/TTableHelper.hxx"
-
-using namespace connectivity;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -------------------------------------------------------------------------
-OKeyColumnsHelper::OKeyColumnsHelper( OTableKeyHelper* _pKey,
- ::osl::Mutex& _rMutex,
- const ::std::vector< ::rtl::OUString> &_rVector)
- : connectivity::sdbcx::OCollection(*_pKey,sal_True,_rMutex,_rVector)
- ,m_pKey(_pKey)
-{
-}
-// -------------------------------------------------------------------------
-sdbcx::ObjectType OKeyColumnsHelper::createObject(const ::rtl::OUString& _rName)
-{
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- ::rtl::OUString aSchema,aTable;
- m_pKey->getTable()->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
- m_pKey->getTable()->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
-
- // frist get the related column to _rName
- Reference< XResultSet > xResult = m_pKey->getTable()->getMetaData()->getImportedKeys(
- m_pKey->getTable()->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)),aSchema,aTable);
-
- ::rtl::OUString aRefColumnName;
- if ( xResult.is() )
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- ::rtl::OUString aTemp;
- while(xResult->next())
- {
- aTemp = xRow->getString(4);
- if(xRow->getString(8) == _rName && m_pKey->getName() == xRow->getString(12))
- {
- aRefColumnName = aTemp;
- break;
- }
- }
- }
-
- sdbcx::ObjectType xRet;
-
- // now describe the column _rName and set his related column
- xResult = m_pKey->getTable()->getMetaData()->getColumns(
- m_pKey->getTable()->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)),aSchema,aTable,_rName);
-
- if ( xResult.is() )
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- if ( xResult->next() )
- {
- if ( xRow->getString(4) == _rName )
- {
- sal_Int32 nDataType = xRow->getInt(5);
- ::rtl::OUString aTypeName(xRow->getString(6));
- sal_Int32 nSize = xRow->getInt(7);
- sal_Int32 nDec = xRow->getInt(9);
- sal_Int32 nNull = xRow->getInt(11);
- ::rtl::OUString sColumnDef;
- try
- {
- sColumnDef = xRow->getString(13);
- }
- catch(const SQLException&)
- {
- // somethimes we get an error when asking for this param
- }
-
- OKeyColumn* pRet = new OKeyColumn(aRefColumnName,
- _rName,
- aTypeName,
- sColumnDef,
- nNull,
- nSize,
- nDec,
- nDataType,
- sal_False,
- sal_False,
- sal_False,
- isCaseSensitive());
- xRet = pRet;
- }
- }
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OKeyColumnsHelper::createDescriptor()
-{
- return new OKeyColumn(isCaseSensitive());
-}
-// -------------------------------------------------------------------------
-void OKeyColumnsHelper::impl_refresh() throw(::com::sun::star::uno::RuntimeException)
-{
- m_pKey->refreshColumns();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TKeys.cxx b/connectivity/source/commontools/TKeys.cxx
deleted file mode 100644
index 1bfd8d111d..0000000000
--- a/connectivity/source/commontools/TKeys.cxx
+++ /dev/null
@@ -1,323 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/TKeys.hxx"
-#include "connectivity/TKey.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include "connectivity/dbtools.hxx"
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include <comphelper/property.hxx>
-#include "TConnection.hxx"
-
-namespace connectivity
-{
-using namespace comphelper;
-using namespace connectivity::sdbcx;
-using namespace dbtools;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-
-
-OKeysHelper::OKeysHelper( OTableHelper* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector& _rVector
- ) : OKeys_BASE(*_pTable,sal_True,_rMutex,_rVector,sal_True)
- ,m_pTable(_pTable)
-{
-}
-// -------------------------------------------------------------------------
-sdbcx::ObjectType OKeysHelper::createObject(const ::rtl::OUString& _rName)
-{
- sdbcx::ObjectType xRet = NULL;
-
- if(_rName.getLength())
- {
- OTableKeyHelper* pRet = new OTableKeyHelper(m_pTable,_rName,m_pTable->getKeyProperties(_rName));
- xRet = pRet;
- }
-
- if(!xRet.is()) // we have a primary key with a system name
- {
- OTableKeyHelper* pRet = new OTableKeyHelper(m_pTable,_rName,m_pTable->getKeyProperties(_rName));
- xRet = pRet;
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void OKeysHelper::impl_refresh() throw(RuntimeException)
-{
- m_pTable->refreshKeys();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OKeysHelper::createDescriptor()
-{
- return new OTableKeyHelper(m_pTable);
-}
-// -----------------------------------------------------------------------------
-/** returns the keyrule string for the primary key
-*/
-::rtl::OUString getKeyRuleString(sal_Bool _bUpdate,sal_Int32 _nKeyRule)
-{
- const char* pKeyRule = NULL;
- switch ( _nKeyRule )
- {
- case KeyRule::CASCADE:
- pKeyRule = _bUpdate ? " ON UPDATE CASCADE " : " ON DELETE CASCADE ";
- break;
- case KeyRule::RESTRICT:
- pKeyRule = _bUpdate ? " ON UPDATE RESTRICT " : " ON DELETE RESTRICT ";
- break;
- case KeyRule::SET_NULL:
- pKeyRule = _bUpdate ? " ON UPDATE SET NULL " : " ON DELETE SET NULL ";
- break;
- case KeyRule::SET_DEFAULT:
- pKeyRule = _bUpdate ? " ON UPDATE SET DEFAULT " : " ON DELETE SET DEFAULT ";
- break;
- default:
- ;
- }
- ::rtl::OUString sRet;
- if ( pKeyRule )
- sRet = ::rtl::OUString::createFromAscii(pKeyRule);
- return sRet;
-}
-// -------------------------------------------------------------------------
-void OKeysHelper::cloneDescriptorColumns( const sdbcx::ObjectType& _rSourceDescriptor, const sdbcx::ObjectType& _rDestDescriptor )
-{
- Reference< XColumnsSupplier > xColSupp( _rSourceDescriptor, UNO_QUERY_THROW );
- Reference< XIndexAccess > xSourceCols( xColSupp->getColumns(), UNO_QUERY_THROW );
-
- xColSupp.set( _rDestDescriptor, UNO_QUERY_THROW );
- Reference< XAppend > xDestAppend( xColSupp->getColumns(), UNO_QUERY_THROW );
-
- sal_Int32 nCount = xSourceCols->getCount();
- for ( sal_Int32 i=0; i< nCount; ++i )
- {
- Reference< XPropertySet > xColProp( xSourceCols->getByIndex(i), UNO_QUERY );
- xDestAppend->appendByDescriptor( xColProp );
- }
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OKeysHelper::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- Reference< XConnection> xConnection = m_pTable->getConnection();
- if ( !xConnection.is() )
- return NULL;
- if ( m_pTable->isNew() )
- {
- Reference< XPropertySet > xNewDescriptor( cloneDescriptor( descriptor ) );
- cloneDescriptorColumns( descriptor, xNewDescriptor );
- return xNewDescriptor;
- }
-
- const ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- sal_Int32 nKeyType = getINT32(descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)));
- sal_Int32 nUpdateRule = 0, nDeleteRule = 0;
- ::rtl::OUString sReferencedName;
-
- if ( nKeyType == KeyType::FOREIGN )
- {
- descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_REFERENCEDTABLE)) >>= sReferencedName;
- descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_UPDATERULE)) >>= nUpdateRule;
- descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DELETERULE)) >>= nDeleteRule;
- }
-
- if ( m_pTable->getKeyService().is() )
- {
- m_pTable->getKeyService()->addKey(m_pTable,descriptor);
- }
- else
- {
- // if we're here, we belong to a table which is not new, i.e. already exists in the database.
- // In this case, really append the new index.
- ::rtl::OUStringBuffer aSql;
- aSql.appendAscii("ALTER TABLE ");
- ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString( );
- ::rtl::OUString aDot = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."));
-
- aSql.append(composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::eInTableDefinitions, false, false, true ));
- aSql.appendAscii(" ADD ");
-
- if ( nKeyType == KeyType::PRIMARY )
- {
- aSql.appendAscii(" PRIMARY KEY (");
- }
- else if ( nKeyType == KeyType::FOREIGN )
- {
- aSql.appendAscii(" FOREIGN KEY (");
- }
- else
- throw SQLException();
-
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
- for(sal_Int32 i = 0 ; i < xColumns->getCount() ; ++i)
- {
- if ( i > 0 )
- aSql.appendAscii(",");
- ::cppu::extractInterface(xColProp,xColumns->getByIndex(i));
- aSql.append( ::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))) );
-
- }
- aSql.appendAscii(")");
-
- if ( nKeyType == KeyType::FOREIGN )
- {
- aSql.appendAscii(" REFERENCES ");
- aSql.append(::dbtools::quoteTableName(m_pTable->getConnection()->getMetaData(),sReferencedName,::dbtools::eInTableDefinitions));
- aSql.appendAscii(" (");
-
- for(sal_Int32 i=0;i<xColumns->getCount();++i)
- {
- if ( i > 0 )
- aSql.appendAscii(",");
- xColumns->getByIndex(i) >>= xColProp;
- aSql.append(::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_RELATEDCOLUMN)))));
-
- }
- aSql.appendAscii(")");
- aSql.append(getKeyRuleString(sal_True ,nUpdateRule));
- aSql.append(getKeyRuleString(sal_False ,nDeleteRule));
- }
-
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- xStmt->execute(aSql.makeStringAndClear());
- }
- // find the name which the database gave the new key
- ::rtl::OUString sNewName( _rForName );
- try
- {
- ::rtl::OUString aSchema,aTable;
- m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
- m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
- Reference< XResultSet > xResult;
- sal_Int32 nColumn = 12;
- if ( nKeyType == KeyType::FOREIGN )
- xResult = m_pTable->getMetaData()->getImportedKeys( m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME))
- ,aSchema
- ,aTable);
- else
- {
- xResult = m_pTable->getMetaData()->getPrimaryKeys( m_pTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME))
- ,aSchema
- ,aTable);
- nColumn = 6;
- }
- if ( xResult.is() )
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while( xResult->next() )
- {
- ::rtl::OUString sName = xRow->getString(nColumn);
- if ( !m_pElements->exists(sName) ) // this name wasn't inserted yet so it must be te new one
- {
- descriptor->setPropertyValue( rPropMap.getNameByIndex( PROPERTY_ID_NAME ), makeAny( sName ) );
- sNewName = sName;
- break;
- }
- }
- ::comphelper::disposeComponent(xResult);
- }
- }
- catch(const SQLException&)
- {
- }
-
- m_pTable->addKey(sNewName,sdbcx::TKeyProperties(new sdbcx::KeyProperties(sReferencedName,nKeyType,nUpdateRule,nDeleteRule)));
-
- return createObject( sNewName );
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OKeysHelper::getDropForeignKey() const
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP CONSTRAINT "));
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OKeysHelper::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName)
-{
- Reference< XConnection> xConnection = m_pTable->getConnection();
- if ( xConnection.is() && !m_pTable->isNew() )
- {
- Reference<XPropertySet> xKey(getObject(_nPos),UNO_QUERY);
- if ( m_pTable->getKeyService().is() )
- {
- m_pTable->getKeyService()->dropKey(m_pTable,xKey);
- }
- else
- {
- ::rtl::OUStringBuffer aSql;
- aSql.appendAscii("ALTER TABLE ");
-
- aSql.append( composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::eInTableDefinitions, false, false, true ));
-
- sal_Int32 nKeyType = KeyType::PRIMARY;
- if ( xKey.is() )
- {
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- xKey->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= nKeyType;
- }
- if ( KeyType::PRIMARY == nKeyType )
- {
- aSql.appendAscii(" DROP PRIMARY KEY");
- }
- else
- {
- aSql.append(getDropForeignKey());
- const ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString();
- aSql.append( ::dbtools::quoteName( aQuote,_sElementName) );
- }
-
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql.makeStringAndClear());
- ::comphelper::disposeComponent(xStmt);
- }
- }
- }
-}
-// -----------------------------------------------------------------------------
-} // namespace connectivity
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TPrivilegesResultSet.cxx b/connectivity/source/commontools/TPrivilegesResultSet.cxx
deleted file mode 100644
index 4814cda9b0..0000000000
--- a/connectivity/source/commontools/TPrivilegesResultSet.cxx
+++ /dev/null
@@ -1,154 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "TPrivilegesResultSet.hxx"
-
-using namespace connectivity;
-//------------------------------------------------------------------------------
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-//------------------------------------------------------------------------------
-OResultSetPrivileges::OResultSetPrivileges( const Reference< XDatabaseMetaData>& _rxMeta
- , const Any& catalog
- , const ::rtl::OUString& schemaPattern
- , const ::rtl::OUString& tableNamePattern)
- : ODatabaseMetaDataResultSet(eTablePrivileges)
- , m_bResetValues(sal_True)
-{
- osl_incrementInterlockedCount( &m_refCount );
- {
- ::rtl::OUString sUserWorkingFor;
- Sequence< ::rtl::OUString > sTableTypes(3);
- // we want all catalogues, all schemas, all tables
- sTableTypes[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW"));
- sTableTypes[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
- sTableTypes[2] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")); // just to be sure to include anything else ....
- try
- {
- m_xTables = _rxMeta->getTables(catalog,schemaPattern,tableNamePattern,sTableTypes);
- m_xRow = Reference< XRow>(m_xTables,UNO_QUERY);
-
- sUserWorkingFor = _rxMeta->getUserName();
- }
- catch(Exception&)
- {
- }
-
- ODatabaseMetaDataResultSet::ORows aRows;
- static ODatabaseMetaDataResultSet::ORow aRow(8);
- aRow[5] = new ORowSetValueDecorator(sUserWorkingFor);
- aRow[6] = ODatabaseMetaDataResultSet::getSelectValue();
- aRow[7] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("YES")));
- aRows.push_back(aRow);
- aRow[6] = ODatabaseMetaDataResultSet::getInsertValue();
- aRows.push_back(aRow);
- aRow[6] = ODatabaseMetaDataResultSet::getDeleteValue();
- aRows.push_back(aRow);
- aRow[6] = ODatabaseMetaDataResultSet::getUpdateValue();
- aRows.push_back(aRow);
- aRow[6] = ODatabaseMetaDataResultSet::getCreateValue();
- aRows.push_back(aRow);
- aRow[6] = ODatabaseMetaDataResultSet::getReadValue();
- aRows.push_back(aRow);
- aRow[6] = ODatabaseMetaDataResultSet::getAlterValue();
- aRows.push_back(aRow);
- aRow[6] = ODatabaseMetaDataResultSet::getDropValue();
- aRows.push_back(aRow);
- aRow[6] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REFERENCE")));
- aRows.push_back(aRow);
-
- setRows(aRows);
- }
- osl_decrementInterlockedCount( &m_refCount );
-}
-//------------------------------------------------------------------------------
-const ORowSetValue& OResultSetPrivileges::getValue(sal_Int32 columnIndex)
-{
- switch(columnIndex)
- {
- case 1:
- case 2:
- case 3:
- if ( m_xRow.is() && m_bResetValues )
- {
- (*m_aRowsIter)[1] = new ORowSetValueDecorator(m_xRow->getString(1));
- if ( m_xRow->wasNull() )
- (*m_aRowsIter)[1]->setNull();
- (*m_aRowsIter)[2] = new ORowSetValueDecorator(m_xRow->getString(2));
- if ( m_xRow->wasNull() )
- (*m_aRowsIter)[2]->setNull();
- (*m_aRowsIter)[3] = new ORowSetValueDecorator(m_xRow->getString(3));
- if ( m_xRow->wasNull() )
- (*m_aRowsIter)[3]->setNull();
-
- m_bResetValues = sal_False;
- }
- }
- return ODatabaseMetaDataResultSet::getValue(columnIndex);
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OResultSetPrivileges::disposing(void)
-{
- ODatabaseMetaDataResultSet::disposing();
-m_xTables.clear();
-m_xRow.clear();
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSetPrivileges::next( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
-
- sal_Bool bReturn = sal_False;
- if ( m_xTables.is() )
- {
- if ( m_bBOF )
- {
- m_bResetValues = sal_True;
- if ( !m_xTables->next() )
- return sal_False;
- }
-
- bReturn = ODatabaseMetaDataResultSet::next();
- if ( !bReturn )
- {
- m_bBOF = sal_False;
- m_bResetValues = bReturn = m_xTables->next();
- }
- }
- return bReturn;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TSkipDeletedSet.cxx b/connectivity/source/commontools/TSkipDeletedSet.cxx
deleted file mode 100644
index 3457587c3f..0000000000
--- a/connectivity/source/commontools/TSkipDeletedSet.cxx
+++ /dev/null
@@ -1,286 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "TSkipDeletedSet.hxx"
-#include <osl/diagnose.h>
-#include <rtl/logfile.hxx>
-
-using namespace connectivity;
-// -----------------------------------------------------------------------------
-OSkipDeletedSet::OSkipDeletedSet(IResultSetHelper* _pHelper)
- : m_pHelper(_pHelper)
- ,m_bDeletedVisible(false)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "commontools", "Ocke.Janssen@sun.com", "OSkipDeletedSet::OSkipDeletedSet" );
- m_aBookmarksPositions.reserve(256);
-}
-// -----------------------------------------------------------------------------
-OSkipDeletedSet::~OSkipDeletedSet()
-{
- m_aBookmarksPositions.clear();
- //m_aBookmarks.clear();
-}
-// -----------------------------------------------------------------------------
-sal_Bool OSkipDeletedSet::skipDeleted(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "commontools", "Ocke.Janssen@sun.com", "OSkipDeletedSet::skipDeleted" );
- OSL_ENSURE(_eCursorPosition != IResultSetHelper::BOOKMARK,"OSkipDeletedSet::SkipDeleted can't be called for BOOKMARK");
-
- IResultSetHelper::Movement eDelPosition = _eCursorPosition;
- sal_Int32 nDelOffset = abs(_nOffset);
-
- switch (_eCursorPosition)
- {
- case IResultSetHelper::ABSOLUTE:
- return moveAbsolute(_nOffset,_bRetrieveData);
- case IResultSetHelper::FIRST: // set the movement when positioning failed
- eDelPosition = IResultSetHelper::NEXT;
- nDelOffset = 1;
- break;
- case IResultSetHelper::LAST:
- eDelPosition = IResultSetHelper::PRIOR; // lsat row is invalid so position before
- nDelOffset = 1;
- break;
- case IResultSetHelper::RELATIVE:
- eDelPosition = (_nOffset >= 0) ? IResultSetHelper::NEXT : IResultSetHelper::PRIOR;
- break;
- default:
- break;
- }
-
- sal_Bool bDone = sal_True;
- sal_Bool bDataFound = sal_False;
-
- if (_eCursorPosition == IResultSetHelper::LAST)
- {
- RTL_LOGFILE_CONTEXT_TRACE( aLogger, "OSkipDeletedSet::skipDeleted: last" );
- sal_Int32 nBookmark = 0;
- // first position on the last known row
- if ( m_aBookmarksPositions.empty() )
- {
- bDataFound = m_pHelper->move(IResultSetHelper::FIRST, 0, _bRetrieveData);
- if(bDataFound && (m_bDeletedVisible || !m_pHelper->isRowDeleted()))
- //m_aBookmarksPositions.push_back(m_aBookmarks.insert(TInt2IntMap::value_type(m_pHelper->getDriverPos(),m_aBookmarksPositions.size()+1)).first);
- m_aBookmarksPositions.push_back(m_pHelper->getDriverPos());
- }
- else
- {
- // I already have a bookmark so we can positioned on that and look if it is the last one
- nBookmark = (*m_aBookmarksPositions.rbegin())/*->first*/;
-
- bDataFound = m_pHelper->move(IResultSetHelper::BOOKMARK, nBookmark, _bRetrieveData);
- OSL_ENSURE((m_bDeletedVisible || !m_pHelper->isRowDeleted()),"A bookmark should not be deleted!");
- }
-
-
- // and than move forward until we are after the last row
- while(bDataFound)
- {
- bDataFound = m_pHelper->move(IResultSetHelper::NEXT, 1, sal_False); // we don't need the data here
- if( bDataFound && ( m_bDeletedVisible || !m_pHelper->isRowDeleted()) )
- { // we weren't on the last row we remember it and move on
- m_aBookmarksPositions.push_back(m_pHelper->getDriverPos());
- //m_aBookmarksPositions.push_back(m_aBookmarks.insert(TInt2IntMap::value_type(m_pHelper->getDriverPos(),m_aBookmarksPositions.size()+1)).first);
- }
- else if(!bDataFound && !m_aBookmarksPositions.empty() )
- {
- // i already know the last bookmark :-)
- // now we only have to repositioning us to the last row
- nBookmark = (*m_aBookmarksPositions.rbegin())/*->first*/;
- bDataFound = m_pHelper->move(IResultSetHelper::BOOKMARK, nBookmark, _bRetrieveData);
- break;
- }
- }
- return bDataFound;
- }
- else if (_eCursorPosition != IResultSetHelper::RELATIVE)
- {
- bDataFound = m_pHelper->move(_eCursorPosition, _nOffset, _bRetrieveData);
- bDone = bDataFound && (m_bDeletedVisible || !m_pHelper->isRowDeleted());
- }
- else
- {
- bDataFound = m_pHelper->move(eDelPosition, 1, _bRetrieveData);
- if (bDataFound && (m_bDeletedVisible || !m_pHelper->isRowDeleted()))
- {
- bDone = (--nDelOffset) == 0;
- if ( !bDone )
- m_aBookmarksPositions.push_back(m_pHelper->getDriverPos());
- //m_aBookmarksPositions.push_back(m_aBookmarks.insert(TInt2IntMap::value_type(m_pHelper->getDriverPos(),m_aBookmarksPositions.size()+1)).first);
- }
- else
- bDone = sal_False;
- }
-
- while (bDataFound && !bDone) // Iterate until we are at the valid set
- {
- bDataFound = m_pHelper->move(eDelPosition, 1, _bRetrieveData);
- if (_eCursorPosition != IResultSetHelper::RELATIVE)
- bDone = bDataFound && (m_bDeletedVisible || !m_pHelper->isRowDeleted());
- else if (bDataFound && (m_bDeletedVisible || !m_pHelper->isRowDeleted()))
- {
- bDone = (--nDelOffset) == 0;
- if ( !bDone )
- m_aBookmarksPositions.push_back(m_pHelper->getDriverPos());
- //m_aBookmarksPositions.push_back(m_aBookmarks.insert(TInt2IntMap::value_type(m_pHelper->getDriverPos(),m_aBookmarksPositions.size()+1)).first);
- }
- else
- bDone = sal_False;
- }
-
- if(bDataFound && bDone)
- {
- const sal_Int32 nDriverPos = m_pHelper->getDriverPos();
- if ( m_bDeletedVisible )
- {
- if ( nDriverPos > (sal_Int32)m_aBookmarksPositions.size() )
- m_aBookmarksPositions.push_back(nDriverPos);
- }
- else if ( ::std::find(m_aBookmarksPositions.begin(),m_aBookmarksPositions.end(),nDriverPos) == m_aBookmarksPositions.end() )
- m_aBookmarksPositions.push_back(nDriverPos);
- /*sal_Int32 nDriverPos = m_pHelper->getDriverPos();
- if(m_aBookmarks.find(nDriverPos) == m_aBookmarks.end())
- m_aBookmarksPositions.push_back(m_aBookmarks.insert(TInt2IntMap::value_type(nDriverPos,m_aBookmarksPositions.size()+1)).first);*/
- }
-
- return bDataFound;
-}
-// -------------------------------------------------------------------------
-sal_Bool OSkipDeletedSet::moveAbsolute(sal_Int32 _nPos,sal_Bool _bRetrieveData)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "commontools", "Ocke.Janssen@sun.com", "OSkipDeletedSet::moveAbsolute" );
- sal_Bool bDataFound = sal_False;
- sal_Int32 nNewPos = _nPos;
- if(nNewPos > 0)
- {
- if((sal_Int32)m_aBookmarksPositions.size() < nNewPos)
- {
- // bookmark isn't known yet
- // start at the last known position
- sal_Int32 nCurPos = 0,nLastBookmark = 1;
- if ( m_aBookmarksPositions.empty() )
- {
- bDataFound = m_pHelper->move(IResultSetHelper::FIRST, 0, _bRetrieveData );
- if(bDataFound && (m_bDeletedVisible || !m_pHelper->isRowDeleted()))
- {
- ++nCurPos;
- m_aBookmarksPositions.push_back(m_pHelper->getDriverPos());
- //m_aBookmarksPositions.push_back(m_aBookmarks.insert(TInt2IntMap::value_type(m_pHelper->getDriverPos(),m_aBookmarksPositions.size()+1)).first);
- --nNewPos;
- }
- } // if ( m_aBookmarksPositions.empty() )
- else
- {
- nLastBookmark = (*m_aBookmarksPositions.rbegin())/*->first*/;
- nCurPos = /*(**/m_aBookmarksPositions.size()/*->second*/;
- nNewPos = nNewPos - nCurPos;
- bDataFound = m_pHelper->move(IResultSetHelper::BOOKMARK, nLastBookmark, _bRetrieveData);
- }
-
- // now move to that row we need and don't count deleted rows
- while (bDataFound && nNewPos)
- {
- bDataFound = m_pHelper->move(IResultSetHelper::NEXT, 1, _bRetrieveData);
- if(bDataFound && (m_bDeletedVisible || !m_pHelper->isRowDeleted()))
- {
- ++nCurPos;
- m_aBookmarksPositions.push_back(m_pHelper->getDriverPos());
- //m_aBookmarksPositions.push_back(m_aBookmarks.insert(TInt2IntMap::value_type(m_pHelper->getDriverPos(),m_aBookmarksPositions.size()+1)).first);
- --nNewPos;
- }
- }
- }
- else
- {
- const sal_Int32 nBookmark = m_aBookmarksPositions[nNewPos-1]/*->first*/;
- bDataFound = m_pHelper->move(IResultSetHelper::BOOKMARK,nBookmark, _bRetrieveData);
- OSL_ENSURE((m_bDeletedVisible || !m_pHelper->isRowDeleted()),"moveAbsolute: row can't be deleted!");
- }
- }
- else
- {
- ++nNewPos;
- bDataFound = skipDeleted(IResultSetHelper::LAST,0,nNewPos == 0);
-
- for(sal_Int32 i=nNewPos+1;bDataFound && i <= 0;++i)
- bDataFound = skipDeleted(IResultSetHelper::PRIOR,1,i == 0);
-
- }
- return bDataFound;
-}
-// -----------------------------------------------------------------------------
-void OSkipDeletedSet::clear()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "commontools", "Ocke.Janssen@sun.com", "OSkipDeletedSet::clear" );
- ::std::vector<sal_Int32>().swap(m_aBookmarksPositions);
- //TInt2IntMap().swap(m_aBookmarks);
-}
-// -----------------------------------------------------------------------------
-sal_Int32 OSkipDeletedSet::getMappedPosition(sal_Int32 _nPos) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "commontools", "Ocke.Janssen@sun.com", "OSkipDeletedSet::getMappedPosition" );
- ::std::vector<sal_Int32>::const_iterator aFind = ::std::find(m_aBookmarksPositions.begin(),m_aBookmarksPositions.end(),_nPos);
- if ( aFind != m_aBookmarksPositions.end() )
- return (aFind - m_aBookmarksPositions.begin()) + 1;
- /*TInt2IntMap::const_iterator aFind = m_aBookmarks.find(_nPos);
- OSL_ENSURE(aFind != m_aBookmarks.end(),"OSkipDeletedSet::getMappedPosition() invalid bookmark!");
- return aFind->second;*/
- OSL_FAIL("Why!");
- return -1;
-}
-// -----------------------------------------------------------------------------
-void OSkipDeletedSet::insertNewPosition(sal_Int32 _nPos)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "commontools", "Ocke.Janssen@sun.com", "OSkipDeletedSet::insertNewPosition" );
- //OSL_ENSURE(m_aBookmarks.find(_nPos) == m_aBookmarks.end(),"OSkipDeletedSet::insertNewPosition: Invalid position");
- //m_aBookmarksPositions.push_back(m_aBookmarks.insert(TInt2IntMap::value_type(_nPos,m_aBookmarksPositions.size()+1)).first);
- //OSL_ENSURE(::std::find(m_aBookmarksPositions.begin(),m_aBookmarksPositions.end(),_nPos) == m_aBookmarksPositions.end(),"Invalid driver pos");
- m_aBookmarksPositions.push_back(_nPos);
-}
-// -----------------------------------------------------------------------------
-void OSkipDeletedSet::deletePosition(sal_Int32 _nBookmark)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "commontools", "Ocke.Janssen@sun.com", "OSkipDeletedSet::deletePosition" );
- ::std::vector<sal_Int32>::iterator aFind = ::std::find(m_aBookmarksPositions.begin(),m_aBookmarksPositions.end(),_nBookmark);
- if ( aFind != m_aBookmarksPositions.end() )
- {
- //TInt2IntMap::iterator aFind = m_aBookmarks.find(_nPos);
- //OSL_ENSURE(aFind != m_aBookmarks.end(),"OSkipDeletedSet::deletePosition() bookmark not found!");
- //TInt2IntMap::iterator aIter = aFind;
- m_aBookmarksPositions.erase(aFind);
- //for (; aFind != m_aBookmarksPositions.end() ; ++aIter)
- // --(aFind->second);
- } // if ( aFind != m_aBookmarksPositions.end() )
- //m_aBookmarksPositions.erase(m_aBookmarksPositions.begin() + aFind->second-1);
- //m_aBookmarks.erase(_nPos);
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TSortIndex.cxx b/connectivity/source/commontools/TSortIndex.cxx
deleted file mode 100644
index afc01259b1..0000000000
--- a/connectivity/source/commontools/TSortIndex.cxx
+++ /dev/null
@@ -1,181 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "TSortIndex.hxx"
-#include <algorithm>
-
-#include <o3tl/compat_functional.hxx>
-
-using namespace connectivity;
-//------------------------------------------------------------------
-/// binary_function Functor object for class OSortIndex::TIntValuePairVector::value_type returntype is bool
-struct TKeyValueFunc : ::std::binary_function<OSortIndex::TIntValuePairVector::value_type,OSortIndex::TIntValuePairVector::value_type,bool>
-{
- OSortIndex* pIndex;
-
- TKeyValueFunc(OSortIndex* _pIndex) : pIndex(_pIndex)
- {
- }
- // return false if compared values are equal otherwise true
- inline bool operator()(const OSortIndex::TIntValuePairVector::value_type& lhs,const OSortIndex::TIntValuePairVector::value_type& rhs) const
- {
- const ::std::vector<OKeyType>& aKeyType = pIndex->getKeyType();
- ::std::vector<OKeyType>::const_iterator aIter = aKeyType.begin();
- for (::std::vector<sal_Int16>::size_type i=0;aIter != aKeyType.end(); ++aIter,++i)
- {
- const bool nGreater = (pIndex->getAscending(i) == SQL_ASC) ? false : true;
- const bool nLess = !nGreater;
-
- // compare depending for type
- switch (*aIter)
- {
- case SQL_ORDERBYKEY_STRING:
- {
- sal_Int32 nRes = lhs.second->getKeyString(i).compareTo(rhs.second->getKeyString(i));
- if (nRes < 0)
- return nLess;
- else if (nRes > 0)
- return nGreater;
- }
- break;
- case SQL_ORDERBYKEY_DOUBLE:
- {
- double d1 = lhs.second->getKeyDouble(i);
- double d2 = rhs.second->getKeyDouble(i);
-
- if (d1 < d2)
- return nLess;
- else if (d1 > d2)
- return nGreater;
- }
- break;
- case SQL_ORDERBYKEY_NONE:
- break;
- }
- }
-
- // know we know that the values are equal
- return false;
- }
-};
-
-// -----------------------------------------------------------------------------
-::rtl::Reference<OKeySet> OSortIndex::CreateKeySet()
-{
- Freeze();
-
- ::rtl::Reference<OKeySet> pKeySet = new OKeySet();
- pKeySet->get().reserve(m_aKeyValues.size());
- ::std::transform(m_aKeyValues.begin()
- ,m_aKeyValues.end()
- ,::std::back_inserter(pKeySet->get())
- ,::o3tl::select1st<TIntValuePairVector::value_type>());
- pKeySet->setFrozen();
- return pKeySet;
-}
-// -----------------------------------------------------------------------------
-OSortIndex::OSortIndex( const ::std::vector<OKeyType>& _aKeyType,
- const ::std::vector<TAscendingOrder>& _aAscending)
- :m_aKeyType(_aKeyType)
- ,m_aAscending(_aAscending)
- ,m_bFrozen(sal_False)
-{
-}
-//------------------------------------------------------------------
-OSortIndex::~OSortIndex()
-{
-}
-//------------------------------------------------------------------
-void OSortIndex::AddKeyValue(OKeyValue * pKeyValue)
-{
- OSL_ENSURE(pKeyValue,"Can not be null here!");
- if(m_bFrozen)
- {
- m_aKeyValues.push_back(TIntValuePairVector::value_type(pKeyValue->getValue(),NULL));
- delete pKeyValue;
- }
- else
- m_aKeyValues.push_back(TIntValuePairVector::value_type(pKeyValue->getValue(),pKeyValue));
-}
-
-
-//------------------------------------------------------------------
-void OSortIndex::Freeze()
-{
- OSL_ENSURE(! m_bFrozen,"OSortIndex::Freeze: already frozen!");
- // Sortierung:
- if (m_aKeyType[0] != SQL_ORDERBYKEY_NONE)
- // we will sort ourself when the first keyType say so
- ::std::sort(m_aKeyValues.begin(),m_aKeyValues.end(),TKeyValueFunc(this));
-
- TIntValuePairVector::iterator aIter = m_aKeyValues.begin();
- for(;aIter != m_aKeyValues.end();++aIter)
- {
- delete aIter->second;
- aIter->second = NULL;
- }
-
- m_bFrozen = sal_True;
-}
-
-//------------------------------------------------------------------
-sal_Int32 OSortIndex::GetValue(sal_Int32 nPos) const
-{
- OSL_ENSURE(nPos > 0,"OSortIndex::GetValue: nPos == 0");
- OSL_ENSURE((size_t)nPos <= m_aKeyValues.size(),"OSortIndex::GetValue: Zugriff ausserhalb der Array-Grenzen");
-
- if (!m_bFrozen && m_aKeyType[0] != SQL_ORDERBYKEY_NONE)
- {
- OSL_FAIL("OSortIndex::GetValue: Invalid use of index!");
- return 0;
- }
- return m_aKeyValues[nPos-1].first;
-}
-// -----------------------------------------------------------------------------
-OKeyValue::OKeyValue()
-{
-}
-// -----------------------------------------------------------------------------
-OKeyValue::OKeyValue(sal_Int32 nVal)
-: m_nValue(nVal)
-{
-}
-// -----------------------------------------------------------------------------
-OKeyValue::~OKeyValue()
-{
-}
-// -----------------------------------------------------------------------------
-OKeyValue* OKeyValue::createKeyValue(sal_Int32 _nVal)
-{
- return new OKeyValue(_nVal);
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
deleted file mode 100644
index ecf97d4beb..0000000000
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ /dev/null
@@ -1,635 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/TTableHelper.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <comphelper/implementationreference.hxx>
-#include <comphelper/sequence.hxx>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <unotools/sharedunocomponent.hxx>
-#include "TConnection.hxx"
-
-#include <o3tl/compat_functional.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-namespace
-{
- /// helper class for column property change events which holds the OComponentDefinition weak
-typedef ::cppu::WeakImplHelper1 < XContainerListener > OTableContainerListener_BASE;
-class OTableContainerListener : public OTableContainerListener_BASE
-{
- OTableHelper* m_pComponent;
- ::std::map< ::rtl::OUString,bool> m_aRefNames;
-
- OTableContainerListener(const OTableContainerListener&);
- void operator =(const OTableContainerListener&);
-protected:
- virtual ~OTableContainerListener(){}
-public:
- OTableContainerListener(OTableHelper* _pComponent) : m_pComponent(_pComponent){}
- virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& /*Event*/ ) throw (RuntimeException)
- {
- }
- virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (RuntimeException)
- {
- ::rtl::OUString sName;
- Event.Accessor >>= sName;
- if ( m_aRefNames.find(sName) != m_aRefNames.end() )
- m_pComponent->refreshKeys();
- }
- virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (RuntimeException)
- {
- ::rtl::OUString sOldComposedName,sNewComposedName;
- Event.ReplacedElement >>= sOldComposedName;
- Event.Accessor >>= sNewComposedName;
- if ( sOldComposedName != sNewComposedName && m_aRefNames.find(sOldComposedName) != m_aRefNames.end() )
- m_pComponent->refreshKeys();
- }
- // XEventListener
- virtual void SAL_CALL disposing( const EventObject& /*_rSource*/ ) throw (RuntimeException)
- {
- }
- void clear() { m_pComponent = NULL; }
- inline void add(const ::rtl::OUString& _sRefName) { m_aRefNames.insert(::std::map< ::rtl::OUString,bool>::value_type(_sRefName,true)); }
-};
-}
-namespace connectivity
-{
- ::rtl::OUString lcl_getServiceNameForSetting(const Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,const ::rtl::OUString& i_sSetting)
- {
- ::rtl::OUString sSupportService;
- Any aValue;
- if ( ::dbtools::getDataSourceSetting(_xConnection,i_sSetting,aValue) )
- {
- aValue >>= sSupportService;
- }
- return sSupportService;
- }
- struct OTableHelperImpl
- {
- TKeyMap m_aKeys;
- // helper services which can be provided by extensions
- Reference< ::com::sun::star::sdb::tools::XTableRename> m_xRename;
- Reference< ::com::sun::star::sdb::tools::XTableAlteration> m_xAlter;
- Reference< ::com::sun::star::sdb::tools::XKeyAlteration> m_xKeyAlter;
- Reference< ::com::sun::star::sdb::tools::XIndexAlteration> m_xIndexAlter;
-
- Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
- ::comphelper::ImplementationReference< OTableContainerListener,XContainerListener>
- m_xTablePropertyListener;
- ::std::vector< ColumnDesc > m_aColumnDesc;
- OTableHelperImpl(const Reference< ::com::sun::star::sdbc::XConnection >& _xConnection)
- : m_xConnection(_xConnection)
- {
- try
- {
- m_xMetaData = m_xConnection->getMetaData();
- Reference<XMultiServiceFactory> xFac(_xConnection,UNO_QUERY);
- if ( xFac.is() )
- {
- static const ::rtl::OUString s_sTableRename(RTL_CONSTASCII_USTRINGPARAM("TableRenameServiceName"));
- m_xRename.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sTableRename)),UNO_QUERY);
- static const ::rtl::OUString s_sTableAlteration(RTL_CONSTASCII_USTRINGPARAM("TableAlterationServiceName"));
- m_xAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sTableAlteration)),UNO_QUERY);
- static const ::rtl::OUString s_sKeyAlteration(RTL_CONSTASCII_USTRINGPARAM("KeyAlterationServiceName"));
- m_xKeyAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sKeyAlteration)),UNO_QUERY);
- static const ::rtl::OUString s_sIndexAlteration(RTL_CONSTASCII_USTRINGPARAM("IndexAlterationServiceName"));
- m_xIndexAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sIndexAlteration)),UNO_QUERY);
- }
- }
- catch(const Exception&)
- {
- }
- }
- };
-}
-
-OTableHelper::OTableHelper( sdbcx::OCollection* _pTables,
- const Reference< XConnection >& _xConnection,
- sal_Bool _bCase)
- :OTable_TYPEDEF(_pTables,_bCase)
- ,m_pImpl(new OTableHelperImpl(_xConnection))
-{
-}
-// -------------------------------------------------------------------------
-OTableHelper::OTableHelper( sdbcx::OCollection* _pTables,
- const Reference< XConnection >& _xConnection,
- sal_Bool _bCase,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description ,
- const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName
- ) : OTable_TYPEDEF(_pTables,
- _bCase,
- _Name,
- _Type,
- _Description,
- _SchemaName,
- _CatalogName)
- ,m_pImpl(new OTableHelperImpl(_xConnection))
-{
-}
-// -----------------------------------------------------------------------------
-OTableHelper::~OTableHelper()
-{
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OTableHelper::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- if ( m_pImpl->m_xTablePropertyListener.is() )
- {
- m_pTables->removeContainerListener(m_pImpl->m_xTablePropertyListener.getRef());
- m_pImpl->m_xTablePropertyListener->clear();
- m_pImpl->m_xTablePropertyListener.dispose();
- }
- OTable_TYPEDEF::disposing();
-
- m_pImpl->m_xConnection = NULL;
- m_pImpl->m_xMetaData = NULL;
-
-}
-
-// -------------------------------------------------------------------------
-namespace
-{
- /** collects ColumnDesc's from a resultset produced by XDatabaseMetaData::getColumns
- */
- void lcl_collectColumnDescs_throw( const Reference< XResultSet >& _rxResult, ::std::vector< ColumnDesc >& _out_rColumns )
- {
- Reference< XRow > xRow( _rxResult, UNO_QUERY_THROW );
- ::rtl::OUString sName;
- OrdinalPosition nOrdinalPosition( 0 );
- while ( _rxResult->next() )
- {
- sName = xRow->getString( 4 ); // COLUMN_NAME
- sal_Int32 nField5 = xRow->getInt(5);
- ::rtl::OUString aField6 = xRow->getString(6);
- sal_Int32 nField7 = xRow->getInt(7)
- , nField9 = xRow->getInt(9)
- , nField11= xRow->getInt(11);
- ::rtl::OUString sField12 = xRow->getString(12)
- ,sField13 = xRow->getString(13);
- nOrdinalPosition = xRow->getInt( 17 ); // ORDINAL_POSITION
- _out_rColumns.push_back( ColumnDesc( sName,nField5,aField6,nField7,nField9,nField11,sField12,sField13, nOrdinalPosition ) );
- }
- }
-
- /** checks a given array of ColumnDesc's whether it has reasonable ordinal positions. If not,
- they will be normalized to be the array index.
- */
- void lcl_sanitizeColumnDescs( ::std::vector< ColumnDesc >& _rColumns )
- {
- if ( _rColumns.empty() )
- return;
-
- // collect all used ordinals
- ::std::set< OrdinalPosition > aUsedOrdinals;
- for ( ::std::vector< ColumnDesc >::iterator collect = _rColumns.begin();
- collect != _rColumns.end();
- ++collect
- )
- aUsedOrdinals.insert( collect->nOrdinalPosition );
-
- // we need to have as much different ordinals as we have different columns
- bool bDuplicates = aUsedOrdinals.size() != _rColumns.size();
- // and it needs to be a continuous range
- size_t nOrdinalsRange = *aUsedOrdinals.rbegin() - *aUsedOrdinals.begin() + 1;
- bool bGaps = nOrdinalsRange != _rColumns.size();
-
- // if that's not the case, normalize it
- if ( bGaps || bDuplicates )
- {
- OSL_FAIL( "lcl_sanitizeColumnDescs: database did provide invalid ORDINAL_POSITION values!" );
-
- OrdinalPosition nNormalizedPosition = 1;
- for ( ::std::vector< ColumnDesc >::iterator normalize = _rColumns.begin();
- normalize != _rColumns.end();
- ++normalize
- )
- normalize->nOrdinalPosition = nNormalizedPosition++;
- return;
- }
-
- // what's left is that the range might not be from 1 to <column count>, but for instance
- // 0 to <column count>-1.
- size_t nOffset = *aUsedOrdinals.begin() - 1;
- for ( ::std::vector< ColumnDesc >::iterator offset = _rColumns.begin();
- offset != _rColumns.end();
- ++offset
- )
- offset->nOrdinalPosition -= nOffset;
- }
-}
-
-// -------------------------------------------------------------------------
-void OTableHelper::refreshColumns()
-{
- TStringVector aVector;
- if(!isNew())
- {
- Any aCatalog;
- if ( m_CatalogName.getLength() )
- aCatalog <<= m_CatalogName;
-
- ::utl::SharedUNOComponent< XResultSet > xResult( getMetaData()->getColumns(
- aCatalog,
- m_SchemaName,
- m_Name,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%"))
- ) );
-
- // collect the column names, together with their ordinal position
- m_pImpl->m_aColumnDesc.clear();
- lcl_collectColumnDescs_throw( xResult, m_pImpl->m_aColumnDesc );
-
- // ensure that the ordinal positions as obtained from the meta data do make sense
- lcl_sanitizeColumnDescs( m_pImpl->m_aColumnDesc );
-
- // sort by ordinal position
- ::std::map< OrdinalPosition, ::rtl::OUString > aSortedColumns;
- for ( ::std::vector< ColumnDesc >::const_iterator copy = m_pImpl->m_aColumnDesc.begin();
- copy != m_pImpl->m_aColumnDesc.end();
- ++copy
- )
- aSortedColumns[ copy->nOrdinalPosition ] = copy->sName;
-
- // copy them to aVector, now that we have the proper ordering
- ::std::transform(
- aSortedColumns.begin(),
- aSortedColumns.end(),
- ::std::insert_iterator< TStringVector >( aVector, aVector.begin() ),
- ::o3tl::select2nd< ::std::map< OrdinalPosition, ::rtl::OUString >::value_type >()
- );
- }
-
- if(m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = createColumns(aVector);
-}
-// -----------------------------------------------------------------------------
-const ColumnDesc* OTableHelper::getColumnDescription(const ::rtl::OUString& _sName) const
-{
- const ColumnDesc* pRet = NULL;
- ::std::vector< ColumnDesc >::const_iterator aEnd = m_pImpl->m_aColumnDesc.end();
- for (::std::vector< ColumnDesc >::const_iterator aIter = m_pImpl->m_aColumnDesc.begin();aIter != aEnd;++aIter)
- {
- if ( aIter->sName == _sName )
- {
- pRet = &*aIter;
- break;
- }
- } // for (::std::vector< ColumnDesc >::const_iterator aIter = m_pImpl->m_aColumnDesc.begin();aIter != aEnd;++aIter)
- return pRet;
-}
-// -------------------------------------------------------------------------
-void OTableHelper::refreshPrimaryKeys(TStringVector& _rNames)
-{
- Any aCatalog;
- if ( m_CatalogName.getLength() )
- aCatalog <<= m_CatalogName;
- Reference< XResultSet > xResult = getMetaData()->getPrimaryKeys(aCatalog,m_SchemaName,m_Name);
-
- if ( xResult.is() )
- {
- sdbcx::TKeyProperties pKeyProps(new sdbcx::KeyProperties(::rtl::OUString(),KeyType::PRIMARY,0,0));
- ::rtl::OUString aPkName;
- bool bAlreadyFetched = false;
- const Reference< XRow > xRow(xResult,UNO_QUERY);
- while ( xResult->next() )
- {
- pKeyProps->m_aKeyColumnNames.push_back(xRow->getString(4));
- if ( !bAlreadyFetched )
- {
- aPkName = xRow->getString(6);
- bAlreadyFetched = true;
- }
- }
-
- m_pImpl->m_aKeys.insert(TKeyMap::value_type(aPkName,pKeyProps));
- _rNames.push_back(aPkName);
- } // if ( xResult.is() && xResult->next() )
- ::comphelper::disposeComponent(xResult);
-}
-// -------------------------------------------------------------------------
-void OTableHelper::refreshForgeinKeys(TStringVector& _rNames)
-{
- Any aCatalog;
- if ( m_CatalogName.getLength() )
- aCatalog <<= m_CatalogName;
- Reference< XResultSet > xResult = getMetaData()->getImportedKeys(aCatalog,m_SchemaName,m_Name);
- Reference< XRow > xRow(xResult,UNO_QUERY);
-
- if ( xRow.is() )
- {
- sdbcx::TKeyProperties pKeyProps;
- ::rtl::OUString aName,sCatalog,aSchema,sOldFKName;
- while( xResult->next() )
- {
- // this must be outsid the "if" because we have to call in a right order
- sCatalog = xRow->getString(1);
- if ( xRow->wasNull() )
- sCatalog = ::rtl::OUString();
- aSchema = xRow->getString(2);
- aName = xRow->getString(3);
-
- const ::rtl::OUString sForeignKeyColumn = xRow->getString(8);
- const sal_Int32 nUpdateRule = xRow->getInt(10);
- const sal_Int32 nDeleteRule = xRow->getInt(11);
- const ::rtl::OUString sFkName = xRow->getString(12);
-
- if ( pKeyProps.get() )
- {
- }
-
-
- if ( sFkName.getLength() && !xRow->wasNull() )
- {
- if ( sOldFKName != sFkName )
- {
- if ( pKeyProps.get() )
- m_pImpl->m_aKeys.insert(TKeyMap::value_type(sOldFKName,pKeyProps));
-
- const ::rtl::OUString sReferencedName = ::dbtools::composeTableName(getMetaData(),sCatalog,aSchema,aName,sal_False,::dbtools::eInDataManipulation);
- pKeyProps.reset(new sdbcx::KeyProperties(sReferencedName,KeyType::FOREIGN,nUpdateRule,nDeleteRule));
- pKeyProps->m_aKeyColumnNames.push_back(sForeignKeyColumn);
- _rNames.push_back(sFkName);
- if ( m_pTables->hasByName(sReferencedName) )
- {
- if ( !m_pImpl->m_xTablePropertyListener.is() )
- m_pImpl->m_xTablePropertyListener = ::comphelper::ImplementationReference< OTableContainerListener,XContainerListener>( new OTableContainerListener(this) );
- m_pTables->addContainerListener(m_pImpl->m_xTablePropertyListener.getRef());
- m_pImpl->m_xTablePropertyListener->add(sReferencedName);
- } // if ( m_pTables->hasByName(sReferencedName) )
- sOldFKName = sFkName;
- } // if ( sOldFKName != sFkName )
- else if ( pKeyProps.get() )
- {
- pKeyProps->m_aKeyColumnNames.push_back(sForeignKeyColumn);
- }
- }
- } // while( xResult->next() )
- if ( pKeyProps.get() )
- m_pImpl->m_aKeys.insert(TKeyMap::value_type(sOldFKName,pKeyProps));
- ::comphelper::disposeComponent(xResult);
- }
-}
-// -------------------------------------------------------------------------
-void OTableHelper::refreshKeys()
-{
- m_pImpl->m_aKeys.clear();
-
- TStringVector aNames;
-
- if(!isNew())
- {
- refreshPrimaryKeys(aNames);
- refreshForgeinKeys(aNames);
- m_pKeys = createKeys(aNames);
- } // if(!isNew())
- else if (!m_pKeys )
- m_pKeys = createKeys(aNames);
- /*if(m_pKeys)
- m_pKeys->reFill(aVector);
- else*/
-
-}
-// -------------------------------------------------------------------------
-void OTableHelper::refreshIndexes()
-{
- TStringVector aVector;
- if(!isNew())
- {
- // fill indexes
- Any aCatalog;
- if ( m_CatalogName.getLength() )
- aCatalog <<= m_CatalogName;
- Reference< XResultSet > xResult = getMetaData()->getIndexInfo(aCatalog,m_SchemaName,m_Name,sal_False,sal_False);
-
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- ::rtl::OUString aName;
- ::rtl::OUString sCatalogSep = getMetaData()->getCatalogSeparator();
- ::rtl::OUString sPreviousRoundName;
- while( xResult->next() )
- {
- aName = xRow->getString(5);
- if(aName.getLength())
- aName += sCatalogSep;
- aName += xRow->getString(6);
- if ( aName.getLength() )
- {
- // don't insert the name if the last one we inserted was the same
- if (sPreviousRoundName != aName)
- aVector.push_back(aName);
- }
- sPreviousRoundName = aName;
- }
- ::comphelper::disposeComponent(xResult);
- }
- }
-
- if(m_pIndexes)
- m_pIndexes->reFill(aVector);
- else
- m_pIndexes = createIndexes(aVector);
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OTableHelper::getRenameStart() const
-{
- ::rtl::OUString sSql(RTL_CONSTASCII_USTRINGPARAM("RENAME "));
- if ( m_Type == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW")) )
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" VIEW "));
- else
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" TABLE "));
-
- return sSql;
-}
-// -------------------------------------------------------------------------
-// XRename
-void SAL_CALL OTableHelper::rename( const ::rtl::OUString& newName ) throw(SQLException, ElementExistException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(
-#ifdef GCC
- ::connectivity::sdbcx::OTableDescriptor_BASE::rBHelper.bDisposed
-#else
- rBHelper.bDisposed
-#endif
- );
-
- if(!isNew())
- {
- if ( m_pImpl->m_xRename.is() )
- {
- m_pImpl->m_xRename->rename(this,newName);
- }
- else
- {
- ::rtl::OUString sSql = getRenameStart();
- ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
-
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
-
- ::rtl::OUString sComposedName;
- sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sal_True,::dbtools::eInDataManipulation);
- sSql += sComposedName
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" TO "));
- sComposedName = ::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,sal_True,::dbtools::eInDataManipulation);
- sSql += sComposedName;
-
- Reference< XStatement > xStmt = m_pImpl->m_xConnection->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(sSql);
- ::comphelper::disposeComponent(xStmt);
- }
- }
-
- OTable_TYPEDEF::rename(newName);
- }
- else
- ::dbtools::qualifiedNameComponents(getMetaData(),newName,m_CatalogName,m_SchemaName,m_Name,::dbtools::eInTableDefinitions);
-}
-// -----------------------------------------------------------------------------
-Reference< XDatabaseMetaData> OTableHelper::getMetaData() const
-{
- return m_pImpl->m_xMetaData;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OTableHelper::alterColumnByIndex( sal_Int32 index, const Reference< XPropertySet >& descriptor ) throw(SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(
-#ifdef GCC
- ::connectivity::sdbcx::OTableDescriptor_BASE::rBHelper.bDisposed
-#else
- rBHelper.bDisposed
-#endif
- );
-
- Reference< XPropertySet > xOld;
- if(::cppu::extractInterface(xOld,m_pColumns->getByIndex(index)) && xOld.is())
- alterColumnByName(getString(xOld->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))),descriptor);
-}
-
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OTableHelper::getName() throw(RuntimeException)
-{
- ::rtl::OUString sComposedName;
- sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sal_False,::dbtools::eInDataManipulation);
- return sComposedName;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OTableHelper::acquire() throw()
-{
- OTable_TYPEDEF::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OTableHelper::release() throw()
-{
- OTable_TYPEDEF::release();
-}
-// -----------------------------------------------------------------------------
-sdbcx::TKeyProperties OTableHelper::getKeyProperties(const ::rtl::OUString& _sName) const
-{
- sdbcx::TKeyProperties pKeyProps;
- TKeyMap::const_iterator aFind = m_pImpl->m_aKeys.find(_sName);
- if ( aFind != m_pImpl->m_aKeys.end() )
- {
- pKeyProps = aFind->second;
- }
- else // only a fall back
- {
- OSL_FAIL("No key with the given name found");
- pKeyProps.reset(new sdbcx::KeyProperties());
- }
-
- return pKeyProps;
-}
-// -----------------------------------------------------------------------------
-void OTableHelper::addKey(const ::rtl::OUString& _sName,const sdbcx::TKeyProperties& _aKeyProperties)
-{
- m_pImpl->m_aKeys.insert(TKeyMap::value_type(_sName,_aKeyProperties));
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OTableHelper::getTypeCreatePattern() const
-{
- return ::rtl::OUString();
-}
-// -----------------------------------------------------------------------------
-Reference< XConnection> OTableHelper::getConnection() const
-{
- return m_pImpl->m_xConnection;
-}
-// -----------------------------------------------------------------------------
-Reference< ::com::sun::star::sdb::tools::XTableRename> OTableHelper::getRenameService() const
-{
- return m_pImpl->m_xRename;
-}
-// -----------------------------------------------------------------------------
-Reference< ::com::sun::star::sdb::tools::XTableAlteration> OTableHelper::getAlterService() const
-{
- return m_pImpl->m_xAlter;
-}
-// -----------------------------------------------------------------------------
-Reference< ::com::sun::star::sdb::tools::XKeyAlteration> OTableHelper::getKeyService() const
-{
- return m_pImpl->m_xKeyAlter;
-}
-// -----------------------------------------------------------------------------
-Reference< ::com::sun::star::sdb::tools::XIndexAlteration> OTableHelper::getIndexService() const
-{
- return m_pImpl->m_xIndexAlter;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/conncleanup.cxx b/connectivity/source/commontools/conncleanup.cxx
deleted file mode 100644
index ba853156cc..0000000000
--- a/connectivity/source/commontools/conncleanup.cxx
+++ /dev/null
@@ -1,247 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <connectivity/conncleanup.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <osl/diagnose.h>
-
-//.........................................................................
-namespace dbtools
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::lang;
-
- //=====================================================================
- static const ::rtl::OUString& getActiveConnectionPropertyName()
- {
- static const ::rtl::OUString s_sActiveConnectionPropertyName( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ));
- return s_sActiveConnectionPropertyName;
- }
-
- //=====================================================================
- //= OAutoConnectionDisposer
- //=====================================================================
- //---------------------------------------------------------------------
- OAutoConnectionDisposer::OAutoConnectionDisposer(const Reference< XRowSet >& _rxRowSet, const Reference< XConnection >& _rxConnection)
- :m_xRowSet( _rxRowSet )
- ,m_bRSListening( sal_False )
- ,m_bPropertyListening( sal_False )
- {
- Reference< XPropertySet > xProps(_rxRowSet, UNO_QUERY);
- OSL_ENSURE(xProps.is(), "OAutoConnectionDisposer::OAutoConnectionDisposer: invalid rowset (no XPropertySet)!");
-
- if (!xProps.is())
- return;
-
- try
- {
- xProps->setPropertyValue( getActiveConnectionPropertyName(), makeAny( _rxConnection ) );
- m_xOriginalConnection = _rxConnection;
- startPropertyListening( xProps );
- }
- catch( const Exception& )
- {
- OSL_FAIL( "OAutoConnectionDisposer::OAutoConnectionDisposer: caught an exception!" );
- }
- }
-
- //---------------------------------------------------------------------
- void OAutoConnectionDisposer::startPropertyListening( const Reference< XPropertySet >& _rxRowSet )
- {
- try
- {
- _rxRowSet->addPropertyChangeListener( getActiveConnectionPropertyName(), this );
- m_bPropertyListening = sal_True;
- }
- catch( const Exception& )
- {
- OSL_FAIL( "OAutoConnectionDisposer::startPropertyListening: caught an exception!" );
- }
- }
-
- //---------------------------------------------------------------------
- void OAutoConnectionDisposer::stopPropertyListening( const Reference< XPropertySet >& _rxEventSource )
- {
- // prevent deletion of ourself while we're herein
- Reference< XInterface > xKeepAlive(static_cast< XWeak* >(this));
-
- try
- { // remove ourself as property change listener
- OSL_ENSURE( _rxEventSource.is(), "OAutoConnectionDisposer::stopPropertyListening: invalid event source (no XPropertySet)!" );
- if ( _rxEventSource.is() )
- {
- _rxEventSource->removePropertyChangeListener( getActiveConnectionPropertyName(), this );
- m_bPropertyListening = sal_False;
- }
- }
- catch( const Exception& )
- {
- OSL_FAIL( "OAutoConnectionDisposer::stopPropertyListening: caught an exception!" );
- }
- }
-
- //---------------------------------------------------------------------
- void OAutoConnectionDisposer::startRowSetListening()
- {
- OSL_ENSURE( !m_bRSListening, "OAutoConnectionDisposer::startRowSetListening: already listening!" );
- try
- {
- if ( !m_bRSListening )
- m_xRowSet->addRowSetListener( this );
- }
- catch( const Exception& )
- {
- OSL_FAIL( "OAutoConnectionDisposer::startRowSetListening: caught an exception!" );
- }
- m_bRSListening = sal_True;
- }
-
- //---------------------------------------------------------------------
- void OAutoConnectionDisposer::stopRowSetListening()
- {
- OSL_ENSURE( m_bRSListening, "OAutoConnectionDisposer::stopRowSetListening: not listening!" );
- try
- {
- m_xRowSet->removeRowSetListener( this );
- }
- catch( const Exception& )
- {
- OSL_FAIL( "OAutoConnectionDisposer::stopRowSetListening: caught an exception!" );
- }
- m_bRSListening = sal_False;
- }
-
- //---------------------------------------------------------------------
- void SAL_CALL OAutoConnectionDisposer::propertyChange( const PropertyChangeEvent& _rEvent ) throw (RuntimeException)
- {
- if ( _rEvent.PropertyName.equals( getActiveConnectionPropertyName() ) )
- { // somebody set a new ActiveConnection
-
- Reference< XConnection > xNewConnection;
- _rEvent.NewValue >>= xNewConnection;
-
- if ( isRowSetListening() )
- {
- // we're listening at the row set, this means that the row set does not have our
- // m_xOriginalConnection as active connection anymore
- // So there are two possibilities
- // a. somebody sets a new connection which is not our original one
- // b. somebody sets a new connection, which is exactly the original one
- // a. we're not interested in a, but in b: In this case, we simply need to move to the state
- // we had originally: listen for property changes, do not listen for row set changes, and
- // do not dispose the connection until the row set does not need it anymore
- if ( xNewConnection.get() == m_xOriginalConnection.get() )
- {
- stopRowSetListening();
- }
- }
- else
- {
- // start listening at the row set. We're allowed to dispose the old connection as soon
- // as the RowSet changed
-
- // Unfortunately, the our database form implementations sometimes fire the change of their
- // ActiveConnection twice. This is a error in forms/source/component/DatabaseForm.cxx, but
- // changing this would require incompatible changes we can't do for a while.
- // So for the moment, we have to live with it here.
- //
- // The only scenario where this doubled notification causes problems is when the connection
- // of the form is reset to the one we're responsible for (m_xOriginalConnection), so we
- // check this here.
- //
- // Yes, this is a HACK :(
- if ( xNewConnection.get() != m_xOriginalConnection.get() )
- {
-#if OSL_DEBUG_LEVEL > 0
- Reference< XConnection > xOldConnection;
- _rEvent.OldValue >>= xOldConnection;
- OSL_ENSURE( xOldConnection.get() == m_xOriginalConnection.get(), "OAutoConnectionDisposer::propertyChange: unexpected (original) property value!" );
-#endif
- startRowSetListening();
- }
- }
- }
- }
-
- //---------------------------------------------------------------------
- void SAL_CALL OAutoConnectionDisposer::disposing( const EventObject& _rSource ) throw (RuntimeException)
- {
- // the rowset is beeing disposed, and nobody has set a new ActiveConnection in the meantime
- if ( isRowSetListening() )
- stopRowSetListening();
-
- clearConnection();
-
- if ( isPropertyListening() )
- stopPropertyListening( Reference< XPropertySet >( _rSource.Source, UNO_QUERY ) );
- }
- //---------------------------------------------------------------------
- void OAutoConnectionDisposer::clearConnection()
- {
- try
- {
- // dispose the old connection
- Reference< XComponent > xComp(m_xOriginalConnection, UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- m_xOriginalConnection.clear();
- }
- catch(Exception&)
- {
- OSL_FAIL("OAutoConnectionDisposer::clearConnection: caught an exception!");
- }
- }
- //---------------------------------------------------------------------
- void SAL_CALL OAutoConnectionDisposer::cursorMoved( const ::com::sun::star::lang::EventObject& /*event*/ ) throw (::com::sun::star::uno::RuntimeException)
- {
- }
- //---------------------------------------------------------------------
- void SAL_CALL OAutoConnectionDisposer::rowChanged( const ::com::sun::star::lang::EventObject& /*event*/ ) throw (::com::sun::star::uno::RuntimeException)
- {
- }
- //---------------------------------------------------------------------
- void SAL_CALL OAutoConnectionDisposer::rowSetChanged( const ::com::sun::star::lang::EventObject& /*event*/ ) throw (::com::sun::star::uno::RuntimeException)
- {
- stopRowSetListening();
- clearConnection();
-
- }
- //---------------------------------------------------------------------
-
-//.........................................................................
-} // namespace dbtools
-//.........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/dbcharset.cxx b/connectivity/source/commontools/dbcharset.cxx
deleted file mode 100644
index bee593f447..0000000000
--- a/connectivity/source/commontools/dbcharset.cxx
+++ /dev/null
@@ -1,234 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <connectivity/dbcharset.hxx>
-#include "diagnose_ex.h"
-#include <osl/diagnose.h>
-#include <rtl/tencinfo.h>
-
-//.........................................................................
-namespace dbtools
-{
-//.........................................................................
-
- //=========================================================================
- //= OCharsetMap
- //=========================================================================
- //-------------------------------------------------------------------------
- OCharsetMap::OCharsetMap()
- {
- }
-
- //-------------------------------------------------------------------------
- void OCharsetMap::lateConstruct()
- {
- const rtl_TextEncoding eFirstEncoding = RTL_TEXTENCODING_DONTKNOW;
- const rtl_TextEncoding eLastEncoding = 100; // TODO: a define in rtl/textenc.h would be fine here ...
- OSL_ENSURE( 0 == eFirstEncoding, "OCharsetMap::OCharsetMap: somebody changed the numbers!" );
-
- rtl_TextEncodingInfo aInfo; aInfo.StructSize = sizeof( rtl_TextEncodingInfo );
- for ( rtl_TextEncoding eEncoding = eFirstEncoding; eEncoding < eLastEncoding; ++eEncoding )
- {
- if ( ( RTL_TEXTENCODING_DONTKNOW == eEncoding ) // this is always allowed - it has the special meaning "system encoding"
- || ( rtl_getTextEncodingInfo( eEncoding, &aInfo )
- && approveEncoding( eEncoding, aInfo )
- )
- )
- {
- m_aEncodings.insert( eEncoding );
- }
- }
-
- OSL_ENSURE( find( RTL_TEXTENCODING_MS_1252 ) != end(), "OCharsetMap::lateConstruct: missing compatibility encoding ANSI!" );
- OSL_ENSURE( find( RTL_TEXTENCODING_APPLE_ROMAN ) != end(), "OCharsetMap::lateConstruct: missing compatibility encoding macintosh!" );
- OSL_ENSURE( find( RTL_TEXTENCODING_IBM_437 ) != end(), "OCharsetMap::lateConstruct: missing compatibility encoding IBM437!" );
- OSL_ENSURE( find( RTL_TEXTENCODING_IBM_850) != end(), "OCharsetMap::lateConstruct: missing compatibility encoding IBM850!" );
- OSL_ENSURE( find( RTL_TEXTENCODING_IBM_860 ) != end(), "OCharsetMap::lateConstruct: missing compatibility encoding IBM860!" );
- OSL_ENSURE( find( RTL_TEXTENCODING_IBM_861 ) != end(), "OCharsetMap::lateConstruct: missing compatibility encoding IBM861!" );
- OSL_ENSURE( find( RTL_TEXTENCODING_IBM_863 ) != end(), "OCharsetMap::lateConstruct: missing compatibility encoding IBM863!" );
- OSL_ENSURE( find( RTL_TEXTENCODING_IBM_865 ) != end(), "OCharsetMap::lateConstruct: missing compatibility encoding IBM865!" );
- OSL_ENSURE( find( RTL_TEXTENCODING_IBM_866 ) != end(), "OCharsetMap::lateConstruct: missing compatibility encoding IBM866!" );
- OSL_ENSURE( find( RTL_TEXTENCODING_DONTKNOW ) != end(), "OCharsetMap::lateConstruct: missing compatibility encoding SYSTEM!" );
- OSL_ENSURE( find( RTL_TEXTENCODING_UTF8 ) != end(), "OCharsetMap::lateConstruct: missing compatibility encoding UTF-8!" );
- OSL_ENSURE( find( RTL_TEXTENCODING_BIG5_HKSCS ) != end(), "OCharsetMap::lateConstruct: missing compatibility encoding Big5-HKSCS!" );
- }
-
- //-------------------------------------------------------------------------
- sal_Bool OCharsetMap::approveEncoding( const rtl_TextEncoding _eEncoding, const rtl_TextEncodingInfo& _rInfo ) const
- {
- sal_Bool bIsMimeEncoding = 0 != ( _rInfo.Flags & RTL_TEXTENCODING_INFO_MIME );
- OSL_ENSURE( !bIsMimeEncoding || rtl_getMimeCharsetFromTextEncoding( _eEncoding ),
- "OCharsetMap::OCharsetMap: inconsistence in rtl!" );
- OSL_UNUSED( _eEncoding );
- return bIsMimeEncoding;
- }
-
- //-------------------------------------------------------------------------
- OCharsetMap::~OCharsetMap()
- {
- }
-
- //-------------------------------------------------------------------------
- OCharsetMap::CharsetIterator OCharsetMap::begin() const
- {
- ensureConstructed( );
- return CharsetIterator(this, m_aEncodings.begin() );
- }
-
- //-------------------------------------------------------------------------
- OCharsetMap::CharsetIterator OCharsetMap::find(const rtl_TextEncoding _eEncoding) const
- {
- ensureConstructed( );
- return CharsetIterator( this, m_aEncodings.find( _eEncoding ) );
- }
-
- //-------------------------------------------------------------------------
- OCharsetMap::CharsetIterator OCharsetMap::find(const ::rtl::OUString& _rIanaName, const IANA&) const
- {
- ensureConstructed( );
-
- rtl_TextEncoding eEncoding = RTL_TEXTENCODING_DONTKNOW;
- if ( _rIanaName.getLength() )
- {
- // byte string conversion
- ::rtl::OString sMimeByteString( _rIanaName.getStr(), _rIanaName.getLength(), RTL_TEXTENCODING_ASCII_US );
- // look up
- eEncoding = rtl_getTextEncodingFromMimeCharset( sMimeByteString.getStr() );
-
- if ( RTL_TEXTENCODING_DONTKNOW == eEncoding )
- { // if we're here, the name is not empty, but unknown -> this is an invalid name
- return end();
- }
- }
-
- return find( eEncoding );
- }
-
- //-------------------------------------------------------------------------
- OCharsetMap::CharsetIterator OCharsetMap::end() const
- {
- ensureConstructed( );
-
- return CharsetIterator( this, m_aEncodings.end() );
- }
-
- //=========================================================================
- //= CharsetIteratorDerefHelper
- //=========================================================================
- //-------------------------------------------------------------------------
- CharsetIteratorDerefHelper::CharsetIteratorDerefHelper( const CharsetIteratorDerefHelper& _rSource )
- :m_eEncoding( _rSource.m_eEncoding )
- ,m_aIanaName( _rSource.m_aIanaName )
- {
- }
-
- //-------------------------------------------------------------------------
- CharsetIteratorDerefHelper:: CharsetIteratorDerefHelper(const rtl_TextEncoding _eEncoding, const ::rtl::OUString& _rIanaName )
- :m_eEncoding( _eEncoding )
- ,m_aIanaName( _rIanaName )
- {
- }
-
- //-------------------------------------------------------------------------
- CharsetIteratorDerefHelper::CharsetIteratorDerefHelper()
- :m_eEncoding(RTL_TEXTENCODING_DONTKNOW)
- {
- }
-
- //=========================================================================
- //= OCharsetMap::CharsetIterator
- //=========================================================================
- //-------------------------------------------------------------------------
- OCharsetMap::CharsetIterator::CharsetIterator(const OCharsetMap* _pContainer, OCharsetMap::TextEncBag::const_iterator _aPos )
- :m_pContainer( _pContainer )
- ,m_aPos( _aPos )
- {
- OSL_ENSURE( m_pContainer, "OCharsetMap::CharsetIterator::CharsetIterator : invalid container!" );
- }
-
- //-------------------------------------------------------------------------
- OCharsetMap::CharsetIterator::CharsetIterator(const CharsetIterator& _rSource)
- :m_pContainer( _rSource.m_pContainer )
- ,m_aPos( _rSource.m_aPos )
- {
- }
-
- //-------------------------------------------------------------------------
- OCharsetMap::CharsetIterator::~CharsetIterator()
- {
- }
-
- //-------------------------------------------------------------------------
- CharsetIteratorDerefHelper OCharsetMap::CharsetIterator::operator*() const
- {
- OSL_ENSURE( m_aPos != m_pContainer->m_aEncodings.end(), "OCharsetMap::CharsetIterator::operator*: invalid position!");
-
- rtl_TextEncoding eEncoding = *m_aPos;
- ::rtl::OUString sIanaName;
-
- if ( RTL_TEXTENCODING_DONTKNOW != eEncoding )
- { // it's not the virtual "system charset"
- const char* pIanaName = rtl_getMimeCharsetFromTextEncoding( eEncoding );
- OSL_ENSURE( pIanaName, "OCharsetMap::CharsetIterator: invalid mime name!" );
- if ( pIanaName )
- sIanaName = ::rtl::OUString::createFromAscii( pIanaName );
- }
- return CharsetIteratorDerefHelper( eEncoding, sIanaName );
- }
-
- //-------------------------------------------------------------------------
- const OCharsetMap::CharsetIterator& OCharsetMap::CharsetIterator::operator++()
- {
- OSL_ENSURE( m_aPos != m_pContainer->m_aEncodings.end(), "OCharsetMap::CharsetIterator::operator++ : invalid position!" );
- if ( m_aPos != m_pContainer->m_aEncodings.end())
- ++m_aPos;
- return *this;
- }
-
- //-------------------------------------------------------------------------
- const OCharsetMap::CharsetIterator& OCharsetMap::CharsetIterator::operator--()
- {
- OSL_ENSURE( m_aPos != m_pContainer->m_aEncodings.begin(), "OCharsetMap::CharsetIterator::operator-- : invalid position!" );
- if ( m_aPos != m_pContainer->m_aEncodings.begin() )
- --m_aPos;
- return *this;
- }
-
- //-------------------------------------------------------------------------
- bool operator==(const OCharsetMap::CharsetIterator& lhs, const OCharsetMap::CharsetIterator& rhs)
- {
- return ( lhs.m_pContainer == rhs.m_pContainer ) && ( lhs.m_aPos == rhs.m_aPos );
- }
-
-//.........................................................................
-} // namespace dbtools
-//.........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx
deleted file mode 100644
index bc05694898..0000000000
--- a/connectivity/source/commontools/dbconversion.cxx
+++ /dev/null
@@ -1,492 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <connectivity/dbconversion.hxx>
-#include <connectivity/dbcharset.hxx>
-#include <osl/diagnose.h>
-#ifndef _INC_STDIO
-#include <stdio.h>
-#endif
-#include <com/sun/star/sdbc/SQLException.hpp>
-#include <com/sun/star/util/Date.hpp>
-#include <com/sun/star/util/Time.hpp>
-#include <com/sun/star/util/DateTime.hpp>
-#include <rtl/ustrbuf.hxx>
-
-#define MAX_DAYS 3636532
-
-//.........................................................................
-namespace dbtools
-{
-//.........................................................................
-
-
- using namespace ::comphelper;
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::util;
- using namespace ::com::sun::star::sdb;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::beans;
-
-
- //------------------------------------------------------------------------------
- ::com::sun::star::util::Date DBTypeConversion::getStandardDate()
- {
- static ::com::sun::star::util::Date STANDARD_DB_DATE(1,1,1900);
- return STANDARD_DB_DATE;
- }
- //------------------------------------------------------------------------------
- ::rtl::OUString DBTypeConversion::toDateString(const Date& rDate)
- {
- sal_Char s[11];
- snprintf(s,
- sizeof(s),
- "%04d-%02d-%02d",
- (int)rDate.Year,
- (int)rDate.Month,
- (int)rDate.Day);
- s[10] = 0;
- return ::rtl::OUString::createFromAscii(s);
- }
- //------------------------------------------------------------------
- ::rtl::OUString DBTypeConversion::toTimeString(const Time& rTime)
- {
- sal_Char s[9];
- snprintf(s,
- sizeof(s),
- "%02d:%02d:%02d",
- (int)rTime.Hours,
- (int)rTime.Minutes,
- (int)rTime.Seconds);
- s[8] = 0;
- return ::rtl::OUString::createFromAscii(s);
- }
-
- //------------------------------------------------------------------
- ::rtl::OUString DBTypeConversion::toDateTimeString(const DateTime& _rDateTime)
- {
- Date aDate(_rDateTime.Day,_rDateTime.Month,_rDateTime.Year);
- ::rtl::OUStringBuffer aTemp(toDateString(aDate));
- aTemp.appendAscii(" ");
- Time aTime(0,_rDateTime.Seconds,_rDateTime.Minutes,_rDateTime.Hours);
- aTemp.append( toTimeString(aTime) );
- aTemp.appendAscii(".");
- aTemp.append( static_cast<sal_Int32>(_rDateTime.HundredthSeconds));
- return aTemp.makeStringAndClear();
- }
- //------------------------------------------------------------------------------
- Date DBTypeConversion::toDate(sal_Int32 _nVal)
- {
- Date aReturn;
- aReturn.Day = (sal_uInt16)(_nVal % 100);
- aReturn.Month = (sal_uInt16)((_nVal / 100) % 100);
- aReturn.Year = (sal_uInt16)(_nVal / 10000);
- return aReturn;
- }
-
- //------------------------------------------------------------------------------
- Time DBTypeConversion::toTime(sal_Int32 _nVal)
- {
- Time aReturn;
- aReturn.Hours = (sal_uInt16)(((sal_uInt32)(_nVal >= 0 ? _nVal : _nVal*-1)) / 1000000);
- aReturn.Minutes = (sal_uInt16)((((sal_uInt32)(_nVal >= 0 ? _nVal : _nVal*-1)) / 10000) % 100);
- aReturn.Seconds = (sal_uInt16)((((sal_uInt32)(_nVal >= 0 ? _nVal : _nVal*-1)) / 100) % 100);
- aReturn.HundredthSeconds = (sal_uInt16)(((sal_uInt32)(_nVal >= 0 ? _nVal : _nVal*-1)) % 100);
- return aReturn;
- }
-
- const double fMilliSecondsPerDay = 86400000.0;
- //------------------------------------------------------------------------------
- sal_Int32 DBTypeConversion::toINT32(const Date& rVal)
- {
- return ((sal_Int32)(rVal.Day%100)) +
- (((sal_Int32)(rVal.Month%100))*100) +
- (((sal_Int32) rVal.Year%10000)*10000);
- }
-
- //------------------------------------------------------------------------------
- sal_Int32 DBTypeConversion::toINT32(const Time& rVal)
- {
- // Zeit normalisieren
- sal_Int32 nSeconds = rVal.Seconds + rVal.HundredthSeconds / 100;
- sal_Int32 nHundredthSeconds = rVal.HundredthSeconds % 100;
- sal_Int32 nMinutes = rVal.Minutes + nSeconds / 60;
- nSeconds = nSeconds % 60;
- sal_Int32 nHours = rVal.Hours + nMinutes / 60;
- nMinutes = nMinutes % 60;
-
- // Zeit zusammenbauen
- return (sal_Int32)(nHundredthSeconds + (nSeconds*100) + (nMinutes*10000) + (nHours*1000000));
- }
-
- //------------------------------------------------------------------------------
- sal_Int64 DBTypeConversion::toINT64(const DateTime& rVal)
- {
- // Zeit normalisieren
- sal_Int32 nSeconds = rVal.Seconds + rVal.HundredthSeconds / 100;
- sal_Int32 nHundredthSeconds = rVal.HundredthSeconds % 100;
- sal_Int32 nMinutes = rVal.Minutes + nSeconds / 60;
- nSeconds = nSeconds % 60;
- sal_Int32 nHours = rVal.Hours + nMinutes / 60;
- nMinutes = nMinutes % 60;
-
- // Zeit zusammenbauen
- sal_Int32 nTime = (sal_Int32)(nHundredthSeconds + (nSeconds*100) + (nMinutes*10000) + (nHours*1000000));
- sal_Int32 nDate = ((sal_Int32)(rVal.Day%100)) + (((sal_Int32)(rVal.Month%100))*100) + (((sal_Int32) rVal.Year%10000)*10000);
- sal_Int64 nRet;
-
- nRet = (sal_Int64) nTime;
- nRet <<= 32;
- nRet += nDate;
-
- return nRet;
- }
-
- //------------------------------------------------------------------------------
- sal_Int32 DBTypeConversion::getMsFromTime(const Time& rVal)
- {
- sal_Int32 nHour = rVal.Hours;
- sal_Int32 nMin = rVal.Minutes;
- sal_Int32 nSec = rVal.Seconds;
- sal_Int32 n100Sec = rVal.HundredthSeconds;
-
- return ((nHour*3600000)+(nMin*60000)+(nSec*1000)+(n100Sec*10));
- }
-
- //------------------------------------------------------------------------------
- static sal_Int32 aDaysInMonth[12] = { 31, 28, 31, 30, 31, 30,
- 31, 31, 30, 31, 30, 31 };
-
- //------------------------------------------------------------------------------
- static sal_Bool implIsLeapYear(sal_Int32 _nYear)
- {
- return ( ( ((_nYear % 4) == 0)
- && ((_nYear % 100) != 0)
- )
- )
- || ((_nYear % 400) == 0)
- ;
- }
-
- //------------------------------------------------------------------------------
- static sal_Int32 implDaysInMonth(sal_Int32 _nMonth, sal_Int32 _nYear)
- {
- OSL_ENSURE(_nMonth > 0 && _nMonth < 13,"Month as invalid value!");
- if (_nMonth != 2)
- return aDaysInMonth[_nMonth-1];
- else
- {
- if (implIsLeapYear(_nYear))
- return aDaysInMonth[_nMonth-1] + 1;
- else
- return aDaysInMonth[_nMonth-1];
- }
- }
-
- //------------------------------------------------------------------------------
- static sal_Int32 implRelativeToAbsoluteNull(const Date& _rDate)
- {
- sal_Int32 nDays = 0;
-
- // ripped this code from the implementation of tools::Date
- sal_Int32 nNormalizedYear = _rDate.Year - 1;
- nDays = nNormalizedYear * 365;
- // leap years
- nDays += (nNormalizedYear / 4) - (nNormalizedYear / 100) + (nNormalizedYear / 400);
-
- for (sal_Int32 i = 1; i < _rDate.Month; ++i)
- nDays += implDaysInMonth(i, _rDate.Year);
-
- nDays += _rDate.Day;
- return nDays;
- }
- //------------------------------------------------------------------------------
- static void implBuildFromRelative( sal_Int32 nDays, sal_uInt16& rDay, sal_uInt16& rMonth, sal_uInt16& rYear)
- {
- sal_Int32 nTempDays;
- sal_Int32 i = 0;
- sal_Bool bCalc;
-
- do
- {
- nTempDays = nDays;
- rYear = (sal_uInt16)((nTempDays / 365) - i);
- nTempDays -= (rYear-1) * 365;
- nTempDays -= ((rYear-1) / 4) - ((rYear-1) / 100) + ((rYear-1) / 400);
- bCalc = sal_False;
- if ( nTempDays < 1 )
- {
- i++;
- bCalc = sal_True;
- }
- else
- {
- if ( nTempDays > 365 )
- {
- if ( (nTempDays != 366) || !implIsLeapYear( rYear ) )
- {
- i--;
- bCalc = sal_True;
- }
- }
- }
- }
- while ( bCalc );
-
- rMonth = 1;
- while ( nTempDays > implDaysInMonth( rMonth, rYear ) )
- {
- nTempDays -= implDaysInMonth( rMonth, rYear );
- rMonth++;
- }
- rDay = (sal_uInt16)nTempDays;
- }
- //------------------------------------------------------------------------------
- sal_Int32 DBTypeConversion::toDays(const Date& _rVal, const Date& _rNullDate)
- {
- return implRelativeToAbsoluteNull(_rVal) - implRelativeToAbsoluteNull(_rNullDate);
- }
-
- //------------------------------------------------------------------------------
- double DBTypeConversion::toDouble(const Date& rVal, const Date& _rNullDate)
- {
- return (double)toDays(rVal, _rNullDate);
- }
-
- //------------------------------------------------------------------------------
- double DBTypeConversion::toDouble(const Time& rVal)
- {
- return (double)getMsFromTime(rVal) / fMilliSecondsPerDay;
- }
-
- //------------------------------------------------------------------------------
- double DBTypeConversion::toDouble(const DateTime& _rVal, const Date& _rNullDate)
- {
- sal_Int64 nTime = toDays(Date(_rVal.Day, _rVal.Month, _rVal.Year), _rNullDate);
- Time aTimePart;
-
- aTimePart.Hours = _rVal.Hours;
- aTimePart.Minutes = _rVal.Minutes;
- aTimePart.Seconds = _rVal.Seconds;
- aTimePart.HundredthSeconds = _rVal.HundredthSeconds;
-
- return ((double)nTime) + toDouble(aTimePart);
- }
- // -------------------------------------------------------------------------
- static void addDays(sal_Int32 nDays, Date& _rDate)
- {
- sal_Int32 nTempDays = implRelativeToAbsoluteNull( _rDate );
-
- nTempDays += nDays;
- if ( nTempDays > MAX_DAYS )
- {
- _rDate.Day = 31;
- _rDate.Month = 12;
- _rDate.Year = 9999;
- }
- else if ( nTempDays <= 0 )
- {
- _rDate.Day = 1;
- _rDate.Month = 1;
- _rDate.Year = 00;
- }
- else
- implBuildFromRelative( nTempDays, _rDate.Day, _rDate.Month, _rDate.Year );
- }
- // -----------------------------------------------------------------------
- static void subDays( sal_Int32 nDays, Date& _rDate )
- {
- sal_Int32 nTempDays = implRelativeToAbsoluteNull( _rDate );
-
- nTempDays -= nDays;
- if ( nTempDays > MAX_DAYS )
- {
- _rDate.Day = 31;
- _rDate.Month = 12;
- _rDate.Year = 9999;
- }
- else if ( nTempDays <= 0 )
- {
- _rDate.Day = 1;
- _rDate.Month = 1;
- _rDate.Year = 00;
- }
- else
- implBuildFromRelative( nTempDays, _rDate.Day, _rDate.Month, _rDate.Year );
- }
- // -------------------------------------------------------------------------
- Date DBTypeConversion::toDate(double dVal, const Date& _rNullDate)
- {
- Date aRet = _rNullDate;
-
- if (dVal >= 0)
- addDays((sal_Int32)dVal,aRet);
- else
- subDays((sal_uInt32)(-dVal),aRet);
- // x -= (sal_uInt32)(-nDays);
-
- return aRet;
- }
- // -------------------------------------------------------------------------
- Time DBTypeConversion::toTime(double dVal)
- {
- sal_Int32 nDays = (sal_Int32)dVal;
- sal_Int32 nMS = sal_Int32((dVal - (double)nDays) * fMilliSecondsPerDay + 0.5);
-
- sal_Int16 nSign;
- if ( nMS < 0 )
- {
- nMS *= -1;
- nSign = -1;
- }
- else
- nSign = 1;
-
- Time xRet;
- // Zeit normalisieren
- // we have to sal_Int32 here because otherwise we get an overflow
- sal_Int32 nHundredthSeconds = nMS/10;
- sal_Int32 nSeconds = nHundredthSeconds / 100;
- sal_Int32 nMinutes = nSeconds / 60;
-
- xRet.HundredthSeconds = (sal_uInt16)(nHundredthSeconds % 100);
- xRet.Seconds = (sal_uInt16)(nSeconds % 60);
- xRet.Hours = (sal_uInt16)(nMinutes / 60);
- xRet.Minutes = (sal_uInt16)(nMinutes % 60);
-
- // Zeit zusammenbauen
- sal_Int32 nTime = (sal_Int32)(xRet.HundredthSeconds + (xRet.Seconds*100) + (xRet.Minutes*10000) + (xRet.Hours*1000000)) * nSign;
-
- if(nTime < 0)
- {
- xRet.HundredthSeconds = 99;
- xRet.Minutes = 59;
- xRet.Seconds = 59;
- xRet.Hours = 23;
- }
- return xRet;
- }
- //------------------------------------------------------------------------------
- DateTime DBTypeConversion::toDateTime(double dVal, const Date& _rNullDate)
- {
- Date aDate = toDate(dVal, _rNullDate);
- Time aTime = toTime(dVal);
-
- DateTime xRet;
-
- xRet.Day = aDate.Day;
- xRet.Month = aDate.Month;
- xRet.Year = aDate.Year;
-
- xRet.HundredthSeconds = aTime.HundredthSeconds;
- xRet.Minutes = aTime.Minutes;
- xRet.Seconds = aTime.Seconds;
- xRet.Hours = aTime.Hours;
-
-
- return xRet;
- }
- //------------------------------------------------------------------------------
- Date DBTypeConversion::toDate(const ::rtl::OUString& _sSQLString)
- {
- // get the token out of a string
- static sal_Unicode sDateSep = '-';
-
- sal_Int32 nIndex = 0;
- sal_uInt16 nYear = 0,
- nMonth = 0,
- nDay = 0;
- nYear = (sal_uInt16)_sSQLString.getToken(0,sDateSep,nIndex).toInt32();
- if(nIndex != -1)
- {
- nMonth = (sal_uInt16)_sSQLString.getToken(0,sDateSep,nIndex).toInt32();
- if(nIndex != -1)
- nDay = (sal_uInt16)_sSQLString.getToken(0,sDateSep,nIndex).toInt32();
- }
-
- return Date(nDay,nMonth,nYear);
- }
-
- //-----------------------------------------------------------------------------
- DateTime DBTypeConversion::toDateTime(const ::rtl::OUString& _sSQLString)
- {
- //@see http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Timestamp.html#valueOf(java.lang.String)
- //@see http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Date.html#valueOf(java.lang.String)
- //@see http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Time.html#valueOf(java.lang.String)
-
- // the date part
- Date aDate = toDate(_sSQLString);
- Time aTime;
- sal_Int32 nSeparation = _sSQLString.indexOf( ' ' );
- if ( -1 != nSeparation )
- aTime = toTime( _sSQLString.copy( nSeparation ) );
-
- return DateTime(aTime.HundredthSeconds,aTime.Seconds,aTime.Minutes,aTime.Hours,aDate.Day,aDate.Month,aDate.Year);
- }
-
- //-----------------------------------------------------------------------------
- Time DBTypeConversion::toTime(const ::rtl::OUString& _sSQLString)
- {
- static sal_Unicode sTimeSep = ':';
-
- sal_Int32 nIndex = 0;
- sal_uInt16 nHour = 0,
- nMinute = 0,
- nSecond = 0,
- nHundredthSeconds = 0;
- nHour = (sal_uInt16)_sSQLString.getToken(0,sTimeSep,nIndex).toInt32();
- if(nIndex != -1)
- {
- nMinute = (sal_uInt16)_sSQLString.getToken(0,sTimeSep,nIndex).toInt32();
- if(nIndex != -1)
- {
- nSecond = (sal_uInt16)_sSQLString.getToken(0,sTimeSep,nIndex).toInt32();
- nIndex = 0;
- ::rtl::OUString sNano(_sSQLString.getToken(1,'.',nIndex));
- if ( sNano.getLength() )
- {
- // our time struct only supports hundredth seconds
- sNano = sNano.copy(0,::std::min<sal_Int32>(sNano.getLength(),2));
- const static ::rtl::OUString s_Zeros(RTL_CONSTASCII_USTRINGPARAM("00"));
- sNano += s_Zeros.copy(0,s_Zeros.getLength() - sNano.getLength());
- nHundredthSeconds = static_cast<sal_uInt16>(sNano.toInt32());
- }
- }
- }
- return Time(nHundredthSeconds,nSecond,nMinute,nHour);
- }
-
-//.........................................................................
-} // namespace dbtools
-//.........................................................................
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/dbexception.cxx b/connectivity/source/commontools/dbexception.cxx
deleted file mode 100644
index 8239f81583..0000000000
--- a/connectivity/source/commontools/dbexception.cxx
+++ /dev/null
@@ -1,566 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <connectivity/dbexception.hxx>
-#include <comphelper/types.hxx>
-#include <cppuhelper/exc_hlp.hxx>
-#include <osl/diagnose.h>
-#include <com/sun/star/sdb/SQLContext.hpp>
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/sdb/SQLErrorEvent.hpp>
-#include "TConnection.hxx"
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-
-//.........................................................................
-namespace dbtools
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::sdb;
- using namespace ::com::sun::star::sdbc;
- using namespace ::comphelper;
- using namespace ::connectivity;
-
-//==============================================================================
-//= SQLExceptionInfo - encapsulating the type info of an SQLException-derived class
-//==============================================================================
-//------------------------------------------------------------------------------
-SQLExceptionInfo::SQLExceptionInfo()
- :m_eType(UNDEFINED)
-{
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionInfo::SQLExceptionInfo(const ::com::sun::star::sdbc::SQLException& _rError)
-{
- m_aContent <<= _rError;
- implDetermineType();
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionInfo::SQLExceptionInfo(const ::com::sun::star::sdbc::SQLWarning& _rError)
-{
- m_aContent <<= _rError;
- implDetermineType();
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionInfo::SQLExceptionInfo(const ::com::sun::star::sdb::SQLContext& _rError)
-{
- m_aContent <<= _rError;
- implDetermineType();
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionInfo::SQLExceptionInfo( const ::rtl::OUString& _rSimpleErrorMessage )
-{
- SQLException aError;
- aError.Message = _rSimpleErrorMessage;
- m_aContent <<= aError;
- implDetermineType();
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionInfo::SQLExceptionInfo(const SQLExceptionInfo& _rCopySource)
- :m_aContent(_rCopySource.m_aContent)
- ,m_eType(_rCopySource.m_eType)
-{
-}
-
-//------------------------------------------------------------------------------
-const SQLExceptionInfo& SQLExceptionInfo::operator=(const ::com::sun::star::sdbc::SQLException& _rError)
-{
- m_aContent <<= _rError;
- implDetermineType();
- return *this;
-}
-
-//------------------------------------------------------------------------------
-const SQLExceptionInfo& SQLExceptionInfo::operator=(const ::com::sun::star::sdbc::SQLWarning& _rError)
-{
- m_aContent <<= _rError;
- implDetermineType();
- return *this;
-}
-
-//------------------------------------------------------------------------------
-const SQLExceptionInfo& SQLExceptionInfo::operator=(const ::com::sun::star::sdb::SQLContext& _rError)
-{
- m_aContent <<= _rError;
- implDetermineType();
- return *this;
-}
-
-//------------------------------------------------------------------------------
-const SQLExceptionInfo& SQLExceptionInfo::operator=(const ::com::sun::star::sdb::SQLErrorEvent& _rErrorEvent)
-{
- m_aContent = _rErrorEvent.Reason;
- implDetermineType();
- return *this;
-}
-
-//------------------------------------------------------------------------------
-const SQLExceptionInfo& SQLExceptionInfo::operator=(const ::com::sun::star::uno::Any& _rCaughtSQLException)
-{
- m_aContent = _rCaughtSQLException;
- implDetermineType();
- return *this;
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionInfo::SQLExceptionInfo(const ::com::sun::star::sdb::SQLErrorEvent& _rError)
-{
- m_aContent = _rError.Reason;
- implDetermineType();
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionInfo::SQLExceptionInfo(const staruno::Any& _rError)
-{
- const staruno::Type& aSQLExceptionType = ::getCppuType(reinterpret_cast< ::com::sun::star::sdbc::SQLException*>(NULL));
- sal_Bool bValid = isAssignableFrom(aSQLExceptionType, _rError.getValueType());
- if (bValid)
- m_aContent = _rError;
- // no assertion here : if used with the NextException member of an SQLException bValid==sal_False is allowed.
-
- implDetermineType();
-}
-
-//------------------------------------------------------------------------------
-void SQLExceptionInfo::implDetermineType()
-{
- staruno::Type aContentType = m_aContent.getValueType();
-
- const Type& aSQLExceptionType = ::getCppuType( reinterpret_cast< SQLException* >( NULL ) );
- const Type& aSQLWarningType = ::getCppuType( reinterpret_cast< SQLWarning* >( NULL ) );
- const Type& aSQLContextType = ::getCppuType( reinterpret_cast< SQLContext* >( NULL ) );
-
- if ( isAssignableFrom( aSQLContextType, m_aContent.getValueType() ) )
- m_eType = SQL_CONTEXT;
- else if ( isAssignableFrom( aSQLWarningType, m_aContent.getValueType() ) )
- m_eType = SQL_WARNING;
- else if ( isAssignableFrom( aSQLExceptionType, m_aContent.getValueType() ) )
- m_eType = SQL_EXCEPTION;
- else
- {
- m_eType = UNDEFINED;
- m_aContent.clear();
- }
-}
-
-//------------------------------------------------------------------------------
-sal_Bool SQLExceptionInfo::isKindOf(TYPE _eType) const
-{
- switch (_eType)
- {
- case SQL_CONTEXT:
- return (m_eType == SQL_CONTEXT);
- case SQL_WARNING:
- return (m_eType == SQL_CONTEXT) || (m_eType == SQL_WARNING);
- case SQL_EXCEPTION:
- return (m_eType == SQL_CONTEXT) || (m_eType == SQL_WARNING) || (m_eType == SQL_EXCEPTION);
- case UNDEFINED:
- return (m_eType == UNDEFINED);
- }
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionInfo::operator const ::com::sun::star::sdbc::SQLException*() const
-{
- OSL_ENSURE(isKindOf(SQL_EXCEPTION), "SQLExceptionInfo::operator SQLException* : invalid call !");
- return reinterpret_cast<const ::com::sun::star::sdbc::SQLException*>(m_aContent.getValue());
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionInfo::operator const ::com::sun::star::sdbc::SQLWarning*() const
-{
- OSL_ENSURE(isKindOf(SQL_WARNING), "SQLExceptionInfo::operator SQLException* : invalid call !");
- return reinterpret_cast<const ::com::sun::star::sdbc::SQLWarning*>(m_aContent.getValue());
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionInfo::operator const ::com::sun::star::sdb::SQLContext*() const
-{
- OSL_ENSURE(isKindOf(SQL_CONTEXT), "SQLExceptionInfo::operator SQLException* : invalid call !");
- return reinterpret_cast<const ::com::sun::star::sdb::SQLContext*>(m_aContent.getValue());
-}
-
-//------------------------------------------------------------------------------
-void SQLExceptionInfo::prepend( const ::rtl::OUString& _rErrorMessage, const sal_Char* _pAsciiSQLState, const sal_Int32 _nErrorCode )
-{
- SQLException aException;
- aException.Message = _rErrorMessage;
- aException.ErrorCode = _nErrorCode;
- aException.SQLState = _pAsciiSQLState ? ::rtl::OUString::createFromAscii( _pAsciiSQLState ) : ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "S1000" ));
- aException.NextException = m_aContent;
- m_aContent <<= aException;
-
- m_eType = SQL_EXCEPTION;
-}
-
-//------------------------------------------------------------------------------
-void SQLExceptionInfo::append( TYPE _eType, const ::rtl::OUString& _rErrorMessage, const sal_Char* _pAsciiSQLState, const sal_Int32 _nErrorCode )
-{
- // create the to-be-appended exception
- Any aAppend;
- switch ( _eType )
- {
- case SQL_EXCEPTION: aAppend <<= SQLException(); break;
- case SQL_WARNING: aAppend <<= SQLWarning(); break;
- case SQL_CONTEXT: aAppend <<= SQLContext(); break;
- default:
- OSL_FAIL( "SQLExceptionInfo::append: invalid exception type: this will crash!" );
- break;
- }
-
- SQLException* pAppendException( static_cast< SQLException* >( const_cast< void* >( aAppend.getValue() ) ) );
- pAppendException->Message = _rErrorMessage;
- pAppendException->SQLState = ::rtl::OUString::createFromAscii( _pAsciiSQLState );
- pAppendException->ErrorCode = _nErrorCode;
-
- // find the end of the current chain
- Any* pChainIterator = &m_aContent;
- SQLException* pLastException = NULL;
- const Type& aSQLExceptionType( ::getCppuType< SQLException >() );
- while ( pChainIterator )
- {
- if ( !pChainIterator->hasValue() )
- break;
-
- if ( !isAssignableFrom( aSQLExceptionType, pChainIterator->getValueType() ) )
- break;
-
- pLastException = static_cast< SQLException* >( const_cast< void* >( pChainIterator->getValue() ) );
- pChainIterator = &pLastException->NextException;
- }
-
- // append
- if ( pLastException )
- pLastException->NextException = aAppend;
- else
- {
- m_aContent = aAppend;
- m_eType = _eType;
- }
-}
-
-//------------------------------------------------------------------------------
-void SQLExceptionInfo::doThrow()
-{
- if ( m_aContent.getValueTypeClass() == TypeClass_EXCEPTION )
- ::cppu::throwException( m_aContent );
- throw RuntimeException();
-}
-
-//==============================================================================
-//= SQLExceptionIteratorHelper
-//==============================================================================
-
-//------------------------------------------------------------------------------
-SQLExceptionIteratorHelper::SQLExceptionIteratorHelper( const SQLExceptionInfo& _rChainStart )
- :m_pCurrent( NULL )
- ,m_eCurrentType( SQLExceptionInfo::UNDEFINED )
-{
- if ( _rChainStart.isValid() )
- {
- m_pCurrent = (const SQLException*)_rChainStart;
- m_eCurrentType = _rChainStart.getType();
- }
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionIteratorHelper::SQLExceptionIteratorHelper( const ::com::sun::star::sdbc::SQLException& _rChainStart )
- :m_pCurrent( &_rChainStart )
- ,m_eCurrentType( SQLExceptionInfo::SQL_EXCEPTION )
-{
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionIteratorHelper::SQLExceptionIteratorHelper( const ::com::sun::star::sdbc::SQLWarning& _rChainStart )
- :m_pCurrent( &_rChainStart )
- ,m_eCurrentType( SQLExceptionInfo::SQL_WARNING )
-{
-}
-
-//------------------------------------------------------------------------------
-SQLExceptionIteratorHelper::SQLExceptionIteratorHelper( const ::com::sun::star::sdb::SQLContext& _rChainStart )
- :m_pCurrent( &_rChainStart )
- ,m_eCurrentType( SQLExceptionInfo::SQL_CONTEXT )
-{
-}
-
-//------------------------------------------------------------------------------
-void SQLExceptionIteratorHelper::current( SQLExceptionInfo& _out_rInfo ) const
-{
- switch ( m_eCurrentType )
- {
- case SQLExceptionInfo::SQL_EXCEPTION:
- _out_rInfo = *m_pCurrent;
- break;
-
- case SQLExceptionInfo::SQL_WARNING:
- _out_rInfo = *static_cast< const SQLWarning* >( m_pCurrent );
- break;
-
- case SQLExceptionInfo::SQL_CONTEXT:
- _out_rInfo = *static_cast< const SQLContext* >( m_pCurrent );
- break;
-
- default:
- _out_rInfo = Any();
- break;
- }
-}
-
-//------------------------------------------------------------------------------
-const ::com::sun::star::sdbc::SQLException* SQLExceptionIteratorHelper::next()
-{
- OSL_ENSURE( hasMoreElements(), "SQLExceptionIteratorHelper::next : invalid call (please use hasMoreElements)!" );
-
- const ::com::sun::star::sdbc::SQLException* pReturn = current();
- if ( !m_pCurrent )
- return pReturn;
-
- // check for the next element within the chain
- const Type aTypeException( ::cppu::UnoType< SQLException >::get() );
-
- Type aNextElementType = m_pCurrent->NextException.getValueType();
- if ( !isAssignableFrom( aTypeException, aNextElementType ) )
- {
- // no SQLException at all in the next chain element
- m_pCurrent = NULL;
- m_eCurrentType = SQLExceptionInfo::UNDEFINED;
- return pReturn;
- }
-
- m_pCurrent = static_cast< const SQLException* >( m_pCurrent->NextException.getValue() );
-
- // no finally determine the proper type of the exception
- const Type aTypeContext( ::cppu::UnoType< SQLContext >::get() );
- if ( isAssignableFrom( aTypeContext, aNextElementType ) )
- {
- m_eCurrentType = SQLExceptionInfo::SQL_CONTEXT;
- return pReturn;
- }
-
- const Type aTypeWarning( ::cppu::UnoType< SQLWarning >::get() );
- if ( isAssignableFrom( aTypeWarning, aNextElementType ) )
- {
- m_eCurrentType = SQLExceptionInfo::SQL_WARNING;
- return pReturn;
- }
-
- // a simple SQLException
- m_eCurrentType = SQLExceptionInfo::SQL_EXCEPTION;
- return pReturn;
-}
-
-//------------------------------------------------------------------------------
-void SQLExceptionIteratorHelper::next( SQLExceptionInfo& _out_rInfo )
-{
- current( _out_rInfo );
- next();
-}
-
-//------------------------------------------------------------
-void throwFunctionSequenceException(const Reference< XInterface >& _Context, const Any& _Next) throw ( ::com::sun::star::sdbc::SQLException )
-{
- ::connectivity::SharedResources aResources;
- throw SQLException(
- aResources.getResourceString(STR_ERRORMSG_SEQUENCE),
- _Context,
- getStandardSQLState( SQL_FUNCTION_SEQUENCE_ERROR ),
- 0,
- _Next
- );
-}
-// -----------------------------------------------------------------------------
-void throwInvalidIndexException(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _Context,
- const ::com::sun::star::uno::Any& _Next) throw ( ::com::sun::star::sdbc::SQLException )
-{
- ::connectivity::SharedResources aResources;
- throw SQLException(
- aResources.getResourceString(STR_INVALID_INDEX),
- _Context,
- getStandardSQLState( SQL_INVALID_DESCRIPTOR_INDEX ),
- 0,
- _Next
- );
-}
-// -----------------------------------------------------------------------------
-void throwFunctionNotSupportedException(const ::rtl::OUString& _rMsg,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _Context,
- const ::com::sun::star::uno::Any& _Next) throw ( ::com::sun::star::sdbc::SQLException )
-{
- throw SQLException(
- _rMsg,
- _Context,
- getStandardSQLState( SQL_FUNCTION_NOT_SUPPORTED ),
- 0,
- _Next
- );
-}
-// -----------------------------------------------------------------------------
-void throwFunctionNotSupportedException( const sal_Char* _pAsciiFunctionName, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
- const ::com::sun::star::uno::Any* _pNextException ) throw ( ::com::sun::star::sdbc::SQLException )
-{
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_UNSUPPORTED_FUNCTION,
- "$functionname$", ::rtl::OUString::createFromAscii( _pAsciiFunctionName )
- ) );
- throw SQLException(
- sError,
- _rxContext,
- getStandardSQLState( SQL_FUNCTION_NOT_SUPPORTED ),
- 0,
- _pNextException ? *_pNextException : Any()
- );
-}
-// -----------------------------------------------------------------------------
-void throwGenericSQLException(const ::rtl::OUString& _rMsg, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxSource)
- throw (::com::sun::star::sdbc::SQLException)
-{
- throwGenericSQLException(_rMsg, _rxSource, Any());
-}
-
-// -----------------------------------------------------------------------------
-void throwGenericSQLException(const ::rtl::OUString& _rMsg, const Reference< XInterface >& _rxSource, const Any& _rNextException)
- throw (SQLException)
-{
- throw SQLException( _rMsg, _rxSource, getStandardSQLState( SQL_GENERAL_ERROR ), 0, _rNextException);
-}
-
-// -----------------------------------------------------------------------------
-void throwFeatureNotImplementedException( const sal_Char* _pAsciiFeatureName, const Reference< XInterface >& _rxContext, const Any* _pNextException )
- throw (SQLException)
-{
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_UNSUPPORTED_FEATURE,
- "$featurename$", ::rtl::OUString::createFromAscii( _pAsciiFeatureName )
- ) );
-
- throw SQLException(
- sError,
- _rxContext,
- getStandardSQLState( SQL_FEATURE_NOT_IMPLEMENTED ),
- 0,
- _pNextException ? *_pNextException : Any()
- );
-}
-
-// -----------------------------------------------------------------------------
-void throwSQLException( const sal_Char* _pAsciiMessage, const sal_Char* _pAsciiState,
- const Reference< XInterface >& _rxContext, const sal_Int32 _nErrorCode, const Any* _pNextException ) throw (SQLException)
-{
- throw SQLException(
- ::rtl::OUString::createFromAscii( _pAsciiMessage ),
- _rxContext,
- ::rtl::OUString::createFromAscii( _pAsciiState ),
- _nErrorCode,
- _pNextException ? *_pNextException : Any()
- );
-}
-
-// -----------------------------------------------------------------------------
-void throwSQLException( const sal_Char* _pAsciiMessage, StandardSQLState _eSQLState,
- const Reference< XInterface >& _rxContext, const sal_Int32 _nErrorCode,
- const Any* _pNextException ) throw (SQLException)
-{
- throwSQLException( _pAsciiMessage, getStandardSQLStateAscii( _eSQLState ), _rxContext, _nErrorCode, _pNextException );
-}
-
-// -----------------------------------------------------------------------------
-void throwSQLException( const ::rtl::OUString& _rMessage, StandardSQLState _eSQLState,
- const Reference< XInterface >& _rxContext, const sal_Int32 _nErrorCode,
- const Any* _pNextException ) throw (SQLException)
-{
- throw SQLException(
- _rMessage,
- _rxContext,
- getStandardSQLState( _eSQLState ),
- _nErrorCode,
- _pNextException ? *_pNextException : Any()
- );
-}
-
-// -----------------------------------------------------------------------------
-const sal_Char* getStandardSQLStateAscii( StandardSQLState _eState )
-{
- const sal_Char* pAsciiState = NULL;
- switch ( _eState )
- {
- case SQL_WRONG_PARAMETER_NUMBER: pAsciiState = "07001"; break;
- case SQL_INVALID_DESCRIPTOR_INDEX: pAsciiState = "07009"; break;
- case SQL_UNABLE_TO_CONNECT: pAsciiState = "08001"; break;
- case SQL_NUMERIC_OUT_OF_RANGE: pAsciiState = "22003"; break;
- case SQL_INVALID_DATE_TIME: pAsciiState = "22007"; break;
- case SQL_INVALID_CURSOR_STATE: pAsciiState = "24000"; break;
- case SQL_TABLE_OR_VIEW_EXISTS: pAsciiState = "42S01"; break;
- case SQL_TABLE_OR_VIEW_NOT_FOUND: pAsciiState = "42S02"; break;
- case SQL_INDEX_ESISTS: pAsciiState = "42S11"; break;
- case SQL_INDEX_NOT_FOUND: pAsciiState = "42S12"; break;
- case SQL_COLUMN_EXISTS: pAsciiState = "42S21"; break;
- case SQL_COLUMN_NOT_FOUND: pAsciiState = "42S22"; break;
- case SQL_GENERAL_ERROR: pAsciiState = "HY000"; break;
- case SQL_INVALID_SQL_DATA_TYPE: pAsciiState = "HY004"; break;
- case SQL_OPERATION_CANCELED: pAsciiState = "HY008"; break;
- case SQL_FUNCTION_SEQUENCE_ERROR: pAsciiState = "HY010"; break;
- case SQL_INVALID_CURSOR_POSITION: pAsciiState = "HY109"; break;
- case SQL_INVALID_BOOKMARK_VALUE: pAsciiState = "HY111"; break;
- case SQL_FEATURE_NOT_IMPLEMENTED: pAsciiState = "HYC00"; break;
- case SQL_FUNCTION_NOT_SUPPORTED: pAsciiState = "IM001"; break;
- case SQL_CONNECTION_DOES_NOT_EXIST: pAsciiState = "08003"; break;
-
- default:
- break;
- }
- if ( !pAsciiState )
- throw RuntimeException();
- return pAsciiState;
-}
-
-// -----------------------------------------------------------------------------
-::rtl::OUString getStandardSQLState( StandardSQLState _eState )
-{
- return ::rtl::OUString::createFromAscii( getStandardSQLStateAscii( _eState ) );
-}
-
-// -----------------------------------------------------------------------------
-//.........................................................................
-} // namespace dbtools
-//.........................................................................
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx
deleted file mode 100644
index 04483aa9e9..0000000000
--- a/connectivity/source/commontools/dbmetadata.cxx
+++ /dev/null
@@ -1,451 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "connectivity/dbmetadata.hxx"
-#include "connectivity/dbexception.hxx"
-#include "connectivity/DriversConfig.hxx"
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/sdb/BooleanComparisonMode.hpp>
-#include <com/sun/star/sdbc/XDatabaseMetaData2.hpp>
-#include <com/sun/star/sdbcx/XUsersSupplier.hpp>
-#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
-#include <com/sun/star/sdbc/XDriverAccess.hpp>
-/** === end UNO includes === **/
-
-#include <tools/diagnose_ex.h>
-#include <comphelper/namedvaluecollection.hxx>
-#include <comphelper/componentcontext.hxx>
-#include <comphelper/processfactory.hxx>
-#include <sal/macros.h>
-
-#include <boost/optional.hpp>
-
-//........................................................................
-namespace dbtools
-{
-//........................................................................
-
- /** === begin UNO using === **/
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::sdbc::XConnection;
- using ::com::sun::star::sdbc::XConnection;
- using ::com::sun::star::sdbc::XDatabaseMetaData;
- using ::com::sun::star::sdbc::XDatabaseMetaData2;
- using ::com::sun::star::lang::IllegalArgumentException;
- using ::com::sun::star::uno::Exception;
- using ::com::sun::star::uno::Any;
- using ::com::sun::star::container::XChild;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
- using ::com::sun::star::beans::XPropertySet;
- using ::com::sun::star::uno::Sequence;
- using ::com::sun::star::beans::PropertyValue;
- using ::com::sun::star::beans::XPropertySetInfo;
- using ::com::sun::star::uno::UNO_QUERY;
- using ::com::sun::star::sdbcx::XUsersSupplier;
- using ::com::sun::star::sdbcx::XDataDefinitionSupplier;
- using ::com::sun::star::sdbc::XDriverAccess;
- using ::com::sun::star::uno::UNO_SET_THROW;
- /** === end UNO using === **/
- namespace BooleanComparisonMode = ::com::sun::star::sdb::BooleanComparisonMode;
-
- //====================================================================
- //= DatabaseMetaData_Impl
- //====================================================================
- struct DatabaseMetaData_Impl
- {
- Reference< XConnection > xConnection;
- Reference< XDatabaseMetaData > xConnectionMetaData;
- ::connectivity::DriversConfig aDriverConfig;
-
- ::boost::optional< ::rtl::OUString > sCachedIdentifierQuoteString;
- ::boost::optional< ::rtl::OUString > sCachedCatalogSeparator;
-
- DatabaseMetaData_Impl()
- :xConnection()
- ,xConnectionMetaData()
- ,aDriverConfig( ::comphelper::getProcessServiceFactory() )
- ,sCachedIdentifierQuoteString()
- ,sCachedCatalogSeparator()
- {
- }
- };
-
- //--------------------------------------------------------------------
- namespace
- {
- //................................................................
- static void lcl_construct( DatabaseMetaData_Impl& _metaDataImpl, const Reference< XConnection >& _connection )
- {
- _metaDataImpl.xConnection = _connection;
- if ( !_metaDataImpl.xConnection.is() )
- return;
-
- _metaDataImpl.xConnectionMetaData = _connection->getMetaData();
- if ( !_metaDataImpl.xConnectionMetaData.is() )
- throw IllegalArgumentException();
- }
-
- //................................................................
- static void lcl_checkConnected( const DatabaseMetaData_Impl& _metaDataImpl )
- {
- if ( !_metaDataImpl.xConnection.is() || !_metaDataImpl.xConnectionMetaData.is() )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(STR_NO_CONNECTION_GIVEN));
- throwSQLException( sError, SQL_CONNECTION_DOES_NOT_EXIST, NULL );
- }
- }
-
- //................................................................
- static bool lcl_getDriverSetting( const sal_Char* _asciiName, const DatabaseMetaData_Impl& _metaData, Any& _out_setting )
- {
- lcl_checkConnected( _metaData );
- const ::comphelper::NamedValueCollection& rDriverMetaData = _metaData.aDriverConfig.getMetaData( _metaData.xConnectionMetaData->getURL() );
- if ( !rDriverMetaData.has( _asciiName ) )
- return false;
- _out_setting = rDriverMetaData.get( _asciiName );
- return true;
- }
-
- //................................................................
- static bool lcl_getConnectionSetting( const sal_Char* _asciiName, const DatabaseMetaData_Impl& _metaData, Any& _out_setting )
- {
- try
- {
- Reference< XChild > xConnectionAsChild( _metaData.xConnection, UNO_QUERY );
- if ( xConnectionAsChild.is() )
- {
- Reference< XPropertySet > xDataSource( xConnectionAsChild->getParent(), UNO_QUERY_THROW );
- Reference< XPropertySet > xDataSourceSettings(
- xDataSource->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Settings" ) ) ),
- UNO_QUERY_THROW );
-
- _out_setting = xDataSourceSettings->getPropertyValue( ::rtl::OUString::createFromAscii( _asciiName ) );
- }
- else
- {
- Reference< XDatabaseMetaData2 > xExtendedMetaData( _metaData.xConnectionMetaData, UNO_QUERY_THROW );
- ::comphelper::NamedValueCollection aSettings( xExtendedMetaData->getConnectionInfo() );
- _out_setting = aSettings.get( _asciiName );
- return _out_setting.hasValue();
- }
- return true;
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return false;
- }
-
- //................................................................
- static const ::rtl::OUString& lcl_getConnectionStringSetting(
- const DatabaseMetaData_Impl& _metaData, ::boost::optional< ::rtl::OUString >& _cachedSetting,
- ::rtl::OUString (SAL_CALL XDatabaseMetaData::*_getter)() )
- {
- if ( !_cachedSetting )
- {
- lcl_checkConnected( _metaData );
- try
- {
- _cachedSetting.reset( (_metaData.xConnectionMetaData.get()->*_getter)() );
- }
- catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); }
- }
- return *_cachedSetting;
- }
- }
-
- //====================================================================
- //= DatabaseMetaData
- //====================================================================
- //--------------------------------------------------------------------
- DatabaseMetaData::DatabaseMetaData()
- :m_pImpl( new DatabaseMetaData_Impl )
- {
- }
-
- //--------------------------------------------------------------------
- DatabaseMetaData::DatabaseMetaData( const Reference< XConnection >& _connection )
- :m_pImpl( new DatabaseMetaData_Impl )
- {
- lcl_construct( *m_pImpl, _connection );
- }
-
- //--------------------------------------------------------------------
- DatabaseMetaData::DatabaseMetaData( const DatabaseMetaData& _copyFrom )
- :m_pImpl( new DatabaseMetaData_Impl( *_copyFrom.m_pImpl ) )
- {
- }
-
- //--------------------------------------------------------------------
- DatabaseMetaData& DatabaseMetaData::operator=( const DatabaseMetaData& _copyFrom )
- {
- if ( this == &_copyFrom )
- return *this;
-
- m_pImpl.reset( new DatabaseMetaData_Impl( *_copyFrom.m_pImpl ) );
- return *this;
- }
-
- //--------------------------------------------------------------------
- DatabaseMetaData::~DatabaseMetaData()
- {
- }
-
- //--------------------------------------------------------------------
- bool DatabaseMetaData::isConnected() const
- {
- return m_pImpl->xConnection.is();
- }
-
- //--------------------------------------------------------------------
- bool DatabaseMetaData::supportsSubqueriesInFrom() const
- {
- lcl_checkConnected( *m_pImpl );
-
- bool supportsSubQueries = false;
- try
- {
- sal_Int32 maxTablesInselect = m_pImpl->xConnectionMetaData->getMaxTablesInSelect();
- supportsSubQueries = ( maxTablesInselect > 1 ) || ( maxTablesInselect == 0 );
- // TODO: is there a better way to determine this? The above is not really true. More precise,
- // it's a *very* generous heuristics ...
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return supportsSubQueries;
- }
-
- //--------------------------------------------------------------------
- bool DatabaseMetaData::supportsPrimaryKeys() const
- {
- lcl_checkConnected( *m_pImpl );
-
- bool doesSupportPrimaryKeys = false;
- try
- {
- Any setting;
- if ( !( lcl_getConnectionSetting( "PrimaryKeySupport", *m_pImpl, setting ) )
- || !( setting >>= doesSupportPrimaryKeys )
- )
- doesSupportPrimaryKeys = m_pImpl->xConnectionMetaData->supportsCoreSQLGrammar();
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return doesSupportPrimaryKeys;
- }
-
- //--------------------------------------------------------------------
- const ::rtl::OUString& DatabaseMetaData::getIdentifierQuoteString() const
- {
- return lcl_getConnectionStringSetting( *m_pImpl, m_pImpl->sCachedIdentifierQuoteString, &XDatabaseMetaData::getIdentifierQuoteString );
- }
-
- //--------------------------------------------------------------------
- const ::rtl::OUString& DatabaseMetaData::getCatalogSeparator() const
- {
- return lcl_getConnectionStringSetting( *m_pImpl, m_pImpl->sCachedCatalogSeparator, &XDatabaseMetaData::getCatalogSeparator );
- }
-
- //--------------------------------------------------------------------
- bool DatabaseMetaData::restrictIdentifiersToSQL92() const
- {
- lcl_checkConnected( *m_pImpl );
-
- bool restrict( false );
- Any setting;
- if ( lcl_getConnectionSetting( "EnableSQL92Check", *m_pImpl, setting ) )
- OSL_VERIFY( setting >>= restrict );
- return restrict;
- }
-
- //--------------------------------------------------------------------
- bool DatabaseMetaData::generateASBeforeCorrelationName() const
- {
- bool doGenerate( true );
- Any setting;
- if ( lcl_getConnectionSetting( "GenerateASBeforeCorrelationName", *m_pImpl, setting ) )
- OSL_VERIFY( setting >>= doGenerate );
- return doGenerate;
- }
- //--------------------------------------------------------------------
- bool DatabaseMetaData::shouldEscapeDateTime() const
- {
- bool doGenerate( true );
- Any setting;
- if ( lcl_getConnectionSetting( "EscapeDateTime", *m_pImpl, setting ) )
- OSL_VERIFY( setting >>= doGenerate );
- return doGenerate;
- }
- //--------------------------------------------------------------------
- bool DatabaseMetaData::isAutoIncrementPrimaryKey() const
- {
- bool is( true );
- Any setting;
- if ( lcl_getDriverSetting( "AutoIncrementIsPrimaryKey", *m_pImpl, setting ) )
- OSL_VERIFY( setting >>= is );
- return is;
- }
- //--------------------------------------------------------------------
- sal_Int32 DatabaseMetaData::getBooleanComparisonMode() const
- {
- sal_Int32 mode( BooleanComparisonMode::EQUAL_INTEGER );
- Any setting;
- if ( lcl_getConnectionSetting( "BooleanComparisonMode", *m_pImpl, setting ) )
- OSL_VERIFY( setting >>= mode );
- return mode;
- }
- //--------------------------------------------------------------------
- bool DatabaseMetaData::supportsRelations() const
- {
- lcl_checkConnected( *m_pImpl );
- bool bSupport = false;
- try
- {
- bSupport = m_pImpl->xConnectionMetaData->supportsIntegrityEnhancementFacility();
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- try
- {
- if ( !bSupport )
- {
- const ::rtl::OUString url = m_pImpl->xConnectionMetaData->getURL();
- char pMySQL[] = "sdbc:mysql";
- bSupport = url.matchAsciiL(pMySQL,(SAL_N_ELEMENTS(pMySQL))-1);
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return bSupport;
- }
-
- //--------------------------------------------------------------------
- bool DatabaseMetaData::supportsColumnAliasInOrderBy() const
- {
- bool doGenerate( true );
- Any setting;
- if ( lcl_getConnectionSetting( "ColumnAliasInOrderBy", *m_pImpl, setting ) )
- OSL_VERIFY( setting >>= doGenerate );
- return doGenerate;
- }
-
- //--------------------------------------------------------------------
- bool DatabaseMetaData::supportsUserAdministration( const ::comphelper::ComponentContext& _rContext ) const
- {
- lcl_checkConnected( *m_pImpl );
-
- bool isSupported( false );
- try
- {
- // find the XUsersSupplier interface
- // - either directly at the connection
- Reference< XUsersSupplier > xUsersSupp( m_pImpl->xConnection, UNO_QUERY );
- if ( !xUsersSupp.is() )
- {
- // - or at the driver manager
- Reference< XDriverAccess > xDriverManager(
- _rContext.createComponent( "com.sun.star.sdbc.DriverManager" ), UNO_QUERY_THROW );
- Reference< XDataDefinitionSupplier > xDriver( xDriverManager->getDriverByURL( m_pImpl->xConnectionMetaData->getURL() ), UNO_QUERY );
- if ( xDriver.is() )
- xUsersSupp.set( xDriver->getDataDefinitionByConnection( m_pImpl->xConnection ), UNO_QUERY );
- }
-
- isSupported = ( xUsersSupp.is() && xUsersSupp->getUsers().is() );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return isSupported;
- }
-
- //--------------------------------------------------------------------
- bool DatabaseMetaData::displayEmptyTableFolders() const
- {
- bool doDisplay( true );
-#ifdef IMPLEMENTED_LATER
- Any setting;
- if ( lcl_getConnectionSetting( "DisplayEmptyTableFolders", *m_pImpl, setting ) )
- OSL_VERIFY( setting >>= doDisplay );
-#else
- try
- {
- Reference< XDatabaseMetaData > xMeta( m_pImpl->xConnectionMetaData, UNO_SET_THROW );
- ::rtl::OUString sConnectionURL( xMeta->getURL() );
- doDisplay = sConnectionURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:mysqlc" ) ) == 0;
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-#endif
- return doDisplay;
- }
- //--------------------------------------------------------------------
- bool DatabaseMetaData::supportsThreads() const
- {
- bool bSupported( true );
- try
- {
- Reference< XDatabaseMetaData > xMeta( m_pImpl->xConnectionMetaData, UNO_SET_THROW );
- ::rtl::OUString sConnectionURL( xMeta->getURL() );
- bSupported = sConnectionURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:mysqlc" ) ) != 0;
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return bSupported;
- }
-
-//........................................................................
-} // namespace dbtools
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
deleted file mode 100644
index a93a10cd40..0000000000
--- a/connectivity/source/commontools/dbtools.cxx
+++ /dev/null
@@ -1,2173 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "connectivity/CommonTools.hxx"
-#include "diagnose_ex.h"
-#include "TConnection.hxx"
-#include "connectivity/ParameterCont.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/awt/XWindow.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/form/FormComponentType.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/sdb/BooleanComparisonMode.hpp>
-#include <com/sun/star/sdb/CommandType.hpp>
-#include <com/sun/star/sdb/ParametersRequest.hpp>
-#include <com/sun/star/sdb/RowSetVetoException.hpp>
-#include <com/sun/star/sdb/SQLContext.hpp>
-#include <com/sun/star/sdb/XCompletedConnection.hpp>
-#include <com/sun/star/sdb/XInteractionSupplyParameters.hpp>
-#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
-#include <com/sun/star/sdb/XParametersSupplier.hpp>
-#include <com/sun/star/sdb/XQueriesSupplier.hpp>
-#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/sdbc/XDataSource.hpp>
-#include <com/sun/star/sdbc/XDriverManager.hpp>
-#include <com/sun/star/sdbc/XParameters.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XRowSet.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#include <com/sun/star/task/XInteractionHandler.hpp>
-#include <com/sun/star/task/XInteractionRequest.hpp>
-#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-#include <com/sun/star/uno/XNamingService.hpp>
-#include <com/sun/star/util/NumberFormat.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include <com/sun/star/util/XNumberFormatTypes.hpp>
-/** === end UNO includes === **/
-
-#include <comphelper/extract.hxx>
-#include <comphelper/interaction.hxx>
-#include <comphelper/property.hxx>
-#include <connectivity/conncleanup.hxx>
-#include <connectivity/dbconversion.hxx>
-#include <connectivity/dbexception.hxx>
-#include <connectivity/dbtools.hxx>
-#include <connectivity/statementcomposer.hxx>
-#include <osl/diagnose.h>
-#include <rtl/ustrbuf.hxx>
-#include <tools/diagnose_ex.h>
-
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-#include "OSubComponent.hxx"
-
-#include <algorithm>
-
-using namespace ::comphelper;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::ui::dialogs;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::sdb;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::form;
-using namespace connectivity;
-
-//.........................................................................
-namespace dbtools
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::util;
- using namespace ::com::sun::star::task;
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::task;
-
-//==============================================================================
-//==============================================================================
-namespace
-{
- typedef sal_Bool (SAL_CALL XDatabaseMetaData::*FMetaDataSupport)();
-}
-//==============================================================================
-//==============================================================================
-sal_Int32 getDefaultNumberFormat(const Reference< XPropertySet >& _xColumn,
- const Reference< XNumberFormatTypes >& _xTypes,
- const Locale& _rLocale)
-{
- OSL_ENSURE(_xTypes.is() && _xColumn.is(), "dbtools::getDefaultNumberFormat: invalid arg !");
- if (!_xTypes.is() || !_xColumn.is())
- return NumberFormat::UNDEFINED;
-
- sal_Int32 nDataType = 0;
- sal_Int32 nScale = 0;
- try
- {
- // determine the datatype of the column
- _xColumn->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Type"))) >>= nDataType;
-
- if (DataType::NUMERIC == nDataType || DataType::DECIMAL == nDataType)
- _xColumn->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Scale"))) >>= nScale;
- }
- catch (Exception&)
- {
- return NumberFormat::UNDEFINED;
- }
- return getDefaultNumberFormat(nDataType,
- nScale,
- ::cppu::any2bool(_xColumn->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsCurrency")))),
- _xTypes,
- _rLocale);
-}
-
-//------------------------------------------------------------------
-sal_Int32 getDefaultNumberFormat(sal_Int32 _nDataType,
- sal_Int32 _nScale,
- sal_Bool _bIsCurrency,
- const Reference< XNumberFormatTypes >& _xTypes,
- const Locale& _rLocale)
-{
- OSL_ENSURE(_xTypes.is() , "dbtools::getDefaultNumberFormat: invalid arg !");
- if (!_xTypes.is())
- return NumberFormat::UNDEFINED;
-
- sal_Int32 nFormat = 0;
- sal_Int32 nNumberType = _bIsCurrency ? NumberFormat::CURRENCY : NumberFormat::NUMBER;
- switch (_nDataType)
- {
- case DataType::BIT:
- case DataType::BOOLEAN:
- nFormat = _xTypes->getStandardFormat(NumberFormat::LOGICAL, _rLocale);
- break;
- case DataType::TINYINT:
- case DataType::SMALLINT:
- case DataType::INTEGER:
- case DataType::BIGINT:
- case DataType::FLOAT:
- case DataType::REAL:
- case DataType::DOUBLE:
- case DataType::NUMERIC:
- case DataType::DECIMAL:
- {
- try
- {
- nFormat = _xTypes->getStandardFormat((sal_Int16)nNumberType, _rLocale);
- if(_nScale > 0)
- {
- // generate a new format if necessary
- Reference< XNumberFormats > xFormats(_xTypes, UNO_QUERY);
- ::rtl::OUString sNewFormat = xFormats->generateFormat( 0L, _rLocale, sal_False, sal_False, (sal_Int16)_nScale, sal_True);
-
- // and add it to the formatter if necessary
- nFormat = xFormats->queryKey(sNewFormat, _rLocale, sal_False);
- if (nFormat == (sal_Int32)-1)
- nFormat = xFormats->addNew(sNewFormat, _rLocale);
- }
- }
- catch (Exception&)
- {
- nFormat = _xTypes->getStandardFormat((sal_Int16)nNumberType, _rLocale);
- }
- } break;
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- nFormat = _xTypes->getStandardFormat(NumberFormat::TEXT, _rLocale);
- break;
- case DataType::DATE:
- nFormat = _xTypes->getStandardFormat(NumberFormat::DATE, _rLocale);
- break;
- case DataType::TIME:
- nFormat = _xTypes->getStandardFormat(NumberFormat::TIME, _rLocale);
- break;
- case DataType::TIMESTAMP:
- nFormat = _xTypes->getStandardFormat(NumberFormat::DATETIME, _rLocale);
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- case DataType::SQLNULL:
- case DataType::OTHER:
- case DataType::OBJECT:
- case DataType::DISTINCT:
- case DataType::STRUCT:
- case DataType::ARRAY:
- case DataType::BLOB:
- case DataType::REF:
- default:
- nFormat = _xTypes->getStandardFormat(NumberFormat::UNDEFINED, _rLocale);
- //nFormat = NumberFormat::UNDEFINED;
- }
- return nFormat;
-}
-
-//==============================================================================
-//------------------------------------------------------------------------------
-Reference< XConnection> findConnection(const Reference< XInterface >& xParent)
-{
- Reference< XConnection> xConnection(xParent, UNO_QUERY);
- if (!xConnection.is())
- {
- Reference< XChild> xChild(xParent, UNO_QUERY);
- if (xChild.is())
- xConnection = findConnection(xChild->getParent());
- }
- return xConnection;
-}
-
-//------------------------------------------------------------------------------
-Reference< XDataSource> getDataSource_allowException(
- const ::rtl::OUString& _rsTitleOrPath,
- const Reference< XMultiServiceFactory >& _rxFactory )
-{
- ENSURE_OR_RETURN( _rsTitleOrPath.getLength(), "getDataSource_allowException: invalid arg !", NULL );
-
- Reference< XNameAccess> xDatabaseContext(
- _rxFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.DatabaseContext" )) ),UNO_QUERY );
- OSL_ENSURE( xDatabaseContext.is(), "getDataSource_allowException: could not obtain the database context!" );
-
- return Reference< XDataSource >( xDatabaseContext->getByName( _rsTitleOrPath ), UNO_QUERY );
-}
-
-//------------------------------------------------------------------------------
-Reference< XDataSource > getDataSource(
- const ::rtl::OUString& _rsTitleOrPath,
- const Reference< XMultiServiceFactory >& _rxFactory )
-{
- Reference< XDataSource > xDS;
- try
- {
- xDS = getDataSource_allowException( _rsTitleOrPath, _rxFactory );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- return xDS;
-}
-
-//------------------------------------------------------------------------------
-Reference< XConnection > getConnection_allowException(
- const ::rtl::OUString& _rsTitleOrPath,
- const ::rtl::OUString& _rsUser,
- const ::rtl::OUString& _rsPwd,
- const Reference< XMultiServiceFactory>& _rxFactory)
-{
- Reference< XDataSource> xDataSource( getDataSource_allowException(_rsTitleOrPath, _rxFactory) );
- Reference<XConnection> xConnection;
- if (xDataSource.is())
- {
- // do it with interaction handler
- if(!_rsUser.getLength() || !_rsPwd.getLength())
- {
- Reference<XPropertySet> xProp(xDataSource,UNO_QUERY);
- ::rtl::OUString sPwd, sUser;
- sal_Bool bPwdReq = sal_False;
- try
- {
- xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD)) >>= sPwd;
- bPwdReq = ::cppu::any2bool(xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsPasswordRequired"))));
- xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("User"))) >>= sUser;
- }
- catch(Exception&)
- {
- OSL_FAIL("dbtools::getConnection: error while retrieving data source properties!");
- }
- if(bPwdReq && !sPwd.getLength())
- { // password required, but empty -> connect using an interaction handler
- Reference<XCompletedConnection> xConnectionCompletion(xProp, UNO_QUERY);
- if (xConnectionCompletion.is())
- { // instantiate the default SDB interaction handler
- Reference< XInteractionHandler > xHandler(_rxFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler"))), UNO_QUERY);
- OSL_ENSURE(xHandler.is(), "dbtools::getConnection service com.sun.star.task.InteractionHandler not available!");
- if (xHandler.is())
- {
- xConnection = xConnectionCompletion->connectWithCompletion(xHandler);
- }
- }
- }
- else
- xConnection = xDataSource->getConnection(sUser, sPwd);
- }
- if(!xConnection.is()) // try to get one if not already have one, just to make sure
- xConnection = xDataSource->getConnection(_rsUser, _rsPwd);
- }
- return xConnection;
-}
-
-//------------------------------------------------------------------------------
-Reference< XConnection> getConnection_withFeedback(const ::rtl::OUString& _rDataSourceName,
- const ::rtl::OUString& _rUser, const ::rtl::OUString& _rPwd, const Reference< XMultiServiceFactory>& _rxFactory)
- SAL_THROW ( (SQLException) )
-{
- Reference< XConnection > xReturn;
- try
- {
- xReturn = getConnection_allowException(_rDataSourceName, _rUser, _rPwd, _rxFactory);
- }
- catch(SQLException&)
- {
- // allowed to pass
- throw;
- }
- catch(Exception&)
- {
- OSL_FAIL("::dbtools::getConnection_withFeedback: unexpected (non-SQL) exception caught!");
- }
- return xReturn;
-}
-
-//------------------------------------------------------------------------------
-Reference< XConnection> getConnection(
- const ::rtl::OUString& _rsTitleOrPath,
- const ::rtl::OUString& _rsUser,
- const ::rtl::OUString& _rsPwd,
- const Reference< XMultiServiceFactory>& _rxFactory)
-{
- Reference< XConnection > xReturn;
- try
- {
- xReturn = getConnection_allowException(_rsTitleOrPath, _rsUser, _rsPwd, _rxFactory);
- }
- catch(Exception&)
- {
- }
-
- // TODO: if there were not dozens of places which rely on getConnection not throwing an exception ....
- // I would change this ...
-
- return xReturn;
-}
-
-//------------------------------------------------------------------------------
-Reference< XConnection> getConnection(const Reference< XRowSet>& _rxRowSet) throw (RuntimeException)
-{
- Reference< XConnection> xReturn;
- Reference< XPropertySet> xRowSetProps(_rxRowSet, UNO_QUERY);
- if (xRowSetProps.is())
- xRowSetProps->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveConnection"))) >>= xReturn;
- return xReturn;
-}
-
-//------------------------------------------------------------------------------
-// helper function which allows to implement both the connectRowset and the ensureRowSetConnection semantics
-// if connectRowset (which is deprecated) is removed, this function and one of its parameters are
-// not needed anymore, the whole implementation can be moved into ensureRowSetConnection then)
-SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const Reference< XMultiServiceFactory>& _rxFactory,
- bool _bSetAsActiveConnection, bool _bAttachAutoDisposer )
- SAL_THROW ( ( SQLException, WrappedTargetException, RuntimeException ) )
-{
- SharedConnection xConnection;
-
- do
- {
- Reference< XPropertySet> xRowSetProps(_rxRowSet, UNO_QUERY);
- if ( !xRowSetProps.is() )
- break;
-
- // 1. already connected?
- Reference< XConnection > xExistingConn(
- xRowSetProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) ) ),
- UNO_QUERY );
-
- if ( xExistingConn.is()
- // 2. embedded in a database?
- || isEmbeddedInDatabase( _rxRowSet, xExistingConn )
- // 3. is there a connection in the parent hierarchy?
- || ( xExistingConn = findConnection( _rxRowSet ) ).is()
- )
- {
- if ( _bSetAsActiveConnection )
- {
- xRowSetProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) ), makeAny( xExistingConn ) );
- // no auto disposer needed, since we did not create the connection
- }
-
- xConnection.reset( xExistingConn, SharedConnection::NoTakeOwnership );
- break;
- }
-
- // build a connection with it's current settings (4. data source name, or 5. URL)
-
- const ::rtl::OUString sUserProp( RTL_CONSTASCII_USTRINGPARAM( "User" ));
- ::rtl::OUString sDataSourceName;
- xRowSetProps->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataSourceName"))) >>= sDataSourceName;
- ::rtl::OUString sURL;
- xRowSetProps->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"))) >>= sURL;
-
- Reference< XConnection > xPureConnection;
- if (sDataSourceName.getLength())
- { // the row set's data source property is set
- // -> try to connect, get user and pwd setting for that
- ::rtl::OUString sUser, sPwd;
-
- if (hasProperty(sUserProp, xRowSetProps))
- xRowSetProps->getPropertyValue(sUserProp) >>= sUser;
- if (hasProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD), xRowSetProps))
- xRowSetProps->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD)) >>= sPwd;
-
- xPureConnection = getConnection_allowException( sDataSourceName, sUser, sPwd, _rxFactory );
- }
- else if (sURL.getLength())
- { // the row set has no data source, but a connection url set
- // -> try to connection with that url
- Reference< XDriverManager > xDriverManager(
- _rxFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.ConnectionPool"))), UNO_QUERY);
- if (xDriverManager.is())
- {
- ::rtl::OUString sUser, sPwd;
- if (hasProperty(sUserProp, xRowSetProps))
- xRowSetProps->getPropertyValue(sUserProp) >>= sUser;
- if (hasProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD), xRowSetProps))
- xRowSetProps->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD)) >>= sPwd;
- if (sUser.getLength())
- { // use user and pwd together with the url
- Sequence< PropertyValue> aInfo(2);
- aInfo.getArray()[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user"));
- aInfo.getArray()[0].Value <<= sUser;
- aInfo.getArray()[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("password"));
- aInfo.getArray()[1].Value <<= sPwd;
- xPureConnection = xDriverManager->getConnectionWithInfo( sURL, aInfo );
- }
- else
- // just use the url
- xPureConnection = xDriverManager->getConnection( sURL );
- }
- }
- xConnection.reset(
- xPureConnection,
- _bAttachAutoDisposer ? SharedConnection::NoTakeOwnership : SharedConnection::TakeOwnership
- /* take ownership if and only if we're *not* going to auto-dispose the connection */
- );
-
- // now if we created a connection, forward it to the row set
- if ( xConnection.is() && _bSetAsActiveConnection )
- {
- try
- {
- if ( _bAttachAutoDisposer )
- {
- OAutoConnectionDisposer* pAutoDispose = new OAutoConnectionDisposer( _rxRowSet, xConnection );
- Reference< XPropertyChangeListener > xEnsureDelete(pAutoDispose);
- }
- else
- xRowSetProps->setPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) ),
- makeAny( xConnection.getTyped() )
- );
- }
- catch(Exception&)
- {
- OSL_FAIL("EXception when we set the new active connection!");
- }
- }
- }
- while ( false );
-
- return xConnection;
-}
-
-//------------------------------------------------------------------------------
-Reference< XConnection> connectRowset(const Reference< XRowSet>& _rxRowSet, const Reference< XMultiServiceFactory>& _rxFactory,
- sal_Bool _bSetAsActiveConnection ) SAL_THROW ( ( SQLException, WrappedTargetException, RuntimeException ) )
-{
- SharedConnection xConnection = lcl_connectRowSet( _rxRowSet, _rxFactory, _bSetAsActiveConnection, true );
- return xConnection.getTyped();
-}
-
-//------------------------------------------------------------------------------
-SharedConnection ensureRowSetConnection(const Reference< XRowSet>& _rxRowSet, const Reference< XMultiServiceFactory>& _rxFactory,
- bool _bUseAutoConnectionDisposer ) SAL_THROW ( ( SQLException, WrappedTargetException, RuntimeException ) )
-{
- return lcl_connectRowSet( _rxRowSet, _rxFactory, true, _bUseAutoConnectionDisposer );
-}
-
-//------------------------------------------------------------------------------
-Reference< XNameAccess> getTableFields(const Reference< XConnection>& _rxConn,const ::rtl::OUString& _rName)
-{
- Reference< XComponent > xDummy;
- return getFieldsByCommandDescriptor( _rxConn, CommandType::TABLE, _rName, xDummy );
-}
-//------------------------------------------------------------------------------
-Reference< XNameAccess> getPrimaryKeyColumns_throw(const Any& i_aTable)
-{
- const Reference< XPropertySet > xTable(i_aTable,UNO_QUERY_THROW);
- return getPrimaryKeyColumns_throw(xTable);
-}
-//------------------------------------------------------------------------------
-Reference< XNameAccess> getPrimaryKeyColumns_throw(const Reference< XPropertySet >& i_xTable)
-{
- Reference<XNameAccess> xKeyColumns;
- const Reference<XKeysSupplier> xKeySup(i_xTable,UNO_QUERY);
- if ( xKeySup.is() )
- {
- const Reference<XIndexAccess> xKeys = xKeySup->getKeys();
- if ( xKeys.is() )
- {
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- const ::rtl::OUString sPropName = rPropMap.getNameByIndex(PROPERTY_ID_TYPE);
- Reference<XPropertySet> xProp;
- const sal_Int32 nCount = xKeys->getCount();
- for(sal_Int32 i = 0;i< nCount;++i)
- {
- xProp.set(xKeys->getByIndex(i),UNO_QUERY_THROW);
- if ( xProp.is() )
- {
- sal_Int32 nKeyType = 0;
- xProp->getPropertyValue(sPropName) >>= nKeyType;
- if(KeyType::PRIMARY == nKeyType)
- {
- const Reference<XColumnsSupplier> xKeyColsSup(xProp,UNO_QUERY_THROW);
- xKeyColumns = xKeyColsSup->getColumns();
- break;
- }
- }
- }
- }
- }
-
- return xKeyColumns;
-}
-
-//------------------------------------------------------------------------------
-namespace
-{
- enum FieldLookupState
- {
- HANDLE_TABLE, HANDLE_QUERY, HANDLE_SQL, RETRIEVE_OBJECT, RETRIEVE_COLUMNS, DONE, FAILED
- };
-}
-
-//------------------------------------------------------------------------------
-Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnection >& _rxConnection,
- const sal_Int32 _nCommandType, const ::rtl::OUString& _rCommand,
- Reference< XComponent >& _rxKeepFieldsAlive, SQLExceptionInfo* _pErrorInfo ) SAL_THROW( ( ) )
-{
- OSL_PRECOND( _rxConnection.is(), "::dbtools::getFieldsByCommandDescriptor: invalid connection!" );
- OSL_PRECOND( ( CommandType::TABLE == _nCommandType ) || ( CommandType::QUERY == _nCommandType ) || ( CommandType::COMMAND == _nCommandType ),
- "::dbtools::getFieldsByCommandDescriptor: invalid command type!" );
- OSL_PRECOND( _rCommand.getLength(), "::dbtools::getFieldsByCommandDescriptor: invalid command (empty)!" );
-
- Reference< XNameAccess > xFields;
-
- // reset the error
- if ( _pErrorInfo )
- *_pErrorInfo = SQLExceptionInfo();
- // reset the ownership holder
- _rxKeepFieldsAlive.clear();
-
- // go for the fields
- try
- {
- // some kind of state machine to ease the sharing of code
- FieldLookupState eState = FAILED;
- switch ( _nCommandType )
- {
- case CommandType::TABLE:
- eState = HANDLE_TABLE;
- break;
- case CommandType::QUERY:
- eState = HANDLE_QUERY;
- break;
- case CommandType::COMMAND:
- eState = HANDLE_SQL;
- break;
- }
-
- // needed in various states:
- Reference< XNameAccess > xObjectCollection;
- Reference< XColumnsSupplier > xSupplyColumns;
-
- // go!
- while ( ( DONE != eState ) && ( FAILED != eState ) )
- {
- switch ( eState )
- {
- case HANDLE_TABLE:
- {
- // initial state for handling the tables
-
- // get the table objects
- Reference< XTablesSupplier > xSupplyTables( _rxConnection, UNO_QUERY );
- if ( xSupplyTables.is() )
- xObjectCollection = xSupplyTables->getTables();
- // if something went wrong 'til here, then this will be handled in the next state
-
- // next state: get the object
- eState = RETRIEVE_OBJECT;
- }
- break;
-
- case HANDLE_QUERY:
- {
- // initial state for handling the tables
-
- // get the table objects
- Reference< XQueriesSupplier > xSupplyQueries( _rxConnection, UNO_QUERY );
- if ( xSupplyQueries.is() )
- xObjectCollection = xSupplyQueries->getQueries();
- // if something went wrong 'til here, then this will be handled in the next state
-
- // next state: get the object
- eState = RETRIEVE_OBJECT;
- }
- break;
-
- case RETRIEVE_OBJECT:
- // here we should have an object (aka query or table) collection, and are going
- // to retrieve the desired object
-
- // next state: default to FAILED
- eState = FAILED;
-
- OSL_ENSURE( xObjectCollection.is(), "::dbtools::getFieldsByCommandDescriptor: invalid connection (no sdb.Connection, or no Tables-/QueriesSupplier)!");
- if ( xObjectCollection.is() )
- {
- if ( xObjectCollection.is() && xObjectCollection->hasByName( _rCommand ) )
- {
- xObjectCollection->getByName( _rCommand ) >>= xSupplyColumns;
- // (xSupplyColumns being NULL will be handled in the next state)
-
- // next: go for the columns
- eState = RETRIEVE_COLUMNS;
- }
- }
- break;
-
- case RETRIEVE_COLUMNS:
- OSL_ENSURE( xSupplyColumns.is(), "::dbtools::getFieldsByCommandDescriptor: could not retrieve the columns supplier!" );
-
- // next state: default to FAILED
- eState = FAILED;
-
- if ( xSupplyColumns.is() )
- {
- xFields = xSupplyColumns->getColumns();
- // that's it
- eState = DONE;
- }
- break;
-
- case HANDLE_SQL:
- {
- ::rtl::OUString sStatementToExecute( _rCommand );
-
- // well, the main problem here is to handle statements which contain a parameter
- // If we would simply execute a parametrized statement, then this will fail because
- // we cannot supply any parameter values.
- // Thus, we try to analyze the statement, and to append a WHERE 0=1 filter criterion
- // This should cause every driver to not really execute the statement, but to return
- // an empty result set with the proper structure. We then can use this result set
- // to retrieve the columns.
-
- try
- {
- Reference< XMultiServiceFactory > xComposerFac( _rxConnection, UNO_QUERY );
-
- if ( xComposerFac.is() )
- {
- Reference< XSingleSelectQueryComposer > xComposer(xComposerFac->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.SingleSelectQueryComposer"))),UNO_QUERY);
- if ( xComposer.is() )
- {
- xComposer->setQuery( sStatementToExecute );
-
- // Now set the filter to a dummy restriction which will result in an empty
- // result set.
- xComposer->setFilter( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "0=1" )) );
- sStatementToExecute = xComposer->getQuery( );
- }
- }
- }
- catch( const Exception& )
- {
- // silent this error, this was just a try. If we're here, we did not change sStatementToExecute,
- // so it will still be _rCommand, which then will be executed without being touched
- }
-
- // now execute
- Reference< XPreparedStatement > xStatement = _rxConnection->prepareStatement( sStatementToExecute );
- // transfer ownership of this temporary object to the caller
- _rxKeepFieldsAlive = _rxKeepFieldsAlive.query( xStatement );
-
- // set the "MaxRows" to 0. This is just in case our attempt to append a 0=1 filter
- // failed - in this case, the MaxRows restriction should at least ensure that there
- // is no data returned (which would be potentially expensive)
- Reference< XPropertySet > xStatementProps( xStatement,UNO_QUERY );
- try
- {
- if ( xStatementProps.is() )
- xStatementProps->setPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxRows" ) ),
- makeAny( sal_Int32( 0 ) )
- );
- }
- catch( const Exception& )
- {
- OSL_FAIL( "::dbtools::getFieldsByCommandDescriptor: could not set the MaxRows!" );
- // oh damn. Not much of a chance to recover, we will no retrieve the complete
- // full blown result set
- }
-
- xSupplyColumns = xSupplyColumns.query( xStatement->executeQuery() );
- // this should have given us a result set which does not contain any data, but
- // the structural information we need
-
- // so the next state is to get the columns
- eState = RETRIEVE_COLUMNS;
- }
- break;
-
- default:
- OSL_FAIL( "::dbtools::getFieldsByCommandDescriptor: oops! unhandled state here!" );
- eState = FAILED;
- }
- }
- }
- catch( const SQLContext& e ) { if ( _pErrorInfo ) *_pErrorInfo = SQLExceptionInfo( e ); }
- catch( const SQLWarning& e ) { if ( _pErrorInfo ) *_pErrorInfo = SQLExceptionInfo( e ); }
- catch( const SQLException& e ) { if ( _pErrorInfo ) *_pErrorInfo = SQLExceptionInfo( e ); }
- catch( const Exception& )
- {
- OSL_FAIL( "::dbtools::getFieldsByCommandDescriptor: caught an exception while retrieving the fields!" );
- }
-
- return xFields;
-}
-
-//------------------------------------------------------------------------------
-Sequence< ::rtl::OUString > getFieldNamesByCommandDescriptor( const Reference< XConnection >& _rxConnection,
- const sal_Int32 _nCommandType, const ::rtl::OUString& _rCommand,
- SQLExceptionInfo* _pErrorInfo ) SAL_THROW( ( ) )
-{
- // get the container for the fields
- Reference< XComponent > xKeepFieldsAlive;
- Reference< XNameAccess > xFieldContainer = getFieldsByCommandDescriptor( _rxConnection, _nCommandType, _rCommand, xKeepFieldsAlive, _pErrorInfo );
-
- // get the names of the fields
- Sequence< ::rtl::OUString > aNames;
- if ( xFieldContainer.is() )
- aNames = xFieldContainer->getElementNames();
-
- // clean up any temporary objects which have been created
- disposeComponent( xKeepFieldsAlive );
-
- // outta here
- return aNames;
-}
-
-//------------------------------------------------------------------------------
-SQLContext prependContextInfo(const SQLException& _rException, const Reference< XInterface >& _rxContext, const ::rtl::OUString& _rContextDescription, const ::rtl::OUString& _rContextDetails)
-{
- return SQLContext( _rContextDescription, _rxContext, ::rtl::OUString(), 0, makeAny( _rException ), _rContextDetails );
-}
-//------------------------------------------------------------------------------
-SQLException prependErrorInfo( const SQLException& _rChainedException, const Reference< XInterface >& _rxContext,
- const ::rtl::OUString& _rAdditionalError, const StandardSQLState _eSQLState, const sal_Int32 _nErrorCode )
-{
- return SQLException( _rAdditionalError, _rxContext,
- _eSQLState == SQL_ERROR_UNSPECIFIED ? ::rtl::OUString() : getStandardSQLState( _eSQLState ),
- _nErrorCode, makeAny( _rChainedException ) );
-}
-
-//--------------------------------------------------------------------------
-namespace
-{
- struct NameComponentSupport
- {
- const bool bCatalogs;
- const bool bSchemas;
-
- NameComponentSupport( )
- :bCatalogs( true )
- ,bSchemas( true )
- {
- }
-
- NameComponentSupport( const bool _bCatalogs, const bool _bSchemas )
- :bCatalogs( _bCatalogs )
- ,bSchemas( _bSchemas )
- {
- }
- };
-
- NameComponentSupport lcl_getNameComponentSupport( const Reference< XDatabaseMetaData >& _rxMetaData, EComposeRule _eComposeRule )
- {
- OSL_PRECOND( _rxMetaData.is(), "lcl_getNameComponentSupport: invalid meta data!" );
-
- FMetaDataSupport pCatalogCall = &XDatabaseMetaData::supportsCatalogsInDataManipulation;
- FMetaDataSupport pSchemaCall = &XDatabaseMetaData::supportsSchemasInDataManipulation;
- bool bIgnoreMetaData = false;
-
- switch ( _eComposeRule )
- {
- case eInTableDefinitions:
- pCatalogCall = &XDatabaseMetaData::supportsCatalogsInTableDefinitions;
- pSchemaCall = &XDatabaseMetaData::supportsSchemasInTableDefinitions;
- break;
- case eInIndexDefinitions:
- pCatalogCall = &XDatabaseMetaData::supportsCatalogsInIndexDefinitions;
- pSchemaCall = &XDatabaseMetaData::supportsSchemasInIndexDefinitions;
- break;
- case eInProcedureCalls:
- pCatalogCall = &XDatabaseMetaData::supportsCatalogsInProcedureCalls;
- pSchemaCall = &XDatabaseMetaData::supportsSchemasInProcedureCalls;
- break;
- case eInPrivilegeDefinitions:
- pCatalogCall = &XDatabaseMetaData::supportsCatalogsInPrivilegeDefinitions;
- pSchemaCall = &XDatabaseMetaData::supportsSchemasInPrivilegeDefinitions;
- break;
- case eComplete:
- bIgnoreMetaData = true;
- break;
- case eInDataManipulation:
- // already properly set above
- break;
- }
- return NameComponentSupport(
- bIgnoreMetaData ? true : (_rxMetaData.get()->*pCatalogCall)(),
- bIgnoreMetaData ? true : (_rxMetaData.get()->*pSchemaCall)()
- );
- }
-}
-
-//--------------------------------------------------------------------------
-static ::rtl::OUString impl_doComposeTableName( const Reference< XDatabaseMetaData >& _rxMetaData,
- const ::rtl::OUString& _rCatalog, const ::rtl::OUString& _rSchema, const ::rtl::OUString& _rName,
- sal_Bool _bQuote, EComposeRule _eComposeRule )
-{
- OSL_ENSURE(_rxMetaData.is(), "impl_doComposeTableName : invalid meta data !");
- if ( !_rxMetaData.is() )
- return ::rtl::OUString();
- OSL_ENSURE(_rName.getLength(), "impl_doComposeTableName : at least the name should be non-empty !");
-
- const ::rtl::OUString sQuoteString = _rxMetaData->getIdentifierQuoteString();
- const NameComponentSupport aNameComps( lcl_getNameComponentSupport( _rxMetaData, _eComposeRule ) );
-
- ::rtl::OUStringBuffer aComposedName;
-
- ::rtl::OUString sCatalogSep;
- sal_Bool bCatlogAtStart = sal_True;
- if ( _rCatalog.getLength() && aNameComps.bCatalogs )
- {
- sCatalogSep = _rxMetaData->getCatalogSeparator();
- bCatlogAtStart = _rxMetaData->isCatalogAtStart();
-
- if ( bCatlogAtStart && sCatalogSep.getLength())
- {
- aComposedName.append( _bQuote ? quoteName( sQuoteString, _rCatalog ) : _rCatalog );
- aComposedName.append( sCatalogSep );
- }
- }
-
- if ( _rSchema.getLength() && aNameComps.bSchemas )
- {
- aComposedName.append( _bQuote ? quoteName( sQuoteString, _rSchema ) : _rSchema );
- aComposedName.appendAscii( "." );
- }
-
- aComposedName.append( _bQuote ? quoteName( sQuoteString, _rName ) : _rName );
-
- if ( _rCatalog.getLength()
- && !bCatlogAtStart
- && sCatalogSep.getLength()
- && aNameComps.bCatalogs
- )
- {
- aComposedName.append( sCatalogSep );
- aComposedName.append( _bQuote ? quoteName( sQuoteString, _rCatalog ) : _rCatalog );
- }
-
- return aComposedName.makeStringAndClear();
-}
-
-//------------------------------------------------------------------------------
-::rtl::OUString quoteTableName(const Reference< XDatabaseMetaData>& _rxMeta
- , const ::rtl::OUString& _rName
- , EComposeRule _eComposeRule)
-{
- ::rtl::OUString sCatalog, sSchema, sTable;
- qualifiedNameComponents(_rxMeta,_rName,sCatalog,sSchema,sTable,_eComposeRule);
- return impl_doComposeTableName( _rxMeta, sCatalog, sSchema, sTable, sal_True, _eComposeRule );
-}
-
-//------------------------------------------------------------------------------
-void qualifiedNameComponents(const Reference< XDatabaseMetaData >& _rxConnMetaData, const ::rtl::OUString& _rQualifiedName, ::rtl::OUString& _rCatalog, ::rtl::OUString& _rSchema, ::rtl::OUString& _rName,EComposeRule _eComposeRule)
-{
- OSL_ENSURE(_rxConnMetaData.is(), "QualifiedNameComponents : invalid meta data!");
-
- NameComponentSupport aNameComps( lcl_getNameComponentSupport( _rxConnMetaData, _eComposeRule ) );
-
- ::rtl::OUString sSeparator = _rxConnMetaData->getCatalogSeparator();
-
- ::rtl::OUString sName(_rQualifiedName);
- // do we have catalogs ?
- if ( aNameComps.bCatalogs )
- {
- if (_rxConnMetaData->isCatalogAtStart())
- {
- // search for the catalog name at the beginning
- sal_Int32 nIndex = sName.indexOf(sSeparator);
- if (-1 != nIndex)
- {
- _rCatalog = sName.copy(0, nIndex);
- sName = sName.copy(nIndex + 1);
- }
- }
- else
- {
- // Catalogue name at the end
- sal_Int32 nIndex = sName.lastIndexOf(sSeparator);
- if (-1 != nIndex)
- {
- _rCatalog = sName.copy(nIndex + 1);
- sName = sName.copy(0, nIndex);
- }
- }
- }
-
- if ( aNameComps.bSchemas )
- {
- sal_Int32 nIndex = sName.indexOf((sal_Unicode)'.');
- // OSL_ENSURE(-1 != nIndex, "QualifiedNameComponents : no schema separator!");
- if ( nIndex != -1 )
- _rSchema = sName.copy(0, nIndex);
- sName = sName.copy(nIndex + 1);
- }
-
- _rName = sName;
-}
-
-//------------------------------------------------------------------------------
-Reference< XNumberFormatsSupplier> getNumberFormats(
- const Reference< XConnection>& _rxConn,
- sal_Bool _bAlloweDefault,
- const Reference< XMultiServiceFactory>& _rxFactory)
-{
- // ask the parent of the connection (should be an DatabaseAccess)
- Reference< XNumberFormatsSupplier> xReturn;
- Reference< XChild> xConnAsChild(_rxConn, UNO_QUERY);
- ::rtl::OUString sPropFormatsSupplier( RTL_CONSTASCII_USTRINGPARAM( "NumberFormatsSupplier" ));
- if (xConnAsChild.is())
- {
- Reference< XPropertySet> xConnParentProps(xConnAsChild->getParent(), UNO_QUERY);
- if (xConnParentProps.is() && hasProperty(sPropFormatsSupplier, xConnParentProps))
- xConnParentProps->getPropertyValue(sPropFormatsSupplier) >>= xReturn;
- }
- else if(_bAlloweDefault && _rxFactory.is())
- {
- xReturn = Reference< XNumberFormatsSupplier>(_rxFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatsSupplier"))),UNO_QUERY);
- }
- return xReturn;
-}
-
-//==============================================================================
-//------------------------------------------------------------------------------
-void TransferFormComponentProperties(
- const Reference< XPropertySet>& xOldProps,
- const Reference< XPropertySet>& xNewProps,
- const Locale& _rLocale)
-{
-try
-{
- OSL_ENSURE( xOldProps.is() && xNewProps.is(), "TransferFormComponentProperties: invalid source/dest!" );
- if ( !xOldProps.is() || !xNewProps.is() )
- return;
-
- // First we copy all the Props, that are available in source and target and have the same description
- Reference< XPropertySetInfo> xOldInfo( xOldProps->getPropertySetInfo());
- Reference< XPropertySetInfo> xNewInfo( xNewProps->getPropertySetInfo());
-
- Sequence< Property> aOldProperties = xOldInfo->getProperties();
- Sequence< Property> aNewProperties = xNewInfo->getProperties();
- int nNewLen = aNewProperties.getLength();
-
- Property* pOldProps = aOldProperties.getArray();
- Property* pNewProps = aNewProperties.getArray();
-
- ::rtl::OUString sPropDefaultControl(RTL_CONSTASCII_USTRINGPARAM("DefaultControl"));
- ::rtl::OUString sPropLabelControl(RTL_CONSTASCII_USTRINGPARAM("LabelControl"));
- ::rtl::OUString sPropFormatsSupplier(RTL_CONSTASCII_USTRINGPARAM("FormatsSupplier"));
- ::rtl::OUString sPropCurrencySymbol(RTL_CONSTASCII_USTRINGPARAM("CurrencySymbol"));
- ::rtl::OUString sPropDecimals(RTL_CONSTASCII_USTRINGPARAM("Decimals"));
- ::rtl::OUString sPropEffectiveMin(RTL_CONSTASCII_USTRINGPARAM("EffectiveMin"));
- ::rtl::OUString sPropEffectiveMax(RTL_CONSTASCII_USTRINGPARAM("EffectiveMax"));
- ::rtl::OUString sPropEffectiveDefault(RTL_CONSTASCII_USTRINGPARAM("EffectiveDefault"));
- ::rtl::OUString sPropDefaultText(RTL_CONSTASCII_USTRINGPARAM("DefaultText"));
- ::rtl::OUString sPropDefaultDate(RTL_CONSTASCII_USTRINGPARAM("DefaultDate"));
- ::rtl::OUString sPropDefaultTime(RTL_CONSTASCII_USTRINGPARAM("DefaultTime"));
- ::rtl::OUString sPropValueMin(RTL_CONSTASCII_USTRINGPARAM("ValueMin"));
- ::rtl::OUString sPropValueMax(RTL_CONSTASCII_USTRINGPARAM("ValueMax"));
- ::rtl::OUString sPropDecimalAccuracy(RTL_CONSTASCII_USTRINGPARAM("DecimalAccuracy"));
- ::rtl::OUString sPropClassId(RTL_CONSTASCII_USTRINGPARAM("ClassId"));
- ::rtl::OUString sFormattedServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.FormattedField" ) );
-
- for (sal_Int16 i=0; i<aOldProperties.getLength(); ++i)
- {
- if ( (!pOldProps[i].Name.equals(sPropDefaultControl))
- && (!pOldProps[i].Name.equals(sPropLabelControl))
- )
- {
- // binary search
- Property* pResult = ::std::lower_bound(pNewProps, pNewProps + nNewLen,pOldProps[i].Name, ::comphelper::PropertyStringLessFunctor());
- if ( pResult
- && ( pResult != pNewProps + nNewLen && pResult->Name == pOldProps[i].Name )
- && ( (pResult->Attributes & PropertyAttribute::READONLY) == 0 )
- && ( pResult->Type.equals(pOldProps[i].Type)) )
- { // Attributes match and the property is not read-only
- try
- {
- xNewProps->setPropertyValue(pResult->Name, xOldProps->getPropertyValue(pResult->Name));
- }
- catch(IllegalArgumentException& e)
- {
- OSL_UNUSED( e );
-#ifdef DBG_UTIL
- ::rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM("TransferFormComponentProperties : could not transfer the value for property \""));
- sMessage += pResult->Name;
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\""));
- OSL_FAIL(::rtl::OUStringToOString(sMessage, RTL_TEXTENCODING_ASCII_US));
-#endif
- }
- }
- }
- }
-
- // for formatted fields (either old or new) we have some special treatments
- Reference< XServiceInfo > xSI( xOldProps, UNO_QUERY );
- sal_Bool bOldIsFormatted = xSI.is() && xSI->supportsService( sFormattedServiceName );
- xSI = Reference< XServiceInfo >( xNewProps, UNO_QUERY );
- sal_Bool bNewIsFormatted = xSI.is() && xSI->supportsService( sFormattedServiceName );
-
- if (!bOldIsFormatted && !bNewIsFormatted)
- return; // nothing to do
-
- if (bOldIsFormatted && bNewIsFormatted)
- // if both fields are formatted we do no conversions
- return;
-
- if (bOldIsFormatted)
- {
- // get some properties from the selected format and put them in the new Set
- Any aFormatKey( xOldProps->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FORMATKEY)) );
- if (aFormatKey.hasValue())
- {
- Reference< XNumberFormatsSupplier> xSupplier;
- xOldProps->getPropertyValue(sPropFormatsSupplier) >>= xSupplier;
- if (xSupplier.is())
- {
- Reference< XNumberFormats> xFormats(xSupplier->getNumberFormats());
- Reference< XPropertySet> xFormat(xFormats->getByKey(getINT32(aFormatKey)));
- if (hasProperty(sPropCurrencySymbol, xFormat))
- {
- Any aVal( xFormat->getPropertyValue(sPropCurrencySymbol) );
- if (aVal.hasValue() && hasProperty(sPropCurrencySymbol, xNewProps))
- // If the source value hasn't been set then don't copy it, so we don´t overwrite the default value
- xNewProps->setPropertyValue(sPropCurrencySymbol, aVal);
- }
- if (hasProperty(sPropDecimals, xFormat) && hasProperty(sPropDecimals, xNewProps))
- xNewProps->setPropertyValue(sPropDecimals, xFormat->getPropertyValue(sPropDecimals));
- }
- }
-
- // a potential Min-Max-Conversion
- Any aEffectiveMin( xOldProps->getPropertyValue(sPropEffectiveMin) );
- if (aEffectiveMin.hasValue())
- { // Unlike the ValueMin the EffectiveMin can be void
- if (hasProperty(sPropValueMin, xNewProps))
- {
- OSL_ENSURE(aEffectiveMin.getValueType().getTypeClass() == TypeClass_DOUBLE,
- "TransferFormComponentProperties : invalid property type !");
- xNewProps->setPropertyValue(sPropValueMin, aEffectiveMin);
- }
- }
- Any aEffectiveMax( xOldProps->getPropertyValue(sPropEffectiveMax) );
- if (aEffectiveMax.hasValue())
- { // analog
- if (hasProperty(sPropValueMax, xNewProps))
- {
- OSL_ENSURE(aEffectiveMax.getValueType().getTypeClass() == TypeClass_DOUBLE,
- "TransferFormComponentProperties : invalid property type !");
- xNewProps->setPropertyValue(sPropValueMax, aEffectiveMax);
- }
- }
-
- // then we can still convert and copy the default values
- Any aEffectiveDefault( xOldProps->getPropertyValue(sPropEffectiveDefault) );
- if (aEffectiveDefault.hasValue())
- {
- sal_Bool bIsString = aEffectiveDefault.getValueType().getTypeClass() == TypeClass_STRING;
- OSL_ENSURE(bIsString || aEffectiveDefault.getValueType().getTypeClass() == TypeClass_DOUBLE,
- "TransferFormComponentProperties : invalid property type !");
- // The Effective-Properties should always be void or string or double ....
-
- if (hasProperty(sPropDefaultDate, xNewProps) && !bIsString)
- { // (to convert a ::rtl::OUString into a date will not always succeed, because it might be bound to a text-column,
- // but we can work with a double)
- Date aDate = DBTypeConversion::toDate(getDouble(aEffectiveDefault));
- xNewProps->setPropertyValue(sPropDefaultDate, makeAny(aDate));
- }
-
- if (hasProperty(sPropDefaultTime, xNewProps) && !bIsString)
- { // Completely analogous to time
- Time aTime = DBTypeConversion::toTime(getDouble(aEffectiveDefault));
- xNewProps->setPropertyValue(sPropDefaultTime, makeAny(aTime));
- }
-
- if (hasProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE), xNewProps) && !bIsString)
- { // Here we can simply pass the double
- xNewProps->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE), aEffectiveDefault);
- }
-
- if (hasProperty(sPropDefaultText, xNewProps) && bIsString)
- { // and here the ::rtl::OUString
- xNewProps->setPropertyValue(sPropDefaultText, aEffectiveDefault);
- }
-
- // nyi: The translation between doubles and ::rtl::OUString would offer more alternatives
- }
- }
-
- // The other direction: the new Control shall be formatted
- if (bNewIsFormatted)
- {
- // first the formatting
- // we can't set a Supplier, so the new Set must bring one in
- Reference< XNumberFormatsSupplier> xSupplier;
- xNewProps->getPropertyValue(sPropFormatsSupplier) >>= xSupplier;
- if (xSupplier.is())
- {
- Reference< XNumberFormats> xFormats(xSupplier->getNumberFormats());
-
- // Set number of decimals
- sal_Int16 nDecimals = 2;
- if (hasProperty(sPropDecimalAccuracy, xOldProps))
- xOldProps->getPropertyValue(sPropDecimalAccuracy) >>= nDecimals;
-
- // base format (depending on the ClassId of the old Set)
- sal_Int32 nBaseKey = 0;
- if (hasProperty(sPropClassId, xOldProps))
- {
- Reference< XNumberFormatTypes> xTypeList(xFormats, UNO_QUERY);
- if (xTypeList.is())
- {
- sal_Int16 nClassId = 0;
- xOldProps->getPropertyValue(sPropClassId) >>= nClassId;
- switch (nClassId)
- {
- case FormComponentType::DATEFIELD :
- nBaseKey = xTypeList->getStandardFormat(NumberFormat::DATE, _rLocale);
- break;
-
- case FormComponentType::TIMEFIELD :
- nBaseKey = xTypeList->getStandardFormat(NumberFormat::TIME, _rLocale);
- break;
-
- case FormComponentType::CURRENCYFIELD :
- nBaseKey = xTypeList->getStandardFormat(NumberFormat::CURRENCY, _rLocale);
- break;
- }
- }
- }
-
- // With this we can generate a new format ...
- ::rtl::OUString sNewFormat = xFormats->generateFormat(nBaseKey, _rLocale, sal_False, sal_False, nDecimals, 0);
- // No thousands separator, negative numbers are not in red, no leading zeros
-
- // ... and add at FormatsSupplier (if needed)
- sal_Int32 nKey = xFormats->queryKey(sNewFormat, _rLocale, sal_False);
- if (nKey == (sal_Int32)-1)
- { // not added yet in my formatter ...
- nKey = xFormats->addNew(sNewFormat, _rLocale);
- }
-
- xNewProps->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FORMATKEY), makeAny((sal_Int32)nKey));
- }
-
- // min-/max-Value
- Any aNewMin, aNewMax;
- if (hasProperty(sPropValueMin, xOldProps))
- aNewMin = xOldProps->getPropertyValue(sPropValueMin);
- if (hasProperty(sPropValueMax, xOldProps))
- aNewMax = xOldProps->getPropertyValue(sPropValueMax);
- xNewProps->setPropertyValue(sPropEffectiveMin, aNewMin);
- xNewProps->setPropertyValue(sPropEffectiveMax, aNewMax);
-
- // Default-Value
- Any aNewDefault;
- if (hasProperty(sPropDefaultDate, xOldProps))
- {
- Any aDate( xOldProps->getPropertyValue(sPropDefaultDate) );
- if (aDate.hasValue())
- aNewDefault <<= DBTypeConversion::toDouble(*(Date*)aDate.getValue());
- }
-
- if (hasProperty(sPropDefaultTime, xOldProps))
- {
- Any aTime( xOldProps->getPropertyValue(sPropDefaultTime) );
- if (aTime.hasValue())
- aNewDefault <<= DBTypeConversion::toDouble(*(Time*)aTime.getValue());
- }
-
- // double or ::rtl::OUString will be copied directly
- if (hasProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE), xOldProps))
- aNewDefault = xOldProps->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE));
- if (hasProperty(sPropDefaultText, xOldProps))
- aNewDefault = xOldProps->getPropertyValue(sPropDefaultText);
-
- if (aNewDefault.hasValue())
- xNewProps->setPropertyValue(sPropEffectiveDefault, aNewDefault);
- }
-}
-catch(const Exception&)
-{
- OSL_FAIL( "TransferFormComponentProperties: caught an exception!" );
-}
-}
-
-//------------------------------------------------------------------------------
-sal_Bool canInsert(const Reference< XPropertySet>& _rxCursorSet)
-{
- return ((_rxCursorSet.is() && (getINT32(_rxCursorSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Privileges")))) & Privilege::INSERT) != 0));
-}
-
-//------------------------------------------------------------------------------
-sal_Bool canUpdate(const Reference< XPropertySet>& _rxCursorSet)
-{
- return ((_rxCursorSet.is() && (getINT32(_rxCursorSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Privileges")))) & Privilege::UPDATE) != 0));
-}
-
-//------------------------------------------------------------------------------
-sal_Bool canDelete(const Reference< XPropertySet>& _rxCursorSet)
-{
- return ((_rxCursorSet.is() && (getINT32(_rxCursorSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Privileges")))) & Privilege::DELETE) != 0));
-}
-// -----------------------------------------------------------------------------
-Reference< XDataSource> findDataSource(const Reference< XInterface >& _xParent)
-{
- Reference< XOfficeDatabaseDocument> xDatabaseDocument(_xParent, UNO_QUERY);
- Reference< XDataSource> xDataSource;
- if ( xDatabaseDocument.is() )
- xDataSource = xDatabaseDocument->getDataSource();
- if ( !xDataSource.is() )
- xDataSource.set(_xParent, UNO_QUERY);
- if (!xDataSource.is())
- {
- Reference< XChild> xChild(_xParent, UNO_QUERY);
- if ( xChild.is() )
- xDataSource = findDataSource(xChild->getParent());
- }
- return xDataSource;
-}
-
-//------------------------------------------------------------------------------
-::rtl::OUString getComposedRowSetStatement( const Reference< XPropertySet >& _rxRowSet, const Reference< XMultiServiceFactory>& _rxFactory,
- sal_Bool _bUseRowSetFilter, sal_Bool _bUseRowSetOrder, Reference< XSingleSelectQueryComposer >* _pxComposer )
- SAL_THROW( ( SQLException ) )
-{
- ::rtl::OUString sStatement;
- try
- {
- Reference< XConnection> xConn = connectRowset( Reference< XRowSet >( _rxRowSet, UNO_QUERY ), _rxFactory, sal_True );
- if ( xConn.is() ) // implies _rxRowSet.is()
- {
- // build the statement the row set is based on (can't use the ActiveCommand property of the set
- // as this reflects the status after the last execute, not the currently set properties)
-
- sal_Int32 nCommandType = CommandType::COMMAND;
- ::rtl::OUString sCommand;
- sal_Bool bEscapeProcessing = sal_False;
-
- OSL_VERIFY( _rxRowSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "CommandType" )) ) >>= nCommandType );
- OSL_VERIFY( _rxRowSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Command" )) ) >>= sCommand );
- OSL_VERIFY( _rxRowSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "EscapeProcessing" )) ) >>= bEscapeProcessing );
-
- StatementComposer aComposer( xConn, sCommand, nCommandType, bEscapeProcessing );
- // append sort
- if ( _bUseRowSetOrder )
- aComposer.setOrder( getString( _rxRowSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Order" )) ) ) );
-
- // append filter
- if ( _bUseRowSetFilter )
- {
- sal_Bool bApplyFilter = sal_True;
- _rxRowSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ApplyFilter" )) ) >>= bApplyFilter;
- if ( bApplyFilter )
- aComposer.setFilter( getString( _rxRowSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Filter" )) ) ) );
- }
-
- sStatement = aComposer.getQuery();
-
- if ( _pxComposer )
- {
- *_pxComposer = aComposer.getComposer();
- aComposer.setDisposeComposer( false );
- }
- }
- }
- catch( const SQLException& )
- {
- throw;
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- return sStatement;
-}
-
-//------------------------------------------------------------------------------
-::rtl::OUString getComposedRowSetStatement(
- const Reference< XPropertySet >& _rxRowSet, const Reference< XMultiServiceFactory>& _rxFactory,
- sal_Bool _bUseRowSetFilter, sal_Bool _bUseRowSetOrder )
-{
- return getComposedRowSetStatement( _rxRowSet, _rxFactory, _bUseRowSetFilter, _bUseRowSetOrder, NULL );
-}
-
-//------------------------------------------------------------------------------
-Reference< XSingleSelectQueryComposer > getCurrentSettingsComposer(
- const Reference< XPropertySet>& _rxRowSetProps,
- const Reference< XMultiServiceFactory>& _rxFactory)
-{
- Reference< XSingleSelectQueryComposer > xReturn;
- try
- {
- getComposedRowSetStatement( _rxRowSetProps, _rxFactory, sal_True, sal_True, &xReturn );
- }
- catch( const SQLException& )
- {
- throw;
- }
- catch( const Exception& )
- {
- OSL_FAIL( "::getCurrentSettingsComposer : caught an exception !" );
- }
-
- return xReturn;
-}
-//--------------------------------------------------------------------------
-::rtl::OUString composeTableName( const Reference< XDatabaseMetaData >& _rxMetaData,
- const ::rtl::OUString& _rCatalog,
- const ::rtl::OUString& _rSchema,
- const ::rtl::OUString& _rName,
- sal_Bool _bQuote,
- EComposeRule _eComposeRule)
-{
- return impl_doComposeTableName( _rxMetaData, _rCatalog, _rSchema, _rName, _bQuote, _eComposeRule );
-}
-
-// -----------------------------------------------------------------------------
-::rtl::OUString composeTableNameForSelect( const Reference< XConnection >& _rxConnection,
- const ::rtl::OUString& _rCatalog, const ::rtl::OUString& _rSchema, const ::rtl::OUString& _rName )
-{
- sal_Bool bUseCatalogInSelect = isDataSourcePropertyEnabled( _rxConnection, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCatalogInSelect" ) ), sal_True );
- sal_Bool bUseSchemaInSelect = isDataSourcePropertyEnabled( _rxConnection, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseSchemaInSelect" ) ), sal_True );
-
- return impl_doComposeTableName(
- _rxConnection->getMetaData(),
- bUseCatalogInSelect ? _rCatalog : ::rtl::OUString(),
- bUseSchemaInSelect ? _rSchema : ::rtl::OUString(),
- _rName,
- true,
- eInDataManipulation
- );
-}
-
-// -----------------------------------------------------------------------------
-namespace
-{
- static void lcl_getTableNameComponents( const Reference<XPropertySet>& _xTable,
- ::rtl::OUString& _out_rCatalog, ::rtl::OUString& _out_rSchema, ::rtl::OUString& _out_rName )
- {
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- Reference< XPropertySetInfo > xInfo;
- if (_xTable.is())
- xInfo = _xTable->getPropertySetInfo();
- if ( xInfo.is()
- && xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) )
- {
-
- ::rtl::OUString aCatalog;
- ::rtl::OUString aSchema;
- ::rtl::OUString aTable;
- if ( xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME))
- && xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) )
- {
- _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)) >>= _out_rCatalog;
- _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= _out_rSchema;
- }
- _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= _out_rName;
- }
- else
- OSL_FAIL( "::dbtools::lcl_getTableNameComponents: this is no table object!" );
- }
-}
-
-// -----------------------------------------------------------------------------
-::rtl::OUString composeTableNameForSelect( const Reference< XConnection >& _rxConnection, const Reference<XPropertySet>& _xTable )
-{
- ::rtl::OUString sCatalog, sSchema, sName;
- lcl_getTableNameComponents( _xTable, sCatalog, sSchema, sName );
-
- return composeTableNameForSelect( _rxConnection, sCatalog, sSchema, sName );
-}
-
-// -----------------------------------------------------------------------------
-::rtl::OUString composeTableName(const Reference<XDatabaseMetaData>& _xMetaData,
- const Reference<XPropertySet>& _xTable,
- EComposeRule _eComposeRule,
- bool _bSuppressCatalog,
- bool _bSuppressSchema,
- bool _bQuote )
-{
- ::rtl::OUString sCatalog, sSchema, sName;
- lcl_getTableNameComponents( _xTable, sCatalog, sSchema, sName );
-
- return impl_doComposeTableName(
- _xMetaData,
- _bSuppressCatalog ? ::rtl::OUString() : sCatalog,
- _bSuppressSchema ? ::rtl::OUString() : sSchema,
- sName,
- _bQuote,
- _eComposeRule
- );
-}
-// -----------------------------------------------------------------------------
-sal_Int32 getSearchColumnFlag( const Reference< XConnection>& _rxConn,sal_Int32 _nDataType)
-{
- sal_Int32 nSearchFlag = 0;
- Reference<XResultSet> xSet = _rxConn->getMetaData()->getTypeInfo();
- if(xSet.is())
- {
- Reference<XRow> xRow(xSet,UNO_QUERY);
- while(xSet->next())
- {
- if(xRow->getInt(2) == _nDataType)
- {
- nSearchFlag = xRow->getInt(9);
- break;
- }
- }
- }
- return nSearchFlag;
-}
-
-// -----------------------------------------------------------------------------
-::rtl::OUString createUniqueName( const Sequence< ::rtl::OUString >& _rNames, const ::rtl::OUString& _rBaseName, sal_Bool _bStartWithNumber )
-{
- ::std::set< ::rtl::OUString > aUsedNames;
- ::std::copy(
- _rNames.getConstArray(),
- _rNames.getConstArray() + _rNames.getLength(),
- ::std::insert_iterator< ::std::set< ::rtl::OUString > >( aUsedNames, aUsedNames.end() )
- );
-
- ::rtl::OUString sName( _rBaseName );
- sal_Int32 nPos = 1;
- if ( _bStartWithNumber )
- sName += ::rtl::OUString::valueOf( nPos );
-
- while ( aUsedNames.find( sName ) != aUsedNames.end() )
- {
- sName = _rBaseName;
- sName += ::rtl::OUString::valueOf( ++nPos );
- }
- return sName;
-}
-
-// -----------------------------------------------------------------------------
-::rtl::OUString createUniqueName(const Reference<XNameAccess>& _rxContainer,const ::rtl::OUString& _rBaseName,sal_Bool _bStartWithNumber)
-{
- Sequence< ::rtl::OUString > aElementNames;
-
- OSL_ENSURE( _rxContainer.is(), "createUniqueName: invalid container!" );
- if ( _rxContainer.is() )
- aElementNames = _rxContainer->getElementNames();
-
- return createUniqueName( aElementNames, _rBaseName, _bStartWithNumber );
-}
-
-// -----------------------------------------------------------------------------
-void showError(const SQLExceptionInfo& _rInfo,
- const Reference< XWindow>& _xParent,
- const Reference< XMultiServiceFactory >& _xFactory)
-{
- if (_rInfo.isValid())
- {
- try
- {
- Sequence< Any > aArgs(2);
- aArgs[0] <<= PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLException")), 0, _rInfo.get(), PropertyState_DIRECT_VALUE);
- aArgs[1] <<= PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow")), 0, makeAny(_xParent), PropertyState_DIRECT_VALUE);
-
- static ::rtl::OUString s_sDialogServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.ErrorMessageDialog" ));
- Reference< XExecutableDialog > xErrorDialog(
- _xFactory->createInstanceWithArguments(s_sDialogServiceName, aArgs), UNO_QUERY);
- if (xErrorDialog.is())
- xErrorDialog->execute();
- else
- {
- OSL_FAIL("dbtools::showError: no XExecutableDialog found!");
- }
- }
- catch(Exception&)
- {
- OSL_FAIL("showError: could not display the error message!");
- }
- }
-}
-
-// -------------------------------------------------------------------------
-sal_Bool implUpdateObject(const Reference< XRowUpdate >& _rxUpdatedObject,
- const sal_Int32 _nColumnIndex, const Any& _rValue) SAL_THROW ( ( SQLException, RuntimeException ) )
-{
- sal_Bool bSuccessfullyReRouted = sal_True;
- switch (_rValue.getValueTypeClass())
- {
- case TypeClass_ANY:
- {
- Any aInnerValue;
- _rValue >>= aInnerValue;
- bSuccessfullyReRouted = implUpdateObject(_rxUpdatedObject, _nColumnIndex, aInnerValue);
- }
- break;
-
- case TypeClass_VOID:
- _rxUpdatedObject->updateNull(_nColumnIndex);
- break;
-
- case TypeClass_STRING:
- _rxUpdatedObject->updateString(_nColumnIndex, *(rtl::OUString*)_rValue.getValue());
- break;
-
- case TypeClass_BOOLEAN:
- _rxUpdatedObject->updateBoolean(_nColumnIndex, *(sal_Bool *)_rValue.getValue());
- break;
-
- case TypeClass_BYTE:
- _rxUpdatedObject->updateByte(_nColumnIndex, *(sal_Int8 *)_rValue.getValue());
- break;
-
- case TypeClass_UNSIGNED_SHORT:
- case TypeClass_SHORT:
- _rxUpdatedObject->updateShort(_nColumnIndex, *(sal_Int16*)_rValue.getValue());
- break;
-
- case TypeClass_CHAR:
- _rxUpdatedObject->updateString(_nColumnIndex,::rtl::OUString((sal_Unicode *)_rValue.getValue(),1));
- break;
-
- case TypeClass_UNSIGNED_LONG:
- case TypeClass_LONG:
- _rxUpdatedObject->updateInt(_nColumnIndex, *(sal_Int32*)_rValue.getValue());
- break;
-
- case TypeClass_HYPER:
- {
- sal_Int64 nValue = 0;
- OSL_VERIFY( _rValue >>= nValue );
- _rxUpdatedObject->updateLong( _nColumnIndex, nValue );
- }
- break;
-
- case TypeClass_FLOAT:
- _rxUpdatedObject->updateFloat(_nColumnIndex, *(float*)_rValue.getValue());
- break;
-
- case TypeClass_DOUBLE:
- _rxUpdatedObject->updateDouble(_nColumnIndex, *(double*)_rValue.getValue());
- break;
-
- case TypeClass_SEQUENCE:
- if (_rValue.getValueType() == ::getCppuType((const Sequence< sal_Int8 > *)0))
- _rxUpdatedObject->updateBytes(_nColumnIndex, *(Sequence<sal_Int8>*)_rValue.getValue());
- else
- bSuccessfullyReRouted = sal_False;
- break;
- case TypeClass_STRUCT:
- if (_rValue.getValueType() == ::getCppuType((const DateTime*)0))
- _rxUpdatedObject->updateTimestamp(_nColumnIndex, *(DateTime*)_rValue.getValue());
- else if (_rValue.getValueType() == ::getCppuType((const Date*)0))
- _rxUpdatedObject->updateDate(_nColumnIndex, *(Date*)_rValue.getValue());
- else if (_rValue.getValueType() == ::getCppuType((const Time*)0))
- _rxUpdatedObject->updateTime(_nColumnIndex, *(Time*)_rValue.getValue());
- else
- bSuccessfullyReRouted = sal_False;
- break;
-
- case TypeClass_INTERFACE:
- if (_rValue.getValueType() == ::getCppuType(static_cast<Reference< XInputStream>*>(NULL)))
- {
- Reference< XInputStream > xStream;
- _rValue >>= xStream;
- _rxUpdatedObject->updateBinaryStream(_nColumnIndex, xStream, xStream->available());
- break;
- }
- // run through
- default:
- bSuccessfullyReRouted = sal_False;
- }
-
- return bSuccessfullyReRouted;
-}
-// -------------------------------------------------------------------------
-sal_Bool implSetObject( const Reference< XParameters >& _rxParameters,
- const sal_Int32 _nColumnIndex, const Any& _rValue) SAL_THROW ( ( SQLException, RuntimeException ) )
-{
- sal_Bool bSuccessfullyReRouted = sal_True;
- switch (_rValue.getValueTypeClass())
- {
- case TypeClass_HYPER:
- {
- sal_Int64 nValue = 0;
- OSL_VERIFY( _rValue >>= nValue );
- _rxParameters->setLong( _nColumnIndex, nValue );
- }
- break;
-
- case TypeClass_ANY:
- {
- Any aInnerValue;
- _rValue >>= aInnerValue;
- bSuccessfullyReRouted = implSetObject(_rxParameters, _nColumnIndex, aInnerValue);
- }
- break;
-
- case TypeClass_VOID:
- _rxParameters->setNull(_nColumnIndex,DataType::VARCHAR);
- break;
-
- case TypeClass_STRING:
- _rxParameters->setString(_nColumnIndex, *(rtl::OUString*)_rValue.getValue());
- break;
-
- case TypeClass_BOOLEAN:
- _rxParameters->setBoolean(_nColumnIndex, *(sal_Bool *)_rValue.getValue());
- break;
-
- case TypeClass_BYTE:
- _rxParameters->setByte(_nColumnIndex, *(sal_Int8 *)_rValue.getValue());
- break;
-
- case TypeClass_UNSIGNED_SHORT:
- case TypeClass_SHORT:
- _rxParameters->setShort(_nColumnIndex, *(sal_Int16*)_rValue.getValue());
- break;
-
- case TypeClass_CHAR:
- _rxParameters->setString(_nColumnIndex, ::rtl::OUString((sal_Unicode *)_rValue.getValue(),1));
- break;
-
- case TypeClass_UNSIGNED_LONG:
- case TypeClass_LONG:
- _rxParameters->setInt(_nColumnIndex, *(sal_Int32*)_rValue.getValue());
- break;
-
- case TypeClass_FLOAT:
- _rxParameters->setFloat(_nColumnIndex, *(float*)_rValue.getValue());
- break;
-
- case TypeClass_DOUBLE:
- _rxParameters->setDouble(_nColumnIndex, *(double*)_rValue.getValue());
- break;
-
- case TypeClass_SEQUENCE:
- if (_rValue.getValueType() == ::getCppuType((const Sequence< sal_Int8 > *)0))
- {
- _rxParameters->setBytes(_nColumnIndex, *(Sequence<sal_Int8>*)_rValue.getValue());
- }
- else
- bSuccessfullyReRouted = sal_False;
- break;
- case TypeClass_STRUCT:
- if (_rValue.getValueType() == ::getCppuType((const DateTime*)0))
- _rxParameters->setTimestamp(_nColumnIndex, *(DateTime*)_rValue.getValue());
- else if (_rValue.getValueType() == ::getCppuType((const Date*)0))
- _rxParameters->setDate(_nColumnIndex, *(Date*)_rValue.getValue());
- else if (_rValue.getValueType() == ::getCppuType((const Time*)0))
- _rxParameters->setTime(_nColumnIndex, *(Time*)_rValue.getValue());
- else
- bSuccessfullyReRouted = sal_False;
- break;
-
- case TypeClass_INTERFACE:
- if (_rValue.getValueType() == ::getCppuType(static_cast<Reference< XInputStream>*>(NULL)))
- {
- Reference< XInputStream > xStream;
- _rValue >>= xStream;
- _rxParameters->setBinaryStream(_nColumnIndex, xStream, xStream->available());
- break;
- }
- // run through
- default:
- bSuccessfullyReRouted = sal_False;
-
- }
-
- return bSuccessfullyReRouted;
-}
-
-//..................................................................
-namespace
-{
- class OParameterWrapper : public ::cppu::WeakImplHelper1< XIndexAccess >
- {
- ::std::vector<bool, std::allocator<bool> > m_aSet;
- Reference<XIndexAccess> m_xSource;
- public:
- OParameterWrapper(const ::std::vector<bool, std::allocator<bool> >& _aSet,const Reference<XIndexAccess>& _xSource) : m_aSet(_aSet),m_xSource(_xSource){}
- private:
- // ::com::sun::star::container::XElementAccess
- virtual Type SAL_CALL getElementType() throw(RuntimeException)
- {
- return m_xSource->getElementType();
- }
- virtual sal_Bool SAL_CALL hasElements( ) throw(RuntimeException)
- {
- if ( m_aSet.empty() )
- return m_xSource->hasElements();
- return ::std::count(m_aSet.begin(),m_aSet.end(),false) != 0;
- }
- // ::com::sun::star::container::XIndexAccess
- virtual sal_Int32 SAL_CALL getCount( ) throw(RuntimeException)
- {
- if ( m_aSet.empty() )
- return m_xSource->getCount();
- return ::std::count(m_aSet.begin(),m_aSet.end(),false);
- }
- virtual Any SAL_CALL getByIndex( sal_Int32 Index ) throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException)
- {
- if ( m_aSet.empty() )
- return m_xSource->getByIndex(Index);
- if ( m_aSet.size() < (size_t)Index )
- throw IndexOutOfBoundsException();
-
- ::std::vector<bool, std::allocator<bool> >::iterator aIter = m_aSet.begin();
- ::std::vector<bool, std::allocator<bool> >::iterator aEnd = m_aSet.end();
- sal_Int32 i = 0;
- sal_Int32 nParamPos = -1;
- for(; aIter != aEnd && i <= Index; ++aIter)
- {
- ++nParamPos;
- if ( !*aIter )
- {
- ++i;
- }
- }
- return m_xSource->getByIndex(nParamPos);
- }
- };
-}
-
-// -----------------------------------------------------------------------------
-void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer,
- const Reference<XParameters>& _xParameters,
- const Reference< XConnection>& _xConnection,
- const Reference< XInteractionHandler >& _rxHandler,
- const ::std::vector<bool, std::allocator<bool> >& _aParametersSet)
-{
- OSL_ENSURE(_xComposer.is(),"dbtools::askForParameters XSQLQueryComposer is null!");
- OSL_ENSURE(_xParameters.is(),"dbtools::askForParameters XParameters is null!");
- OSL_ENSURE(_xConnection.is(),"dbtools::askForParameters XConnection is null!");
- OSL_ENSURE(_rxHandler.is(),"dbtools::askForParameters XInteractionHandler is null!");
-
- // we have to set this here again because getCurrentSettingsComposer can force a setpropertyvalue
- Reference<XParametersSupplier> xParameters = Reference<XParametersSupplier> (_xComposer, UNO_QUERY);
-
- Reference<XIndexAccess> xParamsAsIndicies = xParameters.is() ? xParameters->getParameters() : Reference<XIndexAccess>();
- Reference<XNameAccess> xParamsAsNames(xParamsAsIndicies, UNO_QUERY);
- sal_Int32 nParamCount = xParamsAsIndicies.is() ? xParamsAsIndicies->getCount() : 0;
- ::std::vector<bool, std::allocator<bool> > aNewParameterSet( _aParametersSet );
- if ( nParamCount || ::std::count(aNewParameterSet.begin(),aNewParameterSet.end(),true) != nParamCount )
- {
- static const ::rtl::OUString PROPERTY_NAME(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME));
- aNewParameterSet.resize(nParamCount ,false);
- typedef ::std::map< ::rtl::OUString, ::std::vector<sal_Int32> > TParameterPositions;
- TParameterPositions aParameterNames;
- for(sal_Int32 i = 0; i < nParamCount; ++i)
- {
- Reference<XPropertySet> xParam(xParamsAsIndicies->getByIndex(i),UNO_QUERY);
- ::rtl::OUString sName;
- xParam->getPropertyValue(PROPERTY_NAME) >>= sName;
-
- TParameterPositions::iterator aFind = aParameterNames.find(sName);
- if ( aFind != aParameterNames.end() )
- aNewParameterSet[i] = true;
- aParameterNames[sName].push_back(i+1);
- }
- // build an interaction request
- // two continuations (Ok and Cancel)
- OInteractionAbort* pAbort = new OInteractionAbort;
- OParameterContinuation* pParams = new OParameterContinuation;
- // the request
- ParametersRequest aRequest;
- Reference<XIndexAccess> xWrappedParameters = new OParameterWrapper(aNewParameterSet,xParamsAsIndicies);
- aRequest.Parameters = xWrappedParameters;
- aRequest.Connection = _xConnection;
- OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aRequest));
- Reference< XInteractionRequest > xRequest(pRequest);
- // some knittings
- pRequest->addContinuation(pAbort);
- pRequest->addContinuation(pParams);
-
- // execute the request
- _rxHandler->handle(xRequest);
-
- if (!pParams->wasSelected())
- {
- // canceled by the user (i.e. (s)he canceled the dialog)
- RowSetVetoException e;
- e.ErrorCode = ParameterInteractionCancelled;
- throw e;
- }
-
- // now transfer the values from the continuation object to the parameter columns
- Sequence< PropertyValue > aFinalValues = pParams->getValues();
- const PropertyValue* pFinalValues = aFinalValues.getConstArray();
- for (sal_Int32 i=0; i<aFinalValues.getLength(); ++i, ++pFinalValues)
- {
- Reference< XPropertySet > xParamColumn(xWrappedParameters->getByIndex(i),UNO_QUERY);
- if (xParamColumn.is())
- {
- ::rtl::OUString sName;
- xParamColumn->getPropertyValue(PROPERTY_NAME) >>= sName;
- OSL_ENSURE(sName.equals(pFinalValues->Name), "::dbaui::askForParameters: inconsistent parameter names!");
-
- // determine the field type and ...
- sal_Int32 nParamType = 0;
- xParamColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nParamType;
- // ... the scale of the parameter column
- sal_Int32 nScale = 0;
- if (hasProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE), xParamColumn))
- xParamColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)) >>= nScale;
- // (the index of the parameters is one-based)
- TParameterPositions::iterator aFind = aParameterNames.find(pFinalValues->Name);
- ::std::vector<sal_Int32>::iterator aIterPos = aFind->second.begin();
- ::std::vector<sal_Int32>::iterator aEndPos = aFind->second.end();
- for(;aIterPos != aEndPos;++aIterPos)
- {
- if ( _aParametersSet.empty() || !_aParametersSet[(*aIterPos)-1] )
- {
- _xParameters->setObjectWithInfo(*aIterPos, pFinalValues->Value, nParamType, nScale);
- }
- }
- }
- }
- }
-}
-// -----------------------------------------------------------------------------
-void setObjectWithInfo(const Reference<XParameters>& _xParams,
- sal_Int32 parameterIndex,
- const Any& x,
- sal_Int32 sqlType,
- sal_Int32 scale) throw(SQLException, RuntimeException)
-{
- ORowSetValue aVal;
- aVal.fill(x);
- setObjectWithInfo(_xParams,parameterIndex,aVal,sqlType,scale);
-}
-// -----------------------------------------------------------------------------
-void setObjectWithInfo(const Reference<XParameters>& _xParams,
- sal_Int32 parameterIndex,
- const ::connectivity::ORowSetValue& _rValue,
- sal_Int32 sqlType,
- sal_Int32 scale) throw(SQLException, RuntimeException)
-{
- if ( _rValue.isNull() )
- _xParams->setNull(parameterIndex,sqlType);
- else
- {
- switch(sqlType)
- {
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- _xParams->setObjectWithInfo(parameterIndex,_rValue.makeAny(),sqlType,scale);
- break;
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- _xParams->setString(parameterIndex,_rValue);
- break;
- case DataType::CLOB:
- {
- Any x(_rValue.makeAny());
- ::rtl::OUString sValue;
- if ( x >>= sValue )
- _xParams->setString(parameterIndex,sValue);
- else
- {
- Reference< XClob > xClob;
- if(x >>= xClob)
- _xParams->setClob(parameterIndex,xClob);
- else
- {
- Reference< ::com::sun::star::io::XInputStream > xStream;
- if(x >>= xStream)
- _xParams->setCharacterStream(parameterIndex,xStream,xStream->available());
- }
- }
- }
- break;
- case DataType::BIGINT:
- if ( _rValue.isSigned() )
- _xParams->setLong(parameterIndex,_rValue);
- else
- _xParams->setString(parameterIndex,_rValue);
- break;
-
- case DataType::FLOAT:
- _xParams->setFloat(parameterIndex,_rValue);
- break;
- case DataType::REAL:
- case DataType::DOUBLE:
- _xParams->setDouble(parameterIndex,_rValue);
- break;
- case DataType::DATE:
- _xParams->setDate(parameterIndex,_rValue);
- break;
- case DataType::TIME:
- _xParams->setTime(parameterIndex,_rValue);
- break;
- case DataType::TIMESTAMP:
- _xParams->setTimestamp(parameterIndex,_rValue);
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- {
- Any x(_rValue.makeAny());
- Sequence< sal_Int8> aBytes;
- if(x >>= aBytes)
- _xParams->setBytes(parameterIndex,aBytes);
- else
- {
- Reference< XBlob > xBlob;
- if(x >>= xBlob)
- _xParams->setBlob(parameterIndex,xBlob);
- else
- {
- Reference< XClob > xClob;
- if(x >>= xClob)
- _xParams->setClob(parameterIndex,xClob);
- else
- {
- Reference< ::com::sun::star::io::XInputStream > xBinStream;
- if(x >>= xBinStream)
- _xParams->setBinaryStream(parameterIndex,xBinStream,xBinStream->available());
- }
- }
- }
- }
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- _xParams->setBoolean(parameterIndex,_rValue);
- break;
- case DataType::TINYINT:
- if ( _rValue.isSigned() )
- _xParams->setByte(parameterIndex,_rValue);
- else
- _xParams->setShort(parameterIndex,_rValue);
- break;
- case DataType::SMALLINT:
- if ( _rValue.isSigned() )
- _xParams->setShort(parameterIndex,_rValue);
- else
- _xParams->setInt(parameterIndex,_rValue);
- break;
- case DataType::INTEGER:
- if ( _rValue.isSigned() )
- _xParams->setInt(parameterIndex,_rValue);
- else
- _xParams->setLong(parameterIndex,_rValue);
- break;
- default:
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_UNKNOWN_PARA_TYPE,
- "$position$", ::rtl::OUString::valueOf(parameterIndex)
- ) );
- ::dbtools::throwGenericSQLException(sError,NULL);
- }
- }
- }
-}
-
-// --------------------------------------------------------------------
-void getBoleanComparisonPredicate( const ::rtl::OUString& _rExpression, const sal_Bool _bValue, const sal_Int32 _nBooleanComparisonMode,
- ::rtl::OUStringBuffer& _out_rSQLPredicate )
-{
- switch ( _nBooleanComparisonMode )
- {
- case BooleanComparisonMode::IS_LITERAL:
- _out_rSQLPredicate.append( _rExpression );
- if ( _bValue )
- _out_rSQLPredicate.appendAscii( " IS TRUE" );
- else
- _out_rSQLPredicate.appendAscii( " IS FALSE" );
- break;
-
- case BooleanComparisonMode::EQUAL_LITERAL:
- _out_rSQLPredicate.append( _rExpression );
- _out_rSQLPredicate.appendAscii( _bValue ? " = TRUE" : " = FALSE" );
- break;
-
- case BooleanComparisonMode::ACCESS_COMPAT:
- if ( _bValue )
- {
- _out_rSQLPredicate.appendAscii( " NOT ( ( " );
- _out_rSQLPredicate.append( _rExpression );
- _out_rSQLPredicate.appendAscii( " = 0 ) OR ( " );
- _out_rSQLPredicate.append( _rExpression );
- _out_rSQLPredicate.appendAscii( " IS NULL ) )" );
- }
- else
- {
- _out_rSQLPredicate.append( _rExpression );
- _out_rSQLPredicate.appendAscii( " = 0" );
- }
- break;
-
- case BooleanComparisonMode::EQUAL_INTEGER:
- // fall through
- default:
- _out_rSQLPredicate.append( _rExpression );
- _out_rSQLPredicate.appendAscii( _bValue ? " = 1" : " = 0" );
- break;
- }
-}
-
-//.........................................................................
-} // namespace dbtools
-//.........................................................................
-
-//.........................................................................
-namespace connectivity
-{
-//.........................................................................
-
-void release(oslInterlockedCount& _refCount,
- ::cppu::OBroadcastHelper& rBHelper,
- Reference< XInterface >& _xInterface,
- ::com::sun::star::lang::XComponent* _pObject)
-{
- if (osl_decrementInterlockedCount( &_refCount ) == 0)
- {
- osl_incrementInterlockedCount( &_refCount );
-
- if (!rBHelper.bDisposed && !rBHelper.bInDispose)
- {
- // remember the parent
- Reference< XInterface > xParent;
- {
- ::osl::MutexGuard aGuard( rBHelper.rMutex );
- xParent = _xInterface;
- _xInterface = NULL;
- }
-
- // First dispose
- _pObject->dispose();
-
- // only the alive ref holds the object
- OSL_ASSERT( _refCount == 1 );
-
- // release the parent in the ~
- if (xParent.is())
- {
- ::osl::MutexGuard aGuard( rBHelper.rMutex );
- _xInterface = xParent;
- }
-
-// // destroy the object if xHoldAlive decrement the refcount to 0
-// m_pDerivedImplementation->WEAK::release();
- }
- }
- else
- osl_incrementInterlockedCount( &_refCount );
-}
-
-void checkDisposed(sal_Bool _bThrow) throw ( DisposedException )
-{
- if (_bThrow)
- throw DisposedException();
-
-}
-// -------------------------------------------------------------------------
- OSQLColumns::Vector::const_iterator find( OSQLColumns::Vector::const_iterator __first,
- OSQLColumns::Vector::const_iterator __last,
- const ::rtl::OUString& _rVal,
- const ::comphelper::UStringMixEqual& _rCase)
- {
- ::rtl::OUString sName = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME);
- return find(__first,__last,sName,_rVal,_rCase);
- }
- // -------------------------------------------------------------------------
- OSQLColumns::Vector::const_iterator findRealName( OSQLColumns::Vector::const_iterator __first,
- OSQLColumns::Vector::const_iterator __last,
- const ::rtl::OUString& _rVal,
- const ::comphelper::UStringMixEqual& _rCase)
- {
- ::rtl::OUString sRealName = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME);
- return find(__first,__last,sRealName,_rVal,_rCase);
- }
- // -------------------------------------------------------------------------
- OSQLColumns::Vector::const_iterator find( OSQLColumns::Vector::const_iterator __first,
- OSQLColumns::Vector::const_iterator __last,
- const ::rtl::OUString& _rProp,
- const ::rtl::OUString& _rVal,
- const ::comphelper::UStringMixEqual& _rCase)
- {
- while (__first != __last && !_rCase(getString((*__first)->getPropertyValue(_rProp)),_rVal))
- ++__first;
- return __first;
- }
-
-// -----------------------------------------------------------------------------
-} //namespace connectivity
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
deleted file mode 100644
index c1ae2b668c..0000000000
--- a/connectivity/source/commontools/dbtools2.cxx
+++ /dev/null
@@ -1,975 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbconversion.hxx"
-#include "connectivity/dbcharset.hxx"
-#include "connectivity/SQLStatementHelper.hxx"
-#include <unotools/confignode.hxx>
-#include "resource/sharedresources.hxx"
-#include "resource/common_res.hrc"
-#include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
-#include <com/sun/star/sdbc/XDriverAccess.hpp>
-#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/container/XEnumerationAccess.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include "TConnection.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/container/XChild.hpp>
-
-#include <tools/diagnose_ex.h>
-#include <unotools/sharedunocomponent.hxx>
-#include <comphelper/configurationhelper.hxx>
-
-//.........................................................................
-namespace dbtools
-{
-//.........................................................................
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::sdbcx;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::frame;
- using namespace connectivity;
- using namespace comphelper;
-
-::rtl::OUString createStandardColumnPart(const Reference< XPropertySet >& xColProp,const Reference< XConnection>& _xConnection,ISQLStatementHelper* _pHelper,const ::rtl::OUString& _sCreatePattern)
-{
-
- Reference<XDatabaseMetaData> xMetaData = _xConnection->getMetaData();
-
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
-
- ::rtl::OUString sTypeName;
- sal_Int32 nDataType = 0;
- sal_Int32 nPrecision = 0;
- sal_Int32 nScale = 0;
-
- const ::rtl::OUString sQuoteString = xMetaData->getIdentifierQuoteString();
- ::rtl::OUStringBuffer aSql = ::dbtools::quoteName(sQuoteString,::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))));
-
- aSql.appendAscii(" ");
-
- nDataType = nPrecision = nScale = 0;
- sal_Bool bIsAutoIncrement = sal_False;
- xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPENAME)) >>= sTypeName;
- xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= nDataType;
- xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_PRECISION)) >>= nPrecision;
- xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCALE)) >>= nScale;
- xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bIsAutoIncrement;
-
- // check if the user enter a specific string to create autoincrement values
- ::rtl::OUString sAutoIncrementValue;
- Reference<XPropertySetInfo> xPropInfo = xColProp->getPropertySetInfo();
- if ( xPropInfo.is() && xPropInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION)) )
- xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION)) >>= sAutoIncrementValue;
- // look if we have to use precisions
- sal_Bool bUseLiteral = sal_False;
- ::rtl::OUString sPreFix,sPostFix,sCreateParams;
- {
- Reference<XResultSet> xRes = xMetaData->getTypeInfo();
- if(xRes.is())
- {
- Reference<XRow> xRow(xRes,UNO_QUERY);
- while(xRes->next())
- {
- ::rtl::OUString sTypeName2Cmp = xRow->getString(1);
- sal_Int32 nType = xRow->getShort(2);
- sPreFix = xRow->getString (4);
- sPostFix = xRow->getString (5);
- sCreateParams = xRow->getString(6);
- // first identical type will be used if typename is empty
- if ( !sTypeName.getLength() && nType == nDataType )
- sTypeName = sTypeName2Cmp;
-
- if( sTypeName.equalsIgnoreAsciiCase(sTypeName2Cmp) && nType == nDataType && sCreateParams.getLength() && !xRow->wasNull())
- {
- bUseLiteral = sal_True;
- break;
- }
- }
- }
- }
-
- sal_Int32 nIndex = 0;
- if ( sAutoIncrementValue.getLength() && (nIndex = sTypeName.indexOf(sAutoIncrementValue)) != -1 )
- {
- sTypeName = sTypeName.replaceAt(nIndex,sTypeName.getLength() - nIndex,::rtl::OUString());
- }
-
- if ( (nPrecision > 0 || nScale > 0) && bUseLiteral )
- {
- sal_Int32 nParenPos = sTypeName.indexOf('(');
- if ( nParenPos == -1 )
- {
- aSql.append(sTypeName);
- aSql.appendAscii("(");
- }
- else
- {
- aSql.append(sTypeName.copy(0,++nParenPos));
- }
-
- if ( nPrecision > 0 && nDataType != DataType::TIMESTAMP )
- {
- aSql.append(nPrecision);
- if ( (nScale > 0) || (_sCreatePattern.getLength() && sCreateParams.indexOf(_sCreatePattern) != -1) )
- aSql.appendAscii(",");
- }
- if ( (nScale > 0) || (_sCreatePattern.getLength() && sCreateParams.indexOf(_sCreatePattern) != -1 ) || nDataType == DataType::TIMESTAMP )
- aSql.append(nScale);
-
- if ( nParenPos == -1 )
- aSql.appendAscii(")");
- else
- {
- nParenPos = sTypeName.indexOf(')',nParenPos);
- aSql.append(sTypeName.copy(nParenPos));
- }
- }
- else
- aSql.append(sTypeName); // simply add the type name
-
- ::rtl::OUString aDefault = ::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DEFAULTVALUE)));
- if ( aDefault.getLength() )
- {
- aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DEFAULT ")));
- aSql.append(sPreFix);
- aSql.append(aDefault);
- aSql.append(sPostFix);
- } // if ( aDefault.getLength() )
-
- if(::comphelper::getINT32(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISNULLABLE))) == ColumnValue::NO_NULLS)
- aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" NOT NULL")));
-
- if ( bIsAutoIncrement && sAutoIncrementValue.getLength())
- {
- aSql.appendAscii(" ");
- aSql.append(sAutoIncrementValue);
- }
-
- if ( _pHelper )
- _pHelper->addComment(xColProp,aSql);
-
- return aSql.makeStringAndClear();
-}
-// -----------------------------------------------------------------------------
-
-::rtl::OUString createStandardCreateStatement(const Reference< XPropertySet >& descriptor,const Reference< XConnection>& _xConnection,ISQLStatementHelper* _pHelper,const ::rtl::OUString& _sCreatePattern)
-{
- ::rtl::OUStringBuffer aSql(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CREATE TABLE ")));
- ::rtl::OUString sCatalog,sSchema,sTable,sComposedName;
-
- Reference<XDatabaseMetaData> xMetaData = _xConnection->getMetaData();
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
-
- descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)) >>= sCatalog;
- descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= sSchema;
- descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= sTable;
-
- sComposedName = ::dbtools::composeTableName( xMetaData, sCatalog, sSchema, sTable, sal_True, ::dbtools::eInTableDefinitions );
- if ( !sComposedName.getLength() )
- ::dbtools::throwFunctionSequenceException(_xConnection);
-
- aSql.append(sComposedName);
- aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (")));
-
- // columns
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- // check if there are columns
- if(!xColumns.is() || !xColumns->getCount())
- ::dbtools::throwFunctionSequenceException(_xConnection);
-
- Reference< XPropertySet > xColProp;
-
- sal_Int32 nCount = xColumns->getCount();
- for(sal_Int32 i=0;i<nCount;++i)
- {
- if ( (xColumns->getByIndex(i) >>= xColProp) && xColProp.is() )
- {
- aSql.append(createStandardColumnPart(xColProp,_xConnection,_pHelper,_sCreatePattern));
- aSql.appendAscii(",");
- }
- }
- return aSql.makeStringAndClear();
-}
-namespace
-{
- ::rtl::OUString generateColumnNames(const Reference<XIndexAccess>& _xColumns,const Reference<XDatabaseMetaData>& _xMetaData)
- {
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- static const ::rtl::OUString sComma(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(",")));
-
- const ::rtl::OUString sQuote(_xMetaData->getIdentifierQuoteString());
- ::rtl::OUString sSql( RTL_CONSTASCII_USTRINGPARAM( " (" ));
- Reference< XPropertySet > xColProp;
-
- sal_Int32 nColCount = _xColumns->getCount();
- for(sal_Int32 i=0;i<nColCount;++i)
- {
- if ( (_xColumns->getByIndex(i) >>= xColProp) && xColProp.is() )
- sSql += ::dbtools::quoteName(sQuote,::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))))
- + sComma;
- }
-
- if ( nColCount )
- sSql = sSql.replaceAt(sSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
- return sSql;
- }
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString createStandardKeyStatement(const Reference< XPropertySet >& descriptor,const Reference< XConnection>& _xConnection)
-{
- Reference<XDatabaseMetaData> xMetaData = _xConnection->getMetaData();
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
-
- ::rtl::OUStringBuffer aSql;
- // keys
- Reference<XKeysSupplier> xKeySup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xKeys = xKeySup->getKeys();
- if ( xKeys.is() )
- {
- Reference< XPropertySet > xColProp;
- Reference<XIndexAccess> xColumns;
- Reference<XColumnsSupplier> xColumnSup;
- ::rtl::OUString sCatalog,sSchema,sTable,sComposedName;
- sal_Bool bPKey = sal_False;
- for(sal_Int32 i=0;i<xKeys->getCount();++i)
- {
- if ( (xKeys->getByIndex(i) >>= xColProp) && xColProp.is() )
- {
-
- sal_Int32 nKeyType = ::comphelper::getINT32(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)));
-
- if ( nKeyType == KeyType::PRIMARY )
- {
- if(bPKey)
- ::dbtools::throwFunctionSequenceException(_xConnection);
-
- bPKey = sal_True;
- xColumnSup = Reference<XColumnsSupplier>(xColProp,UNO_QUERY);
- xColumns = Reference<XIndexAccess>(xColumnSup->getColumns(),UNO_QUERY);
- if(!xColumns.is() || !xColumns->getCount())
- ::dbtools::throwFunctionSequenceException(_xConnection);
-
- const ::rtl::OUString sQuote = xMetaData->getIdentifierQuoteString();
- aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" PRIMARY KEY ")));
- aSql.append(generateColumnNames(xColumns,xMetaData));
- }
- else if(nKeyType == KeyType::UNIQUE)
- {
- xColumnSup = Reference<XColumnsSupplier>(xColProp,UNO_QUERY);
- xColumns = Reference<XIndexAccess>(xColumnSup->getColumns(),UNO_QUERY);
- if(!xColumns.is() || !xColumns->getCount())
- ::dbtools::throwFunctionSequenceException(_xConnection);
-
- const ::rtl::OUString sQuote = xMetaData->getIdentifierQuoteString();
- aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" UNIQUE ")));
- aSql.append(generateColumnNames(xColumns,xMetaData));
- }
- else if(nKeyType == KeyType::FOREIGN)
- {
- sal_Int32 nDeleteRule = getINT32(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DELETERULE)));
-
- xColumnSup = Reference<XColumnsSupplier>(xColProp,UNO_QUERY);
- xColumns = Reference<XIndexAccess>(xColumnSup->getColumns(),UNO_QUERY);
- if(!xColumns.is() || !xColumns->getCount())
- ::dbtools::throwFunctionSequenceException(_xConnection);
-
- aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FOREIGN KEY ")));
- ::rtl::OUString sRefTable = getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_REFERENCEDTABLE)));
- ::dbtools::qualifiedNameComponents(xMetaData,
- sRefTable,
- sCatalog,
- sSchema,
- sTable,
- ::dbtools::eInDataManipulation);
- sComposedName = ::dbtools::composeTableName( xMetaData, sCatalog, sSchema, sTable, sal_True, ::dbtools::eInTableDefinitions );
-
-
- if ( !sComposedName.getLength() )
- ::dbtools::throwFunctionSequenceException(_xConnection);
-
- aSql.append(generateColumnNames(xColumns,xMetaData));
-
- switch(nDeleteRule)
- {
- case KeyRule::CASCADE:
- aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON DELETE CASCADE ")));
- break;
- case KeyRule::RESTRICT:
- aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON DELETE RESTRICT ")));
- break;
- case KeyRule::SET_NULL:
- aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON DELETE SET NULL ")));
- break;
- case KeyRule::SET_DEFAULT:
- aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON DELETE SET DEFAULT ")));
- break;
- default:
- ;
- }
- }
- }
- }
- }
-
- if ( aSql.getLength() )
- {
- if ( aSql.charAt(aSql.getLength()-1) == ',' )
- aSql.setCharAt(aSql.getLength()-1,')');
- else
- aSql.appendAscii(")");
- }
-
- return aSql.makeStringAndClear();
-
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString createSqlCreateTableStatement( const Reference< XPropertySet >& descriptor,
- const Reference< XConnection>& _xConnection,
- ISQLStatementHelper* _pHelper,
- const ::rtl::OUString& _sCreatePattern)
-{
- ::rtl::OUString aSql = ::dbtools::createStandardCreateStatement(descriptor,_xConnection,_pHelper,_sCreatePattern);
- const ::rtl::OUString sKeyStmt = ::dbtools::createStandardKeyStatement(descriptor,_xConnection);
- if ( sKeyStmt.getLength() )
- aSql += sKeyStmt;
- else
- {
- if ( aSql.lastIndexOf(',') == (aSql.getLength()-1) )
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
- else
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
- }
- return aSql;
-}
-namespace
-{
- Reference<XPropertySet> lcl_createSDBCXColumn(const Reference<XNameAccess>& _xPrimaryKeyColumns,
- const Reference<XConnection>& _xConnection,
- const Any& _aCatalog,
- const ::rtl::OUString& _aSchema,
- const ::rtl::OUString& _aTable,
- const ::rtl::OUString& _rQueryName,
- const ::rtl::OUString& _rName,
- sal_Bool _bCase,
- sal_Bool _bQueryForInfo,
- sal_Bool _bIsAutoIncrement,
- sal_Bool _bIsCurrency,
- sal_Int32 _nDataType)
- {
- Reference<XPropertySet> xProp;
- Reference<XDatabaseMetaData> xMetaData = _xConnection->getMetaData();
- Reference< XResultSet > xResult = xMetaData->getColumns(_aCatalog, _aSchema, _aTable, _rQueryName);
-
- if ( xResult.is() )
- {
- UStringMixEqual aMixCompare(_bCase);
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while( xResult->next() )
- {
- if ( aMixCompare(xRow->getString(4),_rName) )
- {
- sal_Int32 nField5 = xRow->getInt(5);
- ::rtl::OUString aField6 = xRow->getString(6);
- sal_Int32 nField7 = xRow->getInt(7)
- , nField9 = xRow->getInt(9)
- , nField11= xRow->getInt(11);
- ::rtl::OUString sField12 = xRow->getString(12),
- sField13 = xRow->getString(13);
- ::comphelper::disposeComponent(xRow);
-
- sal_Bool bAutoIncrement = _bIsAutoIncrement
- ,bIsCurrency = _bIsCurrency;
- if ( _bQueryForInfo )
- {
- const ::rtl::OUString sQuote = xMetaData->getIdentifierQuoteString();
- ::rtl::OUString sQuotedName = ::dbtools::quoteName(sQuote,_rName);
- ::rtl::OUString sComposedName;
- sComposedName = composeTableNameForSelect(_xConnection, getString( _aCatalog ), _aSchema, _aTable );
-
- ColumnInformationMap aInfo(_bCase);
- collectColumnInformation(_xConnection,sComposedName,sQuotedName,aInfo);
- ColumnInformationMap::iterator aIter = aInfo.begin();
- if ( aIter != aInfo.end() )
- {
- bAutoIncrement = aIter->second.first.first;
- bIsCurrency = aIter->second.first.second;
- if ( DataType::OTHER == nField5 )
- nField5 = aIter->second.second;
- }
- }
- else if ( DataType::OTHER == nField5 )
- nField5 = _nDataType;
-
- if ( nField11 != ColumnValue::NO_NULLS )
- {
- try
- {
- if ( _xPrimaryKeyColumns.is() )
- {
- if ( _xPrimaryKeyColumns->hasByName(_rName) )
- nField11 = ColumnValue::NO_NULLS;
-
- }
- else
- {
- Reference< XResultSet > xPKeys = xMetaData->getPrimaryKeys( _aCatalog, _aSchema, _aTable );
- Reference< XRow > xPKeyRow( xPKeys, UNO_QUERY_THROW );
- while( xPKeys->next() ) // there can be only one primary key
- {
- ::rtl::OUString sKeyColumn = xPKeyRow->getString(4);
- if ( aMixCompare(_rName,sKeyColumn) )
- {
- nField11 = ColumnValue::NO_NULLS;
- break;
- }
- }
- }
- }
- catch(SQLException&)
- {
- OSL_FAIL( "lcl_createSDBCXColumn: caught an exception!" );
- }
- }
-
- connectivity::sdbcx::OColumn* pRet = new connectivity::sdbcx::OColumn(_rName,
- aField6,
- sField13,
- sField12,
- nField11,
- nField7,
- nField9,
- nField5,
- bAutoIncrement,
- sal_False,
- bIsCurrency,
- _bCase);
-
- xProp = pRet;
- break;
- }
- }
- }
-
- return xProp;
- }
- //------------------------------------------------------------------
- Reference< XModel> lcl_getXModel(const Reference< XInterface>& _xIface)
- {
- Reference< XInterface > xParent = _xIface;
- Reference< XModel > xModel(xParent,UNO_QUERY);;
- while( xParent.is() && !xModel.is() )
- {
- Reference<XChild> xChild(xParent,UNO_QUERY);
- xParent.set(xChild.is() ? xChild->getParent() : Reference< XInterface >(),UNO_QUERY);
- xModel.set(xParent,UNO_QUERY);
- }
- return xModel;
- }
-}
-// -----------------------------------------------------------------------------
-Reference<XPropertySet> createSDBCXColumn(const Reference<XPropertySet>& _xTable,
- const Reference<XConnection>& _xConnection,
- const ::rtl::OUString& _rName,
- sal_Bool _bCase,
- sal_Bool _bQueryForInfo,
- sal_Bool _bIsAutoIncrement,
- sal_Bool _bIsCurrency,
- sal_Int32 _nDataType)
-{
- Reference<XPropertySet> xProp;
- OSL_ENSURE(_xTable.is(),"Table is NULL!");
- if ( !_xTable.is() )
- return xProp;
-
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- Reference<XDatabaseMetaData> xMetaData = _xConnection->getMetaData();
- Any aCatalog;
- aCatalog = _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME));
-
- ::rtl::OUString aSchema, aTable;
- _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
- _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
-
- Reference<XNameAccess> xPrimaryKeyColumns = getPrimaryKeyColumns_throw(_xTable);
-
- xProp = lcl_createSDBCXColumn(xPrimaryKeyColumns,_xConnection,aCatalog, aSchema, aTable, _rName,_rName,_bCase,_bQueryForInfo,_bIsAutoIncrement,_bIsCurrency,_nDataType);
- if ( !xProp.is() )
- {
- xProp = lcl_createSDBCXColumn(xPrimaryKeyColumns,_xConnection,aCatalog, aSchema, aTable, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),_rName,_bCase,_bQueryForInfo,_bIsAutoIncrement,_bIsCurrency,_nDataType);
- if ( !xProp.is() )
- xProp = new connectivity::sdbcx::OColumn(_rName,
- ::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),
- ColumnValue::NULLABLE_UNKNOWN,
- 0,
- 0,
- DataType::VARCHAR,
- _bIsAutoIncrement,
- sal_False,
- _bIsCurrency,
- _bCase);
-
- }
-
- return xProp;
-}
-
-// -----------------------------------------------------------------------------
-bool getBooleanDataSourceSetting( const Reference< XConnection >& _rxConnection, const sal_Char* _pAsciiSettingName )
-{
- bool bValue( false );
- try
- {
- Reference< XPropertySet> xDataSourceProperties( findDataSource( _rxConnection ), UNO_QUERY );
- OSL_ENSURE( xDataSourceProperties.is(), "::dbtools::getBooleanDataSourceSetting: somebody is using this with a non-SDB-level connection!" );
- if ( xDataSourceProperties.is() )
- {
- Reference< XPropertySet > xSettings(
- xDataSourceProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Settings") ) ),
- UNO_QUERY_THROW
- );
- OSL_VERIFY( xSettings->getPropertyValue( ::rtl::OUString::createFromAscii( _pAsciiSettingName ) ) >>= bValue );
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return bValue;
-}
-// -------------------------------------------------------------------------
-bool getDataSourceSetting( const Reference< XInterface >& _xChild, const ::rtl::OUString& _sAsciiSettingsName,
- Any& /* [out] */ _rSettingsValue )
-{
- bool bIsPresent = false;
- try
- {
- const Reference< XPropertySet> xDataSourceProperties( findDataSource( _xChild ), UNO_QUERY );
- if ( !xDataSourceProperties.is() )
- return false;
-
- const Reference< XPropertySet > xSettings(
- xDataSourceProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Settings") ) ),
- UNO_QUERY_THROW
- );
-
- _rSettingsValue = xSettings->getPropertyValue( _sAsciiSettingsName );
- bIsPresent = true;
- }
- catch( const Exception& )
- {
- bIsPresent = false;
- }
- return bIsPresent;
-}
-// -------------------------------------------------------------------------
-bool getDataSourceSetting( const Reference< XInterface >& _rxDataSource, const sal_Char* _pAsciiSettingsName,
- Any& /* [out] */ _rSettingsValue )
-{
- ::rtl::OUString sAsciiSettingsName = ::rtl::OUString::createFromAscii(_pAsciiSettingsName);
- return getDataSourceSetting( _rxDataSource, sAsciiSettingsName,_rSettingsValue );
-}
-// -----------------------------------------------------------------------------
-sal_Bool isDataSourcePropertyEnabled(const Reference<XInterface>& _xProp,const ::rtl::OUString& _sProperty,sal_Bool _bDefault)
-{
- sal_Bool bEnabled = _bDefault;
- try
- {
- Reference< XPropertySet> xProp(findDataSource(_xProp),UNO_QUERY);
- if ( xProp.is() )
- {
- Sequence< PropertyValue > aInfo;
- xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Info"))) >>= aInfo;
- const PropertyValue* pValue =::std::find_if(aInfo.getConstArray(),
- aInfo.getConstArray() + aInfo.getLength(),
- ::std::bind2nd(TPropertyValueEqualFunctor(),_sProperty));
- if ( pValue && pValue != (aInfo.getConstArray() + aInfo.getLength()) )
- pValue->Value >>= bEnabled;
- }
- }
- catch(SQLException&)
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return bEnabled;
-}
-// -----------------------------------------------------------------------------
-Reference< XTablesSupplier> getDataDefinitionByURLAndConnection(
- const ::rtl::OUString& _rsUrl,
- const Reference< XConnection>& _xConnection,
- const Reference< XMultiServiceFactory>& _rxFactory)
-{
- Reference< XTablesSupplier> xTablesSup;
- try
- {
- Reference< XDriverAccess> xManager(
- _rxFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.DriverManager")) ),
- UNO_QUERY_THROW );
- Reference< XDataDefinitionSupplier > xSupp( xManager->getDriverByURL( _rsUrl ), UNO_QUERY );
-
- if ( xSupp.is() )
- {
- xTablesSup = xSupp->getDataDefinitionByConnection( _xConnection );
- OSL_ENSURE(xTablesSup.is(),"No table supplier!");
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return xTablesSup;
-}
-
-// -----------------------------------------------------------------------------
-sal_Int32 getTablePrivileges(const Reference< XDatabaseMetaData>& _xMetaData,
- const ::rtl::OUString& _sCatalog,
- const ::rtl::OUString& _sSchema,
- const ::rtl::OUString& _sTable)
-{
- OSL_ENSURE(_xMetaData.is(),"Invalid metadata!");
- sal_Int32 nPrivileges = 0;
- try
- {
- Any aVal;
- if(_sCatalog.getLength())
- aVal <<= _sCatalog;
- Reference< XResultSet > xPrivileges = _xMetaData->getTablePrivileges(aVal, _sSchema, _sTable);
- Reference< XRow > xCurrentRow(xPrivileges, UNO_QUERY);
-
- if ( xCurrentRow.is() )
- {
- ::rtl::OUString sUserWorkingFor = _xMetaData->getUserName();
- static const ::rtl::OUString sSELECT( RTL_CONSTASCII_USTRINGPARAM( "SELECT" ));
- static const ::rtl::OUString sINSERT( RTL_CONSTASCII_USTRINGPARAM( "INSERT" ));
- static const ::rtl::OUString sUPDATE( RTL_CONSTASCII_USTRINGPARAM( "UPDATE" ));
- static const ::rtl::OUString sDELETE( RTL_CONSTASCII_USTRINGPARAM( "DELETE" ));
- static const ::rtl::OUString sREAD( RTL_CONSTASCII_USTRINGPARAM( "READ" ));
- static const ::rtl::OUString sCREATE( RTL_CONSTASCII_USTRINGPARAM( "CREATE" ));
- static const ::rtl::OUString sALTER( RTL_CONSTASCII_USTRINGPARAM( "ALTER" ));
- static const ::rtl::OUString sREFERENCE( RTL_CONSTASCII_USTRINGPARAM( "REFERENCE" ));
- static const ::rtl::OUString sDROP( RTL_CONSTASCII_USTRINGPARAM( "DROP" ));
- // after creation the set is positioned before the first record, per definitionem
-#ifdef DBG_UTIL
- Reference< XResultSetMetaDataSupplier > xSup(xPrivileges,UNO_QUERY);
- if ( xSup.is() )
- {
- Reference< XResultSetMetaData > xRsMetaData = xSup->getMetaData();
- if ( xRsMetaData.is() )
- {
- sal_Int32 nCount = xRsMetaData->getColumnCount();
- for (sal_Int32 i=1; i<=nCount; ++i)
- {
- ::rtl::OUString sColumnName = xRsMetaData->getColumnName(i);
- }
- }
- }
-#endif
-
- ::rtl::OUString sPrivilege, sGrantee;
- while ( xPrivileges->next() )
- {
-#ifdef DBG_UTIL
- ::rtl::OUString sCat, sSchema, sName, sGrantor, sGrantable;
- sCat = xCurrentRow->getString(1);
- sSchema = xCurrentRow->getString(2);
- sName = xCurrentRow->getString(3);
- sGrantor = xCurrentRow->getString(4);
-#endif
- sGrantee = xCurrentRow->getString(5);
- sPrivilege = xCurrentRow->getString(6);
-#ifdef DBG_UTIL
- sGrantable = xCurrentRow->getString(7);
-#endif
-
- if (!sUserWorkingFor.equalsIgnoreAsciiCase(sGrantee))
- continue;
-
- if (sPrivilege.equalsIgnoreAsciiCase(sSELECT))
- nPrivileges |= Privilege::SELECT;
- else if (sPrivilege.equalsIgnoreAsciiCase(sINSERT))
- nPrivileges |= Privilege::INSERT;
- else if (sPrivilege.equalsIgnoreAsciiCase(sUPDATE))
- nPrivileges |= Privilege::UPDATE;
- else if (sPrivilege.equalsIgnoreAsciiCase(sDELETE))
- nPrivileges |= Privilege::DELETE;
- else if (sPrivilege.equalsIgnoreAsciiCase(sREAD))
- nPrivileges |= Privilege::READ;
- else if (sPrivilege.equalsIgnoreAsciiCase(sCREATE))
- nPrivileges |= Privilege::CREATE;
- else if (sPrivilege.equalsIgnoreAsciiCase(sALTER))
- nPrivileges |= Privilege::ALTER;
- else if (sPrivilege.equalsIgnoreAsciiCase(sREFERENCE))
- nPrivileges |= Privilege::REFERENCE;
- else if (sPrivilege.equalsIgnoreAsciiCase(sDROP))
- nPrivileges |= Privilege::DROP;
- }
- }
- disposeComponent(xPrivileges);
- }
- catch(const SQLException& e)
- {
- static ::rtl::OUString sNotSupportedState( RTL_CONSTASCII_USTRINGPARAM( "IM001" ));
- // some drivers don't support any privileges so we assume that we are allowed to do all we want :-)
- if(e.SQLState == sNotSupportedState)
- nPrivileges |= Privilege::DROP |
- Privilege::REFERENCE |
- Privilege::ALTER |
- Privilege::CREATE |
- Privilege::READ |
- Privilege::DELETE |
- Privilege::UPDATE |
- Privilege::INSERT |
- Privilege::SELECT;
- else
- OSL_FAIL("Could not collect the privileges !");
- }
- return nPrivileges;
-}
-// -----------------------------------------------------------------------------
-// we need some more information about the column
-void collectColumnInformation(const Reference< XConnection>& _xConnection,
- const ::rtl::OUString& _sComposedName,
- const ::rtl::OUString& _rName,
- ColumnInformationMap& _rInfo)
-{
- static ::rtl::OUString STR_WHERE = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" WHERE "));
-
- ::rtl::OUString sSelect = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT "));
- sSelect += _rName;
- sSelect += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FROM "));
- sSelect += _sComposedName;
- sSelect += STR_WHERE;
- sSelect += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0 = 1"));
-
- try
- {
- ::utl::SharedUNOComponent< XStatement > xStmt( _xConnection->createStatement() );
- Reference< XPropertySet > xStatementProps( xStmt, UNO_QUERY_THROW );
- xStatementProps->setPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_ESCAPEPROCESSING ), makeAny( (sal_Bool)sal_False ) );
- Reference< XResultSet > xResult( xStmt->executeQuery( sSelect ), UNO_QUERY_THROW );
- Reference< XResultSetMetaDataSupplier > xSuppMeta( xResult, UNO_QUERY_THROW );
- Reference< XResultSetMetaData > xMeta( xSuppMeta->getMetaData(), UNO_QUERY_THROW );
-
- sal_Int32 nCount = xMeta->getColumnCount();
- OSL_ENSURE( nCount != 0, "::dbtools::collectColumnInformation: result set has empty (column-less) meta data!" );
- for (sal_Int32 i=1; i <= nCount ; ++i)
- {
- _rInfo.insert(ColumnInformationMap::value_type(xMeta->getColumnName(i),
- ColumnInformation(TBoolPair(xMeta->isAutoIncrement(i),xMeta->isCurrency(i)),xMeta->getColumnType(i))));
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-}
-
-// -----------------------------------------------------------------------------
-bool isEmbeddedInDatabase( const Reference< XInterface >& _rxComponent, Reference< XConnection >& _rxActualConnection )
-{
- bool bIsEmbedded = false;
- try
- {
- Reference< XModel > xModel = lcl_getXModel( _rxComponent );
-
- if ( xModel.is() )
- {
- Sequence< PropertyValue > aArgs = xModel->getArgs();
- const PropertyValue* pIter = aArgs.getConstArray();
- const PropertyValue* pEnd = pIter + aArgs.getLength();
- for(;pIter != pEnd;++pIter)
- {
- if ( pIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ComponentData")) )
- {
- Sequence<PropertyValue> aDocumentContext;
- pIter->Value >>= aDocumentContext;
- const PropertyValue* pContextIter = aDocumentContext.getConstArray();
- const PropertyValue* pContextEnd = pContextIter + aDocumentContext.getLength();
- for(;pContextIter != pContextEnd;++pContextIter)
- {
- if ( pContextIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ActiveConnection" ) )
- && ( pContextIter->Value >>= _rxActualConnection )
- )
- {
- bIsEmbedded = true;
- break;
- }
- }
- break;
- }
- }
- }
- }
- catch(Exception&)
- {
- // not intereseted in
- }
- return bIsEmbedded;
-}
-// -----------------------------------------------------------------------------
-namespace
-{
- ::rtl::OUString lcl_getEncodingName( rtl_TextEncoding _eEncoding )
- {
- ::rtl::OUString sEncodingName;
-
- OCharsetMap aCharsets;
- OCharsetMap::CharsetIterator aEncodingPos = aCharsets.find( _eEncoding );
- OSL_ENSURE( aEncodingPos != aCharsets.end(), "lcl_getEncodingName: *which* encoding?" );
- if ( aEncodingPos != aCharsets.end() )
- sEncodingName = (*aEncodingPos).getIanaName();
-
- return sEncodingName;
- }
-}
-
-// -----------------------------------------------------------------------------
-sal_Int32 DBTypeConversion::convertUnicodeString( const ::rtl::OUString& _rSource, ::rtl::OString& _rDest, rtl_TextEncoding _eEncoding ) SAL_THROW((com::sun::star::sdbc::SQLException))
-{
- if ( !rtl_convertUStringToString( &_rDest.pData, _rSource.getStr(), _rSource.getLength(),
- _eEncoding,
- RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
- RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE |
- RTL_UNICODETOTEXT_FLAGS_PRIVATE_MAPTO0 |
- RTL_UNICODETOTEXT_FLAGS_NOCOMPOSITE )
- )
- {
- SharedResources aResources;
- ::rtl::OUString sMessage = aResources.getResourceStringWithSubstitution( STR_CANNOT_CONVERT_STRING,
- "$string$", _rSource,
- "$charset$", lcl_getEncodingName( _eEncoding )
- );
-
- throw SQLException(
- sMessage,
- NULL,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "22018" ) ),
- 22018,
- Any()
- );
- }
-
- return _rDest.getLength();
-}
-
-// -----------------------------------------------------------------------------
-sal_Int32 DBTypeConversion::convertUnicodeStringToLength( const ::rtl::OUString& _rSource, ::rtl::OString& _rDest,
- sal_Int32 _nMaxLen, rtl_TextEncoding _eEncoding ) SAL_THROW((SQLException))
-{
- sal_Int32 nLen = convertUnicodeString( _rSource, _rDest, _eEncoding );
- if ( nLen > _nMaxLen )
- {
- SharedResources aResources;
- ::rtl::OUString sMessage = aResources.getResourceStringWithSubstitution( STR_STRING_LENGTH_EXCEEDED,
- "$string$", _rSource,
- "$maxlen$", ::rtl::OUString::valueOf( _nMaxLen ),
- "$charset$", lcl_getEncodingName( _eEncoding )
- );
-
- throw SQLException(
- sMessage,
- NULL,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "22001" ) ),
- 22001,
- Any()
- );
- }
-
- return nLen;
-}
-::rtl::OUString lcl_getReportEngines()
-{
- static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess/ReportEngines"));
- return s_sNodeName;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString lcl_getDefaultReportEngine()
-{
- static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("DefaultReportEngine"));
- return s_sNodeName;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString lcl_getReportEngineNames()
-{
- static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("ReportEngineNames"));
- return s_sNodeName;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString getDefaultReportEngineServiceName(const Reference< XMultiServiceFactory >& _rxORB)
-{
- ::utl::OConfigurationTreeRoot aReportEngines = ::utl::OConfigurationTreeRoot::createWithServiceFactory(
- _rxORB, lcl_getReportEngines(), -1, ::utl::OConfigurationTreeRoot::CM_READONLY);
-
- if ( aReportEngines.isValid() )
- {
- ::rtl::OUString sDefaultReportEngineName;
- aReportEngines.getNodeValue(lcl_getDefaultReportEngine()) >>= sDefaultReportEngineName;
- if ( sDefaultReportEngineName.getLength() )
- {
- ::utl::OConfigurationNode aReportEngineNames = aReportEngines.openNode(lcl_getReportEngineNames());
- if ( aReportEngineNames.isValid() )
- {
- ::utl::OConfigurationNode aReportEngine = aReportEngineNames.openNode(sDefaultReportEngineName);
- if ( aReportEngine.isValid() )
- {
- ::rtl::OUString sRet;
- const static ::rtl::OUString s_sService(RTL_CONSTASCII_USTRINGPARAM("ServiceName"));
- aReportEngine.getNodeValue(s_sService) >>= sRet;
- return sRet;
- }
- }
- }
- else
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOReportJobFactory"));
- }
- else
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOReportJobFactory"));
- return ::rtl::OUString();
-}
-// -----------------------------------------------------------------------------
-//.........................................................................
-} // namespace dbtools
-//.........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/filtermanager.cxx b/connectivity/source/commontools/filtermanager.cxx
deleted file mode 100644
index e3b71a19bb..0000000000
--- a/connectivity/source/commontools/filtermanager.cxx
+++ /dev/null
@@ -1,189 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/filtermanager.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp>
-/** === end UNO includes === **/
-#include "TConnection.hxx"
-#include <osl/diagnose.h>
-#include "connectivity/dbtools.hxx"
-#include <tools/diagnose_ex.h>
-#include <rtl/ustrbuf.hxx>
-
-//........................................................................
-namespace dbtools
-{
-//........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::sdb;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::beans;
- using namespace connectivity;
-
- //====================================================================
- //= FilterManager
- //====================================================================
- //--------------------------------------------------------------------
- FilterManager::FilterManager( const Reference< XMultiServiceFactory >& _rxORB )
- :m_xORB( _rxORB )
- ,m_aFilterComponents( FC_COMPONENT_COUNT )
- ,m_bApplyPublicFilter( true )
- {
- }
-
- //--------------------------------------------------------------------
- void FilterManager::initialize( const Reference< XPropertySet >& _rxComponentAggregate )
- {
- m_xComponentAggregate = _rxComponentAggregate;
- OSL_ENSURE( m_xComponentAggregate.is(), "FilterManager::initialize: invalid arguments!" );
-
- if ( m_xComponentAggregate.is() )
- m_xComponentAggregate->setPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_APPLYFILTER), makeAny( (sal_Bool)sal_True ) );
- }
-
- //--------------------------------------------------------------------
- void FilterManager::dispose( )
- {
- m_xComponentAggregate.clear();
- }
-
- //--------------------------------------------------------------------
- const ::rtl::OUString& FilterManager::getFilterComponent( FilterComponent _eWhich ) const
- {
- return m_aFilterComponents[ _eWhich ];
- }
-
- //--------------------------------------------------------------------
- void FilterManager::setFilterComponent( FilterComponent _eWhich, const ::rtl::OUString& _rComponent )
- {
- m_aFilterComponents[ _eWhich ] = _rComponent;
- try
- {
- if ( m_xComponentAggregate.is() && (( _eWhich != fcPublicFilter ) || m_bApplyPublicFilter ) )
- m_xComponentAggregate->setPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FILTER), makeAny( getComposedFilter() ) );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
-
- //--------------------------------------------------------------------
- void FilterManager::setApplyPublicFilter( sal_Bool _bApply )
- {
- if ( m_bApplyPublicFilter == _bApply )
- return;
-
- m_bApplyPublicFilter = _bApply;
-
- try
- {
- if ( m_xComponentAggregate.is() && getFilterComponent( fcPublicFilter ).getLength() )
- { // only if there changed something
- m_xComponentAggregate->setPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FILTER), makeAny( getComposedFilter() ) );
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
-
- //--------------------------------------------------------------------
- void FilterManager::appendFilterComponent( ::rtl::OUStringBuffer& io_appendTo, const ::rtl::OUString& i_component ) const
- {
- if ( io_appendTo.getLength() > 0 )
- {
- io_appendTo.insert( 0, sal_Unicode( '(' ) );
- io_appendTo.insert( 1, sal_Unicode( ' ' ) );
- io_appendTo.appendAscii( " ) AND " );
- }
-
- io_appendTo.appendAscii( "( " );
- io_appendTo.append( i_component );
- io_appendTo.appendAscii( " )" );
- }
-
- //--------------------------------------------------------------------
- bool FilterManager::isThereAtMostOneComponent( ::rtl::OUStringBuffer& o_singleComponent ) const
- {
- sal_Int32 nOnlyNonEmpty = -1;
- sal_Int32 i;
- for ( i = getFirstApplicableFilterIndex(); i < FC_COMPONENT_COUNT; ++i )
- {
- if ( m_aFilterComponents[ i ].getLength() )
- {
- if ( nOnlyNonEmpty != -1 )
- // it's the second non-empty component
- break;
- else
- nOnlyNonEmpty = i;
- }
- }
- if ( nOnlyNonEmpty == -1 )
- {
- o_singleComponent.makeStringAndClear();
- return true;
- }
-
- if ( i == FC_COMPONENT_COUNT )
- {
- // we found only one non-empty filter component
- o_singleComponent = m_aFilterComponents[ nOnlyNonEmpty ];
- return true;
- }
- return false;
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString FilterManager::getComposedFilter( ) const
- {
- ::rtl::OUStringBuffer aComposedFilter;
-
- // if we have only one non-empty component, then there's no need to compose anything
- if ( !isThereAtMostOneComponent( aComposedFilter ) )
- {
- // append the single components
- for ( sal_Int32 i = getFirstApplicableFilterIndex(); i < FC_COMPONENT_COUNT; ++i )
- appendFilterComponent( aComposedFilter, m_aFilterComponents[ i ] );
- }
-
- return aComposedFilter.makeStringAndClear();
- }
-
-//........................................................................
-} // namespace dbtools
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx
deleted file mode 100644
index 141a59b6bf..0000000000
--- a/connectivity/source/commontools/formattedcolumnvalue.cxx
+++ /dev/null
@@ -1,347 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "connectivity/formattedcolumnvalue.hxx"
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbconversion.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/util/XNumberFormatter.hpp>
-#include <com/sun/star/util/Date.hpp>
-#include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/util/XNumberFormatTypes.hpp>
-#include <com/sun/star/util/NumberFormat.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-/** === end UNO includes === **/
-
-#include <tools/diagnose_ex.h>
-#include <i18npool/mslangid.hxx>
-#include <comphelper/numbers.hxx>
-#include <comphelper/componentcontext.hxx>
-#include <unotools/sharedunocomponent.hxx>
-
-//........................................................................
-namespace dbtools
-{
-//........................................................................
-
- /** === begin UNO using === **/
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::UNO_QUERY;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
- using ::com::sun::star::uno::UNO_SET_THROW;
- using ::com::sun::star::uno::Exception;
- using ::com::sun::star::uno::RuntimeException;
- using ::com::sun::star::uno::Any;
- using ::com::sun::star::uno::makeAny;
- using ::com::sun::star::sdbc::XRowSet;
- using ::com::sun::star::beans::XPropertySet;
- using ::com::sun::star::util::XNumberFormatter;
- using ::com::sun::star::util::Date;
- using ::com::sun::star::sdbc::XConnection;
- using ::com::sun::star::util::XNumberFormatsSupplier;
- using ::com::sun::star::beans::XPropertySetInfo;
- using ::com::sun::star::lang::Locale;
- using ::com::sun::star::util::XNumberFormatTypes;
- using ::com::sun::star::sdb::XColumn;
- using ::com::sun::star::sdb::XColumnUpdate;
- using ::com::sun::star::lang::XComponent;
- /** === end UNO using === **/
- namespace DataType = ::com::sun::star::sdbc::DataType;
- namespace NumberFormat = ::com::sun::star::util::NumberFormat;
-
- //====================================================================
- //= FormattedColumnValue_Data
- //====================================================================
- struct FormattedColumnValue_Data
- {
- Reference< XNumberFormatter > m_xFormatter;
- Date m_aNullDate;
- sal_Int32 m_nFormatKey;
- sal_Int32 m_nFieldType;
- sal_Int16 m_nKeyType;
- bool m_bNumericField;
-
- Reference< XColumn > m_xColumn;
- Reference< XColumnUpdate > m_xColumnUpdate;
-
- FormattedColumnValue_Data()
- :m_xFormatter()
- ,m_aNullDate( DBTypeConversion::getStandardDate() )
- ,m_nFormatKey( 0 )
- ,m_nFieldType( DataType::OTHER )
- ,m_nKeyType( NumberFormat::UNDEFINED )
- ,m_bNumericField( false )
- ,m_xColumn()
- ,m_xColumnUpdate()
- {
- }
- };
-
- //--------------------------------------------------------------------
- namespace
- {
- //................................................................
- void lcl_clear_nothrow( FormattedColumnValue_Data& _rData )
- {
- _rData.m_xFormatter.clear();
- _rData.m_nFormatKey = 0;
- _rData.m_nFieldType = DataType::OTHER;
- _rData.m_nKeyType = NumberFormat::UNDEFINED;
- _rData.m_bNumericField = false;
-
- _rData.m_xColumn.clear();
- _rData.m_xColumnUpdate.clear();
- }
-
- //................................................................
- void lcl_initColumnDataValue_nothrow( FormattedColumnValue_Data& _rData,
- const Reference< XNumberFormatter >& i_rNumberFormatter, const Reference< XPropertySet >& _rxColumn )
- {
- lcl_clear_nothrow( _rData );
-
- OSL_PRECOND( i_rNumberFormatter.is(), "lcl_initColumnDataValue_nothrow: no number formats -> no formatted values!" );
- if ( !i_rNumberFormatter.is() )
- return;
-
- try
- {
- Reference< XNumberFormatsSupplier > xNumberFormatsSupp( i_rNumberFormatter->getNumberFormatsSupplier(), UNO_SET_THROW );
-
- // remember the column
- _rData.m_xColumn.set( _rxColumn, UNO_QUERY_THROW );
- _rData.m_xColumnUpdate.set( _rxColumn, UNO_QUERY );
-
- // determine the field type, and whether it's a numeric field
- OSL_VERIFY( _rxColumn->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ) ) ) >>= _rData.m_nFieldType );
-
- switch ( _rData.m_nFieldType )
- {
- case DataType::DATE:
- case DataType::TIME:
- case DataType::TIMESTAMP:
- case DataType::BIT:
- case DataType::BOOLEAN:
- case DataType::TINYINT:
- case DataType::SMALLINT:
- case DataType::INTEGER:
- case DataType::REAL:
- case DataType::BIGINT:
- case DataType::DOUBLE:
- case DataType::NUMERIC:
- case DataType::DECIMAL:
- _rData.m_bNumericField = true;
- break;
- default:
- _rData.m_bNumericField = false;
- break;
- }
-
- // get the format key of our bound field
- Reference< XPropertySetInfo > xPSI( _rxColumn->getPropertySetInfo(), UNO_QUERY_THROW );
- bool bHaveFieldFormat = false;
- const ::rtl::OUString sFormatKeyProperty( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormatKey" ) ) );
- if ( xPSI->hasPropertyByName( sFormatKeyProperty ) )
- {
- bHaveFieldFormat = ( _rxColumn->getPropertyValue( sFormatKeyProperty ) >>= _rData.m_nFormatKey );
- }
- if ( !bHaveFieldFormat )
- {
- // fall back to a format key as indicated by the field type
- Locale aSystemLocale;
- MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage(), aSystemLocale );
- Reference< XNumberFormatTypes > xNumTypes( xNumberFormatsSupp->getNumberFormats(), UNO_QUERY_THROW );
- _rData.m_nFormatKey = getDefaultNumberFormat( _rxColumn, xNumTypes, aSystemLocale );
- }
-
- // some more formatter settings
- _rData.m_nKeyType = ::comphelper::getNumberFormatType( xNumberFormatsSupp->getNumberFormats(), _rData.m_nFormatKey );
- Reference< XPropertySet > xFormatSettings( xNumberFormatsSupp->getNumberFormatSettings(), UNO_QUERY_THROW );
- OSL_VERIFY( xFormatSettings->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "NullDate" )) ) >>= _rData.m_aNullDate );
-
- // remember the formatter
- _rData.m_xFormatter = i_rNumberFormatter;
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
-
- //................................................................
- void lcl_initColumnDataValue_nothrow( const ::comphelper::ComponentContext& i_rContext, FormattedColumnValue_Data& i_rData,
- const Reference< XRowSet >& i_rRowSet, const Reference< XPropertySet >& i_rColumn )
- {
- OSL_PRECOND( i_rRowSet.is(), "lcl_initColumnDataValue_nothrow: no row set!" );
- if ( !i_rRowSet.is() )
- return;
-
- Reference< XNumberFormatter > xNumberFormatter;
- try
- {
- // get the number formats supplier of the connection of the form
- Reference< XConnection > xConnection( getConnection( i_rRowSet ), UNO_QUERY_THROW );
- Reference< XNumberFormatsSupplier > xSupplier( getNumberFormats( xConnection, sal_True, i_rContext.getLegacyServiceFactory() ), UNO_SET_THROW );
-
- // create a number formatter for it
- xNumberFormatter.set( i_rContext.createComponent( "com.sun.star.util.NumberFormatter" ), UNO_QUERY_THROW );
- xNumberFormatter->attachNumberFormatsSupplier( xSupplier );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- lcl_initColumnDataValue_nothrow( i_rData, xNumberFormatter, i_rColumn );
- }
- }
-
- //====================================================================
- //= FormattedColumnValue
- //====================================================================
- //--------------------------------------------------------------------
- FormattedColumnValue::FormattedColumnValue( const ::comphelper::ComponentContext& i_rContext,
- const Reference< XRowSet >& _rxRowSet, const Reference< XPropertySet >& i_rColumn )
- :m_pData( new FormattedColumnValue_Data )
- {
- lcl_initColumnDataValue_nothrow( i_rContext, *m_pData, _rxRowSet, i_rColumn );
- }
-
- //--------------------------------------------------------------------
- FormattedColumnValue::FormattedColumnValue( const Reference< XNumberFormatter >& i_rNumberFormatter,
- const Reference< XPropertySet >& _rxColumn )
- :m_pData( new FormattedColumnValue_Data )
- {
- lcl_initColumnDataValue_nothrow( *m_pData, i_rNumberFormatter, _rxColumn );
- }
-
- //--------------------------------------------------------------------
- void FormattedColumnValue::clear()
- {
- lcl_clear_nothrow( *m_pData );
- }
-
- //--------------------------------------------------------------------
- FormattedColumnValue::~FormattedColumnValue()
- {
- clear();
- }
-
- //--------------------------------------------------------------------
- sal_Int32 FormattedColumnValue::getFormatKey() const
- {
- return m_pData->m_nFormatKey;
- }
-
- //--------------------------------------------------------------------
- sal_Int32 FormattedColumnValue::getFieldType() const
- {
- return m_pData->m_nFieldType;
- }
-
- //--------------------------------------------------------------------
- sal_Int16 FormattedColumnValue::getKeyType() const
- {
- return m_pData->m_nKeyType;
- }
-
- //--------------------------------------------------------------------
- bool FormattedColumnValue::isNumericField() const
- {
- return m_pData->m_bNumericField;
- }
-
- //--------------------------------------------------------------------
- const Reference< XColumn >& FormattedColumnValue::getColumn() const
- {
- return m_pData->m_xColumn;
- }
-
- //--------------------------------------------------------------------
- const Reference< XColumnUpdate >& FormattedColumnValue::getColumnUpdate() const
- {
- return m_pData->m_xColumnUpdate;
- }
-
- //--------------------------------------------------------------------
- bool FormattedColumnValue::setFormattedValue( const ::rtl::OUString& _rFormattedStringValue ) const
- {
- OSL_PRECOND( m_pData->m_xColumnUpdate.is(), "FormattedColumnValue::setFormattedValue: no column!" );
- if ( !m_pData->m_xColumnUpdate.is() )
- return false;
-
- try
- {
- if ( m_pData->m_bNumericField )
- {
- ::dbtools::DBTypeConversion::setValue( m_pData->m_xColumnUpdate, m_pData->m_xFormatter, m_pData->m_aNullDate,
- _rFormattedStringValue, m_pData->m_nFormatKey, ::sal::static_int_cast< sal_Int16 >( m_pData->m_nFieldType ),
- m_pData->m_nKeyType );
- }
- else
- {
- m_pData->m_xColumnUpdate->updateString( _rFormattedStringValue );
- }
- }
- catch( const Exception& )
- {
- return false;
- }
- return true;
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString FormattedColumnValue::getFormattedValue() const
- {
- OSL_PRECOND( m_pData->m_xColumn.is(), "FormattedColumnValue::setFormattedValue: no column!" );
-
- ::rtl::OUString sStringValue;
- if ( m_pData->m_xColumn.is() )
- {
- if ( m_pData->m_bNumericField )
- {
- sStringValue = DBTypeConversion::getFormattedValue(
- m_pData->m_xColumn, m_pData->m_xFormatter, m_pData->m_aNullDate, m_pData->m_nFormatKey, m_pData->m_nKeyType
- );
- }
- else
- {
- sStringValue = m_pData->m_xColumn->getString();
- }
- }
- return sStringValue;
- }
-
-//........................................................................
-} // namespace dbtools
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/makefile.mk b/connectivity/source/commontools/makefile.mk
deleted file mode 100755
index 24125388dd..0000000000
--- a/connectivity/source/commontools/makefile.mk
+++ /dev/null
@@ -1,103 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=connectivity
-TARGET=commontools
-
-# --- Settings -----------------------------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/dbtools.pmk
-
-# Disable optimization for SunCC SPARC and MACOSX (funny loops
-# when parsing e.g. "x+width/2"),
-# also http://gcc.gnu.org/PR22392
-.IF ("$(OS)$(CPU)"=="SOLARISS" && "$(COM)"!="GCC") || "$(OS)"=="MACOSX" || ("$(OS)"=="LINUX" && "$(CPU)"=="P")
-NOOPTFILES= $(SLO)$/RowFunctionParser.obj
-.ENDIF
-
-ENVCFLAGS += -DBOOST_SPIRIT_USE_OLD_NAMESPACE
-
-# --- Files --------------------------------------------------------
-EXCEPTIONSFILES=\
- $(SLO)$/predicateinput.obj \
- $(SLO)$/ConnectionWrapper.obj \
- $(SLO)$/TConnection.obj \
- $(SLO)$/conncleanup.obj \
- $(SLO)$/dbtools.obj \
- $(SLO)$/dbtools2.obj \
- $(SLO)$/dbexception.obj \
- $(SLO)$/CommonTools.obj \
- $(SLO)$/TColumnsHelper.obj \
- $(SLO)$/TTableHelper.obj \
- $(SLO)$/TKeys.obj \
- $(SLO)$/TKey.obj \
- $(SLO)$/TKeyColumns.obj \
- $(SLO)$/TIndexes.obj \
- $(SLO)$/TIndex.obj \
- $(SLO)$/TIndexColumns.obj \
- $(SLO)$/DateConversion.obj \
- $(SLO)$/FDatabaseMetaDataResultSetMetaData.obj \
- $(SLO)$/FDatabaseMetaDataResultSet.obj \
- $(SLO)$/TDatabaseMetaDataBase.obj \
- $(SLO)$/TPrivilegesResultSet.obj \
- $(SLO)$/TSkipDeletedSet.obj \
- $(SLO)$/dbmetadata.obj \
- $(SLO)$/TSortIndex.obj \
- $(SLO)$/dbcharset.obj \
- $(SLO)$/propertyids.obj \
- $(SLO)$/FValue.obj \
- $(SLO)$/paramwrapper.obj \
- $(SLO)$/statementcomposer.obj \
- $(SLO)$/RowFunctionParser.obj \
- $(SLO)$/sqlerror.obj \
- $(SLO)$/filtermanager.obj \
- $(SLO)$/parameters.obj \
- $(SLO)$/ParamterSubstitution.obj \
- $(SLO)$/DriversConfig.obj \
- $(SLO)$/formattedcolumnvalue.obj \
- $(SLO)$/BlobHelper.obj \
- $(SLO)$/warningscontainer.obj \
- $(SLO)$/dbconversion.obj
-
-SLOFILES=\
- $(EXCEPTIONSFILES) \
- $(SLO)$/AutoRetrievingBase.obj \
-
-
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-
diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx
deleted file mode 100644
index b94596f3b4..0000000000
--- a/connectivity/source/commontools/parameters.cxx
+++ /dev/null
@@ -1,1123 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/parameters.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/form/DatabaseParameterEvent.hpp>
-#include <com/sun/star/sdbc/XParameters.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/container/XEnumerationAccess.hpp>
-#include <com/sun/star/sdb/XParametersSupplier.hpp>
-#include <com/sun/star/sdb/XInteractionSupplyParameters.hpp>
-#include <com/sun/star/sdb/ParametersRequest.hpp>
-/** === end UNO includes === **/
-
-#include <connectivity/dbtools.hxx>
-#include "connectivity/filtermanager.hxx"
-#include "TConnection.hxx"
-
-#include <tools/debug.hxx>
-#include <tools/diagnose_ex.h>
-
-#include <comphelper/uno3.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include <comphelper/broadcasthelper.hxx>
-#include "connectivity/ParameterCont.hxx"
-#include <rtl/ustrbuf.hxx>
-
-//........................................................................
-namespace dbtools
-{
-//........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::sdb;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::sdbcx;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::task;
- using namespace ::com::sun::star::form;
- using namespace ::com::sun::star::container;
-
- using namespace ::comphelper;
- using namespace ::connectivity;
-
- //====================================================================
- //= ParameterManager
- //====================================================================
- //--------------------------------------------------------------------
- ParameterManager::ParameterManager( ::osl::Mutex& _rMutex, const Reference< XMultiServiceFactory >& _rxORB )
- :m_rMutex ( _rMutex )
- ,m_aParameterListeners( _rMutex )
- ,m_xORB ( _rxORB )
- ,m_pOuterParameters ( NULL )
- ,m_nInnerCount ( 0 )
- ,m_bUpToDate ( false )
- {
- OSL_ENSURE( m_xORB.is(), "ParameterManager::ParameterManager: no service factory!" );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::initialize( const Reference< XPropertySet >& _rxComponent, const Reference< XAggregation >& _rxComponentAggregate )
- {
- OSL_ENSURE( !m_xComponent.get().is(), "ParameterManager::initialize: already initialized!" );
-
- m_xComponent = _rxComponent;
- m_xAggregatedRowSet = _rxComponentAggregate;
- if ( m_xAggregatedRowSet.is() )
- m_xAggregatedRowSet->queryAggregation( ::getCppuType( &m_xInnerParamUpdate ) ) >>= m_xInnerParamUpdate;
- OSL_ENSURE( m_xComponent.get().is() && m_xInnerParamUpdate.is(), "ParameterManager::initialize: invalid arguments!" );
- if ( !m_xComponent.get().is() || !m_xInnerParamUpdate.is() )
- return;
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::dispose( )
- {
- clearAllParameterInformation();
-
- m_xComposer.clear();
- m_xParentComposer.clear();
- //m_xComponent.clear();
- m_xInnerParamUpdate.clear();
- m_xAggregatedRowSet.clear();
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::clearAllParameterInformation()
- {
- m_xInnerParamColumns.clear();
- if ( m_pOuterParameters.is() )
- m_pOuterParameters->dispose();
- m_pOuterParameters = NULL;
- m_nInnerCount = 0;
- ParameterInformation aEmptyInfo;
- m_aParameterInformation.swap( aEmptyInfo );
- m_aMasterFields.realloc( 0 );
- m_aDetailFields.realloc( 0 );
- m_sIdentifierQuoteString = ::rtl::OUString();
- ::std::vector< bool > aEmptyArray;
- m_aParametersVisited.swap( aEmptyArray );
- m_bUpToDate = false;
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::disposing( const EventObject& /*_rDisposingEvent*/ )
- {
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setAllParametersNull() SAL_THROW( ( SQLException, RuntimeException ) )
- {
- OSL_PRECOND( isAlive(), "ParameterManager::setAllParametersNull: not initialized, or already disposed!" );
- if ( !isAlive() )
- return;
-
- for ( sal_Int32 i = 1; i <= m_nInnerCount; ++i )
- m_xInnerParamUpdate->setNull( i, DataType::VARCHAR );
- }
-
- //--------------------------------------------------------------------
- bool ParameterManager::initializeComposerByComponent( const Reference< XPropertySet >& _rxComponent )
- {
- OSL_PRECOND( _rxComponent.is(), "ParameterManager::initializeComposerByComponent: invalid !" );
-
- m_xComposer.clear();
- m_xInnerParamColumns.clear();
- m_nInnerCount = 0;
-
- // create and fill a composer
- try
- {
- // get a query composer for the 's settings
- m_xComposer.reset( getCurrentSettingsComposer( _rxComponent, m_xORB ), SharedQueryComposer::TakeOwnership );
-
- // see if the composer found parameters
- Reference< XParametersSupplier > xParamSupp( m_xComposer, UNO_QUERY );
- if ( xParamSupp.is() )
- m_xInnerParamColumns = xParamSupp->getParameters();
-
- if ( m_xInnerParamColumns.is() )
- m_nInnerCount = m_xInnerParamColumns->getCount();
- }
- catch( const SQLException& )
- {
- }
-
- return m_xInnerParamColumns.is();
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::collectInnerParameters( bool _bSecondRun )
- {
- OSL_PRECOND( m_xInnerParamColumns.is(), "ParameterManager::collectInnerParameters: missing some internal data!" );
- if ( !m_xInnerParamColumns.is() )
- return;
-
- // strip previous index informations
- if ( _bSecondRun )
- {
- for ( ParameterInformation::iterator aParamInfo = m_aParameterInformation.begin();
- aParamInfo != m_aParameterInformation.end();
- ++aParamInfo
- )
- {
- aParamInfo->second.aInnerIndexes.clear();
- }
- }
-
- // we need to map the parameter names (which is all we get from the 's
- // MasterFields property) to indicies, which are needed by the XParameters
- // interface of the row set)
- Reference<XPropertySet> xParam;
- for ( sal_Int32 i = 0; i < m_nInnerCount; ++i )
- {
- try
- {
- xParam.clear();
- m_xInnerParamColumns->getByIndex( i ) >>= xParam;
-
- ::rtl::OUString sName;
- xParam->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME) ) >>= sName;
-
- // only append additonal paramters when they are not already in the list
- ParameterInformation::iterator aExistentPos = m_aParameterInformation.find( sName );
- OSL_ENSURE( !_bSecondRun || ( aExistentPos != m_aParameterInformation.end() ),
- "ParameterManager::collectInnerParameters: the parameter information should already exist in the second run!" );
-
- if ( aExistentPos == m_aParameterInformation.end() )
- {
- aExistentPos = m_aParameterInformation.insert( ParameterInformation::value_type(
- sName, xParam ) ).first;
- }
- else
- aExistentPos->second.xComposerColumn = xParam;
-
- aExistentPos->second.aInnerIndexes.push_back( i );
- }
- catch( const Exception& )
- {
- OSL_FAIL( "ParameterManager::collectInnerParameters: caught an exception!" );
- }
- }
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString ParameterManager::createFilterConditionFromColumnLink(
- const ::rtl::OUString& _rMasterColumn, const ::rtl::OUString& _rDetailLink, ::rtl::OUString& _rNewParamName )
- {
- ::rtl::OUString sFilter;
-
- // format is:
- // <detail_column> = :<new_param_name>
- sFilter = quoteName( m_sIdentifierQuoteString, _rDetailLink );
- sFilter += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( " = :" ));
-
- // generate a parameter name which is not already used
- _rNewParamName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "link_from_" ) );
- _rNewParamName += convertName2SQLName( _rMasterColumn, m_sSpecialCharacters );
- while ( m_aParameterInformation.find( _rNewParamName ) != m_aParameterInformation.end() )
- {
- _rNewParamName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_" ) );
- }
-
- return sFilter += _rNewParamName;
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::classifyLinks( const Reference< XNameAccess >& _rxParentColumns,
- const Reference< XNameAccess >& _rxColumns, ::std::vector< ::rtl::OUString >& _out_rAdditionalFilterComponents ) SAL_THROW(( Exception ))
- {
- OSL_PRECOND( m_aMasterFields.getLength() == m_aDetailFields.getLength(),
- "ParameterManager::classifyLinks: master and detail fields should have the same length!" );
- OSL_ENSURE( _rxColumns.is(), "ParameterManager::classifyLinks: invalid columns!" );
-
- if ( !_rxColumns.is() )
- return;
-
- // we may need to strip any links which are invalid, so here go the containers
- // for temporarirly holding the new pairs
- ::std::vector< ::rtl::OUString > aStrippedMasterFields;
- ::std::vector< ::rtl::OUString > aStrippedDetailFields;
-
- bool bNeedExchangeLinks = false;
-
- // classify the links
- const ::rtl::OUString* pMasterFields = m_aMasterFields.getConstArray();
- const ::rtl::OUString* pDetailFields = m_aDetailFields.getConstArray();
- const ::rtl::OUString* pDetailFieldsEnd = pDetailFields + m_aDetailFields.getLength();
- for ( ; pDetailFields < pDetailFieldsEnd; ++pDetailFields, ++pMasterFields )
- {
- if ( !pMasterFields->getLength() || !pDetailFields->getLength() )
- continue;
-
- // if not even the master part of the relationship exists in the parent , the
- // link is invalid as a whole
- // #i63674# / 2006-03-28 / frank.schoenheit@sun.com
- if ( !_rxParentColumns->hasByName( *pMasterFields ) )
- {
- bNeedExchangeLinks = true;
- continue;
- }
-
- bool bValidLink = true;
-
- // is there an inner parameter with this name? That is, a parameter which is already part of
- // the very original statement (not the one we create ourselve, with the additional parameters)
- ParameterInformation::iterator aPos = m_aParameterInformation.find( *pDetailFields );
- if ( aPos != m_aParameterInformation.end() )
- { // there is an inner parameter with this name
- aPos->second.eType = eLinkedByParamName;
- aStrippedDetailFields.push_back( *pDetailFields );
- }
- else
- {
- // does the detail name denote a column?
- if ( _rxColumns->hasByName( *pDetailFields ) )
- {
- ::rtl::OUString sNewParamName;
- const ::rtl::OUString sFilterCondition = createFilterConditionFromColumnLink( *pMasterFields, *pDetailFields, sNewParamName );
- OSL_PRECOND( sNewParamName.getLength(), "ParameterManager::classifyLinks: createFilterConditionFromColumnLink returned nonsense!" );
-
- // remember meta information about this new parameter
- ::std::pair< ParameterInformation::iterator, bool > aInsertionPos =
- m_aParameterInformation.insert(
- ParameterInformation::value_type( sNewParamName, ParameterMetaData( NULL ) )
- );
- OSL_ENSURE( aInsertionPos.second, "ParameterManager::classifyLinks: there already was a parameter with this name!" );
- aInsertionPos.first->second.eType = eLinkedByColumnName;
-
- // remember the filter component
- _out_rAdditionalFilterComponents.push_back( sFilterCondition );
-
- // remember the new "detail field" for this link
- aStrippedDetailFields.push_back( sNewParamName );
- bNeedExchangeLinks = true;
- }
- else
- {
- // the detail field neither denotes a column name, nor a parameter name
- bValidLink = false;
- bNeedExchangeLinks = true;
- }
- }
-
- if ( bValidLink )
- aStrippedMasterFields.push_back( *pMasterFields );
- }
- OSL_POSTCOND( aStrippedMasterFields.size() == aStrippedDetailFields.size(),
- "ParameterManager::classifyLinks: inconsistency in new link pairs!" );
-
- if ( bNeedExchangeLinks )
- {
- ::rtl::OUString *pFields = aStrippedMasterFields.empty() ? 0 : &aStrippedMasterFields[0];
- m_aMasterFields = Sequence< ::rtl::OUString >( pFields, aStrippedMasterFields.size() );
- pFields = aStrippedDetailFields.empty() ? 0 : &aStrippedDetailFields[0];
- m_aDetailFields = Sequence< ::rtl::OUString >( pFields, aStrippedDetailFields.size() );
- }
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::analyzeFieldLinks( FilterManager& _rFilterManager, bool& /* [out] */ _rColumnsInLinkDetails )
- {
- OSL_PRECOND( isAlive(), "ParameterManager::analyzeFieldLinks: not initialized, or already disposed!" );
- if ( !isAlive() )
- return;
-
- _rColumnsInLinkDetails = false;
- try
- {
- // the links as determined by the properties
- Reference< XPropertySet > xProp = m_xComponent;
- OSL_ENSURE(xProp.is(),"Some already released my component!");
- if ( xProp.is() )
- {
- xProp->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MASTERFIELDS) ) >>= m_aMasterFields;
- xProp->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DETAILFIELDS) ) >>= m_aDetailFields;
- }
-
- {
- // normalize to equal length
- sal_Int32 nMasterLength = m_aMasterFields.getLength();
- sal_Int32 nDetailLength = m_aDetailFields.getLength();
-
- if ( nMasterLength > nDetailLength )
- m_aMasterFields.realloc( nDetailLength );
- else if ( nDetailLength > nMasterLength )
- m_aDetailFields.realloc( nMasterLength );
- }
-
- Reference< XNameAccess > xColumns;
- if ( !getColumns( xColumns, true ) )
- // already asserted in getColumns
- return;
-
- Reference< XNameAccess > xParentColumns;
- if ( !getParentColumns( xParentColumns, true ) )
- return;
-
- // classify the links - depending on what the detail fields in each link pair denotes
- ::std::vector< ::rtl::OUString > aAdditionalFilterComponents;
- classifyLinks( xParentColumns, xColumns, aAdditionalFilterComponents );
-
- // did we find links where the detail field refers to a detail column (instead of a parameter name)?
- if ( !aAdditionalFilterComponents.empty() )
- {
- const static ::rtl::OUString s_sAnd( RTL_CONSTASCII_USTRINGPARAM( " AND " ) );
- // build a conjunction of all the filter components
- ::rtl::OUStringBuffer sAdditionalFilter;
- for ( ::std::vector< ::rtl::OUString >::const_iterator aComponent = aAdditionalFilterComponents.begin();
- aComponent != aAdditionalFilterComponents.end();
- ++aComponent
- )
- {
- if ( sAdditionalFilter.getLength() )
- sAdditionalFilter.append(s_sAnd);
-
- sAdditionalFilter.appendAscii("( ",((sal_Int32)(sizeof("( ")-1)));
- sAdditionalFilter.append(*aComponent);
- sAdditionalFilter.appendAscii(" )",((sal_Int32)(sizeof(" )")-1)));
- }
-
- // now set this filter at the 's filter manager
- _rFilterManager.setFilterComponent( FilterManager::fcLinkFilter, sAdditionalFilter.makeStringAndClear() );
-
- _rColumnsInLinkDetails = true;
- }
- }
- catch( const Exception& )
- {
- OSL_FAIL( "ParameterManager::analyzeFieldLinks: caught an exception!" );
- }
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::createOuterParameters()
- {
- OSL_PRECOND( !m_pOuterParameters.is(), "ParameterManager::createOuterParameters: outer parameters not initialized!" );
- OSL_PRECOND( m_xInnerParamUpdate.is(), "ParameterManager::createOuterParameters: no write access to the inner parameters!" );
- if ( !m_xInnerParamUpdate.is() )
- return;
-
- m_pOuterParameters = new param::ParameterWrapperContainer;
-
-#if OSL_DEBUG_LEVEL > 0
- sal_Int32 nSmallestIndexLinkedByColumnName = -1;
- sal_Int32 nLargestIndexNotLinkedByColumnName = -1;
-#endif
- ::rtl::OUString sName;
- for ( ParameterInformation::iterator aParam = m_aParameterInformation.begin();
- aParam != m_aParameterInformation.end();
- ++aParam
- )
- {
-#if OSL_DEBUG_LEVEL > 0
- if ( aParam->second.aInnerIndexes.size() )
- {
- if ( aParam->second.eType == eLinkedByColumnName )
- {
- if ( nSmallestIndexLinkedByColumnName == -1 )
- nSmallestIndexLinkedByColumnName = aParam->second.aInnerIndexes[ 0 ];
- }
- else
- {
- nLargestIndexNotLinkedByColumnName = aParam->second.aInnerIndexes[ aParam->second.aInnerIndexes.size() - 1 ];
- }
- }
-#endif
- if ( aParam->second.eType != eFilledExternally )
- continue;
-
- // check which of the parameters have already been visited (e.g. filled via XParameters)
- size_t nAlreadyVisited = 0;
- for ( ::std::vector< sal_Int32 >::iterator aIndex = aParam->second.aInnerIndexes.begin();
- aIndex != aParam->second.aInnerIndexes.end();
- ++aIndex
- )
- {
- if ( ( m_aParametersVisited.size() > (size_t)*aIndex ) && m_aParametersVisited[ *aIndex ] )
- { // exclude this index
- *aIndex = -1;
- ++nAlreadyVisited;
- }
- }
- if ( nAlreadyVisited == aParam->second.aInnerIndexes.size() )
- continue;
-
- // need a wrapper for this .... the "inner parameters" as supplied by a result set don't have a "Value"
- // property, but the parameter listeners expect such a property. So we need an object "aggregating"
- // xParam and supplying an additional property ("Value")
- // (it's no real aggregation of course ...)
- m_pOuterParameters->push_back( new param::ParameterWrapper( aParam->second.xComposerColumn, m_xInnerParamUpdate, aParam->second.aInnerIndexes ) );
- }
-
-#if OSL_DEBUG_LEVEL > 0
- OSL_ENSURE( ( nSmallestIndexLinkedByColumnName == -1 ) || ( nLargestIndexNotLinkedByColumnName == -1 ) ||
- ( nSmallestIndexLinkedByColumnName > nLargestIndexNotLinkedByColumnName ),
- "ParameterManager::createOuterParameters: inconsistency!" );
-
- // for the master-detail links, where the detail field denoted a column name, we created an addtional ("artificial")
- // filter, and *appended* it to all other (potentially) existing filters of the row set. This means that the indexes
- // for the parameters resulting from the artifical filter should be larger than any other parameter index, and this
- // is what the assertion checks.
- // If the assertion fails, then we would need another handling for the "parameters visited" flags, since they're based
- // on parameter indexes *without* the artificial filter (because this filter is not visible from the outside).
-#endif
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::updateParameterInfo( FilterManager& _rFilterManager )
- {
- OSL_PRECOND( isAlive(), "ParameterManager::updateParameterInfo: not initialized, or already disposed!" );
- if ( !isAlive() )
- return;
-
- clearAllParameterInformation();
- cacheConnectionInfo();
-
- // check whether the is based on a statement/query which requires parameters
- Reference< XPropertySet > xProp = m_xComponent;
- OSL_ENSURE(xProp.is(),"Some already released my component!");
- if ( xProp.is() )
- {
- if ( !initializeComposerByComponent( xProp ) )
- { // okay, nothing to do
- m_bUpToDate = true;
- return;
- } // if ( !initializeComposerByComponent( m_xComponent ) )
- }
- OSL_POSTCOND( m_xInnerParamColumns.is(), "ParameterManager::updateParameterInfo: initializeComposerByComponent did nonsense (1)!" );
-
- // collect all parameters which are defined by the "inner parameters"
- collectInnerParameters( false );
-
- // analyze the master-detail relationships
- bool bColumnsInLinkDetails = false;
- analyzeFieldLinks( _rFilterManager, bColumnsInLinkDetails );
-
- if ( bColumnsInLinkDetails )
- {
- // okay, in this case, analyzeFieldLinks modified the "real" filter at the RowSet, to contain
- // an additional restriction (which we created ourself)
- // So we need to update all information about our inner parameter columns
- Reference< XPropertySet > xDirectRowSetProps;
- m_xAggregatedRowSet->queryAggregation( ::getCppuType( &xDirectRowSetProps ) ) >>= xDirectRowSetProps;
- OSL_VERIFY( initializeComposerByComponent( xDirectRowSetProps ) );
- collectInnerParameters( true );
- }
-
- if ( !m_nInnerCount )
- { // no parameters at all
- m_bUpToDate = true;
- return;
- }
-
- // for what now remains as outer parameters, create the wrappers for the single
- // parameter columns
- createOuterParameters();
-
- m_bUpToDate = true;
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::fillLinkedParameters( const Reference< XNameAccess >& _rxParentColumns )
- {
- OSL_PRECOND( isAlive(), "ParameterManager::fillLinkedParameters: not initialized, or already disposed!" );
- if ( !isAlive() )
- return;
- OSL_PRECOND( m_xInnerParamColumns.is(), "ParameterManager::fillLinkedParameters: no inner parameters found!" );
- OSL_ENSURE ( _rxParentColumns.is(), "ParameterManager::fillLinkedParameters: invalid parent columns!" );
-
- try
- {
- // the master and detail field( name)s of the
- const ::rtl::OUString* pMasterFields = m_aMasterFields.getConstArray();
- const ::rtl::OUString* pDetailFields = m_aDetailFields.getConstArray();
-
- sal_Int32 nMasterLen = m_aMasterFields.getLength();
- Any aParamType, aScale, aValue;
-
- // loop through all master fields. For each of them, get the respective column from the
- // parent , and forward it's current value as paramter value to the (inner) row set
- for ( sal_Int32 i = 0; i < nMasterLen; ++i, ++pMasterFields, ++pDetailFields )
- {
- // does the name denote a valid column in the parent?
- if ( !_rxParentColumns->hasByName( *pMasterFields ) )
- {
- OSL_FAIL( "ParameterManager::fillLinkedParameters: invalid master names should have been stripped long before!" );
- continue;
- }
-
- // do we, for this name, know where to place the values?
- ParameterInformation::const_iterator aParamInfo = m_aParameterInformation.find( *pDetailFields );
- if ( ( aParamInfo == m_aParameterInformation.end() )
- || ( aParamInfo->second.aInnerIndexes.empty() )
- )
- {
- OSL_FAIL( "ParameterManager::fillLinkedParameters: nothing known about this detail field!" );
- continue;
- }
-
- // the concrete master field
- Reference< XPropertySet > xMasterField(_rxParentColumns->getByName( *pMasterFields ),UNO_QUERY);
-
- // the positions where we have to fill in values for the current parameter name
- for ( ::std::vector< sal_Int32 >::const_iterator aPosition = aParamInfo->second.aInnerIndexes.begin();
- aPosition != aParamInfo->second.aInnerIndexes.end();
- ++aPosition
- )
- {
- // the concrete detail field
- Reference< XPropertySet > xDetailField(m_xInnerParamColumns->getByIndex( *aPosition ),UNO_QUERY);
- OSL_ENSURE( xDetailField.is(), "ParameterManager::fillLinkedParameters: invalid detail field!" );
- if ( !xDetailField.is() )
- continue;
-
- // type and scale of the parameter field
- sal_Int32 nParamType = DataType::VARCHAR;
- OSL_VERIFY( xDetailField->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE) ) >>= nParamType );
-
- sal_Int32 nScale = 0;
- if ( xDetailField->getPropertySetInfo()->hasPropertyByName( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE) ) )
- OSL_VERIFY( xDetailField->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE) ) >>= nScale );
-
- // transfer the param value
- try
- {
- m_xInnerParamUpdate->setObjectWithInfo(
- *aPosition + 1, // parameters are based at 1
- xMasterField->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_VALUE) ),
- nParamType,
- nScale
- );
- }
- catch( const Exception& )
- {
- OSL_FAIL( ::rtl::OString( "ParameterManager::fillLinkedParameters: master-detail parameter number " )
- += ::rtl::OString::valueOf( sal_Int32( *aPosition + 1 ) )
- += ::rtl::OString( " could not be filled!" ) );
- }
- }
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
-
- //--------------------------------------------------------------------
- bool ParameterManager::completeParameters( const Reference< XInteractionHandler >& _rxCompletionHandler, const Reference< XConnection > _rxConnection )
- {
- OSL_PRECOND( isAlive(), "ParameterManager::completeParameters: not initialized, or already disposed!" );
- OSL_ENSURE ( _rxCompletionHandler.is(), "ParameterManager::completeParameters: invalid interaction handler!" );
-
- // two continuations (Ok and Cancel)
- OInteractionAbort* pAbort = new OInteractionAbort;
- OParameterContinuation* pParams = new OParameterContinuation;
-
- // the request
- ParametersRequest aRequest;
- aRequest.Parameters = m_pOuterParameters.get();
- aRequest.Connection = _rxConnection;
- OInteractionRequest* pRequest = new OInteractionRequest( makeAny( aRequest ) );
- Reference< XInteractionRequest > xRequest( pRequest );
-
- // some knittings
- pRequest->addContinuation( pAbort );
- pRequest->addContinuation( pParams );
-
- // execute the request
- try
- {
- _rxCompletionHandler->handle( xRequest );
- }
- catch( const Exception& )
- {
- OSL_FAIL( "ParameterManager::completeParameters: caught an exception while calling the handler!" );
- }
-
- if ( !pParams->wasSelected() )
- // canceled by the user (i.e. (s)he canceled the dialog)
- return false;
-
- try
- {
- // transfer the values from the continuation object to the parameter columns
- Sequence< PropertyValue > aFinalValues = pParams->getValues();
- const PropertyValue* pFinalValues = aFinalValues.getConstArray();
- for ( sal_Int32 i = 0; i < aFinalValues.getLength(); ++i, ++pFinalValues )
- {
- Reference< XPropertySet > xParamColumn(aRequest.Parameters->getByIndex( i ),UNO_QUERY);
- if ( xParamColumn.is() )
- {
- #ifdef DBG_UTIL
- ::rtl::OUString sName;
- xParamColumn->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME) ) >>= sName;
- OSL_ENSURE( sName == pFinalValues->Name, "ParameterManager::completeParameters: inconsistent parameter names!" );
- #endif
- xParamColumn->setPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_VALUE), pFinalValues->Value );
- // the property sets are wrapper classes, translating the Value property into a call to
- // the appropriate XParameters interface
- }
- }
- }
- catch( const Exception& )
- {
- OSL_FAIL( "ParameterManager::completeParameters: caught an exception while propagating the values!" );
- }
- return true;
- }
-
- //--------------------------------------------------------------------
- bool ParameterManager::consultParameterListeners( ::osl::ResettableMutexGuard& _rClearForNotifies )
- {
- bool bCanceled = false;
-
- sal_Int32 nParamsLeft = m_pOuterParameters->getParameters().size();
- // TODO: shouldn't we subtract all the parameters which were already visited?
- if ( nParamsLeft )
- {
- ::cppu::OInterfaceIteratorHelper aIter( m_aParameterListeners );
- Reference< XPropertySet > xProp = m_xComponent;
- OSL_ENSURE(xProp.is(),"Some already released my component!");
- DatabaseParameterEvent aEvent( xProp.get(), m_pOuterParameters.get() );
-
- _rClearForNotifies.clear();
- while ( aIter.hasMoreElements() && !bCanceled )
- bCanceled = !static_cast< XDatabaseParameterListener* >( aIter.next() )->approveParameter( aEvent );
- _rClearForNotifies.reset();
- }
-
- return !bCanceled;
- }
-
- //--------------------------------------------------------------------
- bool ParameterManager::fillParameterValues( const Reference< XInteractionHandler >& _rxCompletionHandler, ::osl::ResettableMutexGuard& _rClearForNotifies )
- {
- OSL_PRECOND( isAlive(), "ParameterManager::fillParameterValues: not initialized, or already disposed!" );
- if ( !isAlive() )
- return true;
-
- if ( m_nInnerCount == 0 )
- // no parameters at all
- return true;
-
- // fill the parameters from the master-detail relationship
- Reference< XNameAccess > xParentColumns;
- if ( getParentColumns( xParentColumns, false ) && xParentColumns->hasElements() && m_aMasterFields.getLength() )
- fillLinkedParameters( xParentColumns );
-
- // let the user (via the interaction handler) fill all remaining parameters
- Reference< XConnection > xConnection;
- getConnection( xConnection );
-
- if ( _rxCompletionHandler.is() )
- return completeParameters( _rxCompletionHandler, xConnection );
-
- return consultParameterListeners( _rClearForNotifies );
- }
-
- //--------------------------------------------------------------------
- bool ParameterManager::getConnection( Reference< XConnection >& /* [out] */ _rxConnection )
- {
- OSL_PRECOND( isAlive(), "ParameterManager::getConnection: not initialized, or already disposed!" );
- if ( !isAlive() )
- return false;
-
- _rxConnection.clear();
- try
- {
- Reference< XPropertySet > xProp = m_xComponent;
- OSL_ENSURE(xProp.is(),"Some already released my component!");
- if ( xProp.is() )
- xProp->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ACTIVE_CONNECTION) ) >>= _rxConnection;
- }
- catch( const Exception& )
- {
- OSL_FAIL( "ParameterManager::getConnection: could not retrieve the connection of the !" );
- }
- return _rxConnection.is();
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::cacheConnectionInfo() SAL_THROW(( ))
- {
- try
- {
- Reference< XConnection > xConnection;
- getConnection( xConnection );
- Reference< XDatabaseMetaData > xMeta;
- if ( xConnection.is() )
- xMeta = xConnection->getMetaData();
- if ( xMeta.is() )
- {
- m_sIdentifierQuoteString = xMeta->getIdentifierQuoteString();
- m_sSpecialCharacters = xMeta->getExtraNameCharacters();
- }
- }
- catch( const Exception& )
- {
- OSL_FAIL( "ParameterManager::cacheConnectionInfo: caught an exception!" );
- }
- }
-
- //--------------------------------------------------------------------
- bool ParameterManager::getColumns( Reference< XNameAccess >& /* [out] */ _rxColumns, bool _bFromComposer ) SAL_THROW(( Exception ))
- {
- _rxColumns.clear();
-
- Reference< XColumnsSupplier > xColumnSupp;
- if ( _bFromComposer )
- xColumnSupp = xColumnSupp.query( m_xComposer );
- else
- xColumnSupp.set( m_xComponent.get(),UNO_QUERY);
- if ( xColumnSupp.is() )
- _rxColumns = xColumnSupp->getColumns();
- OSL_ENSURE( _rxColumns.is(), "ParameterManager::getColumns: could not retrieve the columns for the detail !" );
-
- return _rxColumns.is();
- }
-
- //--------------------------------------------------------------------
- bool ParameterManager::getParentColumns( Reference< XNameAccess >& /* [out] */ _out_rxParentColumns, bool _bFromComposer )
- {
- OSL_PRECOND( isAlive(), "ParameterManager::getParentColumns: not initialized, or already disposed!" );
-
- _out_rxParentColumns.clear();
- try
- {
- // get the parent of the component we're working for
- Reference< XChild > xAsChild( m_xComponent.get(), UNO_QUERY_THROW );
- Reference< XPropertySet > xParent( xAsChild->getParent(), UNO_QUERY );
- if ( !xParent.is() )
- return false;
-
- // the columns supplier: either from a composer, or directly from the
- Reference< XColumnsSupplier > xParentColSupp;
- if ( _bFromComposer )
- {
- // re-create the parent composer all the time. Else, we'd have to bother with
- // being a listener at its properties, its loaded state, and event the parent-relationship.
- m_xParentComposer.reset(
- getCurrentSettingsComposer( xParent, m_xORB ),
- SharedQueryComposer::TakeOwnership
- );
- xParentColSupp = xParentColSupp.query( m_xParentComposer );
- }
- else
- xParentColSupp = xParentColSupp.query( xParent );
-
- // get the columns of the parent
- if ( xParentColSupp.is() )
- _out_rxParentColumns = xParentColSupp->getColumns();
- }
- catch( const Exception& )
- {
- OSL_FAIL( "ParameterManager::getParentColumns: caught an exception!" );
- }
- return _out_rxParentColumns.is();
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::addParameterListener( const Reference< XDatabaseParameterListener >& _rxListener )
- {
- if ( _rxListener.is() )
- m_aParameterListeners.addInterface( _rxListener );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::removeParameterListener( const Reference< XDatabaseParameterListener >& _rxListener )
- {
- m_aParameterListeners.removeInterface( _rxListener );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::resetParameterValues( ) SAL_THROW(())
- {
- OSL_PRECOND( isAlive(), "ParameterManager::resetParameterValues: not initialized, or already disposed!" );
- if ( !isAlive() )
- return;
-
- if ( !m_nInnerCount )
- // no parameters at all
- return;
-
- try
- {
- Reference< XNameAccess > xColumns;
- if ( !getColumns( xColumns, false ) )
- // already asserted in getColumns
- return;
-
- Reference< XNameAccess > xParentColumns;
- if ( !getParentColumns( xParentColumns, false ) )
- return;
-
- // loop through all links pairs
- const ::rtl::OUString* pMasterFields = m_aMasterFields.getConstArray();
- const ::rtl::OUString* pDetailFields = m_aDetailFields.getConstArray();
-
- Reference< XPropertySet > xMasterField;
- Reference< XPropertySet > xDetailField;
-
- // now really ....
- const ::rtl::OUString* pDetailFieldsEnd = pDetailFields + m_aDetailFields.getLength();
- for ( ; pDetailFields < pDetailFieldsEnd; ++pDetailFields, ++pMasterFields )
- {
- if ( !xParentColumns->hasByName( *pMasterFields ) )
- {
- // if this name is unknown in the parent columns, then we don't have a source
- // for copying the value to the detail columns
- OSL_FAIL( "ParameterManager::resetParameterValues: this should have been stripped long before!" );
- continue;
- }
-
- // for all inner parameters which are bound to the name as specified by the
- // slave element of the link, propagate the value from the master column to this
- // parameter column
- ParameterInformation::const_iterator aParamInfo = m_aParameterInformation.find( *pDetailFields );
- if ( ( aParamInfo == m_aParameterInformation.end() )
- || ( aParamInfo->second.aInnerIndexes.empty() )
- )
- {
- OSL_FAIL( "ParameterManager::resetParameterValues: nothing known about this detail field!" );
- continue;
- }
-
- xParentColumns->getByName( *pMasterFields ) >>= xMasterField;
- if ( !xMasterField.is() )
- continue;
-
- for ( ::std::vector< sal_Int32 >::const_iterator aPosition = aParamInfo->second.aInnerIndexes.begin();
- aPosition != aParamInfo->second.aInnerIndexes.end();
- ++aPosition
- )
- {
- Reference< XPropertySet > xInnerParameter;
- m_xInnerParamColumns->getByIndex( *aPosition ) >>= xInnerParameter;
- if ( !xInnerParameter.is() )
- continue;
-
- ::rtl::OUString sParamColumnRealName;
- xInnerParameter->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME) ) >>= sParamColumnRealName;
- if ( xColumns->hasByName( sParamColumnRealName ) )
- { // our own columns have a column which's name equals the real name of the param column
- // -> transfer the value property
- xColumns->getByName( sParamColumnRealName ) >>= xDetailField;
- if ( xDetailField.is() )
- xDetailField->setPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_VALUE), xMasterField->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_VALUE) ) );
- }
- }
- }
- }
- catch( const Exception& )
- {
- OSL_FAIL( "ParameterManager::resetParameterValues: caught an exception!" );
- }
-
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::externalParameterVisited( sal_Int32 _nIndex )
- {
- if ( m_aParametersVisited.size() < (size_t)_nIndex )
- {
- m_aParametersVisited.reserve( _nIndex );
- for ( sal_Int32 i = m_aParametersVisited.size(); i < _nIndex; ++i )
- m_aParametersVisited.push_back( false );
- }
- m_aParametersVisited[ _nIndex - 1 ] = true;
- }
-
-#define VISIT_PARAMETER( method ) \
- ::osl::MutexGuard aGuard( m_rMutex ); \
- OSL_ENSURE( m_xInnerParamUpdate.is(), "ParameterManager::XParameters::setXXX: no XParameters access to the RowSet!" ); \
- if ( !m_xInnerParamUpdate.is() ) \
- return; \
- m_xInnerParamUpdate->method; \
- externalParameterVisited( _nIndex ) \
-
- //--------------------------------------------------------------------
- void ParameterManager::setNull( sal_Int32 _nIndex, sal_Int32 sqlType )
- {
- VISIT_PARAMETER( setNull( _nIndex, sqlType ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setObjectNull( sal_Int32 _nIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName )
- {
- VISIT_PARAMETER( setObjectNull( _nIndex, sqlType, typeName ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setBoolean( sal_Int32 _nIndex, sal_Bool x )
- {
- VISIT_PARAMETER( setBoolean( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setByte( sal_Int32 _nIndex, sal_Int8 x )
- {
- VISIT_PARAMETER( setByte( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setShort( sal_Int32 _nIndex, sal_Int16 x )
- {
- VISIT_PARAMETER( setShort( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setInt( sal_Int32 _nIndex, sal_Int32 x )
- {
- VISIT_PARAMETER( setInt( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setLong( sal_Int32 _nIndex, sal_Int64 x )
- {
- VISIT_PARAMETER( setLong( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setFloat( sal_Int32 _nIndex, float x )
- {
- VISIT_PARAMETER( setFloat( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setDouble( sal_Int32 _nIndex, double x )
- {
- VISIT_PARAMETER( setDouble( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setString( sal_Int32 _nIndex, const ::rtl::OUString& x )
- {
- VISIT_PARAMETER( setString( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setBytes( sal_Int32 _nIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x )
- {
- VISIT_PARAMETER( setBytes( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setDate( sal_Int32 _nIndex, const ::com::sun::star::util::Date& x )
- {
- VISIT_PARAMETER( setDate( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setTime( sal_Int32 _nIndex, const ::com::sun::star::util::Time& x )
- {
- VISIT_PARAMETER( setTime( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setTimestamp( sal_Int32 _nIndex, const ::com::sun::star::util::DateTime& x )
- {
- VISIT_PARAMETER( setTimestamp( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setBinaryStream( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x, sal_Int32 length )
- {
- VISIT_PARAMETER( setBinaryStream( _nIndex, x, length ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setCharacterStream( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x, sal_Int32 length )
- {
- VISIT_PARAMETER( setCharacterStream( _nIndex, x, length ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setObject( sal_Int32 _nIndex, const ::com::sun::star::uno::Any& x )
- {
- VISIT_PARAMETER( setObject( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setObjectWithInfo( sal_Int32 _nIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale )
- {
- VISIT_PARAMETER( setObjectWithInfo( _nIndex, x, targetSqlType, scale ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setRef( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef>& x )
- {
- VISIT_PARAMETER( setRef( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setBlob( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob>& x )
- {
- VISIT_PARAMETER( setBlob( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setClob( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob>& x )
- {
- VISIT_PARAMETER( setClob( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::setArray( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray>& x )
- {
- VISIT_PARAMETER( setArray( _nIndex, x ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterManager::clearParameters( )
- {
- if ( m_xInnerParamUpdate.is() )
- m_xInnerParamUpdate->clearParameters( );
- }
-
- //====================================================================
- //= OParameterContinuation
- //====================================================================
- //--------------------------------------------------------------------
- void SAL_CALL OParameterContinuation::setParameters( const Sequence< PropertyValue >& _rValues ) throw( RuntimeException )
- {
- m_aValues = _rValues;
- }
-
-//........................................................................
-} // namespace frm
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/paramwrapper.cxx b/connectivity/source/commontools/paramwrapper.cxx
deleted file mode 100644
index a04271140f..0000000000
--- a/connectivity/source/commontools/paramwrapper.cxx
+++ /dev/null
@@ -1,366 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <connectivity/paramwrapper.hxx>
-
-/** === begin UNO includes === **/
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/sdb/XParametersSupplier.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-/** === end UNO includes === **/
-
-#include <tools/diagnose_ex.h>
-#include <comphelper/enumhelper.hxx>
-
-#define PROPERTY_ID_VALUE 1000
-
-//........................................................................
-namespace dbtools
-{
-namespace param
-{
-//........................................................................
-
- /** === begin UNO using === **/
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::beans::XPropertySet;
- using ::com::sun::star::sdbc::XParameters;
- using ::com::sun::star::uno::Sequence;
- using ::com::sun::star::uno::Type;
- using ::com::sun::star::uno::RuntimeException;
- using ::com::sun::star::uno::XWeak;
- using ::com::sun::star::beans::XPropertySet;
- using ::com::sun::star::beans::XFastPropertySet;
- using ::com::sun::star::beans::XMultiPropertySet;
- using ::com::sun::star::beans::XPropertySetInfo;
- using ::com::sun::star::beans::Property;
- using ::com::sun::star::uno::Exception;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
- using ::com::sun::star::uno::Any;
- using ::com::sun::star::lang::IllegalArgumentException;
- using ::com::sun::star::sdbc::SQLException;
- using ::com::sun::star::lang::WrappedTargetException;
- using ::com::sun::star::lang::IndexOutOfBoundsException;
- using ::com::sun::star::container::XEnumeration;
- using ::com::sun::star::sdb::XSingleSelectQueryAnalyzer;
- using ::com::sun::star::sdb::XParametersSupplier;
- using ::com::sun::star::lang::DisposedException;
- /** === end UNO using === **/
- namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute;
- namespace DataType = ::com::sun::star::sdbc::DataType;
-
- //====================================================================
- //= ParameterWrapper
- //====================================================================
- //--------------------------------------------------------------------
- ParameterWrapper::ParameterWrapper( const Reference< XPropertySet >& _rxColumn )
- :PropertyBase( m_aBHelper )
- ,m_xDelegator( _rxColumn )
- {
- if ( m_xDelegator.is() )
- m_xDelegatorPSI = m_xDelegator->getPropertySetInfo();
- if ( !m_xDelegatorPSI.is() )
- throw RuntimeException();
- }
-
- //--------------------------------------------------------------------
- ParameterWrapper::ParameterWrapper( const Reference< XPropertySet >& _rxColumn,
- const Reference< XParameters >& _rxAllParameters, const ::std::vector< sal_Int32 >& _rIndexes )
- :PropertyBase( m_aBHelper )
- ,m_aIndexes( _rIndexes )
- ,m_xDelegator( _rxColumn )
- ,m_xValueDestination( _rxAllParameters )
- {
- if ( m_xDelegator.is() )
- m_xDelegatorPSI = m_xDelegator->getPropertySetInfo();
- if ( !m_xDelegatorPSI.is() )
- throw RuntimeException();
-
- OSL_ENSURE( !m_aIndexes.empty(), "ParameterWrapper::ParameterWrapper: sure about the indexes?" );
- }
-
- //--------------------------------------------------------------------
- ParameterWrapper::~ParameterWrapper()
- {
- }
-
- //--------------------------------------------------------------------
- IMPLEMENT_FORWARD_XINTERFACE2( ParameterWrapper, UnoBase, PropertyBase )
-
- //--------------------------------------------------------------------
- Sequence< Type > SAL_CALL ParameterWrapper::getTypes( ) throw(RuntimeException)
- {
- Sequence< Type > aTypes( 4 );
- aTypes[ 1 ] = ::getCppuType( static_cast< Reference< XWeak >* >( NULL ) );
- aTypes[ 1 ] = ::getCppuType( static_cast< Reference< XPropertySet >* >( NULL ) );
- aTypes[ 2 ] = ::getCppuType( static_cast< Reference< XFastPropertySet >* >( NULL ) );
- aTypes[ 3 ] = ::getCppuType( static_cast< Reference< XMultiPropertySet >* >( NULL ) );
- return aTypes;
- }
-
- //--------------------------------------------------------------------
- IMPLEMENT_GET_IMPLEMENTATION_ID( ParameterWrapper )
-
- //--------------------------------------------------------------------
- ::rtl::OUString ParameterWrapper::impl_getPseudoAggregatePropertyName( sal_Int32 _nHandle ) const
- {
- Reference< XPropertySetInfo > xInfo = const_cast<ParameterWrapper*>( this )->getPropertySetInfo();
- Sequence< Property > aProperties = xInfo->getProperties();
- const Property* pProperties = aProperties.getConstArray();
- for ( sal_Int32 i = 0; i < aProperties.getLength(); ++i, ++pProperties )
- {
- if ( pProperties->Handle == _nHandle )
- return pProperties->Name;
- }
-
- OSL_FAIL( "ParameterWrapper::impl_getPseudoAggregatePropertyName: invalid argument!" );
- return ::rtl::OUString();
- }
-
- //--------------------------------------------------------------------
- Reference< XPropertySetInfo > ParameterWrapper::getPropertySetInfo() throw( RuntimeException )
- {
- return createPropertySetInfo( getInfoHelper() );
- }
-
- //--------------------------------------------------------------------
- ::cppu::IPropertyArrayHelper& ParameterWrapper::getInfoHelper()
- {
- if ( !m_pInfoHelper.get() )
- {
- Sequence< Property > aProperties;
- try
- {
- aProperties = m_xDelegatorPSI->getProperties();
- sal_Int32 nProperties( aProperties.getLength() );
- aProperties.realloc( nProperties + 1 );
- aProperties[ nProperties ] = Property(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value" ) ),
- PROPERTY_ID_VALUE,
- ::cppu::UnoType< Any >::get(),
- PropertyAttribute::TRANSIENT | PropertyAttribute::MAYBEVOID
- );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- m_pInfoHelper.reset( new ::cppu::OPropertyArrayHelper( aProperties, false ) );
- }
- return *m_pInfoHelper;
- }
-
- //--------------------------------------------------------------------
- sal_Bool ParameterWrapper::convertFastPropertyValue(Any& rConvertedValue, Any& rOldValue, sal_Int32 nHandle, const Any& rValue) throw( IllegalArgumentException )
- {
- OSL_ENSURE( PROPERTY_ID_VALUE == nHandle, "ParameterWrapper::convertFastPropertyValue: the only non-readonly prop should be our PROPERTY_VALUE!" );
- (void)nHandle;
-
- // we're lazy here ...
- rOldValue = m_aValue.makeAny();
- rConvertedValue = rValue;
- return sal_True; // assume "modified" ...
- }
-
- //--------------------------------------------------------------------
- void ParameterWrapper::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw( Exception )
- {
- if ( nHandle == PROPERTY_ID_VALUE )
- {
- try
- {
- // TODO : aParamType & nScale can be obtained within the constructor ....
- sal_Int32 nParamType = DataType::VARCHAR;
- OSL_VERIFY( m_xDelegator->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ) ) ) >>= nParamType );
-
- sal_Int32 nScale = 0;
- if ( m_xDelegatorPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Scale" ) ) ) )
- OSL_VERIFY( m_xDelegator->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Scale" ) ) ) >>= nScale );
-
- if ( m_xValueDestination.is() )
- {
- for ( ::std::vector< sal_Int32 >::iterator aIter = m_aIndexes.begin(); aIter != m_aIndexes.end(); ++aIter )
- {
- m_xValueDestination->setObjectWithInfo( *aIter + 1, rValue, nParamType, nScale );
- // (the index of the parameters is one-based)
- }
- }
-
- m_aValue = rValue;
- }
- catch( SQLException& e )
- {
- WrappedTargetException aExceptionWrapper;
- aExceptionWrapper.Context = e.Context;
- aExceptionWrapper.Message = e.Message;
- aExceptionWrapper.TargetException <<= e;
- throw WrappedTargetException( aExceptionWrapper );
- }
- }
- else
- {
- ::rtl::OUString aName = impl_getPseudoAggregatePropertyName( nHandle );
- m_xDelegator->setPropertyValue( aName, rValue );
- }
- }
-
- //--------------------------------------------------------------------
- void ParameterWrapper::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const
- {
- if ( nHandle == PROPERTY_ID_VALUE )
- {
- rValue = m_aValue.makeAny();
- }
- else
- {
- ::rtl::OUString aName = impl_getPseudoAggregatePropertyName( nHandle );
- rValue = m_xDelegator->getPropertyValue( aName );
- }
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL ParameterWrapper::dispose()
- {
- ::osl::MutexGuard aGuard( m_aMutex );
-
- m_aValue.setNull();
- m_aIndexes.resize(0);
- m_xDelegator.clear();
- m_xDelegatorPSI.clear();
- m_xValueDestination.clear();
-
- m_aBHelper.bDisposed = sal_True;
- }
-
- //====================================================================
- //= ParameterWrapperContainer
- //====================================================================
- //--------------------------------------------------------------------
- ParameterWrapperContainer::ParameterWrapperContainer()
- :ParameterWrapperContainer_Base( m_aMutex )
- {
- }
-
- //--------------------------------------------------------------------
- ParameterWrapperContainer::ParameterWrapperContainer( const Reference< XSingleSelectQueryAnalyzer >& _rxComposer )
- :ParameterWrapperContainer_Base( m_aMutex )
- {
- Reference< XParametersSupplier > xSuppParams( _rxComposer, UNO_QUERY_THROW );
- Reference< XIndexAccess > xParameters( xSuppParams->getParameters(), UNO_QUERY_THROW );
- sal_Int32 nParamCount( xParameters->getCount() );
- m_aParameters.reserve( nParamCount );
- for ( sal_Int32 i=0; i<nParamCount; ++i )
- {
- m_aParameters.push_back( new ParameterWrapper( Reference< XPropertySet >( xParameters->getByIndex( i ), UNO_QUERY_THROW ) ) );
- }
- }
-
- //--------------------------------------------------------------------
- ParameterWrapperContainer::~ParameterWrapperContainer()
- {
- }
-
- //--------------------------------------------------------------------
- Type SAL_CALL ParameterWrapperContainer::getElementType() throw( RuntimeException )
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- impl_checkDisposed_throw();
- return ::getCppuType( static_cast< Reference< XPropertySet >* >( NULL ) );
- }
-
- //--------------------------------------------------------------------
- sal_Bool SAL_CALL ParameterWrapperContainer::hasElements() throw( RuntimeException )
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- impl_checkDisposed_throw();
- return !m_aParameters.empty();
- }
-
- //--------------------------------------------------------------------
- sal_Int32 SAL_CALL ParameterWrapperContainer::getCount() throw( RuntimeException )
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- impl_checkDisposed_throw();
- return m_aParameters.size();
- }
-
- //--------------------------------------------------------------------
- Any SAL_CALL ParameterWrapperContainer::getByIndex( sal_Int32 _nIndex ) throw( IndexOutOfBoundsException, WrappedTargetException, RuntimeException )
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- impl_checkDisposed_throw();
-
- if ( ( _nIndex < 0 ) || ( _nIndex >= (sal_Int32)m_aParameters.size() ) )
- throw IndexOutOfBoundsException();
-
- return makeAny( Reference< XPropertySet >( m_aParameters[ _nIndex ].get() ) );
- }
-
- //--------------------------------------------------------------------
- Reference< XEnumeration > ParameterWrapperContainer::createEnumeration() throw( RuntimeException )
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- impl_checkDisposed_throw();
-
- return new ::comphelper::OEnumerationByIndex( static_cast< XIndexAccess* >( this ) );
- }
-
- //--------------------------------------------------------------------
- void ParameterWrapperContainer::impl_checkDisposed_throw()
- {
- if ( rBHelper.bDisposed )
- throw DisposedException( ::rtl::OUString(), *this );
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL ParameterWrapperContainer::disposing()
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- impl_checkDisposed_throw();
-
- for ( Parameters::const_iterator param = m_aParameters.begin();
- param != m_aParameters.end();
- ++param
- )
- {
- (*param)->dispose();
- }
-
- Parameters aEmpty;
- m_aParameters.swap( aEmpty );
- }
-
-//........................................................................
-} } // namespace dbtools::param
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx
deleted file mode 100644
index 1bba5dab6f..0000000000
--- a/connectivity/source/commontools/predicateinput.cxx
+++ /dev/null
@@ -1,448 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <connectivity/predicateinput.hxx>
-#include <comphelper/types.hxx>
-#include <connectivity/dbtools.hxx>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <osl/diagnose.h>
-#include <connectivity/sqlnode.hxx>
-#include <connectivity/PColumn.hxx>
-#include <comphelper/numbers.hxx>
-
-//.........................................................................
-namespace dbtools
-{
-//.........................................................................
-
- using ::com::sun::star::sdbc::XConnection;
- using ::com::sun::star::lang::XMultiServiceFactory;
- using ::com::sun::star::util::XNumberFormatsSupplier;
- using ::com::sun::star::util::XNumberFormatter;
- using ::com::sun::star::uno::UNO_QUERY;
- using ::com::sun::star::beans::XPropertySet;
- using ::com::sun::star::beans::XPropertySetInfo;
- using ::com::sun::star::lang::Locale;
- using ::com::sun::star::uno::Exception;
- using ::com::sun::star::i18n::XLocaleData;
- using ::com::sun::star::i18n::LocaleDataItem;
-
- using namespace ::com::sun::star::sdbc;
- using namespace ::connectivity;
-
- using ::connectivity::OSQLParseNode;
-
- #define Reference ::com::sun::star::uno::Reference
-
- //=====================================================================
- //---------------------------------------------------------------------
- static sal_Unicode lcl_getSeparatorChar( const ::rtl::OUString& _rSeparator, sal_Unicode _nFallback )
- {
- OSL_ENSURE( 0 < _rSeparator.getLength(), "::lcl_getSeparatorChar: invalid separator string!" );
-
- sal_Unicode nReturn( _nFallback );
- if ( _rSeparator.getLength() )
- nReturn = static_cast< sal_Char >( _rSeparator.getStr()[0] );
- return nReturn;
- }
-
- //=====================================================================
- //= OPredicateInputController
- //=====================================================================
- //---------------------------------------------------------------------
- sal_Bool OPredicateInputController::getSeparatorChars( const Locale& _rLocale, sal_Unicode& _rDecSep, sal_Unicode& _rThdSep ) const
- {
- _rDecSep = '.';
- _rThdSep = ',';
- try
- {
- LocaleDataItem aLocaleData;
- if ( m_xLocaleData.is() )
- {
- aLocaleData = m_xLocaleData->getLocaleItem( _rLocale );
- _rDecSep = lcl_getSeparatorChar( aLocaleData.decimalSeparator, _rDecSep );
- _rThdSep = lcl_getSeparatorChar( aLocaleData.decimalSeparator, _rThdSep );
- return sal_True;
- }
- }
- catch( const Exception& )
- {
- OSL_FAIL( "OPredicateInputController::getSeparatorChars: caught an exception!" );
- }
- return sal_False;
- }
-
- //---------------------------------------------------------------------
- OPredicateInputController::OPredicateInputController(
- const Reference< XMultiServiceFactory >& _rxORB, const Reference< XConnection >& _rxConnection, const IParseContext* _pParseContext )
- :m_xORB( _rxORB )
- ,m_xConnection( _rxConnection )
- ,m_aParser( m_xORB, _pParseContext )
- {
- try
- {
- // create a number formatter / number formats supplier pair
- OSL_ENSURE( m_xORB.is(), "OPredicateInputController::OPredicateInputController: need a service factory!" );
- if ( m_xORB.is() )
- {
- m_xFormatter = Reference< XNumberFormatter >( m_xORB->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.NumberFormatter" ) ) ),
- UNO_QUERY
- );
- }
-
- Reference< XNumberFormatsSupplier > xNumberFormats = ::dbtools::getNumberFormats( m_xConnection, sal_True );
- if ( !xNumberFormats.is() )
- ::comphelper::disposeComponent( m_xFormatter );
- else if ( m_xFormatter.is() )
- m_xFormatter->attachNumberFormatsSupplier( xNumberFormats );
-
- // create the locale data
- if ( m_xORB.is() )
- {
- m_xLocaleData = m_xLocaleData.query( m_xORB->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.i18n.LocaleData" ) ) )
- );
- }
- }
- catch( const Exception& )
- {
- OSL_FAIL( "OPredicateInputController::OPredicateInputController: caught an exception!" );
- }
- }
-
- //---------------------------------------------------------------------
- OSQLParseNode* OPredicateInputController::implPredicateTree(::rtl::OUString& _rErrorMessage, const ::rtl::OUString& _rStatement, const Reference< XPropertySet > & _rxField) const
- {
- OSQLParseNode* pReturn = const_cast< OSQLParser& >( m_aParser ).predicateTree( _rErrorMessage, _rStatement, m_xFormatter, _rxField );
- if ( !pReturn )
- { // is it a text field ?
- sal_Int32 nType = DataType::OTHER;
- _rxField->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Type" )) ) >>= nType;
-
- if ( ( DataType::CHAR == nType )
- || ( DataType::VARCHAR == nType )
- || ( DataType::LONGVARCHAR == nType )
- || ( DataType::CLOB == nType )
- )
- { // yes -> force a quoted text and try again
- ::rtl::OUString sQuoted( _rStatement );
- if ( sQuoted.getLength()
- && ( (sQuoted.getStr()[0] != '\'')
- || (sQuoted.getStr()[ sQuoted.getLength() - 1 ] != '\'' )
- )
- )
- {
- static const ::rtl::OUString sSingleQuote( RTL_CONSTASCII_USTRINGPARAM( "'" ) );
- static const ::rtl::OUString sDoubleQuote( RTL_CONSTASCII_USTRINGPARAM( "''" ) );
-
- sal_Int32 nIndex = -1;
- sal_Int32 nTemp = 0;
- while ( -1 != ( nIndex = sQuoted.indexOf( '\'',nTemp ) ) )
- {
- sQuoted = sQuoted.replaceAt( nIndex, 1, sDoubleQuote );
- nTemp = nIndex+2;
- }
-
- ::rtl::OUString sTemp( sSingleQuote );
- ( sTemp += sQuoted ) += sSingleQuote;
- sQuoted = sTemp;
- }
- pReturn = const_cast< OSQLParser& >( m_aParser ).predicateTree( _rErrorMessage, sQuoted, m_xFormatter, _rxField );
- }
-
- // one more fallback: for numeric fields, and value strings containing a decimal/thousands separator
- // problem which is to be solved with this:
- // * a system locale "german"
- // * a column formatted with an english number format
- // => the output is german (as we use the system locale for this), i.e. "3,4"
- // => the input does not recognize the german text, as predicateTree uses the number format
- // of the column to determine the main locale - the locale on the context is only a fallback
- if ( ( DataType::FLOAT == nType )
- || ( DataType::REAL == nType )
- || ( DataType::DOUBLE == nType )
- || ( DataType::NUMERIC == nType )
- || ( DataType::DECIMAL == nType )
- )
- {
- const IParseContext& rParseContext = m_aParser.getContext();
- // get the separators for the locale of our parse context
- sal_Unicode nCtxDecSep;
- sal_Unicode nCtxThdSep;
- getSeparatorChars( rParseContext.getPreferredLocale(), nCtxDecSep, nCtxThdSep );
-
- // determine the locale of the column we're building a predicate string for
- sal_Unicode nFmtDecSep( nCtxDecSep );
- sal_Unicode nFmtThdSep( nCtxThdSep );
- try
- {
- Reference< XPropertySetInfo > xPSI( _rxField->getPropertySetInfo() );
- if ( xPSI.is() && xPSI->hasPropertyByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FormatKey" )) ) )
- {
- sal_Int32 nFormatKey = 0;
- _rxField->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FormatKey" )) ) >>= nFormatKey;
- if ( nFormatKey && m_xFormatter.is() )
- {
- Locale aFormatLocale;
- ::comphelper::getNumberFormatProperty(
- m_xFormatter,
- nFormatKey,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Locale" ) )
- ) >>= aFormatLocale;
-
- // valid locale
- if ( aFormatLocale.Language.getLength() )
- {
- getSeparatorChars( aFormatLocale, nFmtDecSep, nCtxThdSep );
- }
- }
- }
- }
- catch( const Exception& )
- {
- OSL_FAIL( "OPredicateInputController::implPredicateTree: caught an exception while dealing with the formats!" );
- }
-
- sal_Bool bDecDiffers = ( nCtxDecSep != nFmtDecSep );
- sal_Bool bFmtDiffers = ( nCtxThdSep != nFmtThdSep );
- if ( bDecDiffers || bFmtDiffers )
- { // okay, at least one differs
- // "translate" the value into the "format locale"
- ::rtl::OUString sTranslated( _rStatement );
- const sal_Unicode nIntermediate( '_' );
- sTranslated = sTranslated.replace( nCtxDecSep, nIntermediate );
- sTranslated = sTranslated.replace( nCtxThdSep, nFmtThdSep );
- sTranslated = sTranslated.replace( nIntermediate, nFmtDecSep );
-
- pReturn = const_cast< OSQLParser& >( m_aParser ).predicateTree( _rErrorMessage, sTranslated, m_xFormatter, _rxField );
- }
- }
- }
- return pReturn;
- }
-
- //---------------------------------------------------------------------
- sal_Bool OPredicateInputController::normalizePredicateString(
- ::rtl::OUString& _rPredicateValue, const Reference< XPropertySet > & _rxField, ::rtl::OUString* _pErrorMessage ) const
- {
- OSL_ENSURE( m_xConnection.is() && m_xFormatter.is() && _rxField.is(),
- "OPredicateInputController::normalizePredicateString: invalid state or params!" );
-
- sal_Bool bSuccess = sal_False;
- if ( m_xConnection.is() && m_xFormatter.is() && _rxField.is() )
- {
- // parse the string
- ::rtl::OUString sError;
- ::rtl::OUString sTransformedText( _rPredicateValue );
- OSQLParseNode* pParseNode = implPredicateTree( sError, sTransformedText, _rxField );
- if ( _pErrorMessage ) *_pErrorMessage = sError;
-
- if ( pParseNode )
- {
- const IParseContext& rParseContext = m_aParser.getContext();
- sal_Unicode nDecSeparator, nThousandSeparator;
- getSeparatorChars( rParseContext.getPreferredLocale(), nDecSeparator, nThousandSeparator );
-
- // translate it back into a string
- sTransformedText = ::rtl::OUString();
- pParseNode->parseNodeToPredicateStr(
- sTransformedText, m_xConnection, m_xFormatter, _rxField,
- rParseContext.getPreferredLocale(), (sal_Char)nDecSeparator, &rParseContext
- );
- _rPredicateValue = sTransformedText;
- delete pParseNode;
-
- bSuccess = sal_True;
- }
- }
-
- return bSuccess;
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString OPredicateInputController::getPredicateValue(
- const ::rtl::OUString& _rPredicateValue, const Reference< XPropertySet > & _rxField,
- sal_Bool _bForStatementUse, ::rtl::OUString* _pErrorMessage ) const
- {
- OSL_ENSURE( _rxField.is(), "OPredicateInputController::getPredicateValue: invalid params!" );
- ::rtl::OUString sReturn;
- if ( _rxField.is() )
- {
- ::rtl::OUString sValue( _rPredicateValue );
-
- // a little problem : if the field is a text field, the normalizePredicateString added two
- // '-characters to the text. If we would give this to predicateTree this would add
- // two additional '-characters which we don't want. So check the field format.
- // FS - 06.01.00 - 71532
- sal_Bool bValidQuotedText = ( sValue.getLength() >= 2 )
- && ( sValue.getStr()[0] == '\'' )
- && ( sValue.getStr()[ sValue.getLength() - 1 ] == '\'' );
- // again : as normalizePredicateString always did a conversion on the value text,
- // bValidQuotedText == sal_True implies that we have a text field, as no other field
- // values will be formatted with the quote characters
- if ( bValidQuotedText )
- {
- sValue = sValue.copy( 1, sValue.getLength() - 2 );
- static const ::rtl::OUString sSingleQuote( RTL_CONSTASCII_USTRINGPARAM( "'" ) );
- static const ::rtl::OUString sDoubleQuote( RTL_CONSTASCII_USTRINGPARAM( "''" ) );
-
- sal_Int32 nIndex = -1;
- sal_Int32 nTemp = 0;
- while ( -1 != ( nIndex = sValue.indexOf( sDoubleQuote,nTemp ) ) )
- {
- sValue = sValue.replaceAt( nIndex, 2, sSingleQuote );
- nTemp = nIndex+2;
- }
- }
-
- // The following is mostly stolen from the former implementation in the parameter dialog
- // (dbaccess/source/ui/dlg/paramdialog.cxx). I do not fully understand this .....
-
- ::rtl::OUString sError;
- OSQLParseNode* pParseNode = implPredicateTree( sError, sValue, _rxField );
- if ( _pErrorMessage )
- *_pErrorMessage = sError;
-
- sReturn = implParseNode(pParseNode,_bForStatementUse);
- }
-
- return sReturn;
- }
-
- ::rtl::OUString OPredicateInputController::getPredicateValue(
- const ::rtl::OUString& _sField, const ::rtl::OUString& _rPredicateValue, sal_Bool _bForStatementUse, ::rtl::OUString* _pErrorMessage ) const
- {
- ::rtl::OUString sReturn = _rPredicateValue;
- ::rtl::OUString sError;
- ::rtl::OUString sField = _sField;
- sal_Int32 nIndex = 0;
- sField = sField.getToken(0,'(',nIndex);
- if(nIndex == -1)
- sField = _sField;
- sal_Int32 nType = ::connectivity::OSQLParser::getFunctionReturnType(sField,&m_aParser.getContext());
- if ( nType == DataType::OTHER || !sField.getLength() )
- {
- // first try the international version
- ::rtl::OUString sSql;
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT * "));
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FROM x WHERE "));
- sSql += sField;
- sSql += _rPredicateValue;
- ::std::auto_ptr<OSQLParseNode> pParseNode( const_cast< OSQLParser& >( m_aParser ).parseTree( sError, sSql, sal_True ) );
- nType = DataType::DOUBLE;
- if ( pParseNode.get() )
- {
- OSQLParseNode* pColumnRef = pParseNode->getByRule(OSQLParseNode::column_ref);
- if ( pColumnRef )
- {
- }
- }
- }
-
- Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- parse::OParseColumn* pColumn = new parse::OParseColumn( sField,
- ::rtl::OUString(),
- ::rtl::OUString(),
- ::rtl::OUString(),
- ColumnValue::NULLABLE_UNKNOWN,
- 0,
- 0,
- nType,
- sal_False,
- sal_False,
- xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers());
- Reference<XPropertySet> xColumn = pColumn;
- pColumn->setFunction(sal_True);
- pColumn->setRealName(sField);
-
- OSQLParseNode* pParseNode = implPredicateTree( sError, _rPredicateValue, xColumn );
- if ( _pErrorMessage )
- *_pErrorMessage = sError;
- return pParseNode ? implParseNode(pParseNode,_bForStatementUse) : sReturn;
- }
-
- ::rtl::OUString OPredicateInputController::implParseNode(OSQLParseNode* pParseNode,sal_Bool _bForStatementUse) const
- {
- ::rtl::OUString sReturn;
- if ( pParseNode )
- {
- ::std::auto_ptr<OSQLParseNode> pTemp(pParseNode);
- OSQLParseNode* pOdbcSpec = pParseNode->getByRule( OSQLParseNode::odbc_fct_spec );
- if ( pOdbcSpec )
- {
- if ( _bForStatementUse )
- {
- OSQLParseNode* pFuncSpecParent = pOdbcSpec->getParent();
- OSL_ENSURE( pFuncSpecParent, "OPredicateInputController::getPredicateValue: an ODBC func spec node without parent?" );
- if ( pFuncSpecParent )
- pFuncSpecParent->parseNodeToStr(sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True);
- }
- else
- {
- OSQLParseNode* pValueNode = pOdbcSpec->getChild(1);
- if ( SQL_NODE_STRING == pValueNode->getNodeType() )
- sReturn = pValueNode->getTokenValue();
- else
- pValueNode->parseNodeToStr(sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True);
- }
- }
- else
- {
- if ( pParseNode->count() >= 3 )
- {
- OSQLParseNode* pValueNode = pParseNode->getChild(2);
- OSL_ENSURE( pValueNode, "OPredicateInputController::getPredicateValue: invalid node child!" );
- if ( !_bForStatementUse )
- {
- if ( SQL_NODE_STRING == pValueNode->getNodeType() )
- sReturn = pValueNode->getTokenValue();
- else
- pValueNode->parseNodeToStr(
- sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True
- );
- }
- else
- pValueNode->parseNodeToStr(
- sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True
- );
- }
- else
- OSL_FAIL( "OPredicateInputController::getPredicateValue: unknown/invalid structure (noodbc)!" );
- }
- }
- return sReturn;
- }
-//.........................................................................
-} // namespace dbtools
-//.........................................................................
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/propertyids.cxx b/connectivity/source/commontools/propertyids.cxx
deleted file mode 100644
index ed591162e9..0000000000
--- a/connectivity/source/commontools/propertyids.cxx
+++ /dev/null
@@ -1,200 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "propertyids.hxx"
-
-namespace dbtools
-{
- const sal_Char* getPROPERTY_QUERYTIMEOUT() { return "QueryTimeOut"; }
- const sal_Char* getPROPERTY_MAXFIELDSIZE() { return "MaxFieldSize"; }
- const sal_Char* getPROPERTY_MAXROWS() { return "MaxRows"; }
- const sal_Char* getPROPERTY_CURSORNAME() { return "CursorName"; }
- const sal_Char* getPROPERTY_RESULTSETCONCURRENCY() { return "ResultSetConcurrency"; }
- const sal_Char* getPROPERTY_RESULTSETTYPE() { return "ResultSetType"; }
- const sal_Char* getPROPERTY_FETCHDIRECTION() { return "FetchDirection"; }
- const sal_Char* getPROPERTY_FETCHSIZE() { return "FetchSize"; }
- const sal_Char* getPROPERTY_ESCAPEPROCESSING() { return "EscapeProcessing"; }
- const sal_Char* getPROPERTY_USEBOOKMARKS() { return "UseBookmarks"; }
-
- const sal_Char* getPROPERTY_NAME() { return "Name"; }
- const sal_Char* getPROPERTY_TYPE() { return "Type"; }
- const sal_Char* getPROPERTY_TYPENAME() { return "TypeName"; }
- const sal_Char* getPROPERTY_PRECISION() { return "Precision"; }
- const sal_Char* getPROPERTY_SCALE() { return "Scale"; }
- const sal_Char* getPROPERTY_ISNULLABLE() { return "IsNullable"; }
- const sal_Char* getPROPERTY_ISAUTOINCREMENT() { return "IsAutoIncrement"; }
- const sal_Char* getPROPERTY_ISROWVERSION() { return "IsRowVersion"; }
- const sal_Char* getPROPERTY_DESCRIPTION() { return "Description"; }
- const sal_Char* getPROPERTY_DEFAULTVALUE() { return "DefaultValue"; }
-
- const sal_Char* getPROPERTY_REFERENCEDTABLE() { return "ReferencedTable"; }
- const sal_Char* getPROPERTY_UPDATERULE() { return "UpdateRule"; }
- const sal_Char* getPROPERTY_DELETERULE() { return "DeleteRule"; }
- const sal_Char* getPROPERTY_CATALOG() { return "Catalog"; }
- const sal_Char* getPROPERTY_ISUNIQUE() { return "IsUnique"; }
- const sal_Char* getPROPERTY_ISPRIMARYKEYINDEX() { return "IsPrimaryKeyIndex"; }
- const sal_Char* getPROPERTY_ISCLUSTERED() { return "IsClustered"; }
- const sal_Char* getPROPERTY_ISASCENDING() { return "IsAscending"; }
- const sal_Char* getPROPERTY_SCHEMANAME() { return "SchemaName"; }
- const sal_Char* getPROPERTY_CATALOGNAME() { return "CatalogName"; }
- const sal_Char* getPROPERTY_COMMAND() { return "Command"; }
- const sal_Char* getPROPERTY_CHECKOPTION() { return "CheckOption"; }
- const sal_Char* getPROPERTY_PASSWORD() { return "Password"; }
- const sal_Char* getPROPERTY_RELATEDCOLUMN() { return "RelatedColumn"; }
-
- const sal_Char* getPROPERTY_FUNCTION() { return "Function"; }
- const sal_Char* getPROPERTY_AGGREGATEFUNCTION() { return "AggregateFunction"; }
- const sal_Char* getPROPERTY_TABLENAME() { return "TableName"; }
- const sal_Char* getPROPERTY_REALNAME() { return "RealName"; }
- const sal_Char* getPROPERTY_DBASEPRECISIONCHANGED() { return "DbasePrecisionChanged"; }
- const sal_Char* getPROPERTY_ISCURRENCY() { return "IsCurrency"; }
- const sal_Char* getPROPERTY_ISBOOKMARKABLE() { return "IsBookmarkable"; }
-
- const sal_Char* getPROPERTY_FORMATKEY() { return "FormatKey"; }
- const sal_Char* getPROPERTY_LOCALE() { return "Locale"; }
-
- const sal_Char* getPROPERTY_AUTOINCREMENTCREATION() { return "AutoIncrementCreation"; }
- const sal_Char* getPROPERTY_PRIVILEGES() { return "Privileges"; }
- const sal_Char* getPROPERTY_ID_HAVINGCLAUSE() { return "HavingClause"; }
- const sal_Char* getPROPERTY_ID_ISSIGNED() { return "IsSigned"; }
- const sal_Char* getPROPERTY_ID_ISSEARCHABLE() { return "IsSearchable"; }
-
- const sal_Char* getPROPERTY_ID_APPLYFILTER() { return "ApplyFilter"; }
- const sal_Char* getPROPERTY_ID_FILTER() { return "Filter"; }
- const sal_Char* getPROPERTY_ID_MASTERFIELDS() { return "MasterFields"; }
- const sal_Char* getPROPERTY_ID_DETAILFIELDS() { return "DetailFields"; }
- const sal_Char* getPROPERTY_ID_FIELDTYPE() { return "FieldType"; }
- const sal_Char* getPROPERTY_ID_VALUE() { return "Value"; }
- const sal_Char* getPROPERTY_ID_ACTIVE_CONNECTION() { return "ActiveConnection"; }
- const sal_Char* getPROPERTY_ID_LABEL() { return "Label"; }
-
- //============================================================
- //= error messages
- //============================================================
- const sal_Char* getSQLSTATE_SEQUENCE() { return "HY010"; }
- const sal_Char* getSTR_DELIMITER() { return "/"; }
-
-
-
- OPropertyMap::~OPropertyMap()
- {
- ::std::map<sal_Int32 , rtl_uString*>::iterator aIter = m_aPropertyMap.begin();
- for(;aIter != m_aPropertyMap.end();++aIter)
- if(aIter->second)
- rtl_uString_release(aIter->second);
- }
- // ------------------------------------------------------------------------------
- ::rtl::OUString OPropertyMap::getNameByIndex(sal_Int32 _nIndex) const
- {
- ::rtl::OUString sRet;
- ::std::map<sal_Int32 , rtl_uString*>::const_iterator aIter = m_aPropertyMap.find(_nIndex);
- if(aIter == m_aPropertyMap.end())
- sRet = const_cast<OPropertyMap*>(this)->fillValue(_nIndex);
- else
- sRet = aIter->second;
- return sRet;
- }
- // ------------------------------------------------------------------------------
- ::rtl::OUString OPropertyMap::fillValue(sal_Int32 _nIndex)
- {
- rtl_uString* pStr = NULL;
- switch(_nIndex)
- {
- case PROPERTY_ID_QUERYTIMEOUT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_QUERYTIMEOUT() ); break; }
- case PROPERTY_ID_MAXFIELDSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXFIELDSIZE() ); break; }
- case PROPERTY_ID_MAXROWS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXROWS() ); break; }
- case PROPERTY_ID_CURSORNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CURSORNAME() ); break; }
- case PROPERTY_ID_RESULTSETCONCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETCONCURRENCY() ); break; }
- case PROPERTY_ID_RESULTSETTYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETTYPE() ); break; }
- case PROPERTY_ID_FETCHDIRECTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHDIRECTION() ); break; }
- case PROPERTY_ID_FETCHSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHSIZE() ); break; }
- case PROPERTY_ID_ESCAPEPROCESSING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ESCAPEPROCESSING() ); break; }
- case PROPERTY_ID_USEBOOKMARKS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_USEBOOKMARKS() ); break; }
- // Column
- case PROPERTY_ID_NAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_NAME() ); break; }
- case PROPERTY_ID_TYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPE() ); break; }
- case PROPERTY_ID_TYPENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPENAME() ); break; }
- case PROPERTY_ID_PRECISION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRECISION() ); break; }
- case PROPERTY_ID_SCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCALE() ); break; }
- case PROPERTY_ID_ISNULLABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISNULLABLE() ); break; }
- case PROPERTY_ID_ISAUTOINCREMENT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISAUTOINCREMENT() ); break; }
- case PROPERTY_ID_ISROWVERSION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISROWVERSION() ); break; }
- case PROPERTY_ID_DESCRIPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DESCRIPTION() ); break; }
- case PROPERTY_ID_DEFAULTVALUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DEFAULTVALUE() ); break; }
-
- case PROPERTY_ID_REFERENCEDTABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REFERENCEDTABLE() ); break; }
- case PROPERTY_ID_UPDATERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_UPDATERULE() ); break; }
- case PROPERTY_ID_DELETERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DELETERULE() ); break; }
- case PROPERTY_ID_CATALOG: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOG() ); break; }
- case PROPERTY_ID_ISUNIQUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISUNIQUE() ); break; }
- case PROPERTY_ID_ISPRIMARYKEYINDEX: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISPRIMARYKEYINDEX() ); break; }
- case PROPERTY_ID_ISCLUSTERED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCLUSTERED() ); break; }
- case PROPERTY_ID_ISASCENDING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISASCENDING() ); break; }
- case PROPERTY_ID_SCHEMANAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCHEMANAME() ); break; }
- case PROPERTY_ID_CATALOGNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOGNAME() ); break; }
-
- case PROPERTY_ID_COMMAND: { rtl_uString_newFromAscii(&pStr,getPROPERTY_COMMAND() ); break; }
- case PROPERTY_ID_CHECKOPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CHECKOPTION() ); break; }
- case PROPERTY_ID_PASSWORD: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PASSWORD() ); break; }
- case PROPERTY_ID_RELATEDCOLUMN: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RELATEDCOLUMN() ); break; }
-
- case PROPERTY_ID_FUNCTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FUNCTION() ); break; }
- case PROPERTY_ID_AGGREGATEFUNCTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_AGGREGATEFUNCTION() ); break; }
- case PROPERTY_ID_TABLENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TABLENAME() ); break; }
- case PROPERTY_ID_REALNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REALNAME() ); break; }
- case PROPERTY_ID_DBASEPRECISIONCHANGED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DBASEPRECISIONCHANGED()); break; }
- case PROPERTY_ID_ISCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCURRENCY() ); break; }
- case PROPERTY_ID_ISBOOKMARKABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISBOOKMARKABLE() ); break; }
- case PROPERTY_ID_HY010: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_SEQUENCE() ); break; }
- case PROPERTY_ID_DELIMITER: { rtl_uString_newFromAscii(&pStr,getSTR_DELIMITER() ); break; }
- case PROPERTY_ID_FORMATKEY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FORMATKEY() ); break; }
- case PROPERTY_ID_LOCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_LOCALE() ); break; }
- case PROPERTY_ID_AUTOINCREMENTCREATION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_AUTOINCREMENTCREATION()); break; }
- case PROPERTY_ID_PRIVILEGES: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRIVILEGES() ); break; }
- case PROPERTY_ID_HAVINGCLAUSE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_HAVINGCLAUSE() ); break; }
- case PROPERTY_ID_ISSIGNED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ISSIGNED() ); break; }
- case PROPERTY_ID_ISSEARCHABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ISSEARCHABLE() ); break; }
- case PROPERTY_ID_LABEL: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_LABEL() ); break; }
- case PROPERTY_ID_APPLYFILTER: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_APPLYFILTER() ); break; }
- case PROPERTY_ID_FILTER: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_FILTER() ); break; }
- case PROPERTY_ID_MASTERFIELDS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_MASTERFIELDS() ); break; }
- case PROPERTY_ID_DETAILFIELDS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_DETAILFIELDS() ); break; }
- case PROPERTY_ID_FIELDTYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_FIELDTYPE() ); break; }
- case PROPERTY_ID_VALUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_VALUE() ); break; }
- case PROPERTY_ID_ACTIVE_CONNECTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ACTIVE_CONNECTION() ); break; }
- }
- m_aPropertyMap[_nIndex] = pStr;
- return pStr;
- }
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/sqlerror.cxx b/connectivity/source/commontools/sqlerror.cxx
deleted file mode 100644
index 11cf19a823..0000000000
--- a/connectivity/source/commontools/sqlerror.cxx
+++ /dev/null
@@ -1,366 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "connectivity/sqlerror.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/sdbc/SQLException.hpp>
-/** === end UNO includes === **/
-
-#include <comphelper/officeresourcebundle.hxx>
-#include <cppuhelper/exc_hlp.hxx>
-#include <rtl/ustrbuf.hxx>
-
-#include <string.h>
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- /** === begin UNO using === **/
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::UNO_QUERY;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
- using ::com::sun::star::uno::Exception;
- using ::com::sun::star::uno::RuntimeException;
- using ::com::sun::star::uno::Any;
- using ::com::sun::star::uno::makeAny;
- using ::com::sun::star::uno::XInterface;
- using ::com::sun::star::sdbc::SQLException;
- using ::com::sun::star::uno::Type;
- /** === end UNO using === **/
-
- //using SQLError::ParamValue; // GCC (unxlngi6) does not like this
- namespace
- {
- typedef SQLError::ParamValue ParamValue;
- }
-
- //====================================================================
- //= SQLError_Impl - declaration
- //====================================================================
- class SQLError_Impl
- {
- public:
- SQLError_Impl( const ::comphelper::ComponentContext& _rContext );
- ~SQLError_Impl();
-
- // versions of the public SQLError methods which are just delegated to this impl-class
- static const ::rtl::OUString& getMessagePrefix();
- ::rtl::OUString getErrorMessage( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 );
- ::rtl::OUString getSQLState( const ErrorCondition _eCondition );
- static ErrorCode getErrorCode( const ErrorCondition _eCondition );
- void raiseException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 );
- void raiseException( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 );
- void raiseTypedException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, const Type& _rExceptionType, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 );
- SQLException getSQLException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 );
-
- private:
- /// returns the basic error message associated with the given error condition, without any parameter replacements
- ::rtl::OUString
- impl_getErrorMessage( const ErrorCondition& _eCondition );
-
- /// returns the SQLState associated with the given error condition
- ::rtl::OUString
- impl_getSQLState( const ErrorCondition& _eCondition );
-
- /// returns an SQLException describing the given error condition
- SQLException
- impl_buildSQLException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext,
- const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 );
-
- /// initializes our resource bundle
- bool impl_initResources();
-
- private:
- ::osl::Mutex m_aMutex;
- ::comphelper::ComponentContext m_aContext;
- ::std::auto_ptr< ::comphelper::OfficeResourceBundle > m_pResources;
- bool m_bAttemptedInit;
- };
-
- //====================================================================
- //= SQLError_Impl - implementation
- //====================================================================
- //--------------------------------------------------------------------
- SQLError_Impl::SQLError_Impl( const ::comphelper::ComponentContext& _rContext )
- :m_aContext( _rContext )
- ,m_pResources( )
- ,m_bAttemptedInit( false )
- {
- }
-
- //--------------------------------------------------------------------
- SQLError_Impl::~SQLError_Impl()
- {
- }
-
- //--------------------------------------------------------------------
- const ::rtl::OUString& SQLError_Impl::getMessagePrefix()
- {
- static ::rtl::OUString s_sMessagePrefix( RTL_CONSTASCII_USTRINGPARAM( "[OOoBase]" ) );
- return s_sMessagePrefix;
- }
-
- //--------------------------------------------------------------------
- namespace
- {
- //................................................................
- /** substitutes a given placeholder in the given message with the given value
- */
- void lcl_substitutePlaceholder( ::rtl::OUString& _rMessage, const sal_Char* _pPlaceholder, ParamValue _rParamValue )
- {
- size_t nPlaceholderLen( strlen( _pPlaceholder ) );
- sal_Int32 nIndex = _rMessage.indexOfAsciiL( _pPlaceholder, nPlaceholderLen );
-
- bool bHasPlaceholder = ( nIndex != -1 );
- bool bWantsPlaceholder = _rParamValue.is();
- OSL_ENSURE( bHasPlaceholder == bWantsPlaceholder, "lcl_substitutePlaceholder: placeholder where none is expected, or no placeholder where one is needed!" );
-
- if ( bHasPlaceholder && bWantsPlaceholder )
- _rMessage = _rMessage.replaceAt( nIndex, nPlaceholderLen, *_rParamValue );
- }
-
- //................................................................
- sal_Int32 lcl_getResourceID( const ErrorCondition _eCondition, bool _bSQLState )
- {
- return 256
- + 2 * ::sal::static_int_cast< sal_Int32, ErrorCondition >( _eCondition )
- + ( _bSQLState ? 1 : 0 );
- }
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString SQLError_Impl::getErrorMessage( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 )
- {
- ::rtl::OUString sErrorMessage( impl_getErrorMessage( _eCondition ) );
-
- lcl_substitutePlaceholder( sErrorMessage, "$1$", _rParamValue1 );
- lcl_substitutePlaceholder( sErrorMessage, "$2$", _rParamValue2 );
- lcl_substitutePlaceholder( sErrorMessage, "$3$", _rParamValue3 );
-
- return sErrorMessage;
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString SQLError_Impl::getSQLState( const ErrorCondition _eCondition )
- {
- return impl_getSQLState( _eCondition );
- }
-
- //--------------------------------------------------------------------
- ErrorCode SQLError_Impl::getErrorCode( const ErrorCondition _eCondition )
- {
- return 0 - ::sal::static_int_cast< ErrorCode, ErrorCondition >( _eCondition );
- }
-
- //--------------------------------------------------------------------
- void SQLError_Impl::raiseException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 )
- {
- raiseTypedException(
- _eCondition,
- _rxContext,
- ::cppu::UnoType< SQLException >::get(),
- _rParamValue1,
- _rParamValue2,
- _rParamValue3
- );
- }
-
- //--------------------------------------------------------------------
- void SQLError_Impl::raiseException( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 )
- {
- raiseTypedException(
- _eCondition,
- NULL,
- ::cppu::UnoType< SQLException >::get(),
- _rParamValue1,
- _rParamValue2,
- _rParamValue3
- );
- }
-
- //--------------------------------------------------------------------
- void SQLError_Impl::raiseTypedException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext,
- const Type& _rExceptionType, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 )
- {
- if ( !::cppu::UnoType< SQLException >::get().isAssignableFrom( _rExceptionType ) )
- throw ::std::bad_cast();
-
- // default-construct an exception of the desired type
- Any aException( NULL, _rExceptionType );
-
- // fill it
- SQLException* pException = static_cast< SQLException* >( aException.pData );
- *pException = impl_buildSQLException( _eCondition, _rxContext, _rParamValue1, _rParamValue2, _rParamValue3 );
-
- // throw it
- ::cppu::throwException( aException );
- }
-
- //--------------------------------------------------------------------
- SQLException SQLError_Impl::getSQLException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext,
- const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 )
- {
- return impl_buildSQLException( _eCondition, _rxContext, _rParamValue1, _rParamValue2, _rParamValue3 );
- }
-
- //--------------------------------------------------------------------
- SQLException SQLError_Impl::impl_buildSQLException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext,
- const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 )
- {
- return SQLException(
- getErrorMessage( _eCondition, _rParamValue1, _rParamValue2, _rParamValue3 ),
- _rxContext,
- getSQLState( _eCondition ),
- getErrorCode( _eCondition ),
- Any()
- );
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString SQLError_Impl::impl_getErrorMessage( const ErrorCondition& _eCondition )
- {
- ::rtl::OUStringBuffer aMessage;
-
- if ( impl_initResources() )
- {
- ::rtl::OUString sResMessage( m_pResources->loadString( lcl_getResourceID( _eCondition, false ) ) );
- OSL_ENSURE( sResMessage.getLength(), "SQLError_Impl::impl_getErrorMessage: illegal error condition, or invalid resource!" );
- aMessage.append( getMessagePrefix() ).appendAscii( " " ).append( sResMessage );
- }
-
- return aMessage.makeStringAndClear();
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString SQLError_Impl::impl_getSQLState( const ErrorCondition& _eCondition )
- {
- ::rtl::OUString sState;
-
- if ( impl_initResources() )
- {
- sal_Int32 nResourceId( lcl_getResourceID( _eCondition, true ) );
- if ( m_pResources->hasString( nResourceId ) )
- sState = m_pResources->loadString( nResourceId );
- }
-
- if ( !sState.getLength() )
- sState = ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "S1000" ) );
-
- return sState;
- }
-
- //--------------------------------------------------------------------
- bool SQLError_Impl::impl_initResources()
- {
- if ( m_pResources.get() )
- return true;
- if ( m_bAttemptedInit )
- return false;
-
- ::osl::MutexGuard aGuard( m_aMutex );
- m_bAttemptedInit = true;
-
- m_pResources.reset( new ::comphelper::OfficeResourceBundle( m_aContext.getUNOContext(), "sdberr" ) );
- return m_pResources.get() != NULL;
- }
-
- //====================================================================
- //= SQLError
- //====================================================================
- //--------------------------------------------------------------------
- SQLError::SQLError( const ::comphelper::ComponentContext& _rContext )
- :m_pImpl( new SQLError_Impl( _rContext ) )
- {
- }
-
- //--------------------------------------------------------------------
- SQLError::~SQLError()
- {
- }
-
- //--------------------------------------------------------------------
- const ::rtl::OUString& SQLError::getMessagePrefix()
- {
- return SQLError_Impl::getMessagePrefix();
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString SQLError::getErrorMessage( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) const
- {
- return m_pImpl->getErrorMessage( _eCondition, _rParamValue1, _rParamValue2, _rParamValue3 );
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString SQLError::getSQLState( const ErrorCondition _eCondition ) const
- {
- return m_pImpl->getSQLState( _eCondition );
- }
-
- //--------------------------------------------------------------------
- ErrorCode SQLError::getErrorCode( const ErrorCondition _eCondition )
- {
- return SQLError_Impl::getErrorCode( _eCondition );
- }
-
- //--------------------------------------------------------------------
- void SQLError::raiseException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) const
- {
- m_pImpl->raiseException( _eCondition, _rxContext, _rParamValue1, _rParamValue2, _rParamValue3 );
- }
-
- //--------------------------------------------------------------------
- void SQLError::raiseException( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) const
- {
- m_pImpl->raiseException( _eCondition, _rParamValue1, _rParamValue2, _rParamValue3 );
- }
-
- //--------------------------------------------------------------------
- void SQLError::raiseTypedException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext,
- const Type& _rExceptionType, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) const
- {
- m_pImpl->raiseTypedException( _eCondition, _rxContext, _rExceptionType, _rParamValue1, _rParamValue2, _rParamValue3 );
- }
-
- //--------------------------------------------------------------------
- SQLException SQLError::getSQLException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext,
- const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 ) const
- {
- return m_pImpl->getSQLException( _eCondition, _rxContext, _rParamValue1, _rParamValue2, _rParamValue3 );
- }
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/statementcomposer.cxx b/connectivity/source/commontools/statementcomposer.cxx
deleted file mode 100644
index 355e68858b..0000000000
--- a/connectivity/source/commontools/statementcomposer.cxx
+++ /dev/null
@@ -1,318 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <connectivity/statementcomposer.hxx>
-
-#include <connectivity/dbtools.hxx>
-
-/** === begin UNO includes === **/
-#include <com/sun/star/sdb/CommandType.hpp>
-#include <com/sun/star/lang/NullPointerException.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/sdb/XQueriesSupplier.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-/** === end UNO includes === **/
-
-#include <unotools/sharedunocomponent.hxx>
-#include <tools/diagnose_ex.h>
-#include <comphelper/property.hxx>
-
-//........................................................................
-namespace dbtools
-{
-//........................................................................
-
- /** === begin UNO using === **/
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::sdbc::XConnection;
- using ::com::sun::star::sdb::XSingleSelectQueryComposer;
- using ::com::sun::star::lang::NullPointerException;
- using ::com::sun::star::uno::Exception;
- using ::com::sun::star::lang::XComponent;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
- using ::com::sun::star::sdb::XQueriesSupplier;
- using ::com::sun::star::container::XNameAccess;
- using ::com::sun::star::uno::UNO_QUERY;
- using ::com::sun::star::beans::XPropertySet;
- using ::com::sun::star::lang::XMultiServiceFactory;
- using ::com::sun::star::sdbc::SQLException;
- /** === end UNO using === **/
- namespace CommandType = ::com::sun::star::sdb::CommandType;
-
- //====================================================================
- //= StatementComposer_Data
- //====================================================================
- struct StatementComposer_Data
- {
- const Reference< XConnection > xConnection;
- Reference< XSingleSelectQueryComposer > xComposer;
- ::rtl::OUString sCommand;
- ::rtl::OUString sFilter;
- ::rtl::OUString sOrder;
- sal_Int32 nCommandType;
- sal_Bool bEscapeProcessing;
- bool bComposerDirty;
- bool bDisposeComposer;
-
- StatementComposer_Data( const Reference< XConnection >& _rxConnection )
- :xConnection( _rxConnection )
- ,sCommand()
- ,sFilter()
- ,sOrder()
- ,nCommandType( CommandType::COMMAND )
- ,bEscapeProcessing( sal_True )
- ,bComposerDirty( true )
- ,bDisposeComposer( true )
- {
- if ( !_rxConnection.is() )
- throw NullPointerException();
- }
- };
-
- //--------------------------------------------------------------------
- namespace
- {
- //----------------------------------------------------------------
- void lcl_resetComposer( StatementComposer_Data& _rData )
- {
- if ( _rData.bDisposeComposer && _rData.xComposer.is() )
- {
- try
- {
- Reference< XComponent > xComposerComponent( _rData.xComposer, UNO_QUERY_THROW );
- xComposerComponent->dispose();
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
- _rData.xComposer.clear();
- }
-
- //----------------------------------------------------------------
- bool lcl_ensureUpToDateComposer_nothrow( StatementComposer_Data& _rData )
- {
- if ( !_rData.bComposerDirty )
- return _rData.xComposer.is();
- lcl_resetComposer( _rData );
-
- try
- {
- ::rtl::OUString sStatement;
- switch ( _rData.nCommandType )
- {
- case CommandType::COMMAND:
- if ( _rData.bEscapeProcessing )
- sStatement = _rData.sCommand;
- // (in case of no escape processing we assume a not parseable statement)
- break;
-
- case CommandType::TABLE:
- {
- if ( !_rData.sCommand.getLength() )
- break;
-
- sStatement = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SELECT * FROM " ) );
-
- ::rtl::OUString sCatalog, sSchema, sTable;
- qualifiedNameComponents( _rData.xConnection->getMetaData(), _rData.sCommand, sCatalog, sSchema, sTable, eInDataManipulation );
-
- sStatement += composeTableNameForSelect( _rData.xConnection, sCatalog, sSchema, sTable );
- }
- break;
-
- case CommandType::QUERY:
- {
- // ask the connection for the query
- Reference< XQueriesSupplier > xSupplyQueries( _rData.xConnection, UNO_QUERY_THROW );
- Reference< XNameAccess > xQueries( xSupplyQueries->getQueries(), UNO_QUERY_THROW );
-
- if ( !xQueries->hasByName( _rData.sCommand ) )
- break;
-
- Reference< XPropertySet > xQuery( xQueries->getByName( _rData.sCommand ), UNO_QUERY_THROW );
-
- // a native query ?
- sal_Bool bQueryEscapeProcessing = sal_False;
- xQuery->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EscapeProcessing" ) ) ) >>= bQueryEscapeProcessing;
- if ( !bQueryEscapeProcessing )
- break;
-
- // the command used by the query
- xQuery->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Command" ) ) ) >>= sStatement;
- if ( !sStatement.getLength() )
- break;
-
- // use a composer to build a statement from the query filter/order props
- Reference< XMultiServiceFactory > xFactory( _rData.xConnection, UNO_QUERY_THROW );
- ::utl::SharedUNOComponent< XSingleSelectQueryComposer > xComposer;
- xComposer.set(
- xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.SingleSelectQueryComposer" ) ) ),
- UNO_QUERY_THROW
- );
-
- // the "basic" statement
- xComposer->setElementaryQuery( sStatement );
-
- // the sort order
- const ::rtl::OUString sPropOrder( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Order" ) ) );
- if ( ::comphelper::hasProperty( sPropOrder, xQuery ) )
- {
- ::rtl::OUString sOrder;
- OSL_VERIFY( xQuery->getPropertyValue( sPropOrder ) >>= sOrder );
- xComposer->setOrder( sOrder );
- }
-
- // the filter
- sal_Bool bApplyFilter = sal_True;
- const ::rtl::OUString sPropApply( RTL_CONSTASCII_USTRINGPARAM( "ApplyFilter" ));
- if ( ::comphelper::hasProperty( sPropApply, xQuery ) )
- {
- OSL_VERIFY( xQuery->getPropertyValue( sPropApply ) >>= bApplyFilter );
- }
-
- if ( bApplyFilter )
- {
- ::rtl::OUString sFilter;
- OSL_VERIFY( xQuery->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Filter" ) ) ) >>= sFilter );
- xComposer->setFilter( sFilter );
- }
-
- // the composed statement
- sStatement = xComposer->getQuery();
- }
- break;
-
- default:
- OSL_FAIL("lcl_ensureUpToDateComposer_nothrow: no table, no query, no statement - what else ?!");
- break;
- }
-
- if ( sStatement.getLength() )
- {
- // create an composer
- Reference< XMultiServiceFactory > xFactory( _rData.xConnection, UNO_QUERY_THROW );
- Reference< XSingleSelectQueryComposer > xComposer( xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.SingleSelectQueryComposer" ) ) ),
- UNO_QUERY_THROW );
- xComposer->setElementaryQuery( sStatement );
-
- // append sort/filter
- xComposer->setOrder( _rData.sOrder );
- xComposer->setFilter( _rData.sFilter );
-
- sStatement = xComposer->getQuery();
-
- _rData.xComposer = xComposer;
- _rData.bComposerDirty = false;
- }
- }
- catch( const SQLException& )
- {
- // allowed to leave here
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- return _rData.xComposer.is();
- }
- }
-
- //====================================================================
- //= StatementComposer
- //====================================================================
- //--------------------------------------------------------------------
- StatementComposer::StatementComposer( const Reference< XConnection >& _rxConnection,
- const ::rtl::OUString& _rCommand, const sal_Int32 _nCommandType, const sal_Bool _bEscapeProcessing )
- :m_pData( new StatementComposer_Data( _rxConnection ) )
- {
- OSL_PRECOND( _rxConnection.is(), "StatementComposer::StatementComposer: illegal connection!" );
- m_pData->sCommand = _rCommand;
- m_pData->nCommandType = _nCommandType;
- m_pData->bEscapeProcessing = _bEscapeProcessing;
- }
-
- //--------------------------------------------------------------------
- StatementComposer::~StatementComposer()
- {
- lcl_resetComposer( *m_pData );
- }
-
- //--------------------------------------------------------------------
- void StatementComposer::setDisposeComposer( bool _bDoDispose )
- {
- m_pData->bDisposeComposer = _bDoDispose;
- }
-
- //--------------------------------------------------------------------
- bool StatementComposer::getDisposeComposer() const
- {
- return m_pData->bDisposeComposer;
- }
-
- //--------------------------------------------------------------------
- void StatementComposer::setFilter( const ::rtl::OUString& _rFilter )
- {
- m_pData->sFilter = _rFilter;
- m_pData->bComposerDirty = true;
- }
-
- //--------------------------------------------------------------------
- void StatementComposer::setOrder( const ::rtl::OUString& _rOrder )
- {
- m_pData->sOrder = _rOrder;
- m_pData->bComposerDirty = true;
- }
-
- //--------------------------------------------------------------------
- Reference< XSingleSelectQueryComposer > StatementComposer::getComposer()
- {
- lcl_ensureUpToDateComposer_nothrow( *m_pData );
- return m_pData->xComposer;
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString StatementComposer::getQuery()
- {
- if ( lcl_ensureUpToDateComposer_nothrow( *m_pData ) )
- {
- return m_pData->xComposer->getQuery();
- }
-
- return ::rtl::OUString();
- }
-
-//........................................................................
-} // namespace dbtools
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/warningscontainer.cxx b/connectivity/source/commontools/warningscontainer.cxx
deleted file mode 100644
index 407f08596d..0000000000
--- a/connectivity/source/commontools/warningscontainer.cxx
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "connectivity/warningscontainer.hxx"
-#include "connectivity/dbexception.hxx"
-
-#include <osl/diagnose.h>
-
-//........................................................................
-namespace dbtools
-{
-//........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::sdb;
-
- //====================================================================
- //= WarningsContainer
- //====================================================================
- //--------------------------------------------------------------------
- static void lcl_concatWarnings( Any& _rChainLeft, const Any& _rChainRight )
- {
- if ( !_rChainLeft.hasValue() )
- _rChainLeft = _rChainRight;
- else
- {
- // to travel the chain by reference (and not by value), we need the getValue ...
- // looks like a hack, but the meaning of getValue is documented, and it's the only chance for reference-traveling ....
-
- OSL_ENSURE( SQLExceptionInfo( _rChainLeft ).isValid(),
- "lcl_concatWarnings: invalid warnings chain (this will crash)!" );
-
- const SQLException* pChainTravel = static_cast< const SQLException* >( _rChainLeft.getValue() );
- SQLExceptionIteratorHelper aReferenceIterHelper( *pChainTravel );
- while ( aReferenceIterHelper.hasMoreElements() )
- pChainTravel = aReferenceIterHelper.next();
-
- // reached the end of the chain, and pChainTravel points to the last element
- const_cast< SQLException* >( pChainTravel )->NextException = _rChainRight;
- }
- }
-
- //--------------------------------------------------------------------
- WarningsContainer::~WarningsContainer()
- {
- }
-
- //--------------------------------------------------------------------
- void WarningsContainer::appendWarning(const SQLException& _rWarning)
- {
- lcl_concatWarnings( m_aOwnWarnings, makeAny( _rWarning ) );
- }
-
- //--------------------------------------------------------------------
- void WarningsContainer::appendWarning( const SQLContext& _rContext )
- {
- lcl_concatWarnings( m_aOwnWarnings, makeAny( _rContext ));
- }
-
- //--------------------------------------------------------------------
- void WarningsContainer::appendWarning(const SQLWarning& _rWarning)
- {
- lcl_concatWarnings( m_aOwnWarnings, makeAny( _rWarning ) );
- }
-
- //--------------------------------------------------------------------
- Any SAL_CALL WarningsContainer::getWarnings( ) const
- {
- Any aAllWarnings;
- if ( m_xExternalWarnings.is() )
- aAllWarnings = m_xExternalWarnings->getWarnings();
-
- if ( m_aOwnWarnings.hasValue() )
- lcl_concatWarnings( aAllWarnings, m_aOwnWarnings );
-
- return aAllWarnings;
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL WarningsContainer::clearWarnings( )
- {
- if ( m_xExternalWarnings.is() )
- m_xExternalWarnings->clearWarnings();
- m_aOwnWarnings.clear();
- }
-
- //--------------------------------------------------------------------
- void WarningsContainer::appendWarning( const ::rtl::OUString& _rWarning, const sal_Char* _pAsciiSQLState, const Reference< XInterface >& _rxContext )
- {
- appendWarning( SQLWarning( _rWarning, _rxContext, ::rtl::OUString::createFromAscii( _pAsciiSQLState ), 0, Any() ) );
- }
-
-//........................................................................
-} // namespace dbtools
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/cpool/ZConnectionPool.cxx b/connectivity/source/cpool/ZConnectionPool.cxx
deleted file mode 100644
index a1836f2388..0000000000
--- a/connectivity/source/cpool/ZConnectionPool.cxx
+++ /dev/null
@@ -1,335 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include "ZConnectionPool.hxx"
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/container/ElementExistException.hpp>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include <com/sun/star/lang/XComponent.hpp>
-#include "ZPooledConnection.hxx"
-#include "ZPoolCollection.hxx"
-#include "connectivity/ConnectionWrapper.hxx"
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include "connectivity/ConnectionWrapper.hxx"
-
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::osl;
-using namespace connectivity;
-
-#include <algorithm>
-
-//==========================================================================
-//= OPoolTimer
-//==========================================================================
-void SAL_CALL OPoolTimer::onShot()
-{
- m_pPool->invalidatePooledConnections();
-}
-namespace
-{
- //--------------------------------------------------------------------
- static const ::rtl::OUString& getTimeoutNodeName()
- {
- static ::rtl::OUString s_sNodeName( RTL_CONSTASCII_USTRINGPARAM( "Timeout" ));
- return s_sNodeName;
- }
-
-}
-//==========================================================================
-//= OConnectionPool
-//==========================================================================
-//--------------------------------------------------------------------------
-OConnectionPool::OConnectionPool(const Reference< XDriver >& _xDriver,
- const Reference< XInterface >& _xDriverNode,
- const Reference< ::com::sun::star::reflection::XProxyFactory >& _rxProxyFactory)
- :m_xDriver(_xDriver)
- ,m_xDriverNode(_xDriverNode)
- ,m_xProxyFactory(_rxProxyFactory)
- ,m_nTimeOut(10)
- ,m_nALiveCount(10)
-{
- OSL_ENSURE(m_xDriverNode.is(),"NO valid Driver node set!");
- Reference< XComponent > xComponent(m_xDriverNode, UNO_QUERY);
- if (xComponent.is())
- xComponent->addEventListener(this);
-
- Reference<XPropertySet> xProp(m_xDriverNode,UNO_QUERY);
- if(xProp.is())
- xProp->addPropertyChangeListener(getTimeoutNodeName(),this);
-
- OPoolCollection::getNodeValue(getTimeoutNodeName(),m_xDriverNode) >>= m_nALiveCount;
- calculateTimeOuts();
-
- m_xInvalidator = new OPoolTimer(this,::salhelper::TTimeValue(m_nTimeOut,0));
- m_xInvalidator->start();
-}
-// -----------------------------------------------------------------------------
-OConnectionPool::~OConnectionPool()
-{
- clear(sal_False);
-}
-// -----------------------------------------------------------------------------
-struct TRemoveEventListenerFunctor : ::std::unary_function<TPooledConnections::value_type,void>
- ,::std::unary_function<TActiveConnectionMap::value_type,void>
-{
- OConnectionPool* m_pConnectionPool;
- sal_Bool m_bDispose;
-
- TRemoveEventListenerFunctor(OConnectionPool* _pConnectionPool,sal_Bool _bDispose = sal_False)
- : m_pConnectionPool(_pConnectionPool)
- ,m_bDispose(_bDispose)
- {
- OSL_ENSURE(m_pConnectionPool,"No connection pool!");
- }
- // -----------------------------------------------------------------------------
- void dispose(const Reference<XInterface>& _xComponent)
- {
- Reference< XComponent > xComponent(_xComponent, UNO_QUERY);
-
- if ( xComponent.is() )
- {
- xComponent->removeEventListener(m_pConnectionPool);
- if ( m_bDispose )
- xComponent->dispose();
- }
- }
- // -----------------------------------------------------------------------------
- void operator()(const TPooledConnections::value_type& _aValue)
- {
- dispose(_aValue);
- }
- // -----------------------------------------------------------------------------
- void operator()(const TActiveConnectionMap::value_type& _aValue)
- {
- dispose(_aValue.first);
- }
-};
-// -----------------------------------------------------------------------------
-struct TConnectionPoolFunctor : ::std::unary_function<TConnectionMap::value_type,void>
-{
- OConnectionPool* m_pConnectionPool;
-
- TConnectionPoolFunctor(OConnectionPool* _pConnectionPool)
- : m_pConnectionPool(_pConnectionPool)
- {
- OSL_ENSURE(m_pConnectionPool,"No connection pool!");
- }
- void operator()(const TConnectionMap::value_type& _aValue)
- {
- ::std::for_each(_aValue.second.aConnections.begin(),_aValue.second.aConnections.end(),TRemoveEventListenerFunctor(m_pConnectionPool,sal_True));
- }
-};
-// -----------------------------------------------------------------------------
-void OConnectionPool::clear(sal_Bool _bDispose)
-{
- MutexGuard aGuard(m_aMutex);
-
- if(m_xInvalidator->isTicking())
- m_xInvalidator->stop();
-
- ::std::for_each(m_aPool.begin(),m_aPool.end(),TConnectionPoolFunctor(this));
- m_aPool.clear();
-
- ::std::for_each(m_aActiveConnections.begin(),m_aActiveConnections.end(),TRemoveEventListenerFunctor(this,_bDispose));
- m_aActiveConnections.clear();
-
- Reference< XComponent > xComponent(m_xDriverNode, UNO_QUERY);
- if (xComponent.is())
- xComponent->removeEventListener(this);
- Reference< XPropertySet > xProp(m_xDriverNode, UNO_QUERY);
- if (xProp.is())
- xProp->removePropertyChangeListener(getTimeoutNodeName(),this);
-
-m_xDriverNode.clear();
-m_xDriver.clear();
-}
-//--------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL OConnectionPool::getConnectionWithInfo( const ::rtl::OUString& _rURL, const Sequence< PropertyValue >& _rInfo ) throw(SQLException, RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
-
- Reference<XConnection> xConnection;
-
- // create a unique id and look for it in our map
- Sequence< PropertyValue > aInfo(_rInfo);
- TConnectionMap::key_type nId;
- OConnectionWrapper::createUniqueId(_rURL,aInfo,nId.m_pBuffer);
- TConnectionMap::iterator aIter = m_aPool.find(nId);
-
- if ( m_aPool.end() != aIter )
- xConnection = getPooledConnection(aIter);
-
- if ( !xConnection.is() )
- xConnection = createNewConnection(_rURL,_rInfo);
-
- return xConnection;
-}
-//--------------------------------------------------------------------------
-void SAL_CALL OConnectionPool::disposing( const ::com::sun::star::lang::EventObject& Source ) throw (RuntimeException)
-{
- Reference<XConnection> xConnection(Source.Source,UNO_QUERY);
- if(xConnection.is())
- {
- MutexGuard aGuard(m_aMutex);
- TActiveConnectionMap::iterator aIter = m_aActiveConnections.find(xConnection);
- OSL_ENSURE(aIter != m_aActiveConnections.end(),"OConnectionPool::disposing: Conenction wasn't in pool");
- if(aIter != m_aActiveConnections.end())
- { // move the pooled connection back to the pool
- aIter->second.aPos->second.nALiveCount = m_nALiveCount;
- aIter->second.aPos->second.aConnections.push_back(aIter->second.xPooledConnection);
- m_aActiveConnections.erase(aIter);
- }
- }
- else
- {
- m_xDriverNode.clear();
- }
-}
-// -----------------------------------------------------------------------------
-Reference< XConnection> OConnectionPool::createNewConnection(const ::rtl::OUString& _rURL,const Sequence< PropertyValue >& _rInfo)
-{
- // create new pooled conenction
- Reference< XPooledConnection > xPooledConnection = new ::connectivity::OPooledConnection(m_xDriver->connect(_rURL,_rInfo),m_xProxyFactory);
- // get the new connection from the pooled connection
- Reference<XConnection> xConnection = xPooledConnection->getConnection();
- if(xConnection.is())
- {
- // add our own as dispose listener to know when we should put the connection back to the pool
- Reference< XComponent > xComponent(xConnection, UNO_QUERY);
- if (xComponent.is())
- xComponent->addEventListener(this);
-
- // save some information to find the right pool later on
- Sequence< PropertyValue > aInfo(_rInfo);
- TConnectionMap::key_type nId;
- OConnectionWrapper::createUniqueId(_rURL,aInfo,nId.m_pBuffer);
- TConnectionPool aPack;
-
- // insert the new connection and struct into the active connection map
- aPack.nALiveCount = m_nALiveCount;
- TActiveConnectionInfo aActiveInfo;
- aActiveInfo.aPos = m_aPool.insert(TConnectionMap::value_type(nId,aPack)).first;
- aActiveInfo.xPooledConnection = xPooledConnection;
- m_aActiveConnections.insert(TActiveConnectionMap::value_type(xConnection,aActiveInfo));
-
- if(m_xInvalidator->isExpired())
- m_xInvalidator->start();
- }
-
- return xConnection;
-}
-// -----------------------------------------------------------------------------
-void OConnectionPool::invalidatePooledConnections()
-{
- MutexGuard aGuard(m_aMutex);
- TConnectionMap::iterator aIter = m_aPool.begin();
- for (; aIter != m_aPool.end(); )
- {
- if(!(--(aIter->second.nALiveCount))) // connections are invalid
- {
- ::std::for_each(aIter->second.aConnections.begin(),aIter->second.aConnections.end(),TRemoveEventListenerFunctor(this,sal_True));
-
- aIter->second.aConnections.clear();
-
- // look if the iterator aIter is still present in the active connection map
- TActiveConnectionMap::iterator aActIter = m_aActiveConnections.begin();
- for (; aActIter != m_aActiveConnections.end(); ++aActIter)
- {
- if(aIter == aActIter->second.aPos)
- break;
- }
- if(aActIter == m_aActiveConnections.end())
- {// he isn't so we can delete him
- TConnectionMap::iterator aDeleteIter = aIter;
- ++aIter;
- m_aPool.erase(aDeleteIter);
- }
- else
- ++aIter;
- }
- else
- ++aIter;
- }
- if(!m_aPool.empty())
- m_xInvalidator->start();
-}
-// -----------------------------------------------------------------------------
-Reference< XConnection> OConnectionPool::getPooledConnection(TConnectionMap::iterator& _rIter)
-{
- Reference<XConnection> xConnection;
-
- if(!_rIter->second.aConnections.empty())
- {
- Reference< XPooledConnection > xPooledConnection = _rIter->second.aConnections.back();
- _rIter->second.aConnections.pop_back();
-
- OSL_ENSURE(xPooledConnection.is(),"Can not be null here!");
- xConnection = xPooledConnection->getConnection();
- Reference< XComponent > xComponent(xConnection, UNO_QUERY);
- if (xComponent.is())
- xComponent->addEventListener(this);
-
- TActiveConnectionInfo aActiveInfo;
- aActiveInfo.aPos = _rIter;
- aActiveInfo.xPooledConnection = xPooledConnection;
- m_aActiveConnections[xConnection] = aActiveInfo;
- }
- return xConnection;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OConnectionPool::propertyChange( const PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException)
-{
- if(getTimeoutNodeName() == evt.PropertyName)
- {
- evt.NewValue >>= m_nALiveCount;
- calculateTimeOuts();
- }
-}
-// -----------------------------------------------------------------------------
-void OConnectionPool::calculateTimeOuts()
-{
- sal_Int32 nTimeOutCorrection = 10;
- if(m_nALiveCount < 100)
- nTimeOutCorrection = 20;
-
- m_nTimeOut = m_nALiveCount / nTimeOutCorrection;
- m_nALiveCount = m_nALiveCount / m_nTimeOut;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/cpool/ZConnectionPool.hxx b/connectivity/source/cpool/ZConnectionPool.hxx
deleted file mode 100644
index fc608ea143..0000000000
--- a/connectivity/source/cpool/ZConnectionPool.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ZCONNECTIONPOOL_HXX_
-#define _CONNECTIVITY_ZCONNECTIONPOOL_HXX_
-
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/sdbc/XPooledConnection.hpp>
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/beans/XPropertyChangeListener.hpp>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
-#include <cppuhelper/weakref.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <comphelper/stl_types.hxx>
-#include <osl/mutex.hxx>
-#include <salhelper/timer.hxx>
-#include <rtl/ref.hxx>
-#include <rtl/digest.h>
-
-namespace connectivity
-{
- class OConnectionPool;
- //==========================================================================
- /// OPoolTimer - Invalidates the connection pool
- //==========================================================================
- class OPoolTimer : public ::salhelper::Timer
- {
- OConnectionPool* m_pPool;
- public:
- OPoolTimer(OConnectionPool* _pPool,const ::salhelper::TTimeValue& _Time)
- : ::salhelper::Timer(_Time)
- ,m_pPool(_pPool)
- {}
- protected:
- virtual void SAL_CALL onShot();
- };
-
- //==========================================================================
- //= OConnectionPool - the one-instance service for PooledConnections
- //= manages the active connections and the connections in the pool
- //==========================================================================
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::beans::XPropertyChangeListener> OConnectionPool_Base;
-
- // typedef for the interanl structure
- typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPooledConnection> > TPooledConnections;
-
- // contains the currently pooled connections
- typedef struct
- {
- TPooledConnections aConnections;
- sal_Int32 nALiveCount; // will be decremented everytime a time says to, when will reach zero the pool will be deleted
- } TConnectionPool;
-
- struct TDigestHolder
- {
- sal_uInt8 m_pBuffer[RTL_DIGEST_LENGTH_SHA1];
- TDigestHolder()
- {
- m_pBuffer[0] = 0;
- }
-
- };
-
- // typedef TDigestHolder
-
- struct TDigestLess : public ::std::binary_function< TDigestHolder, TDigestHolder, bool>
- {
- bool operator() (const TDigestHolder& x, const TDigestHolder& y) const
- {
- sal_uInt32 i;
- for(i=0;i < RTL_DIGEST_LENGTH_SHA1 && (x.m_pBuffer[i] >= y.m_pBuffer[i]); ++i)
- ;
- return i < RTL_DIGEST_LENGTH_SHA1;
- }
- };
-
- typedef ::std::map< TDigestHolder,TConnectionPool,TDigestLess> TConnectionMap;
-
- // contains additional information about a activeconnection which is needed to put it back to the pool
- typedef struct
- {
- TConnectionMap::iterator aPos;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPooledConnection> xPooledConnection;
- } TActiveConnectionInfo;
-
- typedef ::std::map< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>,
- TActiveConnectionInfo> TActiveConnectionMap;
-
- class OConnectionPool : public OConnectionPool_Base
- {
- TConnectionMap m_aPool; // the pooled connections
- TActiveConnectionMap m_aActiveConnections; // the currently active connections
-
- ::osl::Mutex m_aMutex;
- ::rtl::Reference<OPoolTimer> m_xInvalidator; // invalidates the conntection pool when shot
-
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > m_xDriver; // the one and only driver for this connectionpool
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xDriverNode; // config node entry
- ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XProxyFactory > m_xProxyFactory;
- sal_Int32 m_nTimeOut;
- sal_Int32 m_nALiveCount;
-
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> createNewConnection(const ::rtl::OUString& _rURL,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo);
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getPooledConnection(TConnectionMap::iterator& _rIter);
- // calculate the timeout and the corresponding ALiveCount
- void calculateTimeOuts();
-
- protected:
- // the dtor will be called from the last instance (last release call)
- virtual ~OConnectionPool();
- public:
- OConnectionPool(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver >& _xDriver,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xDriverNode,
- const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XProxyFactory >& _rxProxyFactory);
-
- // delete all refs
- void clear(sal_Bool _bDispose);
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnectionWithInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
- // XPropertyChangeListener
- virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException);
-
- void invalidatePooledConnections();
- };
-}
-#endif // _CONNECTIVITY_ZCONNECTIONPOOL_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/cpool/ZConnectionWrapper.cxx b/connectivity/source/cpool/ZConnectionWrapper.cxx
deleted file mode 100644
index f2222fee42..0000000000
--- a/connectivity/source/cpool/ZConnectionWrapper.cxx
+++ /dev/null
@@ -1,260 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ZConnectionWrapper.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/extract.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-
-using namespace connectivity;
-//------------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-// --------------------------------------------------------------------------------
-OConnectionWeakWrapper::OConnectionWeakWrapper(Reference< XAggregation >& _xConnection)
- : OConnectionWeakWrapper_BASE(m_aMutex)
-{
- setDelegation(_xConnection,m_refCount);
- OSL_ENSURE(m_xConnection.is(),"OConnectionWeakWrapper: Connection must be valid!");
-}
-//-----------------------------------------------------------------------------
-OConnectionWeakWrapper::~OConnectionWeakWrapper()
-{
- if ( !OConnectionWeakWrapper_BASE::rBHelper.bDisposed )
- {
- osl_incrementInterlockedCount( &m_refCount );
- dispose();
- }
-}
-// XServiceInfo
-// --------------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OConnectionWeakWrapper, "com.sun.star.sdbc.drivers.OConnectionWeakWrapper", "com.sun.star.sdbc.Connection")
-
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL OConnectionWeakWrapper::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- return m_xConnection->createStatement();
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OConnectionWeakWrapper::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- return m_xConnection->prepareStatement(sql);
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OConnectionWeakWrapper::prepareCall( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- return m_xConnection->prepareCall(sql);
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConnectionWeakWrapper::nativeSQL( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- return m_xConnection->nativeSQL(sql);
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnectionWeakWrapper::setAutoCommit( sal_Bool autoCommit ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
- m_xConnection->setAutoCommit(autoCommit);
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnectionWeakWrapper::getAutoCommit( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- return m_xConnection->getAutoCommit();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnectionWeakWrapper::commit( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- m_xConnection->commit();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnectionWeakWrapper::rollback( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- m_xConnection->rollback();
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnectionWeakWrapper::isClosed( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- return m_xConnection->isClosed();
-}
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL OConnectionWeakWrapper::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- return m_xConnection->getMetaData();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnectionWeakWrapper::setReadOnly( sal_Bool readOnly ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- m_xConnection->setReadOnly(readOnly);
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnectionWeakWrapper::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- return m_xConnection->isReadOnly();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnectionWeakWrapper::setCatalog( const ::rtl::OUString& catalog ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- m_xConnection->setCatalog(catalog);
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConnectionWeakWrapper::getCatalog( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- return m_xConnection->getCatalog();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnectionWeakWrapper::setTransactionIsolation( sal_Int32 level ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- m_xConnection->setTransactionIsolation(level);
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OConnectionWeakWrapper::getTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- return m_xConnection->getTransactionIsolation();
-}
-// --------------------------------------------------------------------------------
-Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OConnectionWeakWrapper::getTypeMap( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- return m_xConnection->getTypeMap();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnectionWeakWrapper::setTypeMap( const Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
-
- m_xConnection->setTypeMap(typeMap);
-}
-// --------------------------------------------------------------------------------
-// XCloseable
-void SAL_CALL OConnectionWeakWrapper::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnectionWeakWrapper_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-}
-//------------------------------------------------------------------------------
-void OConnectionWeakWrapper::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- OConnectionWeakWrapper_BASE::disposing();
- OConnectionWrapper::disposing();
-}
-// -----------------------------------------------------------------------------
-// com::sun::star::lang::XUnoTunnel
-#ifdef N_DEBUG
-IMPLEMENT_FORWARD_XINTERFACE2(OConnectionWeakWrapper,OConnectionWeakWrapper_BASE,OConnectionWrapper)
-#else
-IMPLEMENT_FORWARD_REFCOUNT( OConnectionWeakWrapper, OConnectionWeakWrapper_BASE ) \
-::com::sun::star::uno::Any SAL_CALL OConnectionWeakWrapper::queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException) \
-{ \
- ::com::sun::star::uno::Any aReturn = OConnectionWeakWrapper_BASE::queryInterface( _rType ); \
- if ( !aReturn.hasValue() ) \
- aReturn = OConnectionWrapper::queryInterface( _rType ); \
- return aReturn; \
-}
-#endif
-IMPLEMENT_FORWARD_XTYPEPROVIDER2(OConnectionWeakWrapper,OConnectionWeakWrapper_BASE,OConnectionWrapper)
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/cpool/ZConnectionWrapper.hxx b/connectivity/source/cpool/ZConnectionWrapper.hxx
deleted file mode 100644
index 2d29588689..0000000000
--- a/connectivity/source/cpool/ZConnectionWrapper.hxx
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ZCONNECTIONWEAKWRAPPER_HXX_
-#define _CONNECTIVITY_ZCONNECTIONWEAKWRAPPER_HXX_
-
-#include <cppuhelper/compbase1.hxx>
-#include <com/sun/star/sdbc/XConnection.hpp>
-#include <comphelper/broadcasthelper.hxx>
-#include <comphelper/uno3.hxx>
-#include "connectivity/ConnectionWrapper.hxx"
-
-namespace connectivity
-{
-
- //==========================================================================
- //= OConnectionWeakWrapper - wraps all methods to the real connection from the driver
- //= but when disposed it doesn't dispose the real connection
- //==========================================================================
- typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::sdbc::XConnection
- > OConnectionWeakWrapper_BASE;
-
- class OConnectionWeakWrapper : public ::comphelper::OBaseMutex
- ,public OConnectionWeakWrapper_BASE
- , public OConnectionWrapper
- {
- protected:
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- virtual ~OConnectionWeakWrapper();
- public:
- OConnectionWeakWrapper(::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >& _xConnection);
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
- DECLARE_XTYPEPROVIDER()
- DECLARE_XINTERFACE( )
-
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL nativeSQL( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getAutoCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL commit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL rollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isClosed( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCatalog( const ::rtl::OUString& catalog ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalog( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // _CONNECTIVITY_ZCONNECTIONWEAKWRAPPER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/cpool/ZDriverWrapper.cxx b/connectivity/source/cpool/ZDriverWrapper.cxx
deleted file mode 100644
index 266002c35e..0000000000
--- a/connectivity/source/cpool/ZDriverWrapper.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ZDriverWrapper.hxx"
-#include "ZConnectionPool.hxx"
-#include <osl/diagnose.h>
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::beans;
-
- //====================================================================
- //= ODriverWrapper
- //====================================================================
- //--------------------------------------------------------------------
- ODriverWrapper::ODriverWrapper( Reference< XAggregation >& _rxAggregateDriver, OConnectionPool* _pPool )
- :m_pConnectionPool(_pPool)
- {
- OSL_ENSURE(_rxAggregateDriver.is(), "ODriverWrapper::ODriverWrapper: invalid aggregate!");
- OSL_ENSURE(m_pConnectionPool, "ODriverWrapper::ODriverWrapper: invalid connection pool!");
-
- if (m_pConnectionPool)
- m_pConnectionPool->acquire();
-
- osl_incrementInterlockedCount( &m_refCount );
- if (_rxAggregateDriver.is())
- {
- // transfer the (one and only) real ref to the aggregate to our member
- m_xDriverAggregate = _rxAggregateDriver;
- _rxAggregateDriver = NULL;
-
- // a second "real" reference
- m_xDriver = Reference< XDriver >(m_xDriverAggregate, UNO_QUERY);
- OSL_ENSURE(m_xDriver.is(), "ODriverWrapper::ODriverWrapper: invalid aggregate (no XDriver)!");
-
- // set ourself as delegator
- m_xDriverAggregate->setDelegator( static_cast< XWeak* >( this ) );
- }
- osl_decrementInterlockedCount( &m_refCount );
- }
-
- //--------------------------------------------------------------------
- ODriverWrapper::~ODriverWrapper()
- {
- if (m_xDriverAggregate.is())
- m_xDriverAggregate->setDelegator(NULL);
-
- if (m_pConnectionPool)
- m_pConnectionPool->release();
- m_pConnectionPool = NULL;
- }
-
- //--------------------------------------------------------------------
- Any SAL_CALL ODriverWrapper::queryInterface( const Type& _rType ) throw (RuntimeException)
- {
- Any aReturn = ODriverWrapper_BASE::queryInterface(_rType);
- return aReturn.hasValue() ? aReturn : (m_xDriverAggregate.is() ? m_xDriverAggregate->queryAggregation(_rType) : aReturn);
- }
-
- //--------------------------------------------------------------------
- Reference< XConnection > SAL_CALL ODriverWrapper::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw (SQLException, RuntimeException)
- {
- Reference< XConnection > xConnection;
- if (m_pConnectionPool)
- // route this through the pool
- xConnection = m_pConnectionPool->getConnectionWithInfo( url, info );
- else if (m_xDriver.is())
- xConnection = m_xDriver->connect( url, info );
-
- return xConnection;
- }
-
- //--------------------------------------------------------------------
- sal_Bool SAL_CALL ODriverWrapper::acceptsURL( const ::rtl::OUString& url ) throw (SQLException, RuntimeException)
- {
- return m_xDriver.is() && m_xDriver->acceptsURL(url);
- }
-
- //--------------------------------------------------------------------
- Sequence< DriverPropertyInfo > SAL_CALL ODriverWrapper::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw (SQLException, RuntimeException)
- {
- Sequence< DriverPropertyInfo > aInfo;
- if (m_xDriver.is())
- aInfo = m_xDriver->getPropertyInfo(url, info);
- return aInfo;
- }
-
- //--------------------------------------------------------------------
- sal_Int32 SAL_CALL ODriverWrapper::getMajorVersion( ) throw (RuntimeException)
- {
- return m_xDriver.is() ? m_xDriver->getMajorVersion() : 0;
- }
-
- //--------------------------------------------------------------------
- sal_Int32 SAL_CALL ODriverWrapper::getMinorVersion( ) throw (RuntimeException)
- {
- return m_xDriver.is() ? m_xDriver->getMinorVersion() : 0;
- }
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/cpool/ZDriverWrapper.hxx b/connectivity/source/cpool/ZDriverWrapper.hxx
deleted file mode 100644
index ae5e9b45f6..0000000000
--- a/connectivity/source/cpool/ZDriverWrapper.hxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_CPOOL_ZDRIVERWRAPPER_HXX_
-#define _CONNECTIVITY_CPOOL_ZDRIVERWRAPPER_HXX_
-
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <osl/mutex.hxx>
-#include <com/sun/star/uno/XAggregation.hpp>
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- class OConnectionPool;
- //====================================================================
- //= ODriverWrapper
- //====================================================================
- typedef ::cppu::WeakImplHelper1 < ::com::sun::star::sdbc::XDriver
- > ODriverWrapper_BASE;
-
- class ODriverWrapper : public ODriverWrapper_BASE
- {
- protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >
- m_xDriverAggregate;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver >
- m_xDriver;
- OConnectionPool* m_pConnectionPool;
-
- public:
- /** creates a new wrapper for a driver
- @param _rxAggregateDriver
- the driver to aggregate. The object will be reset to <NULL/> when returning from the ctor.
- */
- ODriverWrapper(
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >& _rxAggregateDriver,
- OConnectionPool* _pPool
- );
-
-
-
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
-
- protected:
- /// dtor
- virtual ~ODriverWrapper();
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMajorVersion( ) throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMinorVersion( ) throw (::com::sun::star::uno::RuntimeException);
- };
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-#endif // _CONNECTIVITY_CPOOL_ZDRIVERWRAPPER_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/cpool/ZPoolCollection.cxx b/connectivity/source/cpool/ZPoolCollection.cxx
deleted file mode 100644
index 664ffa6468..0000000000
--- a/connectivity/source/cpool/ZPoolCollection.cxx
+++ /dev/null
@@ -1,581 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ZPoolCollection.hxx"
-#include "ZDriverWrapper.hxx"
-#include "ZConnectionPool.hxx"
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <comphelper/extract.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include "diagnose_ex.h"
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::reflection;
-using namespace ::osl;
-using namespace connectivity;
-
-//--------------------------------------------------------------------
-static const ::rtl::OUString& getConnectionPoolNodeName()
-{
- static ::rtl::OUString s_sNodeName( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.DataAccess/ConnectionPool" ));
- return s_sNodeName;
-}
-//--------------------------------------------------------------------
-static const ::rtl::OUString& getEnablePoolingNodeName()
-{
- static ::rtl::OUString s_sNodeName( RTL_CONSTASCII_USTRINGPARAM( "EnablePooling" ));
- return s_sNodeName;
-}
-//--------------------------------------------------------------------
-static const ::rtl::OUString& getDriverNameNodeName()
-{
- static ::rtl::OUString s_sNodeName( RTL_CONSTASCII_USTRINGPARAM( "DriverName" ));
- return s_sNodeName;
-}
-// -----------------------------------------------------------------------------
-static const ::rtl::OUString& getDriverSettingsNodeName()
-{
- static ::rtl::OUString s_sNodeName( RTL_CONSTASCII_USTRINGPARAM( "DriverSettings" ));
- return s_sNodeName;
-}
-//--------------------------------------------------------------------------
-static const ::rtl::OUString& getEnableNodeName()
-{
- static ::rtl::OUString s_sNodeName( RTL_CONSTASCII_USTRINGPARAM( "Enable" ));
- return s_sNodeName;
-}
-
-//--------------------------------------------------------------------
-OPoolCollection::OPoolCollection(const Reference< XMultiServiceFactory >& _rxFactory)
- :m_xServiceFactory(_rxFactory)
-{
- // bootstrap all objects supporting the .sdb.Driver service
- m_xManager = Reference< XDriverManager >(m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.DriverManager")) ), UNO_QUERY);
- m_xDriverAccess = Reference< XDriverAccess >(m_xManager, UNO_QUERY);
- OSL_ENSURE(m_xDriverAccess.is(), "have no (or an invalid) driver manager!");
-
- m_xProxyFactory = Reference< XProxyFactory >(
- m_xServiceFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory"))),
- UNO_QUERY);
- OSL_ENSURE(m_xProxyFactory.is(), "OConnectionPool::OConnectionPool: could not create a proxy factory!");
-
- Reference<XPropertySet> xProp(getConfigPoolRoot(),UNO_QUERY);
- if ( xProp.is() )
- xProp->addPropertyChangeListener(getEnablePoolingNodeName(),this);
- // attach as desktop listener to know when we have to release our pools
- osl_incrementInterlockedCount( &m_refCount );
- {
-
- m_xDesktop = Reference< ::com::sun::star::frame::XDesktop>( m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY);
- if ( m_xDesktop.is() )
- m_xDesktop->addTerminateListener(this);
-
- }
- osl_decrementInterlockedCount( &m_refCount );
-}
-// -----------------------------------------------------------------------------
-OPoolCollection::~OPoolCollection()
-{
- clearConnectionPools(sal_False);
-}
-// -----------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL OPoolCollection::getConnection( const ::rtl::OUString& _rURL ) throw(SQLException, RuntimeException)
-{
- return getConnectionWithInfo(_rURL,Sequence< PropertyValue >());
-}
-// -----------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL OPoolCollection::getConnectionWithInfo( const ::rtl::OUString& _rURL, const Sequence< PropertyValue >& _rInfo ) throw(SQLException, RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
- Reference< XConnection > xConnection;
- Reference< XDriver > xDriver;
- Reference< XInterface > xDriverNode;
- ::rtl::OUString sImplName;
- if(isPoolingEnabledByUrl(_rURL,xDriver,sImplName,xDriverNode) && xDriver.is())
- {
- OConnectionPool* pConnectionPool = getConnectionPool(sImplName,xDriver,xDriverNode);
-
- if(pConnectionPool)
- xConnection = pConnectionPool->getConnectionWithInfo(_rURL,_rInfo);
- }
- else if(xDriver.is())
- xConnection = xDriver->connect(_rURL,_rInfo);
-
- return xConnection;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OPoolCollection::setLoginTimeout( sal_Int32 seconds ) throw(RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
- m_xManager->setLoginTimeout(seconds);
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OPoolCollection::getLoginTimeout( ) throw(RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
- return m_xManager->getLoginTimeout();
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OPoolCollection::getImplementationName( ) throw(RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
- return getImplementationName_Static();
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OPoolCollection::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-
-//--------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL OPoolCollection::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-
-//---------------------------------------OPoolCollection----------------------------------
-Reference< XInterface > SAL_CALL OPoolCollection::CreateInstance(const Reference< XMultiServiceFactory >& _rxFactory)
-{
- return static_cast<XDriverManager*>(new OPoolCollection(_rxFactory));
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OPoolCollection::getImplementationName_Static( ) throw(RuntimeException)
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.OConnectionPool"));
-}
-
-//--------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL OPoolCollection::getSupportedServiceNames_Static( ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(1);
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.ConnectionPool"));
- return aSupported;
-}
-// -----------------------------------------------------------------------------
-Reference< XDriver > SAL_CALL OPoolCollection::getDriverByURL( const ::rtl::OUString& _rURL ) throw(RuntimeException)
-{
- // returns the original driver when no connection pooling is enabled else it returns the proxy
- MutexGuard aGuard(m_aMutex);
-
- Reference< XDriver > xDriver;
- Reference< XInterface > xDriverNode;
- ::rtl::OUString sImplName;
- if(isPoolingEnabledByUrl(_rURL,xDriver,sImplName,xDriverNode))
- {
- Reference< XDriver > xExistentProxy;
- // look if we already have a proxy for this driver
- for ( ConstMapDriver2DriverRefIterator aLookup = m_aDriverProxies.begin();
- aLookup != m_aDriverProxies.end();
- ++aLookup
- )
- {
- // hold the proxy alive as long as we're in this loop round
- xExistentProxy = aLookup->second;
-
- if (xExistentProxy.is() && (aLookup->first.get() == xDriver.get()))
- // already created a proxy for this
- break;
- }
- if (xExistentProxy.is())
- {
- xDriver = xExistentProxy;
- }
- else
- { // create a new proxy for the driver
- // this allows us to control the connections created by it
- if (m_xProxyFactory.is())
- {
- Reference< XAggregation > xDriverProxy = m_xProxyFactory->createProxy(xDriver.get());
- OSL_ENSURE(xDriverProxy.is(), "OConnectionPool::getDriverByURL: invalid proxy returned by the proxy factory!");
-
- OConnectionPool* pConnectionPool = getConnectionPool(sImplName,xDriver,xDriverNode);
- xDriver = new ODriverWrapper(xDriverProxy, pConnectionPool);
- }
- else
- OSL_FAIL("OConnectionPool::getDriverByURL: could not instantiate a proxy factory!");
- }
- }
-
- return xDriver;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OPoolCollection::isDriverPoolingEnabled(const ::rtl::OUString& _sDriverImplName,
- Reference< XInterface >& _rxDriverNode)
-{
- sal_Bool bEnabled = sal_False;
- Reference<XInterface> xConnectionPoolRoot = getConfigPoolRoot();
- // then look for which of them settings are stored in the configuration
- Reference< XNameAccess > xDirectAccess(openNode(getDriverSettingsNodeName(),xConnectionPoolRoot),UNO_QUERY);
-
- if(xDirectAccess.is())
- {
- Sequence< ::rtl::OUString > aDriverKeys = xDirectAccess->getElementNames();
- const ::rtl::OUString* pDriverKeys = aDriverKeys.getConstArray();
- const ::rtl::OUString* pDriverKeysEnd = pDriverKeys + aDriverKeys.getLength();
- for (;pDriverKeys != pDriverKeysEnd; ++pDriverKeys)
- {
- // the name of the driver in this round
- if(_sDriverImplName == *pDriverKeys)
- {
- _rxDriverNode = openNode(*pDriverKeys,xDirectAccess);
- if(_rxDriverNode.is())
- getNodeValue(getEnableNodeName(),_rxDriverNode) >>= bEnabled;
- break;
- }
- }
- }
- return bEnabled;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OPoolCollection::isPoolingEnabled()
-{
- // the config node where all pooling relevant info are stored under
- Reference<XInterface> xConnectionPoolRoot = getConfigPoolRoot();
-
- // the global "enabled" flag
- sal_Bool bEnabled = sal_False;
- if(xConnectionPoolRoot.is())
- getNodeValue(getEnablePoolingNodeName(),xConnectionPoolRoot) >>= bEnabled;
- return bEnabled;
-}
-// -----------------------------------------------------------------------------
-Reference<XInterface> OPoolCollection::getConfigPoolRoot()
-{
- if(!m_xConfigNode.is())
- m_xConfigNode = createWithServiceFactory(getConnectionPoolNodeName());
- return m_xConfigNode;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OPoolCollection::isPoolingEnabledByUrl(const ::rtl::OUString& _sUrl,
- Reference< XDriver >& _rxDriver,
- ::rtl::OUString& _rsImplName,
- Reference< XInterface >& _rxDriverNode)
-{
- sal_Bool bEnabled = sal_False;
- if (m_xDriverAccess.is())
- {
- _rxDriver = m_xDriverAccess->getDriverByURL(_sUrl);
- if (_rxDriver.is() && isPoolingEnabled())
- {
- Reference< XServiceInfo > xSerivceInfo(_rxDriver,UNO_QUERY);
- OSL_ENSURE(xSerivceInfo.is(),"Each driver should have a XServiceInfo interface!");
-
- if(xSerivceInfo.is())
- {
- // look for the implementation name of the driver
- _rsImplName = xSerivceInfo->getImplementationName();
- bEnabled = isDriverPoolingEnabled(_rsImplName,_rxDriverNode);
- }
- }
- }
- return bEnabled;
-}
-// -----------------------------------------------------------------------------
-void OPoolCollection::clearConnectionPools(sal_Bool _bDispose)
-{
- OConnectionPools::const_iterator aIter = m_aPools.begin();
- while(aIter != m_aPools.end())
- {
- aIter->second->clear(_bDispose);
- aIter->second->release();
- ::rtl::OUString sKeyValue = aIter->first;
- ++aIter;
- m_aPools.erase(sKeyValue);
- }
-}
-// -----------------------------------------------------------------------------
-OConnectionPool* OPoolCollection::getConnectionPool(const ::rtl::OUString& _sImplName,
- const Reference< XDriver >& _xDriver,
- const Reference< XInterface >& _xDriverNode)
-{
- OConnectionPool *pRet = 0;
- OConnectionPools::const_iterator aFind = m_aPools.find(_sImplName);
- if (aFind != m_aPools.end())
- pRet = aFind->second;
- else if (_xDriver.is() && _xDriverNode.is())
- {
- Reference<XPropertySet> xProp(_xDriverNode,UNO_QUERY);
- if(xProp.is())
- xProp->addPropertyChangeListener(getEnableNodeName(),this);
- OConnectionPool* pConnectionPool = new OConnectionPool(_xDriver,_xDriverNode,m_xProxyFactory);
- pConnectionPool->acquire();
- aFind = m_aPools.insert(OConnectionPools::value_type(_sImplName,pConnectionPool)).first;
- pRet = aFind->second;
- }
-
- OSL_ENSURE(pRet, "Could not query DriverManager from ConnectionPool!");
-
- return pRet;
-}
-// -----------------------------------------------------------------------------
-Reference< XInterface > OPoolCollection::createWithServiceFactory(const ::rtl::OUString& _rPath) const
-{
- Reference< XInterface > xInterface;
- try
- {
- Reference< XInterface > xProvider = m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider")));
- OSL_ENSURE(xProvider.is(), "OConfigurationTreeRoot::createWithServiceFactory: could not instantiate the config provider service!");
- Reference< XMultiServiceFactory > xProviderAsFac(xProvider, UNO_QUERY);
- OSL_ENSURE(xProviderAsFac.is() || !xProvider.is(), "OConfigurationTreeRoot::createWithServiceFactory: the provider is missing an interface!");
- if (xProviderAsFac.is())
- xInterface = createWithProvider(xProviderAsFac, _rPath);
- }
- catch(const Exception&)
- {
- OSL_FAIL("createWithServiceFactory: error while instantiating the provider service!");
- }
- return xInterface;
-}
-//------------------------------------------------------------------------
-Reference< XInterface > OPoolCollection::createWithProvider(const Reference< XMultiServiceFactory >& _rxConfProvider,
- const ::rtl::OUString& _rPath) const
-{
- OSL_ENSURE(_rxConfProvider.is(), "createWithProvider: invalid provider!");
-
- Reference< XInterface > xInterface;
-#ifdef DBG_UTIL
- if (_rxConfProvider.is())
- {
- try
- {
- Reference< XServiceInfo > xSI(_rxConfProvider, UNO_QUERY);
- if (!xSI.is())
- {
- OSL_FAIL("::createWithProvider: no XServiceInfo interface on the provider!");
- }
- else
- {
- OSL_ENSURE(xSI->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))),
- "::createWithProvider: sure this is a provider? Missing the ConfigurationProvider service!");
- }
- }
- catch(const Exception&)
- {
- OSL_FAIL("::createWithProvider: unable to check the service conformance of the provider given!");
- }
- }
-#endif
-
- if (_rxConfProvider.is())
- {
- try
- {
- Sequence< Any > aCreationArgs(3);
- aCreationArgs[0] = makeAny(PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")), 0, makeAny(_rPath), PropertyState_DIRECT_VALUE));
- aCreationArgs[1] = makeAny(PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("depth")), 0, makeAny((sal_Int32)-1), PropertyState_DIRECT_VALUE));
- aCreationArgs[2] = makeAny(PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("lazywrite")), 0, makeAny(sal_True), PropertyState_DIRECT_VALUE));
-
- static ::rtl::OUString sAccessService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" ));
-
- xInterface = _rxConfProvider->createInstanceWithArguments(sAccessService, aCreationArgs);
- OSL_ENSURE(xInterface.is(), "::createWithProvider: could not create the node access!");
- }
- catch(Exception&)
- {
- OSL_FAIL("OConfigurationTreeRoot::createWithProvider: caught an exception while creating the access object!");
- }
- }
- return xInterface;
-}
-// -----------------------------------------------------------------------------
-Reference<XInterface> OPoolCollection::openNode(const ::rtl::OUString& _rPath,const Reference<XInterface>& _xTreeNode) const throw()
-{
- Reference< XHierarchicalNameAccess > xHierarchyAccess(_xTreeNode, UNO_QUERY);
- Reference< XNameAccess > xDirectAccess(_xTreeNode, UNO_QUERY);
- Reference< XInterface > xNode;
-
- try
- {
- if (xDirectAccess.is() && xDirectAccess->hasByName(_rPath))
- {
- if (!::cppu::extractInterface(xNode, xDirectAccess->getByName(_rPath)))
- OSL_FAIL("OConfigurationNode::openNode: could not open the node!");
- }
- else if (xHierarchyAccess.is())
- {
- if (!::cppu::extractInterface(xNode, xHierarchyAccess->getByHierarchicalName(_rPath)))
- OSL_FAIL("OConfigurationNode::openNode: could not open the node!");
- }
-
- }
- catch(const NoSuchElementException&)
- {
- OSL_FAIL(::rtl::OString("::openNode: there is no element named ")
- += ::rtl::OString(_rPath.getStr(), _rPath.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ::rtl::OString("!"));
- }
- catch(Exception&)
- {
- OSL_FAIL("OConfigurationNode::openNode: caught an exception while retrieving the node!");
- }
- return xNode;
-}
-// -----------------------------------------------------------------------------
-Any OPoolCollection::getNodeValue(const ::rtl::OUString& _rPath,const Reference<XInterface>& _xTreeNode) throw()
-{
- Reference< XHierarchicalNameAccess > xHierarchyAccess(_xTreeNode, UNO_QUERY);
- Reference< XNameAccess > xDirectAccess(_xTreeNode, UNO_QUERY);
- Any aReturn;
- try
- {
- if (xDirectAccess.is() && xDirectAccess->hasByName(_rPath) )
- {
- aReturn = xDirectAccess->getByName(_rPath);
- }
- else if (xHierarchyAccess.is())
- {
- aReturn = xHierarchyAccess->getByHierarchicalName(_rPath);
- }
- }
- catch(NoSuchElementException& e)
- {
- OSL_UNUSED( e ); // make compiler happy
- OSL_FAIL(::rtl::OString("::getNodeValue: caught a NoSuchElementException while trying to open ")
- += ::rtl::OString(e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ::rtl::OString("!"));
- }
- return aReturn;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OPoolCollection::queryTermination( const EventObject& /*Event*/ ) throw (::com::sun::star::frame::TerminationVetoException, RuntimeException)
-{
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OPoolCollection::notifyTermination( const EventObject& /*Event*/ ) throw (RuntimeException)
-{
- clearDesktop();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OPoolCollection::disposing( const EventObject& Source ) throw (RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
- if ( m_xDesktop == Source.Source )
- {
- clearDesktop();
- }
- else
- {
- try
- {
- Reference<XPropertySet> xProp(Source.Source,UNO_QUERY);
- if(Source.Source == m_xConfigNode)
- {
- if ( xProp.is() )
- xProp->removePropertyChangeListener(getEnablePoolingNodeName(),this);
- m_xConfigNode.clear();
- }
- else if ( xProp.is() )
- xProp->removePropertyChangeListener(getEnableNodeName(),this);
- }
- catch(const Exception&)
- {
- OSL_FAIL("Exception caught");
- }
- }
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OPoolCollection::propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
- if(evt.Source == m_xConfigNode)
- {
- sal_Bool bEnabled = sal_True;
- evt.NewValue >>= bEnabled;
- if(!bEnabled )
- {
- m_aDriverProxies.clear();
- m_aDriverProxies = MapDriver2DriverRef();
- OConnectionPools::iterator aIter = m_aPools.begin();
- for(;aIter != m_aPools.end();++aIter)
- {
- aIter->second->clear(sal_False);
- aIter->second->release();
- }
- m_aPools.clear();
- m_aPools = OConnectionPools();
- }
- }
- else if(evt.Source.is())
- {
- sal_Bool bEnabled = sal_True;
- evt.NewValue >>= bEnabled;
- if(!bEnabled)
- {
- ::rtl::OUString sThisDriverName;
- getNodeValue(getDriverNameNodeName(),evt.Source) >>= sThisDriverName;
- // 1nd relase the driver
- // look if we already have a proxy for this driver
- MapDriver2DriverRefIterator aLookup = m_aDriverProxies.begin();
- while( aLookup != m_aDriverProxies.end())
- {
- MapDriver2DriverRefIterator aFind = aLookup;
- Reference<XServiceInfo> xInfo(aLookup->first,UNO_QUERY);
- ++aLookup;
- if(xInfo.is() && xInfo->getImplementationName() == sThisDriverName)
- m_aDriverProxies.erase(aFind);
- }
-
- // 2nd clear the connectionpool
- OConnectionPools::iterator aFind = m_aPools.find(sThisDriverName);
- if(aFind != m_aPools.end() && aFind->second)
- {
- aFind->second->clear(sal_False);
- aFind->second->release();
- m_aPools.erase(aFind);
- }
- }
- }
-}
-// -----------------------------------------------------------------------------
-void OPoolCollection::clearDesktop()
-{
- clearConnectionPools(sal_True);
- if ( m_xDesktop.is() )
- m_xDesktop->removeTerminateListener(this);
-m_xDesktop.clear();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/cpool/ZPoolCollection.hxx b/connectivity/source/cpool/ZPoolCollection.hxx
deleted file mode 100644
index 81ccb18ff2..0000000000
--- a/connectivity/source/cpool/ZPoolCollection.hxx
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_POOLCOLLECTION_HXX
-#define CONNECTIVITY_POOLCOLLECTION_HXX
-
-#include <cppuhelper/implbase5.hxx>
-#include <com/sun/star/beans/XPropertyChangeListener.hpp>
-#include <com/sun/star/sdbc/XDriverManager.hpp>
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/sdbc/XDriverAccess.hpp>
-#include <com/sun/star/sdbc/XPooledConnection.hpp>
-#include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-#include <com/sun/star/frame/XTerminateListener.hpp>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
-#include <comphelper/stl_types.hxx>
-#include <osl/mutex.hxx>
-
-namespace connectivity
-{
- class OConnectionPool;
- //==========================================================================
- //= OPoolCollection - the one-instance service for PooledConnections
- //= manages the active connections and the connections in the pool
- //==========================================================================
- typedef ::cppu::WeakImplHelper5< ::com::sun::star::sdbc::XDriverManager,
- ::com::sun::star::sdbc::XDriverAccess,
- ::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::frame::XTerminateListener,
- ::com::sun::star::beans::XPropertyChangeListener
- > OPoolCollection_Base;
-
- /// OPoolCollection: controll the whole connection pooling for oo
- class OPoolCollection : public OPoolCollection_Base
- {
-
- //==========================================================================
- typedef ::comphelper::OInterfaceCompare< ::com::sun::star::sdbc::XDriver > ODriverCompare;
- DECLARE_STL_USTRINGACCESS_MAP(OConnectionPool*, OConnectionPools);
-
- DECLARE_STL_MAP(
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver >,
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDriver >,
- ODriverCompare,
- MapDriver2DriverRef );
-
- MapDriver2DriverRef m_aDriverProxies;
- ::osl::Mutex m_aMutex;
- OConnectionPools m_aPools; // the driver pools
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriverManager > m_xManager;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriverAccess > m_xDriverAccess;
- ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XProxyFactory > m_xProxyFactory;
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xConfigNode; // config node for generel connection pooling
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDesktop> m_xDesktop;
-
- private:
- OPoolCollection(); // never implemented
- OPoolCollection(const OPoolCollection&); // never implemented
- int operator= (const OPoolCollection&); // never implemented
-
- OPoolCollection(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
-
- // some configuration helper methods
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createWithServiceFactory(const ::rtl::OUString& _rPath) const;
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getConfigPoolRoot();
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createWithProvider( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxConfProvider,
- const ::rtl::OUString& _rPath) const;
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > openNode( const ::rtl::OUString& _rPath,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xTreeNode) const throw();
- sal_Bool isPoolingEnabled();
- sal_Bool isDriverPoolingEnabled(const ::rtl::OUString& _sDriverImplName,
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDriverNode);
- sal_Bool isPoolingEnabledByUrl( const ::rtl::OUString& _sUrl,
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver >& _rxDriver,
- ::rtl::OUString& _rsImplName,
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDriverNode);
-
- OConnectionPool* getConnectionPool( const ::rtl::OUString& _sImplName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver >& _xDriver,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDriverNode);
- void clearConnectionPools(sal_Bool _bDispose);
- void clearDesktop();
- protected:
- virtual ~OPoolCollection();
- public:
-
- static ::com::sun::star::uno::Any getNodeValue( const ::rtl::OUString& _rPath,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xTreeNode)throw();
-
- // XDriverManager
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnectionWithInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLoginTimeout( sal_Int32 seconds ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getLoginTimeout( ) throw(::com::sun::star::uno::RuntimeException);
-
- //XDriverAccess
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > SAL_CALL getDriverByURL( const ::rtl::OUString& url ) throw (::com::sun::star::uno::RuntimeException);
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XServiceInfo - static methods
- static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL CreateInstance(const::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
- static ::rtl::OUString SAL_CALL getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
- // XPropertyChangeListener
- virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException);
-
- // XTerminateListener
- virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // CONNECTIVITY_POOLCOLLECTION_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/cpool/ZPooledConnection.cxx b/connectivity/source/cpool/ZPooledConnection.cxx
deleted file mode 100644
index c6344c04bb..0000000000
--- a/connectivity/source/cpool/ZPooledConnection.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ZPooledConnection.hxx"
-#include "ZConnectionWrapper.hxx"
-#include "connectivity/ConnectionWrapper.hxx"
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <comphelper/types.hxx>
-#include <comphelper/uno3.hxx>
-#include <cppuhelper/component.hxx>
-#include <cppuhelper/compbase1.hxx>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::reflection;
-using namespace connectivity;
-using namespace ::osl;
-
-OPooledConnection::OPooledConnection(const Reference< XConnection >& _xConnection,
- const Reference< ::com::sun::star::reflection::XProxyFactory >& _rxProxyFactory)
- : OPooledConnection_Base(m_aMutex)
- ,m_xRealConnection(_xConnection)
- ,m_xProxyFactory(_rxProxyFactory)
-{
-
-}
-// -----------------------------------------------------------------------------
-// OComponentHelper
-void SAL_CALL OPooledConnection::disposing(void)
-{
- MutexGuard aGuard(m_aMutex);
- if (m_xComponent.is())
- m_xComponent->removeEventListener(this);
-m_xComponent.clear();
- ::comphelper::disposeComponent(m_xRealConnection);
-}
-// -----------------------------------------------------------------------------
-// XEventListener
-void SAL_CALL OPooledConnection::disposing( const EventObject& /*Source*/ ) throw (RuntimeException)
-{
-m_xComponent.clear();
-}
-// -----------------------------------------------------------------------------
-//XPooledConnection
-Reference< XConnection > OPooledConnection::getConnection() throw(SQLException, RuntimeException)
-{
- if(!m_xComponent.is() && m_xRealConnection.is())
- {
- Reference< XAggregation > xConProxy = m_xProxyFactory->createProxy(m_xRealConnection.get());
- m_xComponent = new OConnectionWeakWrapper(xConProxy);
- // register as event listener for the new connection
- if (m_xComponent.is())
- m_xComponent->addEventListener(this);
- }
- return Reference< XConnection >(m_xComponent,UNO_QUERY);
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/cpool/ZPooledConnection.hxx b/connectivity/source/cpool/ZPooledConnection.hxx
deleted file mode 100644
index 17104ae92c..0000000000
--- a/connectivity/source/cpool/ZPooledConnection.hxx
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_POOLEDCONNECTION_HXX
-#define CONNECTIVITY_POOLEDCONNECTION_HXX
-
-#include <cppuhelper/compbase2.hxx>
-#include <com/sun/star/sdbc/XPooledConnection.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <comphelper/broadcasthelper.hxx>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
-
-
-namespace connectivity
-{
- //==========================================================================
- //= OPooledConnection -
- //= allows to pool a real connection
- //==========================================================================
- typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::sdbc::XPooledConnection
- ,::com::sun::star::lang::XEventListener> OPooledConnection_Base;
-
- class OPooledConnection : public ::comphelper::OBaseMutex
- ,public OPooledConnection_Base
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xRealConnection; // the connection fom driver
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xComponent; // the connection which wraps the real connection
- ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XProxyFactory > m_xProxyFactory;
- public:
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- OPooledConnection(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
- const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XProxyFactory >& _rxProxyFactory);
-
- //XPooledConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
- };
-
-}
-#endif // CONNECTIVITY_POOLEDCONNECTION_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/cpool/Zregistration.cxx b/connectivity/source/cpool/Zregistration.cxx
deleted file mode 100644
index 169669adaf..0000000000
--- a/connectivity/source/cpool/Zregistration.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include <cppuhelper/factory.hxx>
-#include "ZPoolCollection.hxx"
-
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::registry;
-using namespace connectivity;
-//==========================================================================
-//= registration
-//==========================================================================
-extern "C"
-{
-
-//---------------------------------------------------------------------------------------
-SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/)
-{
- void* pRet = NULL;
-
- if (OPoolCollection::getImplementationName_Static().compareToAscii(_pImplName) == 0)
- {
- Reference< XSingleServiceFactory > xFactory(
- ::cppu::createOneInstanceFactory(
- _pServiceManager,
- OPoolCollection::getImplementationName_Static(),
- OPoolCollection::CreateInstance,
- OPoolCollection::getSupportedServiceNames_Static()
- )
- );
- if (xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
-
- return pRet;
-}
-
-} // extern "C"
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/cpool/dbpool.xml b/connectivity/source/cpool/dbpool.xml
deleted file mode 100755
index 4916954bbb..0000000000
--- a/connectivity/source/cpool/dbpool.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>dbpool</module-name>
- <component-description>
- <author>Ocke Janssen</author>
- <name>com.sun.star.comp.sdbc.OConnectionPool</name>
- <description>
- This is the implementation of the connection pool.
- </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service>com.sun.star.sdbc.ConnectionPool</supported-service>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>dbtools</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
-
-
diff --git a/connectivity/source/cpool/dbpool2.component b/connectivity/source/cpool/dbpool2.component
deleted file mode 100755
index 2fa8a14495..0000000000
--- a/connectivity/source/cpool/dbpool2.component
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.sdbc.OConnectionPool">
- <service name="com.sun.star.sdbc.ConnectionPool"/>
- </implementation>
-</component>
diff --git a/connectivity/source/cpool/exports.dxp b/connectivity/source/cpool/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/cpool/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/cpool/makefile.mk b/connectivity/source/cpool/makefile.mk
deleted file mode 100755
index 45ec3727ea..0000000000
--- a/connectivity/source/cpool/makefile.mk
+++ /dev/null
@@ -1,87 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=..
-PRJNAME=connectivity
-TARGET=dbpool
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/version.mk
-
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/ZConnectionWrapper.obj \
- $(SLO)$/ZDriverWrapper.obj \
- $(SLO)$/ZPooledConnection.obj \
- $(SLO)$/ZConnectionPool.obj \
- $(SLO)$/ZPoolCollection.obj \
- $(SLO)$/Zregistration.obj
-
-# --- Library -----------------------------------
-
-SHL1TARGET= $(DBPOOL_TARGET)$(DBPOOL_MAJOR)
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(DBTOOLSLIB) \
- $(SALLIB) \
- $(SALHELPERLIB)
-
-SHL1DEPN=
-SHL1IMPLIB= i$(SHL1TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
-ALLTAR : $(MISC)/dbpool2.component
-
-$(MISC)/dbpool2.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- dbpool2.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt dbpool2.component
diff --git a/connectivity/source/dbtools/dbt.xml b/connectivity/source/dbtools/dbt.xml
deleted file mode 100755
index e2f8c8921c..0000000000
--- a/connectivity/source/dbtools/dbt.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>dbt</module-name>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
-
-
diff --git a/connectivity/source/dbtools/dbtools.component b/connectivity/source/dbtools/dbtools.component
deleted file mode 100755
index 08be953bb9..0000000000
--- a/connectivity/source/dbtools/dbtools.component
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="org.openoffice.comp.helper.DatabaseMetaDataResultSet">
- <service name="com.sun.star.sdbc.ResultSet"/>
- </implementation>
- <implementation name="org.openoffice.comp.helper.ParameterSubstitution">
- <service name="com.sun.star.sdb.ParameterSubstitution"/>
- </implementation>
-</component>
diff --git a/connectivity/source/dbtools/exports.dxp b/connectivity/source/dbtools/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/dbtools/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/dbtools/makefile.mk b/connectivity/source/dbtools/makefile.mk
deleted file mode 100755
index 9e77702c54..0000000000
--- a/connectivity/source/dbtools/makefile.mk
+++ /dev/null
@@ -1,108 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=connectivity
-TARGET=dbt
-USE_LDUMP2=TRUE
-
-TARGETTYPE=CUI
-USE_DEFFILE=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/dbtools.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-LDUMP=ldump2.exe
-
-# --- Library -----------------------------------
-
-LIB1TARGET=$(SLB)$/$(TARGET).lib
-LIB1FILES=\
- $(SLB)$/sdbcx.lib \
- $(SLB)$/commontools.lib \
- $(SLB)$/sql.lib \
- $(SLB)$/simpledbt.lib \
- $(SLB)$/cnr.lib
-
-# --- dynamic library ---------------------------
-
-SHL1TARGET= $(DBTOOLS_TARGET)$(DLLPOSTFIX)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(JVMACCESSLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(I18NISOLANGLIB)
-
-# NETBSD: somewhere we have to instantiate the static data members.
-# NETBSD-1.2.1 doesn't know about weak symbols so the default mechanism for GCC won't work.
-# MACOSX: the linker does know about weak symbols, but we can't ignore multiple defined symbols
-.IF "$(OS)"=="NETBSD" || "$(OS)"=="MACOSX"
-SHL1STDLIBS+=$(UCBHELPERLIB)
-.ENDIF
-
-.IF "$(COM)" == "MSC"
-SHL1IMPLIB= idbtools
-.ELSE
-SHL1IMPLIB= dbtools$(DLLPOSTFIX)
-.ENDIF
-
-SHL1LIBS= $(LIB1TARGET)
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-DEF1NAME= $(SHL1TARGET)
-DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt \
- $(LIB1TARGET)
-
-DEFLIB1NAME=$(TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
-# --- filter file ------------------------------
-
-$(MISC)$/$(SHL1TARGET).flt: makefile.mk
- @echo ------------------------------
- @echo _TI >$@
- @echo _real >>$@
-
-
-ALLTAR : $(MISC)/dbtools.component
-
-$(MISC)/dbtools.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- dbtools.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt dbtools.component
diff --git a/connectivity/source/drivers/adabas/BCatalog.cxx b/connectivity/source/drivers/adabas/BCatalog.cxx
deleted file mode 100644
index bae14af719..0000000000
--- a/connectivity/source/drivers/adabas/BCatalog.cxx
+++ /dev/null
@@ -1,169 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BCatalog.hxx"
-#include "adabas/BConnection.hxx"
-#include "adabas/BGroups.hxx"
-#include "adabas/BUsers.hxx"
-#include "adabas/BTables.hxx"
-#include "adabas/BViews.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <comphelper/types.hxx>
-
-
-// -------------------------------------------------------------------------
-using namespace connectivity;
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -----------------------------------------------------------------------------
-OAdabasCatalog::OAdabasCatalog(SQLHANDLE _aConnectionHdl, OAdabasConnection* _pCon) : connectivity::sdbcx::OCatalog(_pCon)
- ,m_pConnection(_pCon)
- ,m_aConnectionHdl(_aConnectionHdl)
-{
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OAdabasCatalog::buildName(const Reference< XRow >& _xRow)
-{
- ::rtl::OUString sName;
- sName = _xRow->getString(2);
- if ( sName.getLength() )
- sName += OAdabasCatalog::getDot();
- sName += _xRow->getString(3);
-
- return sName;
-}
-// -----------------------------------------------------------------------------
-void OAdabasCatalog::fillVector(const ::rtl::OUString& _sQuery,TStringVector& _rVector)
-{
- Reference< XStatement > xStmt = m_pConnection->createStatement( );
- OSL_ENSURE(xStmt.is(),"OAdabasCatalog::fillVector: Could not create a statement!");
- Reference< XResultSet > xResult = xStmt->executeQuery(_sQuery);
-
- fillNames(xResult,_rVector);
- ::comphelper::disposeComponent(xStmt);
-
-}
-// -------------------------------------------------------------------------
-void OAdabasCatalog::refreshTables()
-{
- TStringVector aVector;
- {
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%"));
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),
- aTypes);
- fillNames(xResult,aVector);
- }
-
- if(m_pTables)
- m_pTables->reFill(aVector);
- else
- m_pTables = new OTables(m_xMetaData,*this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void OAdabasCatalog::refreshViews()
-{
- TStringVector aVector;
- static const ::rtl::OUString s_sView(RTL_CONSTASCII_USTRINGPARAM("SELECT DISTINCT NULL,DOMAIN.VIEWDEFS.OWNER, DOMAIN.VIEWDEFS.VIEWNAME FROM DOMAIN.VIEWDEFS"));
- fillVector(s_sView,aVector);
-
- if(m_pViews)
- m_pViews->reFill(aVector);
- else
- m_pViews = new OViews(m_xMetaData,*this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void OAdabasCatalog::refreshGroups()
-{
- TStringVector aVector;
- static const ::rtl::OUString s_sGroup(RTL_CONSTASCII_USTRINGPARAM("SELECT DISTINCT NULL,NULL,GROUPNAME FROM DOMAIN.USERS WHERE GROUPNAME IS NOT NULL AND GROUPNAME <> ' '"));
- fillVector(s_sGroup,aVector);
- if(m_pGroups)
- m_pGroups->reFill(aVector);
- else
- m_pGroups = new OGroups(*this,m_aMutex,aVector,m_pConnection,this);
-}
-// -------------------------------------------------------------------------
-void OAdabasCatalog::refreshUsers()
-{
- TStringVector aVector;
- static const ::rtl::OUString s_sUsers(RTL_CONSTASCII_USTRINGPARAM("SELECT DISTINCT NULL,NULL,USERNAME FROM DOMAIN.USERS WHERE USERNAME IS NOT NULL AND USERNAME <> ' ' AND USERNAME <> 'CONTROL'"));
- fillVector(s_sUsers,aVector);
-
- if(m_pUsers)
- m_pUsers->reFill(aVector);
- else
- m_pUsers = new OUsers(*this,m_aMutex,aVector,m_pConnection,this);
-}
-// -------------------------------------------------------------------------
-const ::rtl::OUString& OAdabasCatalog::getDot()
-{
- static const ::rtl::OUString sDot(RTL_CONSTASCII_USTRINGPARAM("."));
- return sDot;
-}
-// -----------------------------------------------------------------------------
-void OAdabasCatalog::correctColumnProperties(sal_Int32 /*_nPrec*/, sal_Int32& _rnType,::rtl::OUString& _rsTypeName)
-{
- switch(_rnType)
- {
- case DataType::DECIMAL:
- {
- static const ::rtl::OUString sDecimal(RTL_CONSTASCII_USTRINGPARAM("DECIMAL"));
- if(_rnType == DataType::DECIMAL && _rsTypeName == sDecimal)
- _rnType = DataType::NUMERIC;
- }
- break;
- case DataType::FLOAT:
- // if(_nPrec >= 16)
- {
- static const ::rtl::OUString sDouble(RTL_CONSTASCII_USTRINGPARAM("DOUBLE PRECISION"));
- _rsTypeName = sDouble;
- _rnType = DataType::DOUBLE;
- }
-// else if(_nPrec > 15)
-// {
-// static const ::rtl::OUString sReal( RTL_CONSTASCII_USTRINGPARAM( "REAL" ));
-// _rsTypeName = sReal;
-// _rnType = DataType::REAL;
-// }
- break;
- }
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BColumns.cxx b/connectivity/source/drivers/adabas/BColumns.cxx
deleted file mode 100644
index aa62a6a4d8..0000000000
--- a/connectivity/source/drivers/adabas/BColumns.cxx
+++ /dev/null
@@ -1,183 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BColumns.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include "adabas/BTable.hxx"
-#include "adabas/BTables.hxx"
-#include "adabas/BCatalog.hxx"
-#include <comphelper/types.hxx>
-#include "connectivity/dbtools.hxx"
-#include <comphelper/property.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity::adabas;
-using namespace connectivity::sdbcx;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
-{
- Reference< XResultSet > xResult = m_pTable->getMetaData()->getColumns(Any(),
- m_pTable->getSchema(),m_pTable->getTableName(),_rName);
-
- sdbcx::ObjectType xRet = NULL;
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- {
- if(xRow->getString(4) == _rName)
- {
- sal_Int32 nType = xRow->getInt(5);
- ::rtl::OUString sTypeName = xRow->getString(6);
- sal_Int32 nPrec = xRow->getInt(7);
- OAdabasCatalog::correctColumnProperties(nPrec,nType,sTypeName);
- sal_Bool bAutoIncrement = sal_False;
- if ( !_rName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DEFAULT")) && !m_pTable->getSchema().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DOMAIN")) && !m_pTable->getTableName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("COLUMNS")) )
- {
- Reference< XStatement > xStmt = m_pTable->getMetaData()->getConnection()->createStatement( );
- ::rtl::OUString sQuery(RTL_CONSTASCII_USTRINGPARAM("SELECT \"DEFAULT\" FROM DOMAIN.COLUMNS WHERE OWNER = '"));
- sQuery += m_pTable->getSchema();
- sQuery += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("' AND TABLENAME = '"));
- sQuery += m_pTable->getTableName() + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("' AND COLUMNNAME = '"));
- sQuery += _rName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- try
- {
- Reference< XResultSet > xResult2 = xStmt->executeQuery(sQuery);
- Reference< XRow > xRow2(xResult2,UNO_QUERY);
- if ( xRow2.is() && xResult2->next() )
- bAutoIncrement = xRow2->getString(1) == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DEFAULT STAMP"));
- }
- catch(const Exception&)
- {
- }
- }
-
- xRet = new OColumn(_rName,
- sTypeName,
- xRow->getString(13),
- xRow->getString(12),
- xRow->getInt(11),
- nPrec,
- xRow->getInt(9),
- nType,
- bAutoIncrement,sal_False,sal_False,sal_True);
- break;
- }
- }
- ::comphelper::disposeComponent(xResult);
- }
-
- return xRet;
-}
-
-// -------------------------------------------------------------------------
-void OColumns::impl_refresh() throw(RuntimeException)
-{
- m_pTable->refreshColumns();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OColumns::createDescriptor()
-{
- return new OColumn(sal_True);
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OColumns::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- ::osl::MutexGuard aGuard(m_rMutex);
- if ( m_pTable->isNew() )
- return cloneDescriptor( descriptor );
-
- ::rtl::OUString aSql(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE "));
- ::rtl::OUString sQuote = m_pTable->getMetaData()->getIdentifierQuoteString( );
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
-
- m_pTable->beginTransAction();
- try
- {
- aSql += ::dbtools::quoteName(sQuote,m_pTable->getSchema()) + sDot + ::dbtools::quoteName(sQuote,m_pTable->getTableName());
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ADD ("));
- aSql += ::dbtools::quoteName(sQuote,_rForName);
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
- aSql += OTables::getColumnSqlType(descriptor);
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" )"));
-
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement();
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
-
- m_pTable->alterNotNullValue(getINT32(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))),_rForName);
- }
- catch(const Exception&)
- {
- m_pTable->rollbackTransAction();
- throw;
- }
- m_pTable->endTransAction();
-
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OColumns::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- OSL_ENSURE(m_pTable,"OColumns::dropByName: Table is null!");
- if(!m_pTable->isNew())
- {
- ::rtl::OUString aSql(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE "));
- ::rtl::OUString sQuote = m_pTable->getMetaData()->getIdentifierQuoteString( );
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
-
- aSql += ::dbtools::quoteName(sQuote,m_pTable->getSchema()) + sDot + ::dbtools::quoteName(sQuote,m_pTable->getTableName());
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP "));
- aSql += ::dbtools::quoteName(sQuote,_sElementName);
-
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BConnection.cxx b/connectivity/source/drivers/adabas/BConnection.cxx
deleted file mode 100644
index 9aae67312c..0000000000
--- a/connectivity/source/drivers/adabas/BConnection.cxx
+++ /dev/null
@@ -1,274 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include "adabas/BConnection.hxx"
-#include "adabas/BDriver.hxx"
-#include "adabas/BCatalog.hxx"
-#include "odbc/OFunctions.hxx"
-#include "odbc/OTools.hxx"
-#include "adabas/BDatabaseMetaData.hxx"
-#include "adabas/BStatement.hxx"
-#include "adabas/BPreparedStatement.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <connectivity/dbcharset.hxx>
-#include "connectivity/sqliterator.hxx"
-#include <connectivity/sqlparse.hxx>
-
-#include <string.h>
-
-using namespace connectivity::adabas;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-
-//------------------------------------------------------------------------------
-namespace starlang = ::com::sun::star::lang;
-// --------------------------------------------------------------------------------
-OAdabasConnection::OAdabasConnection(const SQLHANDLE _pDriverHandle, connectivity::odbc::ODBCDriver* _pDriver)
- : OConnection_BASE2(_pDriverHandle,_pDriver)
-{
- m_bUseOldDateFormat = sal_True;
-}
-//-----------------------------------------------------------------------------
-SQLRETURN OAdabasConnection::Construct( const ::rtl::OUString& url,const Sequence< PropertyValue >& info) throw(SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- m_aConnectionHandle = SQL_NULL_HANDLE;
- setURL(url);
- setConnectionInfo(info);
-
- // Connection allozieren
- N3SQLAllocHandle(SQL_HANDLE_DBC,m_pDriverHandleCopy,&m_aConnectionHandle);
- if(m_aConnectionHandle == SQL_NULL_HANDLE)
- throw SQLException();
-
- const PropertyValue *pBegin = info.getConstArray();
- const PropertyValue *pEnd = pBegin + info.getLength();
- ::rtl::OUString sHostName;
-
- sal_Int32 nLen = url.indexOf(':');
- nLen = url.indexOf(':',nLen+1);
- ::rtl::OUString aDSN(url.copy(nLen+1)),aUID,aPWD;
- sal_Int32 nTimeout = 20;
- for(;pBegin != pEnd;++pBegin)
- {
- if ( !pBegin->Name.compareToAscii("Timeout") )
- pBegin->Value >>= nTimeout;
- else if(!pBegin->Name.compareToAscii("user"))
- pBegin->Value >>= aUID;
- else if(!pBegin->Name.compareToAscii("password"))
- pBegin->Value >>= aPWD;
- else if(!pBegin->Name.compareToAscii("HostName"))
- pBegin->Value >>= sHostName;
- else if(0 == pBegin->Name.compareToAscii("CharSet"))
- {
- ::rtl::OUString sIanaName;
- OSL_VERIFY( pBegin->Value >>= sIanaName );
-
- ::dbtools::OCharsetMap aLookupIanaName;
- ::dbtools::OCharsetMap::const_iterator aLookup = aLookupIanaName.find(sIanaName, ::dbtools::OCharsetMap::IANA());
- if (aLookup != aLookupIanaName.end())
- m_nTextEncoding = (*aLookup).getEncoding();
- else
- m_nTextEncoding = RTL_TEXTENCODING_DONTKNOW;
- if(m_nTextEncoding == RTL_TEXTENCODING_DONTKNOW)
- m_nTextEncoding = osl_getThreadTextEncoding();
- }
- }
- m_sUser = aUID;
-
- if ( sHostName.getLength() )
- aDSN = sHostName + rtl::OUString(static_cast<sal_Unicode>(':')) + aDSN;
- SQLRETURN nSQLRETURN = openConnectionWithAuth(aDSN,nTimeout, aUID,aPWD);
-
- return nSQLRETURN;
-}
-//-----------------------------------------------------------------------------
-SQLRETURN OAdabasConnection::openConnectionWithAuth(const ::rtl::OUString& aConnectStr,sal_Int32 nTimeOut, const ::rtl::OUString& _uid,const ::rtl::OUString& _pwd)
-{
- if (m_aConnectionHandle == SQL_NULL_HANDLE)
- return -1;
-
- SQLRETURN nSQLRETURN = 0;
- SDB_ODBC_CHAR szDSN[4096];
- SDB_ODBC_CHAR szUID[20];
- SDB_ODBC_CHAR szPWD[20];
-
- memset(szDSN,'\0',4096);
- memset(szUID,'\0',20);
- memset(szPWD,'\0',20);
-
- ::rtl::OString aConStr(::rtl::OUStringToOString(aConnectStr,getTextEncoding()));
- ::rtl::OString aUID(::rtl::OUStringToOString(_uid,getTextEncoding()));
- ::rtl::OString aPWD(::rtl::OUStringToOString(_pwd,getTextEncoding()));
- memcpy(szDSN, (SDB_ODBC_CHAR*) aConStr.getStr(), ::std::min<sal_Int32>((sal_Int32)2048,aConStr.getLength()));
- memcpy(szUID, (SDB_ODBC_CHAR*) aUID.getStr(), ::std::min<sal_Int32>((sal_Int32)20,aUID.getLength()));
- memcpy(szPWD, (SDB_ODBC_CHAR*) aPWD.getStr(), ::std::min<sal_Int32>((sal_Int32)20,aPWD.getLength()));
-
-
-
- N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_LOGIN_TIMEOUT,(SQLPOINTER)(sal_IntPtr)nTimeOut,SQL_IS_INTEGER);
- // Verbindung aufbauen
-
- nSQLRETURN = N3SQLConnect(m_aConnectionHandle,
- szDSN,
- (SQLSMALLINT) ::std::min<sal_Int32>((sal_Int32)2048,aConStr.getLength()),
- szUID,
- (SQLSMALLINT) ::std::min<sal_Int32>((sal_Int32)20,aUID.getLength()),
- szPWD,
- (SQLSMALLINT) ::std::min<sal_Int32>((sal_Int32)20,aPWD.getLength()));
- if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA)
- return nSQLRETURN;
-
- m_bClosed = sal_False;
-
- // autocoomit ist immer default
-
- N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_AUTOCOMMIT,(SQLPOINTER)SQL_AUTOCOMMIT_ON,SQL_IS_INTEGER);
-
- return nSQLRETURN;
-}
-
-//------------------------------------------------------------------------------
-void OAdabasConnection::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- Reference< XTablesSupplier > xTableSupplier(m_xCatalog);
- ::comphelper::disposeComponent(xTableSupplier);
-
- m_xCatalog = WeakReference< XTablesSupplier >();
-
- OConnection_BASE2::disposing();
-}
-//------------------------------------------------------------------------------
-Reference< XTablesSupplier > OAdabasConnection::createCatalog()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- Reference< XTablesSupplier > xTab = m_xCatalog;
- if(!xTab.is())
- {
- xTab = new OAdabasCatalog(m_aConnectionHandle,this);
- m_xCatalog = xTab;
- }
- return xTab;
-}
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL OAdabasConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE2::rBHelper.bDisposed);
-
-
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if(!xMetaData.is())
- {
- xMetaData = new OAdabasDatabaseMetaData(m_aConnectionHandle,this);
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL OAdabasConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE2::rBHelper.bDisposed);
-
- Reference< XStatement > xReturn = new OAdabasStatement(this);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OAdabasConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE2::rBHelper.bDisposed);
-
- Reference< XPreparedStatement > xReturn = new OAdabasPreparedStatement(this,sql);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// -----------------------------------------------------------------------------
-sal_Int64 SAL_CALL OAdabasConnection::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw (::com::sun::star::uno::RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OConnection_BASE2::getSomething(rId);
-}
-// -----------------------------------------------------------------------------
-Sequence< sal_Int8 > OAdabasConnection::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-// -----------------------------------------------------------------------------
-::connectivity::odbc::OConnection* OAdabasConnection::cloneConnection()
-{
- return new OAdabasConnection(m_pDriverHandleCopy,m_pDriver);
-}
-// -----------------------------------------------------------------------------
-::rtl::Reference<OSQLColumns> OAdabasConnection::createSelectColumns(const ::rtl::OUString& _rSql)
-{
- ::rtl::Reference<OSQLColumns> aRet;
- OSQLParser aParser(getDriver()->getORB());
- ::rtl::OUString sErrorMessage;
- OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_rSql);
- if(pNode)
- {
- Reference< XTablesSupplier> xCata = createCatalog();
- OSQLParseTreeIterator aParseIter(this, xCata->getTables(),
- aParser, pNode);
- aParseIter.traverseAll();
- aRet = aParseIter.getSelectColumns();
- }
- return aRet;
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BDatabaseMetaData.cxx b/connectivity/source/drivers/adabas/BDatabaseMetaData.cxx
deleted file mode 100644
index d1a9b96e98..0000000000
--- a/connectivity/source/drivers/adabas/BDatabaseMetaData.cxx
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "adabas/BDatabaseMetaData.hxx"
-#include "FDatabaseMetaDataResultSet.hxx"
-
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-::rtl::OUString SAL_CALL OAdabasDatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue(RTL_CONSTASCII_USTRINGPARAM("sdbc:adabas:"));
- aValue += OAdabasDatabaseMetaData_BASE::getURLImpl();
- return aValue;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OAdabasDatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-Reference< XResultSet > OAdabasDatabaseMetaData::impl_getTypeInfo_throw( )
-{
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
- Reference< XResultSet > xNewRes = pResult;
- static ::connectivity::ODatabaseMetaDataResultSet::ORows aRows;
- if(aRows.empty())
- {
- aRows.reserve(19);
- Reference< XResultSet > xRes = OAdabasDatabaseMetaData_BASE::impl_getTypeInfo_throw();
-
- if(xRes.is())
- {
- ::connectivity::ODatabaseMetaDataResultSet::ORow aRow(19);
-
- Reference< XRow> xRow(xRes,UNO_QUERY);
- while(xRes->next())
- {
- sal_Int32 nPos = 1;
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getString (1));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getInt (2));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getInt (3));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getString (4));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getString (5));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getString (6));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getInt (7));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getBoolean (8));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getShort (9));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getBoolean (10));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getInt (11));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getBoolean (12));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getString (13));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getShort (14));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getShort (15));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getInt (16));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator(xRow->getInt (17));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
- aRow[nPos++] = new ::connectivity::ORowSetValueDecorator((sal_Int16)xRow->getInt(18));
- if(xRow->wasNull())
- aRow[nPos-1]->setNull();
-
- // we have to fix some incorrect entries
- if(!aRow[2]->getValue().isNull())
- {
- switch((sal_Int32)aRow[2]->getValue())
- {
- case DataType::FLOAT:
- case DataType::REAL:
- case DataType::DOUBLE:
- aRow[2]->setValue(DataType::DOUBLE);
- aRow[3]->setValue(sal_Int32(18));
- break;
- case DataType::TIMESTAMP:
- aRow[3]->setValue(sal_Int32(27));
- break;
- default:
- break;
- }
- }
- aRows.push_back(aRow);
- }
- }
- }
- pResult->setRows(aRows);
- return xNewRes;
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BDriver.cxx b/connectivity/source/drivers/adabas/BDriver.cxx
deleted file mode 100644
index f215b17b9d..0000000000
--- a/connectivity/source/drivers/adabas/BDriver.cxx
+++ /dev/null
@@ -1,1870 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#ifdef SYSTEM_ODBC_HEADERS
-#include <sqltypes.h>
-#else
-#include <odbc/sqltypes.h>
-#endif
-
-#include <unotools/tempfile.hxx>
-#include <sal/macros.h>
-#include "adabas/BDriver.hxx"
-#include "adabas/BConnection.hxx"
-#include "odbc/OFunctions.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "odbc/OTools.hxx"
-#include "connectivity/dbexception.hxx"
-#include "TConnection.hxx"
-#include "diagnose_ex.h"
-
-#include <osl/process.h>
-#include <unotools/ucbhelper.hxx>
-#include <unotools/ucbstreamhelper.hxx>
-#include <unotools/localfilehelper.hxx>
-#include "resource/adabas_res.hrc"
-#include "resource/sharedresources.hxx"
-
-
-#include <memory>
-#include <sys/stat.h>
-
-#if defined(UNX)
-const char sNewLine = '\012';
-#else
-const char sNewLine[] = "\015\012"; // \015\012 and not \n
-#endif
-#define ADABAS_DB_11 "11.02.00"
-#define ADABAS_KERNEL_11 "11.02"
-#define ADABAS_DB_12 "12.01.00"
-#define ADABAS_KERNEL_12 "12.01"
-#define CURRENT_DB_VERSION "13.01.00"
-#define CURRENT_KERNEL_VERSION "13.01"
-
-#define OPROCESS_ADABAS (osl_Process_HIDDEN | osl_Process_WAIT | osl_Process_SEARCHPATH)
-#define OPROCESS_ADABAS_DBG (osl_Process_WAIT | osl_Process_SEARCHPATH)
-
-
-using namespace connectivity;
-namespace connectivity
-{
- namespace adabas
- {
- // extern declaration of the function pointer
- extern T3SQLAllocHandle pODBC3SQLAllocHandle;
- extern T3SQLConnect pODBC3SQLConnect;
- extern T3SQLDriverConnect pODBC3SQLDriverConnect;
- extern T3SQLBrowseConnect pODBC3SQLBrowseConnect;
- extern T3SQLDataSources pODBC3SQLDataSources;
- extern T3SQLDrivers pODBC3SQLDrivers;
- extern T3SQLGetInfo pODBC3SQLGetInfo;
- extern T3SQLGetFunctions pODBC3SQLGetFunctions;
- extern T3SQLGetTypeInfo pODBC3SQLGetTypeInfo;
- extern T3SQLSetConnectAttr pODBC3SQLSetConnectAttr;
- extern T3SQLGetConnectAttr pODBC3SQLGetConnectAttr;
- extern T3SQLSetEnvAttr pODBC3SQLSetEnvAttr;
- extern T3SQLGetEnvAttr pODBC3SQLGetEnvAttr;
- extern T3SQLSetStmtAttr pODBC3SQLSetStmtAttr;
- extern T3SQLGetStmtAttr pODBC3SQLGetStmtAttr;
- extern T3SQLPrepare pODBC3SQLPrepare;
- extern T3SQLBindParameter pODBC3SQLBindParameter;
- extern T3SQLSetCursorName pODBC3SQLSetCursorName;
- extern T3SQLExecute pODBC3SQLExecute;
- extern T3SQLExecDirect pODBC3SQLExecDirect;
- extern T3SQLDescribeParam pODBC3SQLDescribeParam;
- extern T3SQLNumParams pODBC3SQLNumParams;
- extern T3SQLParamData pODBC3SQLParamData;
- extern T3SQLPutData pODBC3SQLPutData;
- extern T3SQLRowCount pODBC3SQLRowCount;
- extern T3SQLNumResultCols pODBC3SQLNumResultCols;
- extern T3SQLDescribeCol pODBC3SQLDescribeCol;
- extern T3SQLColAttribute pODBC3SQLColAttribute;
- extern T3SQLBindCol pODBC3SQLBindCol;
- extern T3SQLFetch pODBC3SQLFetch;
- extern T3SQLFetchScroll pODBC3SQLFetchScroll;
- extern T3SQLGetData pODBC3SQLGetData;
- extern T3SQLSetPos pODBC3SQLSetPos;
- extern T3SQLBulkOperations pODBC3SQLBulkOperations;
- extern T3SQLMoreResults pODBC3SQLMoreResults;
- extern T3SQLGetDiagRec pODBC3SQLGetDiagRec;
- extern T3SQLColumnPrivileges pODBC3SQLColumnPrivileges;
- extern T3SQLColumns pODBC3SQLColumns;
- extern T3SQLForeignKeys pODBC3SQLForeignKeys;
- extern T3SQLPrimaryKeys pODBC3SQLPrimaryKeys;
- extern T3SQLProcedureColumns pODBC3SQLProcedureColumns;
- extern T3SQLProcedures pODBC3SQLProcedures;
- extern T3SQLSpecialColumns pODBC3SQLSpecialColumns;
- extern T3SQLStatistics pODBC3SQLStatistics;
- extern T3SQLTablePrivileges pODBC3SQLTablePrivileges;
- extern T3SQLTables pODBC3SQLTables;
- extern T3SQLFreeStmt pODBC3SQLFreeStmt;
- extern T3SQLCloseCursor pODBC3SQLCloseCursor;
- extern T3SQLCancel pODBC3SQLCancel;
- extern T3SQLEndTran pODBC3SQLEndTran;
- extern T3SQLDisconnect pODBC3SQLDisconnect;
- extern T3SQLFreeHandle pODBC3SQLFreeHandle;
- extern T3SQLGetCursorName pODBC3SQLGetCursorName;
- extern T3SQLNativeSql pODBC3SQLNativeSql;
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace utl;
-using namespace osl;
-using namespace ::dbtools;
-
- sal_Bool LoadFunctions(oslModule pODBCso);
- sal_Bool LoadLibrary_ADABAS(::rtl::OUString &_rPath);
- // --------------------------------------------------------------------------------
-void ODriver::fillInfo(const Sequence< PropertyValue >& info, TDatabaseStruct& _rDBInfo)
-{
- const PropertyValue* pIter = info.getConstArray();
- const PropertyValue* pEnd = pIter + info.getLength();
- for(;pIter != pEnd;++pIter)
- {
- if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DatabaseName"))))
- {
- pIter->Value >>= _rDBInfo.sDBName;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlUser"))))
- {
- pIter->Value >>= _rDBInfo.sControlUser;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlPassword"))))
- {
- pIter->Value >>= _rDBInfo.sControlPassword;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataCacheSizeIncrement"))))
- pIter->Value >>= _rDBInfo.nDataIncrement;
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShutdownDatabase"))))
- pIter->Value >>= _rDBInfo.bShutDown;
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("User"))))
- {
- pIter->Value >>= _rDBInfo.sSysUser;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Password"))))
- {
- pIter->Value >>= _rDBInfo.sSysPassword;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DomainPassword"))))
- {
- pIter->Value >>= _rDBInfo.sDomainPassword;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CacheSize"))))
- {
- pIter->Value >>= _rDBInfo.sCacheSize;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RestoreDatabase"))))
- {
- pIter->Value >>= _rDBInfo.bRestoreDatabase;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Backup"))))
- {
- pIter->Value >>= _rDBInfo.sBackupFile;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataDevSpace"))))
- {
- pIter->Value >>= _rDBInfo.sDataDevName;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SYSDEVSPACE"))))
- {
- pIter->Value >>= _rDBInfo.sSysDevSpace;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TRANSACTION_LOG"))))
- {
- pIter->Value >>= _rDBInfo.sTransLogName;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataDevSize"))))
- {
- pIter->Value >>= _rDBInfo.nDataSize;
- }
- else if(pIter->Name.equalsIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LogDevSize"))))
- {
- pIter->Value >>= _rDBInfo.nLogSize;
- }
- }
-}
-
-
-// --------------------------------------------------------------------------------
-ODriver::ODriver(const Reference< XMultiServiceFactory >& _rxFactory) : ODBCDriver(_rxFactory)
-{
- osl_incrementInterlockedCount(&m_refCount);
- fillEnvironmentVariables();
- Reference< XComponent > xComponent(m_xORB, UNO_QUERY);
- if (xComponent.is())
- {
- Reference< ::com::sun::star::lang::XEventListener> xEvtL((::cppu::OWeakObject*)this,UNO_QUERY);
- xComponent->addEventListener(xEvtL);
- }
- osl_decrementInterlockedCount(&m_refCount);
-}
-//------------------------------------------------------------------------------
-void ODriver::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- ODriver_BASE::disposing();
- Reference< XComponent > xComponent(m_xORB, UNO_QUERY);
- if (xComponent.is())
- {
- Reference< XEventListener> xEvtL((::cppu::OWeakObject*)this,UNO_QUERY);
- xComponent->removeEventListener(xEvtL);
- }
- m_xORB.clear();
-}
-
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString ODriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdbcx.adabas.ODriver"));
-}
-//------------------------------------------------------------------------------
-Sequence< ::rtl::OUString > ODriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
-{
- Sequence< ::rtl::OUString > aSNS( 2 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"));
- aSNS[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Driver"));
- return aSNS;
-}
-//------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-
-//------------------------------------------------------------------
-sal_Bool SAL_CALL ODriver::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- const Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-//------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL ODriver::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-//------------------------------------------------------------------
-Any SAL_CALL ODriver::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ::cppu::queryInterface(rType, static_cast<XDataDefinitionSupplier*>(this));
- if ( !aRet.hasValue() )
- aRet = ODriver_BASE::queryInterface(rType);
- return aRet.hasValue() ? aRet : ODriver_BASE2::queryInterface(rType);
-}
-//------------------------------------------------------------------
-Reference< XInterface > SAL_CALL ODriver_CreateInstance(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFac) throw( Exception )
-{
- return *(new ODriver(_rxFac));
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODriver::disposing( const EventObject& Source ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if(m_xORB.is() && Reference< XMultiServiceFactory >(Source.Source,UNO_QUERY) == m_xORB)
- {
- TDatabaseMap::iterator aIter = m_aDatabaseMap.begin();
- for(;aIter != m_aDatabaseMap.end();++aIter)
- {
- if(aIter->second.bShutDown)
- {
- ::rtl::OUString sName;
- if(getDBName(aIter->first,sName))
- {
- XUTIL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SHUTDOWN QUICK")),sName,aIter->second.sControlUser,aIter->second.sControlPassword);
- X_STOP(sName);
- }
- }
- }
- m_xORB.clear();
- }
-}
-// --------------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL ODriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- if ( ! acceptsURL(url) )
- return NULL;
-
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- TDatabaseStruct aDBInfo;
- aDBInfo.bShutDown = sal_False;
- fillInfo(info,aDBInfo);
- aDBInfo.sControlUser = aDBInfo.sControlUser.toAsciiUpperCase();
- aDBInfo.sControlPassword = aDBInfo.sControlPassword.toAsciiUpperCase();
- aDBInfo.sSysUser = aDBInfo.sSysUser.toAsciiUpperCase();
- aDBInfo.sSysPassword = aDBInfo.sSysPassword.toAsciiUpperCase();
-
-
- TDatabaseMap::iterator aFind = m_aDatabaseMap.find(url);
- if(aFind == m_aDatabaseMap.end()) // only when not found yet
- m_aDatabaseMap[url] = aDBInfo;
- else
- {
- if(aFind->second.bShutDown != aDBInfo.bShutDown)
- aFind->second.bShutDown &= aDBInfo.bShutDown;
- }
-
- ::rtl::OUString sName;
- if(aDBInfo.sControlPassword.getLength() && aDBInfo.sControlUser.getLength() && getDBName(url,sName))
- {
- // check if we have to add a new data dev space
- checkAndInsertNewDevSpace(sName,aDBInfo);
-
- convertOldVersion(sName,aDBInfo);
- // check if we must restart the database
- checkAndRestart(sName,aDBInfo);
- }
-
-
- if(!m_pDriverHandle)
- {
- ::rtl::OUString aPath;
- if(!EnvironmentHandle(aPath))
- throw SQLException(aPath,*this,::rtl::OUString(),1000,Any());
- }
- OAdabasConnection* pCon = new OAdabasConnection(m_pDriverHandle,this);
- Reference< XConnection > xCon = pCon;
- SQLRETURN nSQLRETURN = pCon->Construct(url,info);
-
- if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA)
- {
- odbc::OTools::ThrowException(pCon,nSQLRETURN,pCon->getConnection(),SQL_HANDLE_DBC,*this);
- }
-
- m_xConnections.push_back(WeakReferenceHelper(*pCon));
-
- return xCon;
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODriver::getDBName(const ::rtl::OUString& _rName,::rtl::OUString& sDBName) const
-{
- sDBName = ::rtl::OUString();
- ::rtl::OUString sName = _rName.copy(12);
- sal_Int32 nPos = sName.indexOf(':');
- if(nPos != -1 && nPos < 1)
- sDBName = sName.copy(1);
- return (nPos != -1 && nPos < 1);
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL ODriver::acceptsURL( const ::rtl::OUString& url )
- throw(SQLException, RuntimeException)
-{
- return (!url.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:adabas:")),12));
-}
-// --------------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL ODriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/) throw(SQLException, RuntimeException)
-{
- if ( acceptsURL(url) )
- {
- ::std::vector< DriverPropertyInfo > aDriverInfo;
-
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShutdownDatabase"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Shut down service when closing."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlUser"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Control user name."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"))
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlPassword"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Control password."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataCacheSizeIncrement"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Data increment (MB)."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet of the database."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- return Sequence< DriverPropertyInfo >(&aDriverInfo[0],aDriverInfo.size());
- }
-
- SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- return Sequence< DriverPropertyInfo >();
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODriver::getMajorVersion( ) throw(RuntimeException)
-{
- return 1;
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODriver::getMinorVersion( ) throw(RuntimeException)
-{
- return 0;
-}
-// -----------------------------------------------------------------------------
-// XCreateCatalog
-void SAL_CALL ODriver::createCatalog( const Sequence< PropertyValue >& info ) throw(SQLException, ElementExistException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- try
- {
- TDatabaseStruct aDBInfo;
- fillInfo(info,aDBInfo);
-
- ::rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DBSERVICE"));
- ::rtl::OUString envData(RTL_CONSTASCII_USTRINGPARAM("0"));
- osl_setEnvironment(envVar.pData, envData.pData);
-
- m_sDbRunDir = m_sDbWorkURL + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/wrk/")) + aDBInfo.sDBName;
- String sTemp;
- LocalFileHelper::ConvertURLToPhysicalName(m_sDbRunDir,sTemp);
- m_sDbRunDir = sTemp;
-
- createNeededDirs(aDBInfo.sDBName);
- if(CreateFiles(aDBInfo))
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_NO_DISK_SPACE,
- "$filename$",aDBInfo.sDBName
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- } // if(CreateFiles(aDBInfo))
-
- createDb(aDBInfo);
- }
- catch( SQLException&)
- {
- throw;
- }
- catch(Exception&)
- {
- throw SQLException();
- }
-
-}
-// -----------------------------------------------------------------------------
-// XDropCatalog
-void SAL_CALL ODriver::dropCatalog( const ::rtl::OUString& /*catalogName*/, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, NoSuchElementException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- ::dbtools::throwFeatureNotImplementedException( "!XDropCatalog::dropCatalog", *this );
-}
-//-----------------------------------------------------------------------------
-// ODBC Environment (common for all Connections):
-SQLHANDLE ODriver::EnvironmentHandle(::rtl::OUString &_rPath)
-{
- // Has an Environment already been created (for this Instance)?
- if (!m_pDriverHandle)
- {
- SQLHANDLE h = SQL_NULL_HANDLE;
- // allocate Environment
-
- // load ODBC-DLL now:
- if (! LoadLibrary_ADABAS(_rPath))
- return SQL_NULL_HANDLE;
-
- if (N3SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&h) != SQL_SUCCESS)
- return SQL_NULL_HANDLE;
-
- // Save in global Structure...
- m_pDriverHandle = h;
- SQLRETURN nError = N3SQLSetEnvAttr(h, SQL_ATTR_ODBC_VERSION,(SQLPOINTER) SQL_OV_ODBC3, SQL_IS_INTEGER);
- OSL_UNUSED( nError );
- //N3SQLSetEnvAttr(h, SQL_ATTR_CONNECTION_POOLING,(SQLPOINTER) SQL_CP_ONE_PER_HENV, SQL_IS_INTEGER);
- }
-
- return m_pDriverHandle;
-}
-// --------------------------------------------------------------------------------
-// XDataDefinitionSupplier
-Reference< XTablesSupplier > SAL_CALL ODriver::getDataDefinitionByConnection( const Reference< ::com::sun::star::sdbc::XConnection >& connection ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- Reference< XTablesSupplier > xTab;
- Reference< ::com::sun::star::lang::XUnoTunnel> xTunnel(connection,UNO_QUERY);
- if ( xTunnel.is() )
- {
-
- OAdabasConnection* pConnection = NULL;
- OAdabasConnection* pSearchConnection = reinterpret_cast< OAdabasConnection* >( xTunnel->getSomething(OAdabasConnection::getUnoTunnelImplementationId()) );
- for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
- {
- if ( (OAdabasConnection*) Reference< XConnection >::query(i->get().get()).get() == pSearchConnection )
- {
- pConnection = pSearchConnection;
- break;
- }
- }
-
-
- if ( pConnection )
- xTab = pConnection->createCatalog();
- }
- return xTab;
-}
-
-// --------------------------------------------------------------------------------
-Reference< XTablesSupplier > SAL_CALL ODriver::getDataDefinitionByURL( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- if ( ! acceptsURL(url) )
- {
- SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- } // if ( ! acceptsURL(url) )
-
- return getDataDefinitionByConnection(connect(url,info));
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODriver::acquire() throw()
-{
- ODriver_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODriver::release() throw()
-{
- ODriver_BASE::release();
-}
-ODriver::~ODriver()
-{
-}
-// -----------------------------------------------------------------------------
-oslGenericFunction ODriver::getOdbcFunction(sal_Int32 _nIndex) const
-{
- oslGenericFunction pFunction = NULL;
- switch(_nIndex)
- {
- case ODBC3SQLAllocHandle:
- pFunction = (oslGenericFunction)pODBC3SQLAllocHandle;;
- break;
- case ODBC3SQLConnect:
- pFunction = (oslGenericFunction)pODBC3SQLConnect;
- break;
- case ODBC3SQLDriverConnect:
- pFunction = (oslGenericFunction)pODBC3SQLDriverConnect;
- break;
- case ODBC3SQLBrowseConnect:
- pFunction = (oslGenericFunction)pODBC3SQLBrowseConnect;
- break;
- case ODBC3SQLDataSources:
- pFunction = (oslGenericFunction)pODBC3SQLDataSources;
- break;
- case ODBC3SQLDrivers:
- pFunction = (oslGenericFunction)pODBC3SQLDrivers;
- break;
- case ODBC3SQLGetInfo:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetInfo;
- break;
- case ODBC3SQLGetFunctions:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetFunctions;
- break;
- case ODBC3SQLGetTypeInfo:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetTypeInfo;
- break;
- case ODBC3SQLSetConnectAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetConnectAttr;
- break;
- case ODBC3SQLGetConnectAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetConnectAttr;
- break;
- case ODBC3SQLSetEnvAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetEnvAttr;
- break;
- case ODBC3SQLGetEnvAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetEnvAttr;
- break;
- case ODBC3SQLSetStmtAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetStmtAttr;
- break;
- case ODBC3SQLGetStmtAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetStmtAttr;
- break;
- case ODBC3SQLPrepare:
-
- pFunction = (oslGenericFunction)pODBC3SQLPrepare;
- break;
- case ODBC3SQLBindParameter:
-
- pFunction = (oslGenericFunction)pODBC3SQLBindParameter;
- break;
- case ODBC3SQLSetCursorName:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetCursorName;
- break;
- case ODBC3SQLExecute:
-
- pFunction = (oslGenericFunction)pODBC3SQLExecute;
- break;
- case ODBC3SQLExecDirect:
-
- pFunction = (oslGenericFunction)pODBC3SQLExecDirect;
- break;
- case ODBC3SQLDescribeParam:
-
- pFunction = (oslGenericFunction)pODBC3SQLDescribeParam;
- break;
- case ODBC3SQLNumParams:
-
- pFunction = (oslGenericFunction)pODBC3SQLNumParams;
- break;
- case ODBC3SQLParamData:
-
- pFunction = (oslGenericFunction)pODBC3SQLParamData;
- break;
- case ODBC3SQLPutData:
-
- pFunction = (oslGenericFunction)pODBC3SQLPutData;
- break;
- case ODBC3SQLRowCount:
-
- pFunction = (oslGenericFunction)pODBC3SQLRowCount;
- break;
- case ODBC3SQLNumResultCols:
-
- pFunction = (oslGenericFunction)pODBC3SQLNumResultCols;
- break;
- case ODBC3SQLDescribeCol:
-
- pFunction = (oslGenericFunction)pODBC3SQLDescribeCol;
- break;
- case ODBC3SQLColAttribute:
-
- pFunction = (oslGenericFunction)pODBC3SQLColAttribute;
- break;
- case ODBC3SQLBindCol:
-
- pFunction = (oslGenericFunction)pODBC3SQLBindCol;
- break;
- case ODBC3SQLFetch:
-
- pFunction = (oslGenericFunction)pODBC3SQLFetch;
- break;
- case ODBC3SQLFetchScroll:
-
- pFunction = (oslGenericFunction)pODBC3SQLFetchScroll;
- break;
- case ODBC3SQLGetData:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetData;
- break;
- case ODBC3SQLSetPos:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetPos;
- break;
- case ODBC3SQLBulkOperations:
-
- pFunction = (oslGenericFunction)pODBC3SQLBulkOperations;
- break;
- case ODBC3SQLMoreResults:
-
- pFunction = (oslGenericFunction)pODBC3SQLMoreResults;
- break;
- case ODBC3SQLGetDiagRec:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetDiagRec;
- break;
- case ODBC3SQLColumnPrivileges:
-
- pFunction = (oslGenericFunction)pODBC3SQLColumnPrivileges;
- break;
- case ODBC3SQLColumns:
-
- pFunction = (oslGenericFunction)pODBC3SQLColumns;
- break;
- case ODBC3SQLForeignKeys:
-
- pFunction = (oslGenericFunction)pODBC3SQLForeignKeys;
- break;
- case ODBC3SQLPrimaryKeys:
-
- pFunction = (oslGenericFunction)pODBC3SQLPrimaryKeys;
- break;
- case ODBC3SQLProcedureColumns:
-
- pFunction = (oslGenericFunction)pODBC3SQLProcedureColumns;
- break;
- case ODBC3SQLProcedures:
-
- pFunction = (oslGenericFunction)pODBC3SQLProcedures;
- break;
- case ODBC3SQLSpecialColumns:
-
- pFunction = (oslGenericFunction)pODBC3SQLSpecialColumns;
- break;
- case ODBC3SQLStatistics:
-
- pFunction = (oslGenericFunction)pODBC3SQLStatistics;
- break;
- case ODBC3SQLTablePrivileges:
-
- pFunction = (oslGenericFunction)pODBC3SQLTablePrivileges;
- break;
- case ODBC3SQLTables:
-
- pFunction = (oslGenericFunction)pODBC3SQLTables;
- break;
- case ODBC3SQLFreeStmt:
-
- pFunction = (oslGenericFunction)pODBC3SQLFreeStmt;
- break;
- case ODBC3SQLCloseCursor:
-
- pFunction = (oslGenericFunction)pODBC3SQLCloseCursor;
- break;
- case ODBC3SQLCancel:
-
- pFunction = (oslGenericFunction)pODBC3SQLCancel;
- break;
- case ODBC3SQLEndTran:
-
- pFunction = (oslGenericFunction)pODBC3SQLEndTran;
- break;
- case ODBC3SQLDisconnect:
-
- pFunction = (oslGenericFunction)pODBC3SQLDisconnect;
- break;
- case ODBC3SQLFreeHandle:
-
- pFunction = (oslGenericFunction)pODBC3SQLFreeHandle;
- break;
- case ODBC3SQLGetCursorName:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetCursorName;
- break;
- case ODBC3SQLNativeSql:
-
- pFunction = (oslGenericFunction)pODBC3SQLNativeSql;
- break;
- default:
- OSL_FAIL("Function unknown!");
- }
- return pFunction;
-}
-// -----------------------------------------------------------------------------
-void ODriver::createNeededDirs(const ::rtl::OUString& sDBName)
-{
- ::rtl::OUString sDbWork,sDBConfig,sTemp;
-
- if(m_sDbWork.getLength())
- {
- sDbWork = m_sDbWorkURL;
- if(!UCBContentHelper::IsFolder(m_sDbWorkURL))
- UCBContentHelper::MakeFolder(m_sDbWorkURL);
-
- sDbWork += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- sDbWork += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("wrk"));
- if(!UCBContentHelper::IsFolder(sDbWork))
- UCBContentHelper::MakeFolder(sDbWork);
-
- sDbWork += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
-
- sTemp = sDbWork;
- sTemp += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("config"));
- if(!UCBContentHelper::IsFolder(sTemp))
- UCBContentHelper::MakeFolder(sTemp);
-
- sTemp = sDbWork;
- sTemp += sDBName;
- if(!UCBContentHelper::IsFolder(sTemp))
- UCBContentHelper::MakeFolder(sTemp);
- }
-
- if(m_sDbConfig.getLength())
- {
- sDBConfig = m_sDbConfigURL;
- if(!UCBContentHelper::IsFolder(sDBConfig))
- UCBContentHelper::MakeFolder(sDBConfig);
-
- sDBConfig += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- sTemp = sDBConfig;
- sTemp += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("config"));
- if(!UCBContentHelper::IsFolder(sTemp))
- UCBContentHelper::MakeFolder(sTemp);
-
- sTemp += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- sTemp += sDBName;
- if(UCBContentHelper::Exists(sTemp))
- UCBContentHelper::Kill(sTemp);
-
-#if !(defined(WNT))
- sTemp = sDBConfig;
- sTemp += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("diag"));
- if(!UCBContentHelper::IsFolder(sTemp))
- UCBContentHelper::MakeFolder(sTemp);
-
- sTemp = sDBConfig;
- sTemp += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ipc"));
- if(!UCBContentHelper::IsFolder(sTemp))
- UCBContentHelper::MakeFolder(sTemp);
-
- sTemp = sDBConfig;
- sTemp += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("spool"));
- if(!UCBContentHelper::IsFolder(sTemp))
- UCBContentHelper::MakeFolder(sTemp);
-#endif
- }
-}
-// -----------------------------------------------------------------------------
-void ODriver::clearDatabase(const ::rtl::OUString& sDBName)
-{ // stop the database
- ::rtl::OUString sCommand;
-#if defined(WNT)
- ::rtl::OUString sStop = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("stop"));
- const sal_uInt32 nArgsCount = 2;
- rtl_uString *pArgs[nArgsCount] = { sDBName.pData, sStop.pData };
-#else
- sCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("x_clear"));
- const sal_uInt32 nArgsCount = 1;
- rtl_uString* pArgs[nArgsCount] = { sDBName.pData };
-#endif
-
- oslProcess aApp;
-
-#if OSL_DEBUG_LEVEL > 0
- oslProcessError eError =
-#endif
- osl_executeProcess(sCommand.pData, pArgs, nArgsCount,
- OPROCESS_ADABAS, NULL, m_sDbWorkURL.pData,
- NULL, 0, &aApp);
- OSL_ENSURE( eError == osl_Process_E_None, "ODriver::clearDatabase: calling the executable failed!" );
-}
-// -----------------------------------------------------------------------------
-void ODriver::createDb( const TDatabaseStruct& _aInfo)
-{
-
- clearDatabase(_aInfo.sDBName);
-
- X_PARAM(_aInfo.sDBName,_aInfo.sControlUser,_aInfo.sControlPassword,String::CreateFromAscii("BINIT"));
-
- String sTemp;
- LocalFileHelper::ConvertURLToPhysicalName(_aInfo.sSysDevSpace,sTemp);
-
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SYSDEVSPACE")),sTemp);
-
- sTemp.Erase();
- LocalFileHelper::ConvertURLToPhysicalName(_aInfo.sTransLogName,sTemp);
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TRANSACTION_LOG")),sTemp);
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MAXUSERTASKS")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("3")));
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MAXDEVSPACES")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("7")));
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MAXDATADEVSPACES")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("5")));
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MAXDATAPAGES")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("25599")));
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MAXBACKUPDEVS")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1")));
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MAXSERVERDB")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1")));
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA_CACHE_PAGES")),_aInfo.sCacheSize);
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONV_CACHE_PAGES")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("23")));
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PROC_DATA_PAGES")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("40")));
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RUNDIRECTORY")),m_sDbRunDir);
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KERNELTRACESIZE")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("100")));
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LOG_QUEUE_PAGES")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("10")));
-
-#if !defined(WNT)
- PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OPMSG1")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/dev/null")));
-#endif
-
- X_PARAM(_aInfo.sDBName,_aInfo.sControlUser,_aInfo.sControlPassword,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BCHECK")));
-
- X_START(_aInfo.sDBName);
-
- // SHOW_STATE()
- // %m_sDbRoot%\bin\xutil -d %_aInfo.sDBName% -u %CONUSR%,%CONPWD% -b %INITCMD%
- ::rtl::OUString aBatch2 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-b "));
-
- // generate the init file for the database
- String sInitFile = getDatabaseInitFile(_aInfo);
-
- LocalFileHelper::ConvertURLToPhysicalName(sInitFile,sTemp);
- aBatch2 += sTemp;
- XUTIL(aBatch2,_aInfo.sDBName,_aInfo.sControlUser,_aInfo.sControlPassword);
-#if OSL_DEBUG_LEVEL < 2
- if(UCBContentHelper::Exists(sInitFile))
- UCBContentHelper::Kill(sInitFile);
-#endif
-
- // install system tables
- installSystemTables(_aInfo);
- // now we have to make our SYSDBA user "NOT EXCLUSIVE"
- {
- String sExt;
- sExt.AssignAscii(".sql");
-
- String sWorkUrl(m_sDbWorkURL);
- ::utl::TempFile aInitFile(String::CreateFromAscii("Init"),&sExt,&sWorkUrl);
- aInitFile.EnableKillingFile();
- {
- ::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(aInitFile.GetURL(),STREAM_WRITE) );
- (*pFileStream) << "ALTER USER \""
- << ::rtl::OString(_aInfo.sSysUser,_aInfo.sSysUser.getLength(),gsl_getSystemTextEncoding())
- << "\" NOT EXCLUSIVE "
- << sNewLine;
- pFileStream->Flush();
- }
- { // just to get sure that the tempfile still lives
- sTemp.Erase();
- LocalFileHelper::ConvertURLToPhysicalName(aInitFile.GetURL(),sTemp);
- LoadBatch(_aInfo.sDBName,_aInfo.sSysUser,_aInfo.sSysPassword,sTemp);
- }
- }
-}
-
-
-//-------------------------------------------------------------------------------------------------
-int ODriver::X_PARAM(const ::rtl::OUString& _DBNAME,
- const ::rtl::OUString& _USR,
- const ::rtl::OUString& _PWD,
- const ::rtl::OUString& _CMD)
-{
- // %XPARAM% -u %CONUSR%,%CONPWD% BINIT
- ::rtl::OUString sCommandFile = generateInitFile();
- {
- ::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE));
- pFileStream->Seek(STREAM_SEEK_TO_END);
- (*pFileStream) << "x_param"
-#if defined(WNT)
- << ".exe"
-#endif
- << " -d "
- << ::rtl::OString(_DBNAME,_DBNAME.getLength(),gsl_getSystemTextEncoding())
- << " -u "
- << ::rtl::OString(_USR,_USR.getLength(),gsl_getSystemTextEncoding())
- << ","
- << ::rtl::OString(_PWD,_PWD.getLength(),gsl_getSystemTextEncoding())
- << " "
- << ::rtl::OString(_CMD,_CMD.getLength(),gsl_getSystemTextEncoding())
-#if defined(WNT)
-#if (OSL_DEBUG_LEVEL > 1) || defined(DBG_UTIL)
- << " >> %DBWORK%\\create.log 2>&1"
-#endif
-#else
-#if (OSL_DEBUG_LEVEL > 1) || defined(DBG_UTIL)
- << " >> /tmp/kstart.log"
-#else
- << " > /dev/null"
-#endif
-#endif
- << " "
- << sNewLine
- << sNewLine;
-
- pFileStream->Flush();
- }
-
- oslProcess aApp;
-
-#if OSL_DEBUG_LEVEL > 0
- oslProcessError eError =
-#endif
- osl_executeProcess(sCommandFile.pData, NULL, 0,
- osl_Process_HIDDEN | osl_Process_WAIT,
- NULL, m_sDbWorkURL.pData, NULL, 0, &aApp);
- OSL_ENSURE( eError == osl_Process_E_None, "ODriver::X_PARAM: calling the executable failed!" );
-
-#if OSL_DEBUG_LEVEL < 2
- if(UCBContentHelper::Exists(sCommandFile))
- UCBContentHelper::Kill(sCommandFile);
-#endif
-
- return 0;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 ODriver::CreateFiles(const TDatabaseStruct& _aInfo)
-{
- int nRet = CreateFile(_aInfo.sSysDevSpace,_aInfo.nDataSize/50) ? 0 : -9;
- if(!nRet)
- nRet = CreateFile(_aInfo.sTransLogName,_aInfo.nLogSize) ? 0 : -10;
- if(!nRet)
- nRet = CreateFile(_aInfo.sDataDevName,_aInfo.nDataSize) ? 0 : -11;
-
- return nRet;
-
-}
-// -----------------------------------------------------------------------------
-void ODriver::PutParam(const ::rtl::OUString& sDBName,
- const ::rtl::OUString& rWhat,
- const ::rtl::OUString& rHow)
-{
- const sal_uInt32 nArgsCount = 3;
- rtl_uString* pArgs[nArgsCount] = { sDBName.pData, rWhat.pData, rHow.pData };
-
- ::rtl::OUString sCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("putparam"));
-#if defined(WNT)
- sCommand += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".exe"));
-#endif
-
- oslProcess aApp;
-
-
-#if OSL_DEBUG_LEVEL > 0
- oslProcessError eError =
-#endif
- osl_executeProcess(sCommand.pData, pArgs, nArgsCount,
- OPROCESS_ADABAS,
- NULL, m_sDbWorkURL.pData, NULL, 0, &aApp);
-
- OSL_ENSURE( eError == osl_Process_E_None, "ODriver::PutParam: calling the executable failed!" );
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODriver::CreateFile(const ::rtl::OUString &_FileName,
- sal_Int32 _nSize)
-{
-OSL_TRACE("CreateFile %d",_nSize);
- sal_Bool bOK = sal_True;
- try
- {
- ::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(_FileName,STREAM_WRITE));
- if( !pFileStream.get())
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_NO_DISK_SPACE,
- "$filename$",_FileName
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
- sal_Int32 nNewSize = 0;
- sal_Int32 nCount = _nSize /2;
- for(sal_Int32 i=0; bOK && i < nCount; ++i)
- {
- nNewSize += 8192;//4096;
- bOK = (*pFileStream).SetStreamSize(nNewSize);
- pFileStream->Flush();
- }
-
- bOK = bOK && static_cast<sal_Int32>(pFileStream->Seek(STREAM_SEEK_TO_END)) == nNewSize;
- }
- catch(Exception&)
- {
- OSL_TRACE("Exception");
- }
- if(!bOK)
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_NO_DISK_SPACE,
- "$filename$",_FileName
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
-
- return bOK;
- // dd if=/dev/zero bs=4k of=$DEV_NAME count=$2
-}
-// -----------------------------------------------------------------------------
-int ODriver::X_START(const ::rtl::OUString& sDBName)
-{
- ::rtl::OUString sCommand;
-#if defined(WNT)
-
- ::rtl::OUString sArg1 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-d"));
- ::rtl::OUString sArg3 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-NoDBService"));
- ::rtl::OUString sArg4 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-NoDBWindow"));
-
- const sal_uInt32 nArgsCount = 4;
- rtl_uString* pArgs[nArgsCount] = { sArg1.pData, sDBName.pData, sArg3.pData, sArg4.pData };
- sCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("strt.exe"));
-#else
- const sal_uInt32 nArgsCount = 1;
- rtl_uString* pArgs[nArgsCount] = { sDBName.pData };
- sCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("x_start"));
-#endif
-
- oslProcess aApp;
-
- oslProcessError eError = osl_executeProcess(sCommand.pData, pArgs, nArgsCount,
- OPROCESS_ADABAS, NULL, m_sDbWorkURL.pData,
- NULL, 0, &aApp);
-
- if(eError == osl_Process_E_NotFound)
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_COMMAND_NOT_FOUND,
- "$databasename$",sDBName,
- "$progname$",sCommand
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
- OSL_ASSERT(eError == osl_Process_E_None);
-
- oslProcessInfo aInfo;
- aInfo.Size = sizeof(oslProcessInfo);
-
- if(osl_getProcessInfo(aApp, osl_Process_EXITCODE, &aInfo) == osl_Process_E_None && aInfo.Code)
- return aInfo.Code;
-
- return 0;
-}
-// -----------------------------------------------------------------------------
-int ODriver::X_STOP(const ::rtl::OUString& sDBName)
-{
- ::rtl::OUString sCommand;
-#if defined(WNT)
-
- ::rtl::OUString sArg1 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-d"));
- ::rtl::OUString sArg2 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-NoDBService"));
-
- const sal_uInt32 nArgsCount = 3;
- rtl_uString* pArgs[nArgsCount] = { sArg1.pData, sDBName.pData, sArg2.pData };
- sCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("stp.exe"));
-#else
- const sal_uInt32 nArgsCount = 1;
- rtl_uString* pArgs[nArgsCount] = { sDBName.pData };
- sCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("x_stop"));
-#endif
-
- oslProcess aApp;
-
- oslProcessError eError = osl_executeProcess(sCommand.pData, pArgs, nArgsCount,
- OPROCESS_ADABAS, NULL, m_sDbWorkURL.pData,
- NULL, 0, &aApp);
-
- OSL_ASSERT(eError == osl_Process_E_None);
- if(eError != osl_Process_E_None)
- return 1;
-
- oslProcessInfo aInfo;
- aInfo.Size = sizeof(oslProcessInfo);
-
- if(osl_getProcessInfo(aApp, osl_Process_EXITCODE, &aInfo) == osl_Process_E_None && aInfo.Code)
- return aInfo.Code;
-
- return 0;
-}
-// -----------------------------------------------------------------------------
-void ODriver::XUTIL(const ::rtl::OUString& _rParam,
- const ::rtl::OUString& _DBNAME,
- const ::rtl::OUString& _USRNAME,
- const ::rtl::OUString& _USRPWD)
-{
- String sWorkUrl(m_sDbWorkURL);
- String sExt = String::CreateFromAscii(".log");
- ::utl::TempFile aCmdFile(String::CreateFromAscii("xutil"),&sExt,&sWorkUrl);
- aCmdFile.EnableKillingFile();
-
- String sPhysicalPath;
- LocalFileHelper::ConvertURLToPhysicalName(aCmdFile.GetURL(),sPhysicalPath);
-
- ::rtl::OUString sCommandFile = generateInitFile();
-
- {
- ::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE));
- pFileStream->Seek(STREAM_SEEK_TO_END);
- (*pFileStream) <<
-#if defined(WNT)
- "xutil.exe"
-#else
- "utility"
-#endif
- << " -u "
- << ::rtl::OString(_USRNAME,_USRNAME.getLength(),gsl_getSystemTextEncoding())
- << ","
- << ::rtl::OString(_USRPWD,_USRPWD.getLength(),gsl_getSystemTextEncoding())
- << " -d "
- << ::rtl::OString(_DBNAME,_DBNAME.getLength(),gsl_getSystemTextEncoding())
- << " "
- << ::rtl::OString(_rParam,_rParam.getLength(),gsl_getSystemTextEncoding())
- << " > "
- << ::rtl::OString(sPhysicalPath.GetBuffer(),sPhysicalPath.Len(),gsl_getSystemTextEncoding())
- << " 2>&1"
- << sNewLine;
- pFileStream->Flush();
- }
-
- oslProcess aApp;
-
-
-#if OSL_DEBUG_LEVEL > 0
- oslProcessError eError =
-#endif
- osl_executeProcess(sCommandFile.pData, NULL, 0,
- osl_Process_HIDDEN | osl_Process_WAIT,
- NULL, m_sDbWorkURL.pData, NULL, 0, &aApp);
- OSL_ENSURE( eError == osl_Process_E_None, "ODriver::XUTIL: calling the executable failed!" );
-
-#if OSL_DEBUG_LEVEL < 2
- if(UCBContentHelper::Exists(sCommandFile))
- UCBContentHelper::Kill(sCommandFile);
-#endif
-}
-// -----------------------------------------------------------------------------
-void ODriver::LoadBatch(const ::rtl::OUString& sDBName,
- const ::rtl::OUString& _rUSR,
- const ::rtl::OUString& _rPWD,
- const ::rtl::OUString& _rBatch)
-{
- OSL_ENSURE(_rBatch.getLength(),"No batch file given!");
- String sWorkUrl(m_sDbWorkURL);
- String sExt = String::CreateFromAscii(".log");
- ::utl::TempFile aCmdFile(String::CreateFromAscii("LoadBatch"),&sExt,&sWorkUrl);
-#if OSL_DEBUG_LEVEL < 2
- aCmdFile.EnableKillingFile();
-#endif
-
- String sPhysicalPath;
- LocalFileHelper::ConvertURLToPhysicalName(aCmdFile.GetURL(),sPhysicalPath);
-
- ::rtl::OUString sCommandFile = generateInitFile();
- {
- ::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE));
- pFileStream->Seek(STREAM_SEEK_TO_END);
- (*pFileStream) << "xload"
-#if defined(WNT)
- << ".exe"
-#endif
- << " -d "
- << ::rtl::OString(sDBName,sDBName.getLength(),gsl_getSystemTextEncoding())
- << " -u "
- << ::rtl::OString(_rUSR,_rUSR.getLength(),gsl_getSystemTextEncoding())
- << ","
- << ::rtl::OString(_rPWD,_rPWD.getLength(),gsl_getSystemTextEncoding());
-
- if ( !isKernelVersion(CURRENT_DB_VERSION) )
- (*pFileStream) << " -S adabas -b ";
- else
- (*pFileStream) << " -S NATIVE -b ";
-
- (*pFileStream) << ::rtl::OString(_rBatch,_rBatch.getLength(),gsl_getSystemTextEncoding())
- << " > "
- << ::rtl::OString(sPhysicalPath.GetBuffer(),sPhysicalPath.Len(),gsl_getSystemTextEncoding())
- << " 2>&1"
- << sNewLine;
-
- pFileStream->Flush();
- }
-
- oslProcess aApp;
-
-
-#if OSL_DEBUG_LEVEL > 0
- oslProcessError eError =
-#endif
- osl_executeProcess(sCommandFile.pData, NULL, 0,
- osl_Process_HIDDEN | osl_Process_WAIT,
- NULL, m_sDbWorkURL.pData, NULL, 0, &aApp);
- OSL_ENSURE( eError == osl_Process_E_None, "ODriver::LoadBatch: calling the executable failed!" );
-
-#if OSL_DEBUG_LEVEL < 2
- if(UCBContentHelper::Exists(sCommandFile))
- UCBContentHelper::Kill(sCommandFile);
-#endif
-}
-// -----------------------------------------------------------------------------
-void ODriver::fillEnvironmentVariables()
-{
- // read the environment vars
- struct env_data
- {
- const sal_Char* pAsciiEnvName;
- ::rtl::OUString* pValue;
- ::rtl::OUString* pValueURL;
- } EnvData[] = {
- { "DBWORK", &m_sDbWork, &m_sDbWorkURL },
- { "DBCONFIG", &m_sDbConfig, &m_sDbConfigURL },
- { "DBROOT", &m_sDbRoot, &m_sDbRootURL }
- };
-
- for ( size_t i = 0; i < SAL_N_ELEMENTS( EnvData ); ++i )
- {
- ::rtl::OUString sVarName = ::rtl::OUString::createFromAscii( EnvData[i].pAsciiEnvName );
- ::rtl::OUString sEnvValue;
- if(osl_getEnvironment( sVarName.pData, &sEnvValue.pData ) == osl_Process_E_None )
- {
- *EnvData[i].pValue = sEnvValue;
- String sURL;
- LocalFileHelper::ConvertPhysicalNameToURL( *EnvData[i].pValue, sURL );
- *EnvData[i].pValueURL = sURL;
- }
- }
-
- m_sDelimit = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString ODriver::generateInitFile() const
-{
- String sExt;
-#if !defined(WNT)
- sExt = String::CreateFromAscii(".sh");
-#else
- sExt = String::CreateFromAscii(".bat");
-#endif
-
- String sWorkUrl(m_sDbWorkURL);
- ::utl::TempFile aCmdFile(String::CreateFromAscii("Init"),&sExt,&sWorkUrl);
-#if !defined(WNT)
- String sPhysicalPath;
- LocalFileHelper::ConvertURLToPhysicalName(aCmdFile.GetURL(),sPhysicalPath);
- chmod(ByteString(sPhysicalPath,gsl_getSystemTextEncoding()).GetBuffer(),S_IRUSR|S_IWUSR|S_IXUSR);
-#endif
-
-#if !defined(WNT)
- SvStream* pFileStream = aCmdFile.GetStream(STREAM_WRITE);
- (*pFileStream) << "#!/bin/sh"
- << sNewLine
- << "cd \"$DBWORK\""
- << sNewLine
- << sNewLine;
- pFileStream->Flush();
-#endif
-
- return aCmdFile.GetURL();
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString ODriver::getDatabaseInitFile( const TDatabaseStruct& _aDBInfo)
-{
- String sExt;
- sExt.AssignAscii(".ins");
-
-
- String sWorkUrl(m_sDbWorkURL);
- ::utl::TempFile aInitFile(String::CreateFromAscii("Init"),&sExt,&sWorkUrl);
- {
- SvStream* pFileStream = aInitFile.GetStream(STREAM_WRITE);
- (*pFileStream) << "* @(#)init.cmd 6.1.1 1994-11-10\n";
- (*pFileStream) << "init config\n";
- (*pFileStream) << "* default code:\n";
- (*pFileStream) << "ascii\n";
- (*pFileStream) << "* date time format\n";
- (*pFileStream) << "internal\n";
- (*pFileStream) << "* command timeout:\n";
- (*pFileStream) << "900\n";
- (*pFileStream) << "* lock timeout:\n";
- (*pFileStream) << "360\n";
- (*pFileStream) << "* request timeout:\n";
- (*pFileStream) << "180\n";
- (*pFileStream) << "* log mode:\n";
- (*pFileStream) << "demo\n";
- (*pFileStream) << "* log segment size:\n";
- (*pFileStream) << "0\n";
- (*pFileStream) << "* no of archive logs:\n";
- (*pFileStream) << "0\n";
- (*pFileStream) << "* no of data devspaces:\n";
- (*pFileStream) << "1\n";
- (*pFileStream) << "* mirror devspaces:\n";
- (*pFileStream) << "n\n";
- (*pFileStream) << "if $rc <> 0 then stop\n";
- (*pFileStream) << "*--- device description ---\n";
- (*pFileStream) << "* sys devspace name:\n";
- {
- String sTemp;
- LocalFileHelper::ConvertURLToPhysicalName(_aDBInfo.sSysDevSpace,sTemp);
- (*pFileStream) << ::rtl::OString(sTemp.GetBuffer(),sTemp.Len(),gsl_getSystemTextEncoding());
- }
- (*pFileStream) << "\n* log devspace size:\n";
- (*pFileStream) << ::rtl::OString::valueOf(_aDBInfo.nLogSize);
- (*pFileStream) << "\n* log devspace name:\n";
- {
- String sTemp;
- LocalFileHelper::ConvertURLToPhysicalName(_aDBInfo.sTransLogName,sTemp);
- (*pFileStream) << ::rtl::OString(sTemp.GetBuffer(),sTemp.Len(),gsl_getSystemTextEncoding());
- }
- (*pFileStream) << "\n* data devspace size:\n";
- (*pFileStream) << ::rtl::OString::valueOf(_aDBInfo.nDataSize);
- (*pFileStream) << "\n* data devspace name:\n";
- {
- String sTemp;
- LocalFileHelper::ConvertURLToPhysicalName(_aDBInfo.sDataDevName,sTemp);
- (*pFileStream) << ::rtl::OString(sTemp.GetBuffer(),sTemp.Len(),gsl_getSystemTextEncoding());
- }
-
- (*pFileStream) << "\n* END INIT CONFIG\n";
- (*pFileStream) << "if $rc <> 0 then stop\n";
- if(_aDBInfo.bRestoreDatabase)
- {
- (*pFileStream) << "RESTORE DATA QUICK FROM '";
- {
- String sTemp;
- LocalFileHelper::ConvertURLToPhysicalName(_aDBInfo.sBackupFile,sTemp);
- (*pFileStream) << ::rtl::OString(sTemp.GetBuffer(),sTemp.Len(),gsl_getSystemTextEncoding());
- }
- (*pFileStream) << "' BLOCKSIZE 8\n";
- (*pFileStream) << "if $rc <> 0 then stop\n";
- (*pFileStream) << "RESTART\n";
-
- }
- else
- {
- (*pFileStream) << "ACTIVATE SERVERDB SYSDBA \"";
- (*pFileStream) << ::rtl::OString(_aDBInfo.sSysUser,_aDBInfo.sSysUser.getLength(),gsl_getSystemTextEncoding());
- (*pFileStream) << "\" PASSWORD \"";
- (*pFileStream) << ::rtl::OString(_aDBInfo.sSysPassword,_aDBInfo.sSysPassword.getLength(),gsl_getSystemTextEncoding());
- (*pFileStream) << "\"\n";
- }
- (*pFileStream) << "if $rc <> 0 then stop\n";
- (*pFileStream) << "exit\n";
- }
- return aInitFile.GetURL();
-}
-// -----------------------------------------------------------------------------
-void ODriver::X_CONS(const ::rtl::OUString& sDBName,const ::rtl::OString& _ACTION,const ::rtl::OUString& _FILENAME)
-{
- String sPhysicalPath;
- LocalFileHelper::ConvertURLToPhysicalName(_FILENAME,sPhysicalPath);
-
- ::rtl::OUString sCommandFile = generateInitFile();
- {
- ::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE));
- pFileStream->Seek(STREAM_SEEK_TO_END);
-
- (*pFileStream) << "x_cons"
-#if defined(WNT)
- << ".exe"
-#endif
- << " "
- << ::rtl::OString(sDBName,sDBName.getLength(),gsl_getSystemTextEncoding())
- << " SHOW "
- << _ACTION
- << " > "
- << ::rtl::OString(sPhysicalPath.GetBuffer(),sPhysicalPath.Len(),gsl_getSystemTextEncoding())
- << sNewLine;
- pFileStream->Flush();
- }
-
- oslProcess aApp;
-
- osl_executeProcess(sCommandFile.pData, NULL, 0,
- osl_Process_HIDDEN | osl_Process_WAIT,
- NULL, m_sDbWorkURL.pData, NULL, 0, &aApp);
-
-#if OSL_DEBUG_LEVEL < 2
- if(UCBContentHelper::Exists(sCommandFile))
- UCBContentHelper::Kill(sCommandFile);
-#endif
-}
-// -----------------------------------------------------------------------------
-void ODriver::checkAndRestart(const ::rtl::OUString& sDBName,const TDatabaseStruct& _rDbInfo)
-{
- String sWorkUrl(m_sDbWorkURL);
- String sExt = String::CreateFromAscii(".st");
- ::utl::TempFile aCmdFile(String::CreateFromAscii("State"),&sExt,&sWorkUrl);
- aCmdFile.EnableKillingFile();
-
- X_CONS(sDBName,"STATE",aCmdFile.GetURL());
- SvStream* pFileStream = aCmdFile.GetStream(STREAM_SHARE_DENYALL);
- if ( pFileStream )
- {
- ByteString sStateLine;
- sal_Bool bRead = sal_True;
- sal_Int32 nStart = 2;
- while(bRead && !pFileStream->IsEof())
- {
- String aLine;
- bRead = pFileStream->ReadLine(sStateLine);
- if(bRead)
- {
- if(sStateLine.Search("WARM") != STRING_NOTFOUND)
- { // nothing to do
- nStart = 0;
- break;
- }
- else if(sStateLine.Search("COLD") != STRING_NOTFOUND)
- {
- nStart = 1;
- break;
- }
- }
- }
- switch(nStart)
- {
- case 2:
- clearDatabase(sDBName);
- X_START(sDBName);
- // don't break here
- case 1:
- XUTIL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RESTART")),sDBName,_rDbInfo.sControlUser,_rDbInfo.sControlPassword);
- case 0:
- break;
- }
- }
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODriver::isVersion(const ::rtl::OUString& sDBName, const char* _pVersion)
-{
- String sWorkUrl(m_sDbWorkURL);
- String sExt = String::CreateFromAscii(".st");
- ::utl::TempFile aCmdFile(String::CreateFromAscii("DevSpaces"),&sExt,&sWorkUrl);
- aCmdFile.EnableKillingFile();
-
- String sPhysicalPath;
- LocalFileHelper::ConvertURLToPhysicalName(aCmdFile.GetURL(),sPhysicalPath);
-
- ::rtl::OUString sCommandFile = generateInitFile();
- {
- ::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE));
- pFileStream->Seek(STREAM_SEEK_TO_END);
-
- (*pFileStream) << "getparam"
-#if defined(WNT)
- << ".exe"
-#endif
- << " "
- << ::rtl::OString(sDBName,sDBName.getLength(),gsl_getSystemTextEncoding())
- << " KERNELVERSION > "
- << ::rtl::OString(sPhysicalPath.GetBuffer(),sPhysicalPath.Len(),gsl_getSystemTextEncoding())
- << sNewLine;
- }
-
- oslProcess aApp;
-
- osl_executeProcess(sCommandFile.pData, NULL, 0,
- OPROCESS_ADABAS,
- NULL, m_sDbWorkURL.pData, NULL, 0, &aApp);
-
-#if OSL_DEBUG_LEVEL < 2
- if(UCBContentHelper::Exists(sCommandFile))
- UCBContentHelper::Kill(sCommandFile);
-#endif
- SvStream* pFileStream = aCmdFile.GetStream(STREAM_STD_READWRITE);
- ByteString sStateLine;
- sal_Bool bRead = sal_True;
- sal_Bool bIsVersion = sal_False;
- while ( pFileStream && bRead && !pFileStream->IsEof() )
- {
- bRead = pFileStream->ReadLine(sStateLine);
- if ( bRead )
- {
- bIsVersion = sStateLine.GetToken(1,' ').Equals(_pVersion) != 0;
- break;
- }
- }
- return bIsVersion;
-}
-// -----------------------------------------------------------------------------
-void ODriver::checkAndInsertNewDevSpace(const ::rtl::OUString& sDBName,
- const TDatabaseStruct& _rDBInfo)
-{
- // %DBROOT%\pgm\getparam %2 DATA_CACHE_PAGES > %3
- String sWorkUrl(m_sDbWorkURL);
- String sExt = String::CreateFromAscii(".st");
- ::utl::TempFile aCmdFile(String::CreateFromAscii("DevSpaces"),&sExt,&sWorkUrl);
- aCmdFile.EnableKillingFile();
-
- String sPhysicalPath;
- LocalFileHelper::ConvertURLToPhysicalName(aCmdFile.GetURL(),sPhysicalPath);
-
- ::rtl::OUString sCommandFile = generateInitFile();
- {
- ::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE));
- pFileStream->Seek(STREAM_SEEK_TO_END);
-
- (*pFileStream) << "getparam"
-#if defined(WNT)
- << ".exe"
-#endif
- << " "
- << ::rtl::OString(sDBName,sDBName.getLength(),gsl_getSystemTextEncoding())
- << " DATA_CACHE_PAGES > "
- << ::rtl::OString(sPhysicalPath.GetBuffer(),sPhysicalPath.Len(),gsl_getSystemTextEncoding())
- << sNewLine;
- }
-
- oslProcess aApp;
- osl_executeProcess(sCommandFile.pData, NULL, 0,
- OPROCESS_ADABAS,
- NULL, m_sDbWorkURL.pData, NULL, 0, &aApp);
-
-#if OSL_DEBUG_LEVEL < 2
- if(UCBContentHelper::Exists(sCommandFile))
- UCBContentHelper::Kill(sCommandFile);
-#endif
- SvStream* pFileStream = aCmdFile.GetStream(STREAM_STD_READWRITE);
- ByteString sStateLine;
- sal_Bool bRead = sal_True;
- sal_Int32 nDataPages = 0;
- while(pFileStream && bRead && !pFileStream->IsEof())
- {
- bRead = pFileStream->ReadLine(sStateLine);
- if(bRead)
- {
- nDataPages = sStateLine.ToInt32();
- if(nDataPages && nDataPages < 100)
- {
- // the space isn't big enough anymore so we increment it
- PutParam(sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA_CACHE_PAGES")),::rtl::OUString::valueOf(nDataPages));
- X_PARAM(sDBName,_rDBInfo.sControlUser,_rDBInfo.sControlPassword,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BCHECK")));
- }
- }
- }
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODriver::isKernelVersion(const char* _pVersion)
-{
- ::utl::TempFile aCmdFile(String::CreateFromAscii("KernelVersion"));
- aCmdFile.EnableKillingFile();
-
- String sPhysicalPath;
- LocalFileHelper::ConvertURLToPhysicalName(aCmdFile.GetURL(),sPhysicalPath);
-
- ::rtl::OUString sCommandFile = generateInitFile();
- {
- ::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE));
- pFileStream->Seek(STREAM_SEEK_TO_END);
-
- (*pFileStream) << "dbversion"
- << " > "
- << ::rtl::OString(sPhysicalPath.GetBuffer(),sPhysicalPath.Len(),gsl_getSystemTextEncoding())
- << sNewLine;
- }
-
- oslProcess aApp;
- osl_executeProcess(sCommandFile.pData, NULL, 0,
- OPROCESS_ADABAS,
- NULL, m_sDbWorkURL.pData, NULL, 0, &aApp);
-
-#if OSL_DEBUG_LEVEL < 2
- if(UCBContentHelper::Exists(sCommandFile))
- UCBContentHelper::Kill(sCommandFile);
-#endif
- SvStream* pFileStream = aCmdFile.GetStream(STREAM_STD_READWRITE);
- ByteString sStateLine;
- sal_Bool bRead = sal_True;
- sal_Bool bIsVersion = sal_True;
- while ( pFileStream && bRead && !pFileStream->IsEof() )
- {
- bRead = pFileStream->ReadLine(sStateLine);
- if ( bRead )
- {
- // convert a 11.02.00 to a 12.01.30 version
- bIsVersion = sStateLine.GetToken(0).Equals(_pVersion) != 0;
- break;
- }
- }
- return bIsVersion;
-}
-// -----------------------------------------------------------------------------
-void ODriver::installSystemTables( const TDatabaseStruct& _aInfo)
-{
-#if defined(WNT)
- // xutil -d %_DBNAME% -u %_CONTROL_USER%,%_CONTROL_PWD% -b %m_sDbRoot%\env\TERMCHAR.ind
- ::rtl::OUString aBatch = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-b "));
- ::rtl::OUString sTemp2 = m_sDbRootURL + m_sDelimit
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("env"))
- + m_sDelimit
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TERMCHAR.ind"));
- String sTemp;
- sal_Bool bOk = LocalFileHelper::ConvertURLToPhysicalName(sTemp2,sTemp);
- aBatch += sTemp;
-
- XUTIL(aBatch,_aInfo.sDBName,_aInfo.sControlUser,_aInfo.sControlPassword);
-
- // xutil -d %_DBNAME% -u %_CONTROL_USER%,%_CONTROL_PWD% DIAGNOSE TRIGGER OFF
- XUTIL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DIAGNOSE TRIGGER OFF")),_aInfo.sDBName,_aInfo.sControlUser,_aInfo.sControlPassword);
- // xload -d %_DBNAME% -u %_SYSDBA_USER%,%_SYSDBA_PWD% -S NATIVE -b %m_sDbRoot%\env\DBS.ins %_DOMAINPWD%
- {
- sTemp2 = m_sDbRootURL
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("env"))
- + m_sDelimit
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DBS.ins"));
- sTemp.Erase();
- bOk = LocalFileHelper::ConvertURLToPhysicalName(sTemp2,sTemp);
- OSL_ENSURE(bOk,"File could be converted into file system path!");
- sTemp.AppendAscii(" ");
- sTemp += String(_aInfo.sDomainPassword);
-
- LoadBatch(_aInfo.sDBName,_aInfo.sSysUser,_aInfo.sSysPassword,sTemp);
- }
- // xload -d %_DBNAME% -u DOMAIN,%_DOMAINPWD% -S NATIVE -b %m_sDbRoot%\env\XDD.ins
- {
- sTemp2 = m_sDbRootURL
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("env"))
- + m_sDelimit
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("XDD.ins"));
- sTemp.Erase();
- bOk = LocalFileHelper::ConvertURLToPhysicalName(sTemp2,sTemp);
- OSL_ENSURE(bOk,"File could be converted into file system path!");
-
- LoadBatch(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAIN")),_aInfo.sDomainPassword,sTemp);
- }
- // xload -d %_DBNAME% -u %_SYSDBA_USER%,%_SYSDBA_PWD% -S NATIVE -b %m_sDbRoot%\env\QP.ins
- {
- sTemp2 = m_sDbRootURL
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("env"))
- + m_sDelimit
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("QP.ins"));
- sTemp.Erase();
- bOk = LocalFileHelper::ConvertURLToPhysicalName(sTemp2,sTemp);
- OSL_ENSURE(bOk,"File could be converted into file system path!");
- LoadBatch(_aInfo.sDBName,_aInfo.sSysUser,_aInfo.sSysPassword,sTemp);
- }
- // xload -d %_DBNAME% -u DOMAIN,%_DOMAINPWD% -S NATIVE -b %m_sDbRoot%\env\SPROC.ins
- {
- sTemp2 = m_sDbRootURL
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("env"))
- + m_sDelimit
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SPROC.ins"));
- sTemp.Erase();
- bOk = LocalFileHelper::ConvertURLToPhysicalName(sTemp2,sTemp);
- OSL_ENSURE(bOk,"File could be converted into file system path!");
-
- LoadBatch(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DOMAIN")),_aInfo.sDomainPassword,sTemp);
- }
-
- // xutil -d %_DBNAME% -u %_CONTROL_USER%,%_CONTROL_PWD% DIAGNOSE TRIGGER ON
- XUTIL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DIAGNOSE TRIGGER ON")),_aInfo.sDBName,_aInfo.sControlUser,_aInfo.sControlPassword);
- // xutil -d %_DBNAME% -u %_CONTROL_USER%,%_CONTROL_PWD% SET NOLOG OFF
- XUTIL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SET NOLOG OFF")),_aInfo.sDBName,_aInfo.sControlUser,_aInfo.sControlPassword);
- // xutil -d %_DBNAME% -u %_CONTROL_USER%,%_CONTROL_PWD% SHUTDOWN QUICK
- XUTIL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SHUTDOWN QUICK")),_aInfo.sDBName,_aInfo.sControlUser,_aInfo.sControlPassword);
- // xutil -d %_DBNAME% -u %_CONTROL_USER%,%_CONTROL_PWD% RESTART
- XUTIL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RESTART")),_aInfo.sDBName,_aInfo.sControlUser,_aInfo.sControlPassword);
-
-#else // UNX
- ::rtl::OUString sCommandFile = generateInitFile();
- {
- ::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE));
- pFileStream->Seek(STREAM_SEEK_TO_END);
- (*pFileStream) << "x_dbinst"
- << " -d "
- << ::rtl::OString(_aInfo.sDBName,_aInfo.sDBName.getLength(),gsl_getSystemTextEncoding())
- << " -u "
- << ::rtl::OString(_aInfo.sSysUser,_aInfo.sSysUser.getLength(),gsl_getSystemTextEncoding())
- << ","
- << ::rtl::OString(_aInfo.sSysPassword,_aInfo.sSysPassword.getLength(),gsl_getSystemTextEncoding())
- << " -w "
- << ::rtl::OString(_aInfo.sDomainPassword,_aInfo.sDomainPassword.getLength(),gsl_getSystemTextEncoding())
- << " -b ";
-
- if ( isKernelVersion(ADABAS_KERNEL_11) )
- (*pFileStream) << "-i all";
- (*pFileStream)
-#if (OSL_DEBUG_LEVEL > 1) || defined(DBG_UTIL)
- << " >> /tmp/kstart.log"
-#else
- << " > /dev/null"
-#endif
- << sNewLine
- << sNewLine;
- pFileStream->Flush();
- }
- // now execute the command
-
- oslProcess aApp;
- osl_executeProcess(sCommandFile.pData, NULL, 0,
- osl_Process_WAIT | osl_Process_HIDDEN,
- NULL, m_sDbWorkURL.pData, NULL, 0, &aApp);
-#if OSL_DEBUG_LEVEL < 2
- if(UCBContentHelper::Exists(sCommandFile))
- UCBContentHelper::Kill(sCommandFile);
-#endif
-
-#endif //WNT,UNX
-}
-// -----------------------------------------------------------------------------
-void ODriver::convertOldVersion(const ::rtl::OUString& sDBName,const TDatabaseStruct& _rDbInfo)
-{
- // first we have to check if this databse is a old version and we have to update the system tables
- if ( !isVersion(sDBName,CURRENT_DB_VERSION) && isKernelVersion(CURRENT_DB_VERSION) )
- {
- if ( !_rDbInfo.sControlUser.getLength()
- || !_rDbInfo.sControlPassword.getLength())
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(STR_DATABASE_NEEDS_CONVERTING) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
- String sCommandFile = m_sDbWorkURL;
- sCommandFile += String::CreateFromAscii("/xparam.prt");
- if ( UCBContentHelper::Exists(sCommandFile) )
- UCBContentHelper::Kill(sCommandFile);
- X_PARAM(sDBName,_rDbInfo.sControlUser,_rDbInfo.sControlPassword,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BCHECK")));
-
- if ( UCBContentHelper::Exists(sCommandFile) )
- {
- {
- ::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READ) );
- ByteString sStateLine;
- sal_Bool bRead = sal_True;
- static ByteString s_ErrorId("-21100");
- while ( pFileStream.get() && bRead && !pFileStream->IsEof() )
- {
- bRead = pFileStream->ReadLine(sStateLine);
- if ( bRead && s_ErrorId == sStateLine.GetToken(0,' ') )
- {
- UCBContentHelper::Kill(sCommandFile);
- ::rtl::OUString sError(::rtl::OUString::createFromAscii(sStateLine.GetBuffer()));
- throw SQLException(sError,*this,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")),1000,Any());
- }
- }
- }
-
- UCBContentHelper::Kill(sCommandFile);
- }
- }
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace adabas
-}// namespace connectivity
-// -----------------------------------------------------------------------------
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BFunctions.cxx b/connectivity/source/drivers/adabas/BFunctions.cxx
deleted file mode 100644
index fde23e9a59..0000000000
--- a/connectivity/source/drivers/adabas/BFunctions.cxx
+++ /dev/null
@@ -1,256 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-//--------------------------------------------------------------------------
-#include "odbc/OFunctions.hxx"
-#include <osl/process.h>
-
-// Implib-Definitionen fuer ODBC-DLL/shared library:
-
-namespace connectivity
-{
- namespace adabas
- {
- T3SQLAllocHandle pODBC3SQLAllocHandle;
-T3SQLConnect pODBC3SQLConnect;
-T3SQLDriverConnect pODBC3SQLDriverConnect;
-T3SQLBrowseConnect pODBC3SQLBrowseConnect;
-T3SQLDataSources pODBC3SQLDataSources;
-T3SQLDrivers pODBC3SQLDrivers;
-T3SQLGetInfo pODBC3SQLGetInfo;
-T3SQLGetFunctions pODBC3SQLGetFunctions;
-T3SQLGetTypeInfo pODBC3SQLGetTypeInfo;
-T3SQLSetConnectAttr pODBC3SQLSetConnectAttr;
-T3SQLGetConnectAttr pODBC3SQLGetConnectAttr;
-T3SQLSetEnvAttr pODBC3SQLSetEnvAttr;
-T3SQLGetEnvAttr pODBC3SQLGetEnvAttr;
-T3SQLSetStmtAttr pODBC3SQLSetStmtAttr;
-T3SQLGetStmtAttr pODBC3SQLGetStmtAttr;
-T3SQLPrepare pODBC3SQLPrepare;
-T3SQLBindParameter pODBC3SQLBindParameter;
-T3SQLSetCursorName pODBC3SQLSetCursorName;
-T3SQLExecute pODBC3SQLExecute;
-T3SQLExecDirect pODBC3SQLExecDirect;
-T3SQLDescribeParam pODBC3SQLDescribeParam;
-T3SQLNumParams pODBC3SQLNumParams;
-T3SQLParamData pODBC3SQLParamData;
-T3SQLPutData pODBC3SQLPutData;
-T3SQLRowCount pODBC3SQLRowCount;
-T3SQLNumResultCols pODBC3SQLNumResultCols;
-T3SQLDescribeCol pODBC3SQLDescribeCol;
-T3SQLColAttribute pODBC3SQLColAttribute;
-T3SQLBindCol pODBC3SQLBindCol;
-T3SQLFetch pODBC3SQLFetch;
-T3SQLFetchScroll pODBC3SQLFetchScroll;
-T3SQLGetData pODBC3SQLGetData;
-T3SQLSetPos pODBC3SQLSetPos;
-T3SQLBulkOperations pODBC3SQLBulkOperations;
-T3SQLMoreResults pODBC3SQLMoreResults;
-T3SQLGetDiagRec pODBC3SQLGetDiagRec;
-T3SQLColumnPrivileges pODBC3SQLColumnPrivileges;
-T3SQLColumns pODBC3SQLColumns;
-T3SQLForeignKeys pODBC3SQLForeignKeys;
-T3SQLPrimaryKeys pODBC3SQLPrimaryKeys;
-T3SQLProcedureColumns pODBC3SQLProcedureColumns;
-T3SQLProcedures pODBC3SQLProcedures;
-T3SQLSpecialColumns pODBC3SQLSpecialColumns;
-T3SQLStatistics pODBC3SQLStatistics;
-T3SQLTablePrivileges pODBC3SQLTablePrivileges;
-T3SQLTables pODBC3SQLTables;
-T3SQLFreeStmt pODBC3SQLFreeStmt;
-T3SQLCloseCursor pODBC3SQLCloseCursor;
-T3SQLCancel pODBC3SQLCancel;
-T3SQLEndTran pODBC3SQLEndTran;
-T3SQLDisconnect pODBC3SQLDisconnect;
-T3SQLFreeHandle pODBC3SQLFreeHandle;
-T3SQLGetCursorName pODBC3SQLGetCursorName;
-T3SQLNativeSql pODBC3SQLNativeSql;
-
-
-sal_Bool LoadFunctions(oslModule pODBCso);
-// -------------------------------------------------------------------------
-sal_Bool LoadLibrary_ADABAS(::rtl::OUString &_rPath)
-{
- static sal_Bool bLoaded = sal_False;
- static oslModule pODBCso = NULL;
-
- if (bLoaded)
- return sal_True;
-
- rtl_uString* pPath = NULL;
- ::rtl::OUString sTemp(RTL_CONSTASCII_USTRINGPARAM("DBROOT"));
- if ( osl_getEnvironment(sTemp.pData,&pPath) == osl_Process_E_None && pPath )
- {
-
-#if ( defined(SOLARIS) && defined(SPARC)) || defined(LINUX) || defined(MACOSX)
- _rPath = ::rtl::OUString(pPath);
- _rPath += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/lib/"));
-#endif
- rtl_uString_release(pPath);
- }
- else
- {
- _rPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The variable DBROOT is not set."));
- return sal_False;
- }
- const sal_Char* pLibraryAsciiName = NULL;
-
-#if defined(WNT)
- pLibraryAsciiName = "SQLOD32.DLL";
-#elif ( defined(SOLARIS) && defined(SPARC)) || defined(LINUX)
- pLibraryAsciiName = "odbclib.so";
-#elif defined(MACOSX)
- pLibraryAsciiName = "odbclib.dylib";
-#endif
- if ( !pLibraryAsciiName )
- return sal_False;
-
- _rPath += ::rtl::OUString::createFromAscii( pLibraryAsciiName );
- pODBCso = osl_loadModule( _rPath.pData,SAL_LOADMODULE_NOW );
- if( !pODBCso)
- return sal_False;
-
-
- return bLoaded = LoadFunctions(pODBCso);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool LoadFunctions(oslModule pODBCso)
-{
-
- if( ( pODBC3SQLAllocHandle = (T3SQLAllocHandle)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLAllocHandle")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLConnect = (T3SQLConnect)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLConnect")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLDriverConnect = (T3SQLDriverConnect)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLDriverConnect")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLBrowseConnect = (T3SQLBrowseConnect)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLBrowseConnect")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetInfo = (T3SQLGetInfo)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetInfo")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetTypeInfo = (T3SQLGetTypeInfo)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetTypeInfo")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLSetConnectAttr = (T3SQLSetConnectAttr)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLSetConnectAttr")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetConnectAttr = (T3SQLGetConnectAttr)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetConnectAttr")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLSetEnvAttr = (T3SQLSetEnvAttr)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLSetEnvAttr")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetEnvAttr = (T3SQLGetEnvAttr)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetEnvAttr")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLSetStmtAttr = (T3SQLSetStmtAttr)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLSetStmtAttr")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetStmtAttr = (T3SQLGetStmtAttr)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetStmtAttr")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLPrepare = (T3SQLPrepare)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLPrepare")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLBindParameter = (T3SQLBindParameter)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLBindParameter")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLSetCursorName = (T3SQLSetCursorName)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLSetCursorName")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLExecute = (T3SQLExecute)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLExecute")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLExecDirect = (T3SQLExecDirect)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLExecDirect")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLDescribeParam = (T3SQLDescribeParam)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLDescribeParam")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLNumParams = (T3SQLNumParams)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLNumParams")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLParamData = (T3SQLParamData)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLParamData")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLPutData = (T3SQLPutData)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLPutData")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLRowCount = (T3SQLRowCount)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLRowCount")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLNumResultCols = (T3SQLNumResultCols)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLNumResultCols")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLDescribeCol = (T3SQLDescribeCol)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLDescribeCol")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLColAttribute = (T3SQLColAttribute)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLColAttribute")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLBindCol = (T3SQLBindCol)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLBindCol")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLFetch = (T3SQLFetch)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLFetch")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLFetchScroll = (T3SQLFetchScroll)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLFetchScroll")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetData = (T3SQLGetData)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetData")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLSetPos = (T3SQLSetPos)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLSetPos")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLMoreResults = (T3SQLMoreResults)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLMoreResults")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetDiagRec = (T3SQLGetDiagRec)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetDiagRec")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLColumnPrivileges = (T3SQLColumnPrivileges)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLColumnPrivileges")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLColumns = (T3SQLColumns)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLColumns")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLForeignKeys = (T3SQLForeignKeys)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLForeignKeys")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLPrimaryKeys = (T3SQLPrimaryKeys)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLPrimaryKeys")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLProcedureColumns = (T3SQLProcedureColumns)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLProcedureColumns")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLProcedures = (T3SQLProcedures)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLProcedures")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLSpecialColumns = (T3SQLSpecialColumns)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLSpecialColumns")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLStatistics = (T3SQLStatistics)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLStatistics")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLTablePrivileges = (T3SQLTablePrivileges)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLTablePrivileges")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLTables = (T3SQLTables)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLTables")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLFreeStmt = (T3SQLFreeStmt)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLFreeStmt")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLCloseCursor = (T3SQLCloseCursor)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLCloseCursor")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLCancel = (T3SQLCancel)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLCancel")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLEndTran = (T3SQLEndTran)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLEndTran")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLDisconnect = (T3SQLDisconnect)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLDisconnect")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLFreeHandle = (T3SQLFreeHandle)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLFreeHandle")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetCursorName = (T3SQLGetCursorName)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetCursorName")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLNativeSql = (T3SQLNativeSql)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLNativeSql")).pData )) == NULL )
- return sal_False;
-
- return sal_True;
-}
-// -------------------------------------------------------------------------
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BGroup.cxx b/connectivity/source/drivers/adabas/BGroup.cxx
deleted file mode 100644
index 1421771056..0000000000
--- a/connectivity/source/drivers/adabas/BGroup.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "adabas/BGroup.hxx"
-#include "adabas/BUsers.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "adabas/BConnection.hxx"
-#include <comphelper/types.hxx>
-
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -------------------------------------------------------------------------
-OAdabasGroup::OAdabasGroup( OAdabasConnection* _pConnection) : connectivity::sdbcx::OGroup(sal_True)
- ,m_pConnection(_pConnection)
-{
- construct();
- TStringVector aVector;
- m_pUsers = new OUsers(*this,m_aMutex,aVector,m_pConnection,this);
-}
-// -------------------------------------------------------------------------
-OAdabasGroup::OAdabasGroup( OAdabasConnection* _pConnection,
- const ::rtl::OUString& _Name
- ) : connectivity::sdbcx::OGroup(_Name,sal_True)
- ,m_pConnection(_pConnection)
-{
- construct();
- refreshUsers();
-}
-// -------------------------------------------------------------------------
-void OAdabasGroup::refreshUsers()
-{
- if(!m_pConnection)
- return;
-
- TStringVector aVector;
- Reference< XStatement > xStmt = m_pConnection->createStatement( );
-
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "SELECT DISTINCT USERNAME FROM DOMAIN.USERS WHERE USERNAME IS NOT NULL AND USERNAME <> ' ' AND USERNAME <> 'CONTROL' AND GROUPNAME = '" ));
- aSql += getName( );
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
-
- Reference< XResultSet > xResult = xStmt->executeQuery(aSql);
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- aVector.push_back(xRow->getString(1));
- ::comphelper::disposeComponent(xResult);
- }
- ::comphelper::disposeComponent(xStmt);
-
- if(m_pUsers)
- m_pUsers->reFill(aVector);
- else
- m_pUsers = new OUsers(*this,m_aMutex,aVector,m_pConnection,this);
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BGroups.cxx b/connectivity/source/drivers/adabas/BGroups.cxx
deleted file mode 100644
index 46256b20d5..0000000000
--- a/connectivity/source/drivers/adabas/BGroups.cxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BGroups.hxx"
-#include "adabas/BGroup.hxx"
-#include "adabas/BTable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <comphelper/types.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-// -------------------------------------------------------------------------
-sdbcx::ObjectType OGroups::createObject(const ::rtl::OUString& _rName)
-{
- return new OAdabasGroup(m_pConnection,_rName);
-}
-// -------------------------------------------------------------------------
-void OGroups::impl_refresh() throw(RuntimeException)
-{
- m_pParent->refreshGroups();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OGroups::createDescriptor()
-{
- // OAdabasGroup* pNew =
- return new OAdabasGroup(m_pConnection);
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OGroups::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& /*descriptor*/ )
-{
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "CREATE USERGROUP " ));
- ::rtl::OUString aQuote = m_pConnection->getMetaData()->getIdentifierQuoteString( );
-
- aSql = aSql + aQuote + _rForName + aQuote;
-
- Reference< XStatement > xStmt = m_pConnection->createStatement( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
-
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OGroups::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "DROP USERGROUP " ));
- ::rtl::OUString aQuote = m_pConnection->getMetaData()->getIdentifierQuoteString( );
-
- aSql = aSql + aQuote + _sElementName + aQuote;
-
- Reference< XStatement > xStmt = m_pConnection->createStatement( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
-}
-// -------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BIndex.cxx b/connectivity/source/drivers/adabas/BIndex.cxx
deleted file mode 100644
index 00d61dd1c0..0000000000
--- a/connectivity/source/drivers/adabas/BIndex.cxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BIndex.hxx"
-#include "adabas/BIndexColumns.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "adabas/BTable.hxx"
-#include <comphelper/types.hxx>
-
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -------------------------------------------------------------------------
-OAdabasIndex::OAdabasIndex( OAdabasTable* _pTable,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Catalog,
- sal_Bool _isUnique,
- sal_Bool _isPrimaryKeyIndex,
- sal_Bool _isClustered
- ) : connectivity::sdbcx::OIndex(_Name,
- _Catalog,
- _isUnique,
- _isPrimaryKeyIndex,
- _isClustered,sal_True)
- ,m_pTable(_pTable)
-{
- construct();
- refreshColumns();
-}
-// -------------------------------------------------------------------------
-OAdabasIndex::OAdabasIndex(OAdabasTable* _pTable)
- : connectivity::sdbcx::OIndex(sal_True)
- ,m_pTable(_pTable)
-{
- construct();
-}
-// -----------------------------------------------------------------------------
-
-void OAdabasIndex::refreshColumns()
-{
- if(!m_pTable)
- return;
-
- TStringVector aVector;
- if(!isNew())
- {
- Reference< XResultSet > xResult = m_pTable->getMetaData()->getIndexInfo(Any(),
- m_pTable->getSchema(),m_pTable->getTableName(),sal_False,sal_False);
-
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- ::rtl::OUString aColName;
- while(xResult->next())
- {
- if(xRow->getString(6) == m_Name)
- {
- aColName = xRow->getString(9);
- if(!xRow->wasNull())
- aVector.push_back(aColName);
- }
- }
- ::comphelper::disposeComponent(xResult);
- }
- }
- if(m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new OIndexColumns(this,m_aMutex,aVector);
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BIndexColumns.cxx b/connectivity/source/drivers/adabas/BIndexColumns.cxx
deleted file mode 100644
index 059ba4fe47..0000000000
--- a/connectivity/source/drivers/adabas/BIndexColumns.cxx
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "adabas/BIndexColumns.hxx"
-#include "connectivity/sdbcx/VIndexColumn.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include "adabas/BTable.hxx"
-#include "adabas/BCatalog.hxx"
-#include <comphelper/types.hxx>
-#include <comphelper/property.hxx>
-
-using namespace connectivity::adabas;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -------------------------------------------------------------------------
-ObjectType OIndexColumns::createObject(const ::rtl::OUString& _rName)
-{
-
- Reference< XResultSet > xResult = m_pIndex->getTable()->getConnection()->getMetaData()->getIndexInfo(Any(),
- m_pIndex->getTable()->getSchema(),m_pIndex->getTable()->getTableName(),sal_False,sal_False);
-
- sal_Bool bAsc = sal_True;
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- ::rtl::OUString aD(RTL_CONSTASCII_USTRINGPARAM("D"));
- while(xResult->next())
- {
- if(xRow->getString(9) == _rName)
- bAsc = xRow->getString(10) != aD;
- }
- ::comphelper::disposeComponent(xResult);
- }
-
- xResult = m_pIndex->getTable()->getConnection()->getMetaData()->getColumns(Any(),
- m_pIndex->getTable()->getSchema(),m_pIndex->getTable()->getTableName(),_rName);
-
- ObjectType xRet = NULL;
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- {
- if(xRow->getString(4) == _rName)
- {
- sal_Int32 nType = xRow->getInt(5);
- ::rtl::OUString sTypeName = xRow->getString(6);
- sal_Int32 nPrec = xRow->getInt(7);
- OAdabasCatalog::correctColumnProperties(nPrec,nType,sTypeName);
-
- OIndexColumn* pRet = new OIndexColumn(bAsc,
- _rName,
- sTypeName,
- xRow->getString(13),
- xRow->getInt(11),
- nPrec,
- xRow->getInt(9),
- nType,
- sal_False,sal_False,sal_False,sal_True);
- xRet = pRet;
- break;
- }
- }
- ::comphelper::disposeComponent(xResult);
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OIndexColumns::createDescriptor()
-{
- return new OIndexColumn(sal_True);
-}
-// -----------------------------------------------------------------------------
-void OIndexColumns::impl_refresh() throw(::com::sun::star::uno::RuntimeException)
-{
- m_pIndex->refreshColumns();
-}
-// -----------------------------------------------------------------------------
-ObjectType OIndexColumns::appendObject( const ::rtl::OUString& /*_rForName*/, const Reference< XPropertySet >& descriptor )
-{
- return cloneDescriptor( descriptor );
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BIndexes.cxx b/connectivity/source/drivers/adabas/BIndexes.cxx
deleted file mode 100644
index 62563cbd2b..0000000000
--- a/connectivity/source/drivers/adabas/BIndexes.cxx
+++ /dev/null
@@ -1,194 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BIndexes.hxx"
-#include "adabas/BIndex.hxx"
-#include "adabas/BTable.hxx"
-#include "connectivity/sdbcx/VIndex.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/IndexType.hpp>
-#include <comphelper/types.hxx>
-#include <comphelper/types.hxx>
-#include "adabas/BCatalog.hxx"
-#include "connectivity/dbexception.hxx"
-
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OIndexes::createObject(const ::rtl::OUString& _rName)
-{
- ::rtl::OUString aName,aQualifier;
- sal_Int32 nLen = _rName.indexOf('.');
- if(nLen != -1)
- {
- aQualifier = _rName.copy(0,nLen);
- aName = _rName.copy(nLen+1);
- }
- else
- aName = _rName;
-
-
- Reference< XResultSet > xResult = m_pTable->getMetaData()->getIndexInfo(Any(),
- m_pTable->getSchema(),m_pTable->getTableName(),sal_False,sal_False);
-
- sdbcx::ObjectType xRet = NULL;
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- {
- if(xRow->getString(6) == aName && (!aQualifier.getLength() || xRow->getString(5) == aQualifier ))
- {
- OAdabasIndex* pRet = new OAdabasIndex(m_pTable,aName,aQualifier,!xRow->getBoolean(4),
- aName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SYSPRIMARYKEYINDEX")),
- xRow->getShort(7) == IndexType::CLUSTERED);
- xRet = pRet;
- break;
- }
- }
- ::comphelper::disposeComponent(xResult);
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void OIndexes::impl_refresh() throw(RuntimeException)
-{
- m_pTable->refreshIndexes();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OIndexes::createDescriptor()
-{
- return new OAdabasIndex(m_pTable);
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OIndexes::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- if ( m_pTable->isNew() )
- ::dbtools::throwFunctionSequenceException(static_cast<XTypeProvider*>(this));
-
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "CREATE " ));
- ::rtl::OUString aQuote = m_pTable->getMetaData()->getIdentifierQuoteString( );
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
-
- if(getBOOL(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE))))
- aSql = aSql + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UNIQUE "));
- aSql = aSql + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INDEX "));
-
-
- if(_rForName.getLength())
- {
- aSql = aSql + aQuote + _rForName + aQuote
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "))
- + aQuote + m_pTable->getSchema() + aQuote + sDot
- + aQuote + m_pTable->getTableName() + aQuote
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ( "));
-
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
- sal_Int32 nCount = xColumns->getCount();
- for(sal_Int32 i=0;i<nCount;++i)
- {
- xColumns->getByIndex(i) >>= xColProp;
- aSql = aSql + aQuote + getString(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))) + aQuote;
- aSql = aSql + (getBOOL(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISASCENDING)))
- ?
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ASC"))
- :
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DESC")))
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- }
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
- }
- else
- {
- aSql = aSql + aQuote + m_pTable->getSchema() + aQuote + sDot + aQuote + m_pTable->getTableName() + aQuote;
-
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
- if(xColumns->getCount() != 1)
- throw SQLException();
-
- xColumns->getByIndex(0) >>= xColProp;
-
- aSql = aSql + sDot + aQuote + getString(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))) + aQuote;
- }
-
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
-
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OIndexes::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- if(!m_pTable->isNew())
- {
- ::rtl::OUString aName,aSchema;
- sal_Int32 nLen = _sElementName.indexOf('.');
- aSchema = _sElementName.copy(0,nLen);
- aName = _sElementName.copy(nLen+1);
-
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "DROP INDEX " ));
- ::rtl::OUString aQuote = m_pTable->getMetaData()->getIdentifierQuoteString( );
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
-
- if (aSchema.getLength())
- (((aSql += aQuote) += aSchema) += aQuote) += sDot;
-
- (((aSql += aQuote) += aName) += aQuote) += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "));
-
- (((aSql += aQuote) += m_pTable->getSchema()) += aQuote) += sDot;
- ((aSql += aQuote) += m_pTable->getTableName()) += aQuote;
-
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BKeys.cxx b/connectivity/source/drivers/adabas/BKeys.cxx
deleted file mode 100644
index d6a6586f10..0000000000
--- a/connectivity/source/drivers/adabas/BKeys.cxx
+++ /dev/null
@@ -1,183 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BKeys.hxx"
-#include "adabas/BTable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <comphelper/types.hxx>
-#include "adabas/BCatalog.hxx"
-#include <comphelper/property.hxx>
-#include <connectivity/TKeys.hxx>
-#include <connectivity/dbtools.hxx>
-
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-typedef OKeysHelper OCollection_TYPE;
-
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OKeys::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- if ( getTable()->isNew() )
- {
- Reference< XPropertySet > xNewDescriptor( cloneDescriptor( descriptor ) );
- OKeysHelper::cloneDescriptorColumns( descriptor, xNewDescriptor );
- return xNewDescriptor;
- }
-
- sal_Int32 nKeyType = getINT32(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)));
-
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "ALTER TABLE " ));
- const ::rtl::OUString aQuote = getTable()->getConnection()->getMetaData()->getIdentifierQuoteString( );
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
-
- aSql += composeTableName( getTable()->getConnection()->getMetaData(), getTable(), ::dbtools::eInTableDefinitions, false, false, true );
-
- if(nKeyType == KeyType::PRIMARY)
- {
- aSql = aSql + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ALTER PRIMARY KEY ("));
- }
- else if(nKeyType == KeyType::FOREIGN)
- {
- aSql = aSql + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FOREIGN KEY ("));
- }
- else
- throw SQLException();
-
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
-
- for(sal_Int32 i=0;i<xColumns->getCount();++i)
- {
- Reference< XPropertySet > xColProp;
- xColumns->getByIndex(i) >>= xColProp;
- aSql = aSql + aQuote + getString(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))) + aQuote
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- }
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
-
- sal_Int32 nUpdateRule = 0, nDeleteRule = 0;
- ::rtl::OUString sReferencedName;
-
- if(nKeyType == KeyType::FOREIGN)
- {
- nDeleteRule = getINT32(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELETERULE)));
-
- ::rtl::OUString aName,aSchema;
- sReferencedName = getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REFERENCEDTABLE)));
- sal_Int32 nLen = sReferencedName.indexOf('.');
- aSchema = sReferencedName.copy(0,nLen);
- aName = sReferencedName.copy(nLen+1);
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" REFERENCES "))
- + aQuote + aSchema + aQuote + sDot + aQuote + aName + aQuote;
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ("));
-
- for(sal_Int32 i=0;i<xColumns->getCount();++i)
- {
- Reference< XPropertySet > xColProp;
- xColumns->getByIndex(i) >>= xColProp;
- aSql = aSql + aQuote + getString(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RELATEDCOLUMN))) + aQuote
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- }
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
-
- switch(nDeleteRule)
- {
- case KeyRule::CASCADE:
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON DELETE CASCADE "));
- break;
- case KeyRule::RESTRICT:
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON DELETE RESTRICT "));
- break;
- case KeyRule::SET_NULL:
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON DELETE SET NULL "));
- break;
- case KeyRule::SET_DEFAULT:
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON DELETE SET DEFAULT "));
- break;
- default:
- ;
- }
- }
-
- Reference< XStatement > xStmt = getTable()->getConnection()->createStatement( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- // find the name which the database gave the new key
- ::rtl::OUString sNewName( _rForName );
- if(nKeyType == KeyType::FOREIGN)
- {
- const ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- ::rtl::OUString aSchema,aTable;
- getTable()->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
- getTable()->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
- Reference< XResultSet > xResult = getTable()->getMetaData()->getImportedKeys( getTable()->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME))
- ,aSchema
- ,aTable);
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- {
- ::rtl::OUString sName = xRow->getString(12);
- if ( !m_pElements->exists(sName) ) // this name wasn't inserted yet so it must be te new one
- {
- descriptor->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME),makeAny(sName));
- sNewName = sName;
- break;
- }
- }
- ::comphelper::disposeComponent(xResult);
- }
- }
-
- getTable()->addKey(sNewName,sdbcx::TKeyProperties(new sdbcx::KeyProperties(sReferencedName,nKeyType,nUpdateRule,nDeleteRule)));
- return createObject( sNewName );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString OKeys::getDropForeignKey() const
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP FOREIGN KEY "));
-}
-
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BPreparedStatement.cxx b/connectivity/source/drivers/adabas/BPreparedStatement.cxx
deleted file mode 100644
index a25b760c3e..0000000000
--- a/connectivity/source/drivers/adabas/BPreparedStatement.cxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BPreparedStatement.hxx"
-#include "adabas/BResultSet.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <connectivity/dbexception.hxx>
-
-using namespace connectivity;
-using namespace connectivity::adabas;
-using namespace connectivity::odbc;
-//------------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-
-OAdabasPreparedStatement::OAdabasPreparedStatement( OAdabasConnection* _pConnection,const ::rtl::OUString& sql)
-: ::connectivity::odbc::OPreparedStatement( _pConnection,sql)
-{
- m_aSelectColumns = _pConnection->createSelectColumns(sql);
-}
-// -----------------------------------------------------------------------------
-OResultSet* OAdabasPreparedStatement::createResulSet()
-{
- return new OAdabasResultSet(m_aStatementHandle,this,m_aSelectColumns);
-}
-// -----------------------------------------------------------------------------
-void OAdabasPreparedStatement::setUsingBookmarks(sal_Bool /*_bUseBookmark*/)
-{
- ::dbtools::throwFeatureNotImplementedException( "bookmarks", *this );
- // adabas doesn't support bookmarks
-}
-// -----------------------------------------------------------------------------
-void OAdabasPreparedStatement::setResultSetConcurrency(sal_Int32 /*_par0*/)
-{
- ::dbtools::throwFeatureNotImplementedException( "PreparedStatement:ResultSetConcurrency", *this );
-}
-// -----------------------------------------------------------------------------
-void OAdabasPreparedStatement::setResultSetType(sal_Int32 /*_par0*/)
-{
- ::dbtools::throwFeatureNotImplementedException( "PreparedStatement:ResultSetType", *this );
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BResultSet.cxx b/connectivity/source/drivers/adabas/BResultSet.cxx
deleted file mode 100644
index 96212030c9..0000000000
--- a/connectivity/source/drivers/adabas/BResultSet.cxx
+++ /dev/null
@@ -1,225 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BResultSet.hxx"
-#include "adabas/BResultSetMetaData.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "odbc/OTools.hxx"
-
-using namespace connectivity::adabas;
-using namespace connectivity::odbc;
-using namespace cppu;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-
-// comment: all this movement methods are needed because adabas doesn't support a SQLGetData call when
-// the cursor was moved with a call of SQLFetchScroll. So when this is fixed by adabas we can remove this damn thing.
-
-
-sal_Bool SAL_CALL OAdabasResultSet::next( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_nLastColumnPos = 0;
- // m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_NEXT,0);
- m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
-
- if(m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO)
- ++m_nRowPos;
-
- OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- return m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OAdabasResultSet::first( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_nLastColumnPos = 0;
- // don't ask why !
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_OFF,SQL_IS_UINTEGER);
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_FIRST,0);
- sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
- if(bRet)
- {
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_PRIOR,0);
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_ON,SQL_IS_UINTEGER);
- m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
- }
-
- OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
-
- bRet = ( m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO );
- if ( bRet )
- m_nRowPos = 1;
- return bRet;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OAdabasResultSet::last( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_nLastColumnPos = 0;
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_OFF,SQL_IS_UINTEGER);
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_LAST,0);
- sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
- if(bRet)
- {
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_PRIOR,0);
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_ON,SQL_IS_UINTEGER);
- m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
- }
-
- m_bEOF = sal_True;
- OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- // here I know definitely that I stand on the last record
- return m_bLastRecord = (m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OAdabasResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_nLastColumnPos = 0;
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_OFF,SQL_IS_UINTEGER);
-
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_ABSOLUTE,row);
- sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
- if(bRet)
- {
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_PRIOR,0);
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_ON,SQL_IS_UINTEGER);
- m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
- }
-
- OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- if(bRet)
- m_nRowPos = row;
- return bRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OAdabasResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_nLastColumnPos = 0;
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_OFF,SQL_IS_UINTEGER);
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_RELATIVE,row);
- sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
- if(bRet)
- {
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_PRIOR,0);
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_ON,SQL_IS_UINTEGER);
- m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
- }
-
- OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- if(bRet)
- m_nRowPos += row;
- return bRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OAdabasResultSet::previous( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_nLastColumnPos = 0;
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_OFF,SQL_IS_UINTEGER);
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_PRIOR,0);
- sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
- if(bRet)
- {
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_PRIOR,0);
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_ON,SQL_IS_UINTEGER);
- m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
- }
-
- OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- if(bRet || m_nCurrentFetchState == SQL_NO_DATA)
- --m_nRowPos;
- return bRet;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdabasResultSet::refreshRow( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- // SQLRETURN nRet = N3SQLSetPos(m_aStatementHandle,1,SQL_REFRESH,SQL_LOCK_NO_CHANGE);
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_OFF,SQL_IS_UINTEGER);
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_RELATIVE,0);
- sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
- if(bRet)
- {
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_PRIOR,0);
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_ON,SQL_IS_UINTEGER);
- m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
- }
- OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
-}
-// -----------------------------------------------------------------------------
-Reference< XResultSetMetaData > SAL_CALL OAdabasResultSet::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(!m_xMetaData.is())
- m_xMetaData = new OAdabasResultSetMetaData(m_pStatement->getOwnConnection(),m_aStatementHandle,m_aSelectColumns);
- return m_xMetaData;
-}
-// -----------------------------------------------------------------------------
-
-
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BResultSetMetaData.cxx b/connectivity/source/drivers/adabas/BResultSetMetaData.cxx
deleted file mode 100644
index fe1eba559a..0000000000
--- a/connectivity/source/drivers/adabas/BResultSetMetaData.cxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "adabas/BResultSetMetaData.hxx"
-#include "adabas/BCatalog.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::uno;
-using namespace connectivity::adabas;
-using namespace connectivity;
-
-OAdabasResultSetMetaData::OAdabasResultSetMetaData(odbc::OConnection* _pConnection, SQLHANDLE _pStmt,const ::rtl::Reference<OSQLColumns>& _rSelectColumns )
-: OAdabasResultSetMetaData_BASE(_pConnection,_pStmt)
-,m_aSelectColumns(_rSelectColumns)
-{
-}
-// -------------------------------------------------------------------------
-OAdabasResultSetMetaData::~OAdabasResultSetMetaData()
-{
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OAdabasResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nType = OAdabasResultSetMetaData_BASE::getColumnType( column);
- // special handling for float values which could be doubles
- ::rtl::OUString sTypeName;
- OAdabasCatalog::correctColumnProperties(getPrecision(column),nType,sTypeName);
-
- return nType;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OAdabasResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0;
- sal_Bool bFound = sal_False;
- if ( m_aSelectColumns.is() && column > 0 && column <= (sal_Int32)m_aSelectColumns->get().size() )
- bFound = (m_aSelectColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)) >>= nValue;
-
- if ( !bFound )
- nValue = getNumColAttrib(column,SQL_DESC_NULLABLE);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OAdabasResultSetMetaData::isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if ( m_aSelectColumns.is() && column > 0 && column <= (sal_Int32)m_aSelectColumns->get().size() )
- {
- sal_Bool bAutoIncrement = sal_False;
- (m_aSelectColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bAutoIncrement;
- return bAutoIncrement;
- }
-
- return getNumColAttrib(column,SQL_DESC_AUTO_UNIQUE_VALUE) == SQL_TRUE;
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BStatement.cxx b/connectivity/source/drivers/adabas/BStatement.cxx
deleted file mode 100644
index f4e399cc3c..0000000000
--- a/connectivity/source/drivers/adabas/BStatement.cxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BStatement.hxx"
-#include "adabas/BResultSet.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <connectivity/dbexception.hxx>
-
-
-using namespace connectivity::adabas;
-using namespace connectivity::odbc;
-//------------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-
-typedef ::connectivity::odbc::OStatement OAdabasStatement_BASE;
-// -----------------------------------------------------------------------------
-OResultSet* OAdabasStatement::createResulSet()
-{
- return new OAdabasResultSet(m_aStatementHandle,this,m_aSelectColumns);
-}
-// -----------------------------------------------------------------------------
-void OAdabasStatement::setUsingBookmarks(sal_Bool /*_bUseBookmark*/)
-{
- ::dbtools::throwFeatureNotImplementedException( "bookmarks", *this );
- // adabas doesn't support bookmarks
-}
-// -----------------------------------------------------------------------------
-void OAdabasStatement::setResultSetConcurrency(sal_Int32 /*_par0*/)
-{
- ::dbtools::throwFeatureNotImplementedException( "PreparedStatement:ResultSetConcurrency", *this );
-}
-// -----------------------------------------------------------------------------
-void OAdabasStatement::setResultSetType(sal_Int32 /*_par0*/)
-{
- ::dbtools::throwFeatureNotImplementedException( "PreparedStatement:ResultSetType", *this );
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OAdabasStatement::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- m_aSelectColumns = m_pOwnConnection->createSelectColumns(sql);
- return OAdabasStatement_BASE::execute(sql);
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BTable.cxx b/connectivity/source/drivers/adabas/BTable.cxx
deleted file mode 100644
index 3f9ad2edde..0000000000
--- a/connectivity/source/drivers/adabas/BTable.cxx
+++ /dev/null
@@ -1,378 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BTable.hxx"
-#include "adabas/BTables.hxx"
-#include "adabas/BIndexes.hxx"
-#include "adabas/BColumns.hxx"
-#include "adabas/BKeys.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <comphelper/sequence.hxx>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include "connectivity/dbtools.hxx"
-#include "adabas/BCatalog.hxx"
-
-
-using namespace ::comphelper;
-using namespace connectivity::adabas;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-OAdabasTable::OAdabasTable( sdbcx::OCollection* _pTables,
- OAdabasConnection* _pConnection)
- :OTable_TYPEDEF(_pTables,_pConnection,sal_True)
- ,m_pConnection(_pConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-OAdabasTable::OAdabasTable( sdbcx::OCollection* _pTables,
- OAdabasConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description ,
- const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName
- ) : OTableHelper( _pTables,
- _pConnection,
- sal_True,
- _Name,
- _Type,
- _Description,
- _SchemaName,
- _CatalogName)
- ,m_pConnection(_pConnection)
-{
- construct();
-}
-// -----------------------------------------------------------------------------
-sdbcx::OCollection* OAdabasTable::createColumns(const TStringVector& _rNames)
-{
- return new OColumns(this,m_aMutex,_rNames);
-}
-// -----------------------------------------------------------------------------
-sdbcx::OCollection* OAdabasTable::createKeys(const TStringVector& _rNames)
-{
- return new OKeys(this,m_aMutex,_rNames);
-}
-// -----------------------------------------------------------------------------
-sdbcx::OCollection* OAdabasTable::createIndexes(const TStringVector& _rNames)
-{
- return new OIndexes(this,m_aMutex,_rNames);
-}
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > OAdabasTable::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OAdabasTable::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OTable_TYPEDEF::getSomething(rId);
-}
-// -------------------------------------------------------------------------
-// XAlterTable
-void SAL_CALL OAdabasTable::alterColumnByName( const ::rtl::OUString& colName, const Reference< XPropertySet >& descriptor ) throw(SQLException, NoSuchElementException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(
-#ifdef GCC
- ::connectivity::sdbcx::OTableDescriptor_BASE::rBHelper.bDisposed
-#else
- rBHelper.bDisposed
-#endif
- );
-
- if(m_pColumns && !m_pColumns->hasByName(colName))
- throw NoSuchElementException(colName,*this);
-
-
- if(!isNew())
- {
- beginTransAction();
-
- try
- {
- // first we have to check what should be altered
- Reference<XPropertySet> xProp;
- m_pColumns->getByName(colName) >>= xProp;
- // first check the types
- sal_Int32 nOldType = 0,nNewType = 0,nOldPrec = 0,nNewPrec = 0,nOldScale = 0,nNewScale = 0;
-
- xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nOldType;
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nNewType;
- // and precsions and scale
- xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)) >>= nOldPrec;
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))>>= nNewPrec;
- xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)) >>= nOldScale;
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)) >>= nNewScale;
-
- if(nOldType != nNewType || nOldPrec != nNewPrec || nOldScale != nNewScale)
- alterColumnType(colName,descriptor);
-
- // second: check the "is nullable" value
- sal_Int32 nOldNullable = 0,nNewNullable = 0;
- xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)) >>= nOldNullable;
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)) >>= nNewNullable;
- if(nNewNullable != nOldNullable)
- alterNotNullValue(nNewNullable,colName);
-
- // third: check the default values
- ::rtl::OUString sNewDefault,sOldDefault;
- xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)) >>= sOldDefault;
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)) >>= sNewDefault;
-
- if(sOldDefault.getLength())
- {
- if(sNewDefault.getLength() && sOldDefault != sNewDefault)
- alterDefaultValue(sNewDefault,colName);
- else if(!sNewDefault.getLength())
- dropDefaultValue(colName);
- }
- else if(!sOldDefault.getLength() && sNewDefault.getLength())
- addDefaultValue(sNewDefault,colName);
-
- // now we should look if the name of the column changed
- ::rtl::OUString sNewColumnName;
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sNewColumnName;
- if(!sNewColumnName.equalsIgnoreAsciiCase(colName))
- {
- const ::rtl::OUString sQuote = m_pConnection->getMetaData()->getIdentifierQuoteString( );
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
-
- ::rtl::OUString sSql( RTL_CONSTASCII_USTRINGPARAM( "RENAME COLUMN " )) ;
- sSql += ::dbtools::quoteName(sQuote,m_SchemaName) + sDot + ::dbtools::quoteName(sQuote,m_Name);
- sSql += sDot + ::dbtools::quoteName(sQuote,colName);
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" TO "));
- sSql += ::dbtools::quoteName(sQuote,sNewColumnName);
-
- Reference< XStatement > xStmt = m_pConnection->createStatement( );
- if(xStmt.is())
- {
- xStmt->execute(sSql);
- ::comphelper::disposeComponent(xStmt);
- }
- }
- m_pColumns->refresh();
- }
- catch(const SQLException&)
- {
- rollbackTransAction();
- throw;
- }
- endTransAction();
- }
- else
- {
- if(m_pColumns)
- {
- m_pColumns->dropByName(colName);
- m_pColumns->appendByDescriptor(descriptor);
- }
- }
-
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OAdabasTable::getName() throw(::com::sun::star::uno::RuntimeException)
-{
- ::rtl::OUString sName = m_SchemaName;
- if(m_SchemaName.getLength())
- {
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
- sName += sDot;
- }
- sName += m_Name;
- return sName;
-}
-// -----------------------------------------------------------------------------
-void OAdabasTable::alterColumnType(const ::rtl::OUString& _rColName, const Reference<XPropertySet>& _xDescriptor)
-{
- ::rtl::OUString sSql = getAlterTableColumnPart(_rColName);
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
- sSql += OTables::getColumnSqlType(_xDescriptor);
-
- Reference< XStatement > xStmt = m_pConnection->createStatement( );
- if(xStmt.is())
- {
- xStmt->execute(sSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-void OAdabasTable::alterNotNullValue(sal_Int32 _nNewNullable,const ::rtl::OUString& _rColName)
-{
- ::rtl::OUString sSql = getAlterTableColumnPart(_rColName);
-
- if(_nNewNullable == ColumnValue::NO_NULLS)
- {
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" NOT NULL"));
- }
- else
- {
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DEFAULT NULL"));
- }
-
- Reference< XStatement > xStmt = m_pConnection->createStatement();
- if(xStmt.is())
- {
- xStmt->execute(sSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-void OAdabasTable::alterDefaultValue(const ::rtl::OUString& _sNewDefault,const ::rtl::OUString& _rColName)
-{
- ::rtl::OUString sSql = getAlterTableColumnPart(_rColName);
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ALTER ")) + _sNewDefault;
-
- Reference< XStatement > xStmt = m_pConnection->createStatement();
- if(xStmt.is())
- {
- xStmt->execute(sSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-void OAdabasTable::dropDefaultValue(const ::rtl::OUString& _rColName)
-{
- ::rtl::OUString sSql = getAlterTableColumnPart(_rColName);
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP DEFAULT"));
-
- Reference< XStatement > xStmt = m_pConnection->createStatement();
- if(xStmt.is())
- {
- xStmt->execute(sSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-void OAdabasTable::addDefaultValue(const ::rtl::OUString& _sNewDefault,const ::rtl::OUString& _rColName)
-{
- ::rtl::OUString sSql = getAlterTableColumnPart(_rColName);
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ADD ")) + _sNewDefault;
-
- Reference< XStatement > xStmt = m_pConnection->createStatement();
- if(xStmt.is())
- {
- xStmt->execute(sSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-void OAdabasTable::beginTransAction()
-{
- try
- {
- Reference< XStatement > xStmt = m_pConnection->createStatement();
- if(xStmt.is())
- {
- xStmt->execute(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SUBTRANS BEGIN")) );
- ::comphelper::disposeComponent(xStmt);
- }
- }
- catch(const Exception&)
- {
- }
-}
-// -----------------------------------------------------------------------------
-void OAdabasTable::endTransAction()
-{
- try
- {
- Reference< XStatement > xStmt = m_pConnection->createStatement();
- if(xStmt.is())
- {
- xStmt->execute(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SUBTRANS END")) );
- ::comphelper::disposeComponent(xStmt);
- }
- }
- catch(const Exception&)
- {
- }
-}
-// -----------------------------------------------------------------------------
-void OAdabasTable::rollbackTransAction()
-{
- try
- {
- Reference< XStatement > xStmt = m_pConnection->createStatement();
- if(xStmt.is())
- {
- xStmt->execute(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SUBTRANS ROLLBACK")) );
- ::comphelper::disposeComponent(xStmt);
- }
- }
- catch(const Exception&)
- {
- }
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OAdabasTable::getAlterTableColumnPart(const ::rtl::OUString& _rsColumnName )
-{
- ::rtl::OUString sSql( RTL_CONSTASCII_USTRINGPARAM( "ALTER TABLE " ));
- const ::rtl::OUString sQuote = m_pConnection->getMetaData()->getIdentifierQuoteString( );
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
-
- sSql += ::dbtools::quoteName(sQuote,m_SchemaName) + sDot + ::dbtools::quoteName(sQuote,m_Name)
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" COLUMN "))
- + ::dbtools::quoteName(sQuote,_rsColumnName);
- return sSql;
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BTables.cxx b/connectivity/source/drivers/adabas/BTables.cxx
deleted file mode 100644
index 302e9b4e8f..0000000000
--- a/connectivity/source/drivers/adabas/BTables.cxx
+++ /dev/null
@@ -1,523 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BTables.hxx"
-#include "adabas/BViews.hxx"
-#include "adabas/BTable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include "adabas/BCatalog.hxx"
-#include "adabas/BConnection.hxx"
-#include <comphelper/extract.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include <cppuhelper/interfacecontainer.h>
-#include <comphelper/types.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace ::cppu;
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace dbtools;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OTables::createObject(const ::rtl::OUString& _rName)
-{
- ::rtl::OUString aName,aSchema;
- sal_Int32 nLen = _rName.indexOf('.');
- aSchema = _rName.copy(0,nLen);
- aName = _rName.copy(nLen+1);
-
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%"));
-
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),aSchema,aName,aTypes);
-
- sdbcx::ObjectType xRet = NULL;
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- if(xResult->next()) // there can be only one table with this name
- {
- OAdabasTable* pRet = new OAdabasTable(this, static_cast<OAdabasCatalog&>(m_rParent).getConnection(),
- aName,xRow->getString(4),xRow->getString(5),aSchema);
- xRet = pRet;
- }
- ::comphelper::disposeComponent(xResult);
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void OTables::impl_refresh( ) throw(RuntimeException)
-{
- static_cast<OAdabasCatalog&>(m_rParent).refreshTables();
-}
-// -------------------------------------------------------------------------
-void OTables::disposing(void)
-{
-m_xMetaData.clear();
- OCollection::disposing();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OTables::createDescriptor()
-{
- return new OAdabasTable(this,static_cast<OAdabasCatalog&>(m_rParent).getConnection());
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OTables::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- createTable(descriptor);
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-void OTables::setComments(const Reference< XPropertySet >& descriptor ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "CREATE TABLE " ));
- ::rtl::OUString aQuote = static_cast<OAdabasCatalog&>(m_rParent).getConnection()->getMetaData()->getIdentifierQuoteString( );
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
-
- OAdabasConnection* pConnection = static_cast<OAdabasCatalog&>(m_rParent).getConnection();
- Reference< XStatement > xStmt = pConnection->createStatement( );
- aSql = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("COMMENT ON TABLE "));
- ::rtl::OUString sSchema;
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= sSchema;
- if(sSchema.getLength())
- aSql += ::dbtools::quoteName(aQuote, sSchema) + sDot;
-
- aSql += aQuote + getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))) + aQuote
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" '"))
- + getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)))
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- xStmt->execute(aSql);
-
- // columns
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
-
- aSql = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("COMMENT ON COLUMN "));
- if(sSchema.getLength())
- aSql += ::dbtools::quoteName(aQuote, sSchema) + sDot;
- aSql += aQuote + getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))) + aQuote + sDot
- + aQuote;
-
- for(sal_Int32 i=0;i<xColumns->getCount();++i)
- {
- ::cppu::extractInterface(xColProp,xColumns->getByIndex(i));
- if(xColProp.is())
- {
- ::rtl::OUString aDescription = getString(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)));
- if(aDescription.getLength())
- {
- ::rtl::OUString aCom = aSql + getString(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))) + aQuote
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" '"))
- + aDescription
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
- }
- }
- ::comphelper::disposeComponent(xStmt);
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OTables::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName)
-{
- Reference< XInterface > xObject( getObject( _nPos ) );
- sal_Bool bIsNew = connectivity::sdbcx::ODescriptor::isNew( xObject );
- if (!bIsNew)
- {
- OAdabasConnection* pConnection = static_cast<OAdabasCatalog&>(m_rParent).getConnection();
- Reference< XStatement > xStmt = pConnection->createStatement( );
-
- ::rtl::OUString aName,aSchema;
- sal_Int32 nLen = _sElementName.indexOf('.');
- aSchema = _sElementName.copy(0,nLen);
- aName = _sElementName.copy(nLen+1);
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "DROP " ));
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
-
- Reference<XPropertySet> xProp(xObject,UNO_QUERY);
- sal_Bool bIsView;
- if((bIsView = (xProp.is() && ::comphelper::getString(xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))) == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW"))))) // here we have a view
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW "));
- else
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE "));
-
- aSql += m_xMetaData->getIdentifierQuoteString( ) + aSchema + m_xMetaData->getIdentifierQuoteString( );
- aSql += sDot;
- aSql += m_xMetaData->getIdentifierQuoteString( ) + aName + m_xMetaData->getIdentifierQuoteString( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- // if no exception was thrown we must delete it from the views
- if(bIsView)
- {
- OViews* pViews = static_cast<OViews*>(static_cast<OAdabasCatalog&>(m_rParent).getPrivateViews());
- if(pViews && pViews->hasByName(_sElementName))
- pViews->dropByNameImpl(_sElementName);
- }
- }
-}
-// -------------------------------------------------------------------------
-void OTables::createTable( const Reference< XPropertySet >& descriptor )
-{
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "CREATE TABLE " ));
- ::rtl::OUString aQuote = static_cast<OAdabasCatalog&>(m_rParent).getConnection()->getMetaData()->getIdentifierQuoteString( );
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
- ::rtl::OUString sSchema;
-
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= sSchema;
- if(sSchema.getLength())
- aSql += ::dbtools::quoteName(aQuote, sSchema) + sDot;
- else
- descriptor->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCHEMANAME),makeAny(static_cast<OAdabasCatalog&>(m_rParent).getConnection()->getUserName().
- toAsciiUpperCase()
- ));
-
- aSql += ::dbtools::quoteName(aQuote, getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))))
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ("));
-
- // columns
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
-
- Any aTypeName;
- sal_Int32 nCount = xColumns->getCount();
- if(!nCount)
- ::dbtools::throwFunctionSequenceException(static_cast<XTypeProvider*>(this));
-
- for(sal_Int32 i=0;i<nCount;++i)
- {
- if(::cppu::extractInterface(xColProp,xColumns->getByIndex(i)) && xColProp.is())
- {
-
- aSql += aQuote + getString(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))) + aQuote;
-
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
- aSql += OTables::getColumnSqlType(xColProp);
- aSql += OTables::getColumnSqlNotNullDefault(xColProp);
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- }
- }
-
- // keys
-
- Reference<XKeysSupplier> xKeySup(descriptor,UNO_QUERY);
-
- Reference<XIndexAccess> xKeys = xKeySup->getKeys();
- if(xKeys.is())
- {
- sal_Bool bPKey = sal_False;
- for( sal_Int32 key=0; key<xKeys->getCount(); ++key )
- {
- if(::cppu::extractInterface(xColProp,xKeys->getByIndex(key)) && xColProp.is())
- {
-
- sal_Int32 nKeyType = getINT32(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)));
-
- if(nKeyType == KeyType::PRIMARY)
- {
- if(bPKey)
- throw SQLException();
-
- bPKey = sal_True;
- xColumnSup = Reference<XColumnsSupplier>(xColProp,UNO_QUERY);
- xColumns = Reference<XIndexAccess>(xColumnSup->getColumns(),UNO_QUERY);
- if(!xColumns->getCount())
- throw SQLException();
-
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" PRIMARY KEY ("));
- for( sal_Int32 column=0; column<xColumns->getCount(); ++column )
- {
- if(::cppu::extractInterface(xColProp,xColumns->getByIndex(column)) && xColProp.is())
- aSql += aQuote + getString(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))) + aQuote
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- }
-
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
- }
- else if(nKeyType == KeyType::UNIQUE)
- {
- xColumnSup = Reference<XColumnsSupplier>(xColProp,UNO_QUERY);
- xColumns = Reference<XIndexAccess>(xColumnSup->getColumns(),UNO_QUERY);
- if(!xColumns->getCount())
- throw SQLException();
-
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" UNIQUE ("));
- for( sal_Int32 column=0; column<xColumns->getCount(); ++column )
- {
- if(::cppu::extractInterface(xColProp,xColumns->getByIndex(column)) && xColProp.is())
- aSql += aQuote + getString(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))) + aQuote
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- }
-
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
- }
- else if(nKeyType == KeyType::FOREIGN)
- {
- sal_Int32 nDeleteRule = getINT32(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELETERULE)));
-
- xColumnSup = Reference<XColumnsSupplier>(xColProp,UNO_QUERY);
- xColumns = Reference<XIndexAccess>(xColumnSup->getColumns(),UNO_QUERY);
- if(!xColumns->getCount())
- throw SQLException();
-
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FOREIGN KEY "));
- ::rtl::OUString aName,aSchema,aRefTable = getString(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REFERENCEDTABLE)));
- sal_Int32 nLen = aRefTable.indexOf('.');
- aSchema = aRefTable.copy(0,nLen);
- aName = aRefTable.copy(nLen+1);
-
- aSql += aQuote + aSchema + aQuote + sDot
- + aQuote + aName + aQuote
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ("));
-
- for ( sal_Int32 column=0; column<xColumns->getCount(); ++column )
- {
- if(::cppu::extractInterface(xColProp,xColumns->getByIndex(column)) && xColProp.is())
- aSql += aQuote + getString(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))) + aQuote
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- }
-
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
-
- switch(nDeleteRule)
- {
- case KeyRule::CASCADE:
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON DELETE CASCADE "));
- break;
- case KeyRule::RESTRICT:
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON DELETE RESTRICT "));
- break;
- case KeyRule::SET_NULL:
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON DELETE SET NULL "));
- break;
- case KeyRule::SET_DEFAULT:
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON DELETE SET DEFAULT "));
- break;
- default:
- ;
- }
- }
- }
- }
- }
-
- if(aSql.lastIndexOf(',') == (aSql.getLength()-1))
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
- else
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
-
- OAdabasConnection* pConnection = static_cast<OAdabasCatalog&>(m_rParent).getConnection();
- Reference< XStatement > xStmt = pConnection->createStatement( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
-
- if(getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION))).getLength())
- setComments(descriptor);
-}
-// -----------------------------------------------------------------------------
-void OTables::appendNew(const ::rtl::OUString& _rsNewTable)
-{
- insertElement(_rsNewTable,NULL);
-
- // notify our container listeners
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rsNewTable), Any(), Any());
- OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
- while (aListenerLoop.hasMoreElements())
- static_cast<XContainerListener*>(aListenerLoop.next())->elementInserted(aEvent);
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OTables::getColumnSqlType(const Reference<XPropertySet>& _rxColProp)
-{
- ::rtl::OUString sSql;
- sal_Int32 nDataType = 0;
- _rxColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nDataType;
- switch(nDataType)
- {
- case DataType::VARBINARY:
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VAR"));
- /* run through*/
- case DataType::BINARY:
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CHAR"));
- break;
- default:
- {
- Any aTypeName = _rxColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME));
- if(aTypeName.hasValue() && getString(aTypeName).getLength())
- sSql += getString(aTypeName);
- else
- sSql += OTables::getTypeString(_rxColProp) + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
- }
- }
-
- switch(nDataType)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::FLOAT:
- case DataType::REAL:
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("("))
- + ::rtl::OUString::valueOf(getINT32(_rxColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))))
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
- break;
-
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("("))
- + ::rtl::OUString::valueOf(getINT32(_rxColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))))
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","))
- + ::rtl::OUString::valueOf(getINT32(_rxColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))))
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("("))
- + ::rtl::OUString::valueOf(getINT32(_rxColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))))
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(") BYTE"));
- break;
- }
- return sSql;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OTables::getColumnSqlNotNullDefault(const Reference<XPropertySet>& _rxColProp)
-{
- OSL_ENSURE(_rxColProp.is(),"OTables::getColumnSqlNotNullDefault: Column is null!");
- ::rtl::OUString sSql;
- ::rtl::OUString aDefault = getString(_rxColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)));
- if(getINT32(_rxColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))) == ColumnValue::NO_NULLS)
- {
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" NOT NULL"));
- if(aDefault.getLength())
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" WITH DEFAULT"));
- }
- else if(aDefault.getLength())
- {
- sSql +=::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DEFAULT '")) + aDefault;
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- }
- return sSql;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OTables::getTypeString(const Reference< XPropertySet >& _rxColProp)
-{
- ::rtl::OUString aValue;
- switch(getINT32(_rxColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))))
- {
- case DataType::BIT:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BOOLEAN"));
- break;
- case DataType::TINYINT:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SMALLINT"));
- break;
- case DataType::SMALLINT:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SMALLINT"));
- break;
- case DataType::INTEGER:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INT"));
- break;
- case DataType::FLOAT:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FLOAT"));
- break;
- case DataType::REAL:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REAL"));
- break;
- case DataType::DOUBLE:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DOUBLE"));
- break;
- case DataType::NUMERIC:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DECIMAL"));
- break;
- case DataType::DECIMAL:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DECIMAL"));
- break;
- case DataType::CHAR:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CHAR"));
- break;
- case DataType::VARCHAR:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
- break;
- case DataType::LONGVARCHAR:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LONG VARCHAR"));
- break;
- case DataType::DATE:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATE"));
- break;
- case DataType::TIME:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIME"));
- break;
- case DataType::TIMESTAMP:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP"));
- break;
- case DataType::BINARY:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CHAR () BYTE"));
- break;
- case DataType::VARBINARY:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR () BYTE"));
- break;
- case DataType::LONGVARBINARY:
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LONG BYTE"));
- break;
- }
- return aValue;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OTables::getNameForObject(const sdbcx::ObjectType& _xObject)
-{
- OSL_ENSURE(_xObject.is(),"OTables::getNameForObject: Object is NULL!");
- ::rtl::OUString sName,sTemp;
- _xObject->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= sName;
- if( sName.getLength() )
- {
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
- sName += sDot;
- }
-
- _xObject->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sTemp;
- sName += sTemp;
-
- return sName;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BUser.cxx b/connectivity/source/drivers/adabas/BUser.cxx
deleted file mode 100644
index 98d61e4f43..0000000000
--- a/connectivity/source/drivers/adabas/BUser.cxx
+++ /dev/null
@@ -1,332 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <sal/macros.h>
-#include "adabas/BUser.hxx"
-#include "adabas/BGroups.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "adabas/BConnection.hxx"
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbcx/PrivilegeObject.hpp>
-#include "resource/adabas_res.hrc"
-
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -------------------------------------------------------------------------
-OAdabasUser::OAdabasUser( OAdabasConnection* _pConnection) : connectivity::sdbcx::OUser(sal_True)
- ,m_pConnection(_pConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-OAdabasUser::OAdabasUser( OAdabasConnection* _pConnection,
- const ::rtl::OUString& _Name
- ) : connectivity::sdbcx::OUser(_Name,sal_True)
- ,m_pConnection(_pConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-void OAdabasUser::refreshGroups()
-{
- if(!m_pConnection)
- return;
-
- TStringVector aVector;
- aVector.reserve(7); // we don't know the excatly count of users but this should fit the normal need
- Reference< XStatement > xStmt = m_pConnection->createStatement( );
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "SELECT DISTINCT GROUPNAME FROM DOMAIN.USERS WHERE GROUPNAME IS NOT NULL AND GROUPNAME <> ' ' AND USERNAME = '" ));
- aSql += getName( );
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
-
- Reference< XResultSet > xResult = xStmt->executeQuery(aSql);
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- aVector.push_back(xRow->getString(1));
- ::comphelper::disposeComponent(xResult);
- }
- ::comphelper::disposeComponent(xStmt);
-
- if(m_pGroups)
- m_pGroups->reFill(aVector);
- else
- m_pGroups = new OGroups(*this,m_aMutex,aVector,m_pConnection,this);
-}
-// -------------------------------------------------------------------------
-OUserExtend::OUserExtend( OAdabasConnection* _pConnection) : OAdabasUser(_pConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-typedef connectivity::sdbcx::OUser OUser_TYPEDEF;
-void OUserExtend::construct()
-{
-
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD), PROPERTY_ID_PASSWORD,0,&m_Password,::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
-}
-// -----------------------------------------------------------------------------
-cppu::IPropertyArrayHelper* OUserExtend::createArrayHelper() const
-{
- Sequence< Property > aProps;
- describeProperties(aProps);
- return new cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-cppu::IPropertyArrayHelper & OUserExtend::getInfoHelper()
-{
- return *OUserExtend_PROP::getArrayHelper();
-}
-typedef connectivity::sdbcx::OUser_BASE OUser_BASE_RBHELPER;
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OAdabasUser::getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(SQLException, RuntimeException)
-{
- if ( objType != PrivilegeObject::TABLE )
- return 0;
-
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
-
- sal_Int32 nRights,nRightsWithGrant;
- getAnyTablePrivileges(objName,nRights,nRightsWithGrant);
- return nRights;
-}
-// -----------------------------------------------------------------------------
-void OAdabasUser::getAnyTablePrivileges(const ::rtl::OUString& objName, sal_Int32& nRights,sal_Int32& nRightsWithGrant) throw(SQLException, RuntimeException)
-{
- nRightsWithGrant = nRights = 0;
- // first we need to create the sql stmt to select the privs
- Reference<XDatabaseMetaData> xMeta = m_pConnection->getMetaData();
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(xMeta,objName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
- Reference<XStatement> xStmt = m_pConnection->createStatement();
- ::rtl::OUString sSql( RTL_CONSTASCII_USTRINGPARAM( "SELECT REFTABLENAME,PRIVILEGES FROM DOMAIN.USR_USES_TAB WHERE REFOBJTYPE <> 'SYSTEM' AND DEFUSERNAME = '" ));
- sSql += m_Name;
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("' AND REFTABLENAME = '"));
- sSql += sTable;
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- if(xStmt.is())
- {
- Reference<XResultSet> xRes = xStmt->executeQuery(sSql);
- if(xRes.is())
- {
- Reference<XRow> xRow(xRes,UNO_QUERY);
- if(xRow.is() && xRes->next())
- {
- ::rtl::OUString sPrivs = xRow->getString(2);
-
- struct _priv_nam
- {
- const sal_Char* pAsciiName;
- sal_Int32 nNumericValue;
- } privileges[] =
- {
- { "INS", Privilege::INSERT },
- { "DEL", Privilege::DELETE },
- { "UPD", Privilege::UPDATE },
- { "ALT", Privilege::ALTER },
- { "SEL", Privilege::SELECT },
- { "REF", Privilege::REFERENCE }
- };
- for ( size_t i = 0; i < SAL_N_ELEMENTS( privileges ); ++i )
- {
- sal_Int32 nIndex = sPrivs.indexOf( ::rtl::OUString::createFromAscii( privileges[i].pAsciiName ) );
- if ( nIndex == -1 )
- continue;
-
- nRights |= privileges[i].nNumericValue;
- if ( sPrivs.copy( nIndex + 2, 1 ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "+" ) ) )
- nRightsWithGrant |= privileges[i].nNumericValue;
- }
- }
- ::comphelper::disposeComponent(xRes);
- }
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OAdabasUser::getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(SQLException, RuntimeException)
-{
- if ( objType != PrivilegeObject::TABLE )
- return 0;
-
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
-
- sal_Int32 nRights,nRightsWithGrant;
- getAnyTablePrivileges(objName,nRights,nRightsWithGrant);
- return nRightsWithGrant;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OAdabasUser::grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(SQLException, RuntimeException)
-{
- if ( objType != PrivilegeObject::TABLE )
- m_pConnection->throwGenericSQLException(STR_PRIVILEGE_NOT_GRANTED,*this);
-
- ::osl::MutexGuard aGuard(m_aMutex);
- ::rtl::OUString sPrivs = getPrivilegeString(objPrivileges);
- if(sPrivs.getLength())
- {
- ::rtl::OUString sGrant(RTL_CONSTASCII_USTRINGPARAM("GRANT "));
- sGrant += sPrivs;
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "));
- Reference<XDatabaseMetaData> xMeta = m_pConnection->getMetaData();
- sGrant += ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation);
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" TO "));
- sGrant += m_Name;
-
- Reference<XStatement> xStmt = m_pConnection->createStatement();
- if(xStmt.is())
- xStmt->execute(sGrant);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OAdabasUser::revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(SQLException, RuntimeException)
-{
- if ( objType != PrivilegeObject::TABLE )
- m_pConnection->throwGenericSQLException(STR_PRIVILEGE_NOT_REVOKED,*this);
-
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
- ::rtl::OUString sPrivs = getPrivilegeString(objPrivileges);
- if(sPrivs.getLength())
- {
- ::rtl::OUString sGrant(RTL_CONSTASCII_USTRINGPARAM("REVOKE "));
- sGrant += sPrivs;
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "));
- Reference<XDatabaseMetaData> xMeta = m_pConnection->getMetaData();
- sGrant += ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation);
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FROM "));
- sGrant += m_Name;
-
- Reference<XStatement> xStmt = m_pConnection->createStatement();
- if(xStmt.is())
- xStmt->execute(sGrant);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-// XUser
-void SAL_CALL OAdabasUser::changePassword( const ::rtl::OUString& objPassword, const ::rtl::OUString& newPassword ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
- ::rtl::OUString sAlterPwd(RTL_CONSTASCII_USTRINGPARAM("ALTER PASSWORD \""));
- sAlterPwd += objPassword.toAsciiUpperCase();
- sAlterPwd += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\" TO \"")) ;
- sAlterPwd += newPassword.toAsciiUpperCase();
- sAlterPwd += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"")) ;
-
- sal_Bool bDisposeConnection = sal_False;
- Reference<XConnection> xConnection = m_pConnection;
- if(m_pConnection->getMetaData()->getUserName() != m_Name)
- {
- OAdabasConnection* pNewConnection = new OAdabasConnection(m_pConnection->getDriverHandle(),m_pConnection->getDriver());
- xConnection = pNewConnection;
- if(pNewConnection)
- {
- Sequence< PropertyValue> aSeq(2);
- aSeq.getArray()[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")) ;
- aSeq.getArray()[0].Value <<= m_Name;
- aSeq.getArray()[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("password")) ;
- aSeq.getArray()[1].Value <<= objPassword;
- pNewConnection->Construct(m_pConnection->getMetaData()->getURL(),aSeq);
- }
- bDisposeConnection = sal_True;
- }
- if(xConnection.is())
- {
- Reference<XStatement> xStmt = xConnection->createStatement();
- if(xStmt.is())
- xStmt->execute(sAlterPwd);
- ::comphelper::disposeComponent(xStmt);
- if(bDisposeConnection)
- ::comphelper::disposeComponent(xConnection);
- }
- else
- ::dbtools::throwFunctionSequenceException(*this);
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OAdabasUser::getPrivilegeString(sal_Int32 nRights) const
-{
- ::rtl::OUString sPrivs;
- if((nRights & Privilege::INSERT) == Privilege::INSERT)
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INSERT"));
-
- if((nRights & Privilege::DELETE) == Privilege::DELETE)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DELETE"));
- }
-
- if((nRights & Privilege::UPDATE) == Privilege::UPDATE)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UPDATE"));
- }
-
- if((nRights & Privilege::ALTER) == Privilege::ALTER)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER"));
- }
-
- if((nRights & Privilege::SELECT) == Privilege::SELECT)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT"));
- }
-
- if((nRights & Privilege::REFERENCE) == Privilege::REFERENCE)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REFERENCES"));
- }
-
- return sPrivs;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BUsers.cxx b/connectivity/source/drivers/adabas/BUsers.cxx
deleted file mode 100644
index 995a4f8739..0000000000
--- a/connectivity/source/drivers/adabas/BUsers.cxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BUsers.hxx"
-#include "adabas/BUser.hxx"
-#include "adabas/BTable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "connectivity/sdbcx/IRefreshable.hxx"
-#include <comphelper/types.hxx>
-#include "connectivity/dbexception.hxx"
-#include "connectivity/dbtools.hxx"
-#include "resource/adabas_res.hrc"
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OUsers::createObject(const ::rtl::OUString& _rName)
-{
- return new OAdabasUser(m_pConnection,_rName);
-}
-// -------------------------------------------------------------------------
-void OUsers::impl_refresh() throw(RuntimeException)
-{
- m_pParent->refreshUsers();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OUsers::createDescriptor()
-{
- OUserExtend* pNew = new OUserExtend(m_pConnection);
- return pNew;
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OUsers::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "CREATE USER " ));
- ::rtl::OUString aQuote = m_pConnection->getMetaData()->getIdentifierQuoteString( );
-
- ::rtl::OUString sUserName( _rForName );
- sUserName = sUserName.toAsciiUpperCase();
- descriptor->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME),makeAny(sUserName));
- aSql += ::dbtools::quoteName(aQuote,sUserName)
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" PASSWORD "))
- + getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD)));
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" RESOURCE NOT EXCLUSIVE"));
-
- Reference< XStatement > xStmt = m_pConnection->createStatement( );
- if(xStmt.is())
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
-
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OUsers::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- {
- // first we have to check if this user is live relevaant for the database
- // which means with out these users the database will miss more than one important system table
- ::rtl::OUString sUsers( RTL_CONSTASCII_USTRINGPARAM( "SELECT USERMODE,USERNAME FROM DOMAIN.USERS WHERE USERNAME = '" ));
- sUsers += _sElementName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- Reference< XStatement > xStmt = m_pConnection->createStatement();
- if(xStmt.is())
- {
- Reference<XResultSet> xRes = xStmt->executeQuery(sUsers);
- Reference<XRow> xRow(xRes,UNO_QUERY);
- if(xRes.is() && xRow.is() && xRes->next()) // there can only be one user with this name
- {
- static const ::rtl::OUString sDbaUser( RTL_CONSTASCII_USTRINGPARAM( "DBA" ));
- if(xRow->getString(1) == sDbaUser)
- {
- ::comphelper::disposeComponent(xStmt);
- m_pConnection->throwGenericSQLException(STR_USER_NO_DELETE,static_cast< XDrop* >( this ));
- }
- }
- ::comphelper::disposeComponent(xStmt);
- }
- }
-
- {
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "DROP USER " ));
- ::rtl::OUString aQuote = m_pConnection->getMetaData()->getIdentifierQuoteString( );
- aSql += ::dbtools::quoteName(aQuote,_sElementName);
-
- Reference< XStatement > xStmt = m_pConnection->createStatement( );
- if(xStmt.is())
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/BViews.cxx b/connectivity/source/drivers/adabas/BViews.cxx
deleted file mode 100644
index f15ff861be..0000000000
--- a/connectivity/source/drivers/adabas/BViews.cxx
+++ /dev/null
@@ -1,197 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BViews.hxx"
-#include "adabas/BTables.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbcx/CheckOption.hpp>
-#include "adabas/BCatalog.hxx"
-#include "adabas/BConnection.hxx"
-#include <comphelper/extract.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include <cppuhelper/interfacecontainer.h>
-#include "connectivity/sdbcx/VView.hxx"
-#include <comphelper/types.hxx>
-
-using namespace ::comphelper;
-
-using namespace ::cppu;
-using namespace connectivity;
-using namespace connectivity::adabas;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace dbtools;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OViews::createObject(const ::rtl::OUString& _rName)
-{
- ::rtl::OUString aName,aSchema;
- sal_Int32 nLen = _rName.indexOf('.');
- aSchema = _rName.copy(0,nLen);
- aName = _rName.copy(nLen+1);
-
- ::rtl::OUString sStmt( RTL_CONSTASCII_USTRINGPARAM( "SELECT DISTINCT * FROM DOMAIN.SHOW_VIEW WHERE " ));
- if(aSchema.getLength())
- {
- sStmt += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OWNER = '"));
- sStmt += aSchema;
- sStmt += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("' AND "));
- }
- sStmt += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEWNAME = '"));
- sStmt += aName;
- sStmt += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- Reference<XConnection> xConnection = static_cast<OAdabasCatalog&>(m_rParent).getConnection();
- Reference< XStatement > xStmt = xConnection->createStatement( );
- Reference< XResultSet > xResult = xStmt->executeQuery(sStmt);
-
- sdbcx::ObjectType xRet = NULL;
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- if(xResult->next()) // there can be only one table with this name
- {
- connectivity::sdbcx::OView* pRet = new connectivity::sdbcx::OView(sal_True,
- aName,
- xConnection->getMetaData(),
- CheckOption::NONE,
- xRow->getString(3),
- aSchema);
- xRet = pRet;
- }
- ::comphelper::disposeComponent(xResult);
- }
- ::comphelper::disposeComponent(xStmt);
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void OViews::impl_refresh( ) throw(RuntimeException)
-{
- static_cast<OAdabasCatalog&>(m_rParent).refreshTables();
-}
-// -------------------------------------------------------------------------
-void OViews::disposing(void)
-{
-m_xMetaData.clear();
- OCollection::disposing();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OViews::createDescriptor()
-{
- Reference<XConnection> xConnection = static_cast<OAdabasCatalog&>(m_rParent).getConnection();
- return new connectivity::sdbcx::OView(sal_True,xConnection->getMetaData());
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OViews::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- createView(descriptor);
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OViews::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName)
-{
- if(m_bInDrop)
- return;
-
- Reference< XInterface > xObject( getObject( _nPos ) );
- sal_Bool bIsNew = connectivity::sdbcx::ODescriptor::isNew( xObject );
- if (!bIsNew)
- {
- OAdabasConnection* pConnection = static_cast<OAdabasCatalog&>(m_rParent).getConnection();
- Reference< XStatement > xStmt = pConnection->createStatement( );
-
- ::rtl::OUString aName,aSchema;
- sal_Int32 nLen = _sElementName.indexOf('.');
- aSchema = _sElementName.copy(0,nLen);
- aName = _sElementName.copy(nLen+1);
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "DROP VIEW" ));
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
-
- aSql = aSql + m_xMetaData->getIdentifierQuoteString( ) + aSchema + m_xMetaData->getIdentifierQuoteString( );
- aSql = aSql + sDot;
- aSql = aSql + m_xMetaData->getIdentifierQuoteString( ) + aName + m_xMetaData->getIdentifierQuoteString( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-void OViews::dropByNameImpl(const ::rtl::OUString& elementName)
-{
- m_bInDrop = sal_True;
- OCollection_TYPE::dropByName(elementName);
- m_bInDrop = sal_False;
-}
-// -----------------------------------------------------------------------------
-void OViews::createView( const Reference< XPropertySet >& descriptor )
-{
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "CREATE VIEW " ));
- ::rtl::OUString aQuote = static_cast<OAdabasCatalog&>(m_rParent).getConnection()->getMetaData()->getIdentifierQuoteString( );
- const ::rtl::OUString& sDot = OAdabasCatalog::getDot();
- ::rtl::OUString sSchema,sCommand;
-
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= sSchema;
- if(sSchema.getLength())
- aSql += ::dbtools::quoteName(aQuote, sSchema) + sDot;
- else
- descriptor->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCHEMANAME),makeAny(sSchema = static_cast<OAdabasCatalog&>(m_rParent).getConnection()->getMetaData()->getUserName()));
-
- aSql += ::dbtools::quoteName(aQuote, getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))))
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" AS "));
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_COMMAND)) >>= sCommand;
- aSql += sCommand;
-
- OAdabasConnection* pConnection = static_cast<OAdabasCatalog&>(m_rParent).getConnection();
- Reference< XStatement > xStmt = pConnection->createStatement( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
-
- // insert the new view also in the tables collection
- OTables* pTables = static_cast<OTables*>(static_cast<OAdabasCatalog&>(m_rParent).getPrivateTables());
- if(pTables)
- {
- ::rtl::OUString sName = sSchema;
- sName += sDot;
- sName += getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)));
- pTables->appendNew(sName);
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/Bservices.cxx b/connectivity/source/drivers/adabas/Bservices.cxx
deleted file mode 100644
index dcb809842c..0000000000
--- a/connectivity/source/drivers/adabas/Bservices.cxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BDriver.hxx"
-#include <cppuhelper/factory.hxx>
-
-using namespace connectivity::adabas;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pT
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- ODriver::getImplementationName_Static(),
- ODriver::getSupportedServiceNames_Static(),
- ODriver_CreateInstance, ::cppu::createSingleFactory)
- ;
-
- if(aReq.xRet.is())
- aReq.xRet->acquire();
-
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/adabas/adabas.component b/connectivity/source/drivers/adabas/adabas.component
deleted file mode 100755
index 3c359c3d02..0000000000
--- a/connectivity/source/drivers/adabas/adabas.component
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.sdbcx.adabas.ODriver">
- <service name="com.sun.star.sdbc.Driver"/>
- <service name="com.sun.star.sdbcx.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/adabas/adabas.mxp.map b/connectivity/source/drivers/adabas/adabas.mxp.map
deleted file mode 100755
index d1251e3725..0000000000
--- a/connectivity/source/drivers/adabas/adabas.mxp.map
+++ /dev/null
@@ -1,146 +0,0 @@
-component_getFactory
-__mh_dylib_header
-___builtin_delete
-___builtin_vec_delete
-___builtin_vec_new
-___check_eh_spec
-___cp_pop_exception
-___cp_push_exception
-___eh_alloc
-___get_eh_context
-___pure_virtual
-___rtti_class
-___rtti_si
-___rtti_user
-___sjthrow
-___start_cp_handler
-___terminate
-_terminate__Fv
-dyld_stub_binding_helper
-rest_world
-save_world
-___eh_rtime_match
-__floatdisf
-___builtin_new
-___rtti_ptr
-___tf9bad_alloc
-__._10bad_typeid
-__._8bad_cast
-___get_eh_info
-___is_pointer__FPv
-___throw_type_match_rtti
-___vt_10bad_typeid
-___vt_8bad_cast
-__keymgr_get_per_thread_data
-__keymgr_set_per_thread_data
-___tf9exception
-___ti9exception
-___vt_9exception
-_what__C9exception
-__._9bad_alloc
-___vt_9bad_alloc
-__._9type_info
-___eq__C9type_infoRCB0
-___tf16__user_type_info
-___tf9type_info
-___ti9type_info
-___vt_9type_info
-_release__Q312connectivity6adabas7ODriver
-_acquire__Q312connectivity6adabas7ODriver
-___Q312connectivity6adabas7ODriver
-_refreshUsers__Q312connectivity6adabas14OAdabasCatalog
-_refreshGroups__Q312connectivity6adabas14OAdabasCatalog
-_refreshViews__Q312connectivity6adabas14OAdabasCatalog
-_refreshTables__Q312connectivity6adabas14OAdabasCatalog
-__._Q312connectivity6adabas12OAdabasGroup
-_refreshUsers__Q312connectivity6adabas12OAdabasGroup
-__._Q312connectivity6adabas11OAdabasUser
-__._Q312connectivity6adabas11OUserExtend
-_construct__Q312connectivity6adabas11OUserExtend
-___Q312connectivity6adabas11OAdabasUserPQ312connectivity6adabas17OAdabasConnection
-__._Q312connectivity6adabas18UStringDescription
-___Q312connectivity6adabas18UStringDescriptionPFv_PCc
-__._Q312connectivity6adabas10OAdabasKey
-_refreshColumns__Q312connectivity6adabas10OAdabasKey
-__._Q312connectivity6adabas12OAdabasIndex
-_refreshColumns__Q312connectivity6adabas12OAdabasIndex
-__._Q312connectivity6adabas12OAdabasTable
-_release__Q312connectivity6adabas12OAdabasTable
-_acquire__Q312connectivity6adabas12OAdabasTable
-_refreshForgeinKeys__Q312connectivity6adabas12OAdabasTableRQ24_STLt6vector2ZQ23rtl8OUStringZQ24_STLt9allocator1ZB2
-_refreshPrimaryKeys__Q312connectivity6adabas12OAdabasTableRQ24_STLt6vector2ZQ23rtl8OUStringZQ24_STLt9allocator1ZB2
-_refreshIndexes__Q312connectivity6adabas12OAdabasTable
-_refreshKeys__Q312connectivity6adabas12OAdabasTable
-_refreshColumns__Q312connectivity6adabas12OAdabasTable
-_setComments__Q312connectivity6adabas7OTablesRCQ53com3sun4star3unot9Reference1ZQ53com3sun4star5beans12XPropertySet
-__._Q312connectivity6adabas23OAdabasDatabaseMetaData
-__._Q312connectivity6adabas24OAdabasPreparedStatement
-__._Q312connectivity6adabas16OAdabasStatement
-__._Q312connectivity6adabas16OAdabasResultSet
-_initBoundParam__Q312connectivity4odbc18OPreparedStatement
-_setStream__Q312connectivity4odbc18OPreparedStatementlRCQ53com3sun4star3unot9Reference1ZQ53com3sun4star2io12XInputStreamln2
-_setBinary__Q312connectivity4odbc18OPreparedStatementllRCQ53com3sun4star3unot8Sequence1ZSc
-_getLengthBuf__Q312connectivity4odbc18OPreparedStatementl
-_allocBindBuf__Q312connectivity4odbc18OPreparedStatementll
-_setChar__Q312connectivity4odbc18OPreparedStatementln2RCQ23rtl8OUString
-_putParamData__Q312connectivity4odbc18OPreparedStatementl
-_FreeParams__Q312connectivity4odbc18OPreparedStatement
-_prepareStatement__Q312connectivity4odbc18OPreparedStatement
-__._Q312connectivity4odbc18UStringDescription
-___Q312connectivity4odbc18UStringDescriptionPFv_PCc
-_disposing__Q312connectivity4odbc15OStatement_Base
-_release__Q312connectivity4odbc15OStatement_Base
-_acquire__Q312connectivity4odbc15OStatement_Base
-__._Q312connectivity4odbc16OStatement_BASE2
-__._Q312connectivity4odbc10OStatement
-_setFetchSize__Q312connectivity4odbc15OStatement_Basel
-_setCursorName__Q312connectivity4odbc15OStatement_BaseRCQ23rtl8OUString
-_setMaxRows__Q312connectivity4odbc15OStatement_Basel
-_setMaxFieldSize__Q312connectivity4odbc15OStatement_Basel
-_setQueryTimeOut__Q312connectivity4odbc15OStatement_Basel
-_isUsingBookmarks__CQ312connectivity4odbc15OStatement_Base
-_getFetchSize__CQ312connectivity4odbc15OStatement_Base
-_getFetchDirection__CQ312connectivity4odbc15OStatement_Base
-_getResultSetType__CQ312connectivity4odbc15OStatement_Base
-_getResultSetConcurrency__CQ312connectivity4odbc15OStatement_Base
-_getCursorName__CQ312connectivity4odbc15OStatement_Base
-_getMaxRows__CQ312connectivity4odbc15OStatement_Base
-_getMaxFieldSize__CQ312connectivity4odbc15OStatement_Base
-_getQueryTimeOut__CQ312connectivity4odbc15OStatement_Base
-_getStmtOption__CQ312connectivity4odbc15OStatement_Bases
-_getRowCount__Q312connectivity4odbc15OStatement_Base
-_lockIfNecessary__Q312connectivity4odbc15OStatement_BaseRCQ23rtl8OUString
-_setWarning__Q312connectivity4odbc15OStatement_BaseRCQ53com3sun4star4sdbc10SQLWarning
-_disposeResultSet__Q312connectivity4odbc15OStatement_Base
-_getCharColAttrib__Q312connectivity4odbc18OResultSetMetaDatall
-_getNumColAttrib__Q312connectivity4odbc18OResultSetMetaDatall
-_getResultSetType__CQ312connectivity4odbc10OResultSet
-_getResultSetConcurrency__CQ312connectivity4odbc10OResultSet
-_getCursorName__CQ312connectivity4odbc10OResultSet
-_isBookmarkable__CQ312connectivity4odbc10OResultSet
-_setFetchSize__Q312connectivity4odbc10OResultSetl
-_setFetchDirection__Q312connectivity4odbc10OResultSetl
-_getFetchSize__CQ312connectivity4odbc10OResultSet
-_getFetchDirection__CQ312connectivity4odbc10OResultSet
-_fillRow__Q312connectivity4odbc10OResultSetl
-_releaseBuffer__Q312connectivity4odbc10OResultSet
-_allocBuffer__Q312connectivity4odbc10OResultSetUc
-_jdbcTypeToOdbc__Q312connectivity4odbc6OToolsl
-_getPropertySetInfo__Q312connectivity4odbc26ODatabaseMetaDataResultSet
-_release__Q312connectivity4odbc26ODatabaseMetaDataResultSet
-_acquire__Q312connectivity4odbc26ODatabaseMetaDataResultSet
-_openSpecialColumns__Q312connectivity4odbc26ODatabaseMetaDataResultSetUcRCQ53com3sun4star3uno3AnyRCQ23rtl8OUStringn1lUc
-_getResultSetType__CQ312connectivity4odbc26ODatabaseMetaDataResultSet
-_getResultSetConcurrency__CQ312connectivity4odbc26ODatabaseMetaDataResultSet
-_getCursorName__CQ312connectivity4odbc26ODatabaseMetaDataResultSet
-_getFetchSize__CQ312connectivity4odbc26ODatabaseMetaDataResultSet
-_getFetchDirection__CQ312connectivity4odbc26ODatabaseMetaDataResultSet
-_getSupportedServiceNames_Static__Q312connectivity4odbc10ODBCDriver
-_getImplementationName_Static__Q312connectivity4odbc10ODBCDriver
-_LoadFunctions__12connectivityP10_oslModuleUc
-_OpenConnection__Q312connectivity4odbc11OConnectionRCQ23rtl8OUStringlUc
-___tf13bad_exception
-___uncatch_exception
-___eh_free
-___tfv
-___dynamic_cast
diff --git a/connectivity/source/drivers/adabas/adabas.xcu b/connectivity/source/drivers/adabas/adabas.xcu
deleted file mode 100644
index fa7defad35..0000000000
--- a/connectivity/source/drivers/adabas/adabas.xcu
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:adabas:*" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbcx.adabas.ODriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Adabas D</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="ShutdownDatabase" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="DataCacheSizeIncrement" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:int">
- <value>20</value>
- </prop>
- </node>
- <node oor:name="DataCacheSize" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:int">
- <value>20</value>
- </prop>
- </node>
- <node oor:name="ControlUser" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="ControlPassword" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="CharSet" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="AddIndexAppendix" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="Features">
- <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="AppendTableAliasInSelect" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="DisplayVersionColumns" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseDOSLineEnds" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="BooleanComparisonMode" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FormsCheckRequiredFields" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsTableCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="SupportsBrowsing" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="Authentication" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>UserPassword</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/adabas/adabas.xml b/connectivity/source/drivers/adabas/adabas.xml
deleted file mode 100755
index a4736d0dfd..0000000000
--- a/connectivity/source/drivers/adabas/adabas.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>adabas</module-name>
- <component-description>
- <author>Ocke Janssen</author>
- <name>com.sun.star.comp.sdbcx.adabas.ODriver</name>
- <description>
- This is the implementation of the sdbc-adabas bridge.
- </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service>com.sun.star.sdbc.Driver</supported-service>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>osl</runtime-module-dependency>
- <runtime-module-dependency>dbtools</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
diff --git a/connectivity/source/drivers/adabas/exports.dxp b/connectivity/source/drivers/adabas/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/drivers/adabas/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/drivers/adabas/makefile.mk b/connectivity/source/drivers/adabas/makefile.mk
deleted file mode 100755
index bfc6a3dcfa..0000000000
--- a/connectivity/source/drivers/adabas/makefile.mk
+++ /dev/null
@@ -1,114 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=adabas
-
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-.IF "$(SYSTEM_ODBC_HEADERS)" == "YES"
-CFLAGS+=-DSYSTEM_ODBC_HEADERS
-.ENDIF
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/BFunctions.obj \
- $(SLO)$/BConnection.obj \
- $(SLO)$/BDriver.obj \
- $(SLO)$/BCatalog.obj \
- $(SLO)$/BGroups.obj \
- $(SLO)$/BGroup.obj \
- $(SLO)$/BUser.obj \
- $(SLO)$/BUsers.obj \
- $(SLO)$/BKeys.obj \
- $(SLO)$/BColumns.obj \
- $(SLO)$/BIndex.obj \
- $(SLO)$/BIndexColumns.obj \
- $(SLO)$/BIndexes.obj \
- $(SLO)$/BTable.obj \
- $(SLO)$/BTables.obj \
- $(SLO)$/BViews.obj \
- $(SLO)$/Bservices.obj \
- $(SLO)$/BDatabaseMetaData.obj \
- $(SLO)$/BPreparedStatement.obj \
- $(SLO)$/BStatement.obj \
- $(SLO)$/BResultSetMetaData.obj \
- $(SLO)$/BResultSet.obj
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-
-# --- Library -----------------------------------
-
-SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(DBTOOLSLIB) \
- $(TOOLSLIB) \
- $(ODBCBASELIB) \
- $(UNOTOOLSLIB) \
- $(COMPHELPERLIB)
-
-.IF "$(ODBCBASELIB)" == ""
-SHL1STDLIBS+=$(ODBCBASELIB)
-.ENDIF
-
-SHL1DEPN=
-SHL1IMPLIB= i$(SHL1TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-# --- Targets ----------------------------------
-
-
-.INCLUDE : $(PRJ)$/target.pmk
-
-ALLTAR : $(MISC)/adabas.component
-
-$(MISC)/adabas.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- adabas.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt adabas.component
diff --git a/connectivity/source/drivers/ado/ACallableStatement.cxx b/connectivity/source/drivers/ado/ACallableStatement.cxx
deleted file mode 100644
index feb29ec8d9..0000000000
--- a/connectivity/source/drivers/ado/ACallableStatement.cxx
+++ /dev/null
@@ -1,237 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/ACallableStatement.hxx"
-#include <connectivity/dbexception.hxx>
-
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::container;
-using namespace com::sun::star::lang;
-
-IMPLEMENT_SERVICE_INFO(OCallableStatement,"com.sun.star.sdbcx.ACallableStatement","com.sun.star.sdbc.CallableStatement");
-
-#define GET_PARAM() \
- ADOParameter* pParam = NULL; \
- m_pParameters->get_Item(OLEVariant(sal_Int32(columnIndex-1)),&pParam); \
- if(pParam) \
- pParam->get_Value(&m_aValue);
-//**************************************************************
-//************ Class: java.sql.CallableStatement
-//**************************************************************
-OCallableStatement::OCallableStatement( OConnection* _pConnection,const OTypeInfoMap& _TypeInfo,const ::rtl::OUString& sql )
- : OPreparedStatement( _pConnection, _TypeInfo, sql )
-{
- m_Command.put_CommandType(adCmdStoredProc);
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL OCallableStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OPreparedStatement::queryInterface(rType);
- return aRet.hasValue() ? aRet : ::cppu::queryInterface(rType,static_cast< XRow*>(this));
-}
-// -------------------------------------------------------------------------
-
-
-sal_Bool SAL_CALL OCallableStatement::wasNull( ) throw(SQLException, RuntimeException)
-{
- return m_aValue.isNull();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- GET_PARAM()
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-sal_Int8 SAL_CALL OCallableStatement::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- GET_PARAM()
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-Sequence< sal_Int8 > SAL_CALL OCallableStatement::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- GET_PARAM()
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-::com::sun::star::util::Date SAL_CALL OCallableStatement::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- GET_PARAM()
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-double SAL_CALL OCallableStatement::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- GET_PARAM()
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-
-float SAL_CALL OCallableStatement::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- GET_PARAM()
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OCallableStatement::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- GET_PARAM()
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-
-sal_Int64 SAL_CALL OCallableStatement::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- GET_PARAM()
- return (sal_Int64)m_aValue.getCurrency().int64;
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL OCallableStatement::getObject( sal_Int32 /*columnIndex*/, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getObject", *this );
- return Any();
-}
-// -------------------------------------------------------------------------
-
-sal_Int16 SAL_CALL OCallableStatement::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- GET_PARAM()
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL OCallableStatement::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- GET_PARAM()
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-
- ::com::sun::star::util::Time SAL_CALL OCallableStatement::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- GET_PARAM()
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-
- ::com::sun::star::util::DateTime SAL_CALL OCallableStatement::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- GET_PARAM()
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OCallableStatement::registerOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& /*typeName*/ ) throw(SQLException, RuntimeException)
-{
- ADOParameter* pParam = NULL;
- m_pParameters->get_Item(OLEVariant(sal_Int32(parameterIndex-1)),&pParam);
- if(pParam)
- {
- pParam->put_Type(ADOS::MapJdbc2ADOType(sqlType,m_pConnection->getEngineType()));
- pParam->put_Direction(adParamOutput);
- }
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OCallableStatement::registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale ) throw(SQLException, RuntimeException)
-{
- ADOParameter* pParam = NULL;
- m_pParameters->get_Item(OLEVariant(sal_Int32(parameterIndex-1)),&pParam);
- if(pParam)
- {
- pParam->put_Type(ADOS::MapJdbc2ADOType(sqlType,m_pConnection->getEngineType()));
- pParam->put_Direction(adParamOutput);
- pParam->put_NumericScale((sal_Int8)scale);
- }
-}
-// -------------------------------------------------------------------------
-
-
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL OCallableStatement::getBinaryStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getBinaryStream", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL OCallableStatement::getCharacterStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getCharacterStream", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Reference< XArray > SAL_CALL OCallableStatement::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getArray", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Reference< XClob > SAL_CALL OCallableStatement::getClob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getClob", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XBlob > SAL_CALL OCallableStatement::getBlob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getBlob", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Reference< XRef > SAL_CALL OCallableStatement::getRef( sal_Int32 /*columnIndex*/) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getRef", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-void SAL_CALL OCallableStatement::acquire() throw()
-{
- OPreparedStatement::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OCallableStatement::release() throw()
-{
- OPreparedStatement::release();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/ACatalog.cxx b/connectivity/source/drivers/ado/ACatalog.cxx
deleted file mode 100644
index 0f3e70c0f1..0000000000
--- a/connectivity/source/drivers/ado/ACatalog.cxx
+++ /dev/null
@@ -1,127 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/ACatalog.hxx"
-#include "ado/AConnection.hxx"
-#include "ado/AGroups.hxx"
-#include "ado/AUsers.hxx"
-#include "ado/ATables.hxx"
-#include "ado/AViews.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-
-
-// -------------------------------------------------------------------------
-using namespace connectivity;
-using namespace connectivity::ado;
-// -------------------------------------------------------------------------
-OCatalog::OCatalog(_ADOCatalog* _pCatalog,OConnection* _pCon) : connectivity::sdbcx::OCatalog(_pCon)
- ,m_pConnection(_pCon)
- ,m_aCatalog(_pCatalog)
-{
-}
-// -----------------------------------------------------------------------------
-OCatalog::~OCatalog()
-{
- if(m_aCatalog.IsValid())
- m_aCatalog.putref_ActiveConnection(NULL);
- m_aCatalog.clear();
-}
-// -----------------------------------------------------------------------------
-void OCatalog::refreshTables()
-{
- TStringVector aVector;
-
- WpADOTables aTables(m_aCatalog.get_Tables());
- if ( aTables.IsValid() )
- {
- aTables.Refresh();
- sal_Int32 nCount = aTables.GetItemCount();
- aVector.reserve(nCount);
- for(sal_Int32 i=0;i< nCount;++i)
- {
- WpADOTable aElement = aTables.GetItem(i);
- if ( aElement.IsValid() )
- {
- ::rtl::OUString sTypeName = aElement.get_Type();
- if ( !sTypeName.equalsIgnoreAsciiCaseAscii("SYSTEM TABLE") && !sTypeName.equalsIgnoreAsciiCaseAscii("ACCESS TABLE") )
- aVector.push_back(aElement.get_Name());
- }
- }
- }
-
- if(m_pTables)
- m_pTables->reFill(aVector);
- else
- m_pTables = new OTables(this,m_aMutex,aVector,aTables,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
-}
-// -------------------------------------------------------------------------
-void OCatalog::refreshViews()
-{
- TStringVector aVector;
-
- WpADOViews aViews = m_aCatalog.get_Views();
- aViews.fillElementNames(aVector);
-
- if(m_pViews)
- m_pViews->reFill(aVector);
- else
- m_pViews = new OViews(this,m_aMutex,aVector,aViews,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
-}
-// -------------------------------------------------------------------------
-void OCatalog::refreshGroups()
-{
- TStringVector aVector;
-
- WpADOGroups aGroups = m_aCatalog.get_Groups();
- aGroups.fillElementNames(aVector);
-
- if(m_pGroups)
- m_pGroups->reFill(aVector);
- else
- m_pGroups = new OGroups(this,m_aMutex,aVector,aGroups,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
-}
-// -------------------------------------------------------------------------
-void OCatalog::refreshUsers()
-{
- TStringVector aVector;
-
- WpADOUsers aUsers = m_aCatalog.get_Users();
- aUsers.fillElementNames(aVector);
-
- if(m_pUsers)
- m_pUsers->reFill(aVector);
- else
- m_pUsers = new OUsers(this,m_aMutex,aVector,aUsers,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
-}
-// -------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx
deleted file mode 100644
index 2a6ae71bed..0000000000
--- a/connectivity/source/drivers/ado/AColumn.cxx
+++ /dev/null
@@ -1,307 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AColumn.hxx"
-#include "ado/AConnection.hxx"
-#include "ado/Awrapado.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include "ado/ACatalog.hxx"
-
-#include <o3tl/compat_functional.hxx>
-
-using namespace ::comphelper;
-
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-
-void WpADOColumn::Create()
-{
- HRESULT hr = -1;
-
- _ADOColumn* pColumn = NULL;
- hr = CoCreateInstance(ADOS::CLSID_ADOCOLUMN_25,
- NULL,
- CLSCTX_INPROC_SERVER,
- ADOS::IID_ADOCOLUMN_25,
- (void**)&pColumn );
-
-
- if( !FAILED( hr ) )
- {
- operator=( pColumn );
- pColumn->Release( );
- }
-}
-// -------------------------------------------------------------------------
-OAdoColumn::OAdoColumn(sal_Bool _bCase,OConnection* _pConnection,_ADOColumn* _pColumn)
- : connectivity::sdbcx::OColumn(::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),0,0,0,0,sal_False,sal_False,sal_False,_bCase)
- ,m_pConnection(_pConnection)
-{
- construct();
- OSL_ENSURE(_pColumn,"Column can not be null!");
- m_aColumn = WpADOColumn(_pColumn);
- // m_aColumn.put_ParentCatalog(_pConnection->getAdoCatalog()->getCatalog());
- fillPropertyValues();
-}
-// -------------------------------------------------------------------------
-OAdoColumn::OAdoColumn(sal_Bool _bCase,OConnection* _pConnection)
- : connectivity::sdbcx::OColumn(_bCase)
- ,m_pConnection(_pConnection)
-{
- m_aColumn.Create();
- m_aColumn.put_ParentCatalog(_pConnection->getAdoCatalog()->getCatalog());
- construct();
- fillPropertyValues();
- m_Type = DataType::OTHER;
-}
-
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > OAdoColumn::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OAdoColumn::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OColumn_ADO::getSomething(rId);
-}
-// -------------------------------------------------------------------------
-void OAdoColumn::construct()
-{
- sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY;
-
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISASCENDING), PROPERTY_ID_ISASCENDING, nAttrib,&m_IsAscending, ::getBooleanCppuType());
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RELATEDCOLUMN), PROPERTY_ID_RELATEDCOLUMN, nAttrib,&m_ReferencedColumn, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
-}
-// -----------------------------------------------------------------------------
-void OAdoColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)throw (Exception)
-{
- if(m_aColumn.IsValid())
- {
- const sal_Char* pAdoPropertyName = NULL;
-
- switch(nHandle)
- {
- case PROPERTY_ID_ISASCENDING:
- m_aColumn.put_SortOrder(::cppu::any2bool(rValue) ? adSortAscending : adSortDescending);
- break;
- case PROPERTY_ID_RELATEDCOLUMN:
- {
- ::rtl::OUString aVal;
- rValue >>= aVal;
- m_aColumn.put_RelatedColumn(aVal);
- }
- break;
- case PROPERTY_ID_NAME:
- {
- ::rtl::OUString aVal;
- rValue >>= aVal;
- m_aColumn.put_Name(aVal);
- }
- break;
- case PROPERTY_ID_TYPE:
- {
- sal_Int32 nVal=0;
- rValue >>= nVal;
- m_aColumn.put_Type(ADOS::MapJdbc2ADOType(nVal,m_pConnection->getEngineType()));
- }
- break;
- case PROPERTY_ID_TYPENAME:
- // rValue <<= m_pTable->getCatalog()->getConnection()->getTypeInfo()->find();
- break;
- case PROPERTY_ID_PRECISION:
- {
- sal_Int32 nVal=0;
- rValue >>= nVal;
- m_aColumn.put_Precision(nVal);
- }
- break;
- case PROPERTY_ID_SCALE:
- {
- sal_Int32 nVal=0;
- rValue >>= nVal;
- if ( !m_IsCurrency )
- m_aColumn.put_NumericScale((sal_Int8)nVal);
- }
- break;
- case PROPERTY_ID_ISNULLABLE:
- {
- sal_Int32 nVal=0;
- rValue >>= nVal;
- if ( nVal == ColumnValue::NULLABLE )
- m_aColumn.put_Attributes( adColNullable );
- }
- break;
- case PROPERTY_ID_ISROWVERSION:
- break;
-
- case PROPERTY_ID_ISAUTOINCREMENT:
- OTools::putValue( m_aColumn.get_Properties(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Autoincrement" )), getBOOL( rValue ) );
- break;
-
- case PROPERTY_ID_IM001:
- case PROPERTY_ID_DESCRIPTION:
- pAdoPropertyName = "Description";
- break;
-
- case PROPERTY_ID_DEFAULTVALUE:
- pAdoPropertyName = "Default";
- break;
- }
-
- if ( pAdoPropertyName )
- OTools::putValue( m_aColumn.get_Properties(), ::rtl::OUString::createFromAscii( pAdoPropertyName ), getString( rValue ) );
- }
- OColumn_ADO::setFastPropertyValue_NoBroadcast(nHandle,rValue);
-}
-// -----------------------------------------------------------------------------
-void OAdoColumn::fillPropertyValues()
-{
- if(m_aColumn.IsValid())
- {
- m_IsAscending = m_aColumn.get_SortOrder() == adSortAscending;
- m_ReferencedColumn = m_aColumn.get_RelatedColumn();
- m_Name = m_aColumn.get_Name();
- m_Precision = m_aColumn.get_Precision();
- m_Scale = m_aColumn.get_NumericScale();
- m_IsNullable = ((m_aColumn.get_Attributes() & adColNullable) == adColNullable) ? ColumnValue::NULLABLE : ColumnValue::NO_NULLS;
-
- DataTypeEnum eType = m_aColumn.get_Type();
- m_IsCurrency = (eType == adCurrency);
- if ( m_IsCurrency && !m_Scale)
- m_Scale = 4;
- m_Type = ADOS::MapADOType2Jdbc(eType);
-
- sal_Bool bForceTo = sal_True;
- const OTypeInfoMap* pTypeInfoMap = m_pConnection->getTypeInfo();
- const OExtendedTypeInfo* pTypeInfo = OConnection::getTypeInfoFromType(*m_pConnection->getTypeInfo(),eType,::rtl::OUString(),m_Precision,m_Scale,bForceTo);
- if ( pTypeInfo )
- m_TypeName = pTypeInfo->aSimpleType.aTypeName;
- else if ( eType == adVarBinary && ADOS::isJetEngine(m_pConnection->getEngineType()) )
- {
- ::comphelper::TStringMixEqualFunctor aCase(sal_False);
- OTypeInfoMap::const_iterator aFind = ::std::find_if(pTypeInfoMap->begin(),
- pTypeInfoMap->end(),
- ::o3tl::compose1(
- ::std::bind2nd(aCase, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VarBinary"))),
- ::o3tl::compose1(
- ::std::mem_fun(&OExtendedTypeInfo::getDBName),
- ::o3tl::select2nd<OTypeInfoMap::value_type>())
- )
-
- );
-
- if ( aFind != pTypeInfoMap->end() ) // change column type if necessary
- {
- eType = aFind->first;
- pTypeInfo = aFind->second;
- }
-
- if ( !pTypeInfo )
- {
- pTypeInfo = OConnection::getTypeInfoFromType(*m_pConnection->getTypeInfo(),adBinary,::rtl::OUString(),m_Precision,m_Scale,bForceTo);
- eType = adBinary;
- }
-
- if ( pTypeInfo )
- {
- m_TypeName = pTypeInfo->aSimpleType.aTypeName;
- m_Type = ADOS::MapADOType2Jdbc(eType);
- }
- }
-
-
- // fill some specific props
- {
- WpADOProperties aProps( m_aColumn.get_Properties() );
-
- if ( aProps.IsValid() )
- {
- m_IsAutoIncrement = OTools::getValue( aProps, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Autoincrement")) );
-
- m_Description = OTools::getValue( aProps, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Description")) );
-
- m_DefaultValue = OTools::getValue( aProps, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Default")) );
-
-#if OSL_DEBUG_LEVEL > 0
- sal_Int32 nCount = aProps.GetItemCount();
- for (sal_Int32 i = 0; i<nCount; ++i)
- {
- WpADOProperty aProp = aProps.GetItem(i);
- ::rtl::OUString sName = aProp.GetName();
- ::rtl::OUString sVal = aProp.GetValue();
- }
-#endif
- }
- }
- }
-}
-// -----------------------------------------------------------------------------
-WpADOColumn OAdoColumn::getColumnImpl() const
-{
- return m_aColumn;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoColumn::acquire() throw()
-{
- OColumn_ADO::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoColumn::release() throw()
-{
- OColumn_ADO::release();
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx
deleted file mode 100644
index c3187fd196..0000000000
--- a/connectivity/source/drivers/ado/AColumns.cxx
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AColumns.hxx"
-#include "ado/AColumn.hxx"
-#include "ado/AConnection.hxx"
-#include "ado/Awrapado.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <comphelper/property.hxx>
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-#include <algorithm>
-#include "resource/ado_res.hrc"
-
-#include <o3tl/compat_functional.hxx>
-
-using namespace connectivity::ado;
-using namespace connectivity;
-using namespace comphelper;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::container;
-
-sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
-{
- return new OAdoColumn(isCaseSensitive(),m_pConnection,m_aCollection.GetItem(_rName));
-}
-
-// -------------------------------------------------------------------------
-void OColumns::impl_refresh() throw(RuntimeException)
-{
- m_aCollection.Refresh();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OColumns::createDescriptor()
-{
- return new OAdoColumn(isCaseSensitive(),m_pConnection);
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OColumns::appendObject( const ::rtl::OUString&, const Reference< XPropertySet >& descriptor )
-{
- OAdoColumn* pColumn = NULL;
- Reference< XPropertySet > xColumn;
- if ( !getImplementation( pColumn, descriptor ) || pColumn == NULL )
- {
- // m_pConnection->throwGenericSQLException( STR_INVALID_COLUMN_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
- pColumn = new OAdoColumn(isCaseSensitive(),m_pConnection);
- xColumn = pColumn;
- ::comphelper::copyProperties(descriptor,xColumn);
- }
-
- WpADOColumn aColumn = pColumn->getColumnImpl();
-
-#if OSL_DEBUG_LEVEL > 0
- sal_Int32 nPrecision;
- sal_Int32 nScale;
- sal_Int32 nType;
- nPrecision = aColumn.get_Precision();
- nScale = aColumn.get_NumericScale();
- nType = ADOS::MapADOType2Jdbc(aColumn.get_Type());
-#endif
-
- ::rtl::OUString sTypeName;
- pColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)) >>= sTypeName;
-
- const OTypeInfoMap* pTypeInfoMap = m_pConnection->getTypeInfo();
- ::comphelper::TStringMixEqualFunctor aCase(sal_False);
- // search for typeinfo where the typename is equal sTypeName
- OTypeInfoMap::const_iterator aFind = ::std::find_if(pTypeInfoMap->begin(),
- pTypeInfoMap->end(),
- ::o3tl::compose1(
- ::std::bind2nd(aCase, sTypeName),
- ::o3tl::compose1(
- ::std::mem_fun(&OExtendedTypeInfo::getDBName),
- ::o3tl::select2nd<OTypeInfoMap::value_type>())
- )
-
- );
-
- if ( aFind != pTypeInfoMap->end() ) // change column type if necessary
- aColumn.put_Type(aFind->first);
-
- if ( SUCCEEDED(((ADOColumns*)m_aCollection)->Append(OLEVariant(aColumn.get_Name()),aColumn.get_Type(),aColumn.get_DefinedSize())) )
- {
- WpADOColumn aAddedColumn = m_aCollection.GetItem(OLEVariant(aColumn.get_Name()));
- if ( aAddedColumn.IsValid() )
- {
- sal_Bool bAutoIncrement = sal_False;
- pColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bAutoIncrement;
- if ( bAutoIncrement )
- OTools::putValue( aAddedColumn.get_Properties(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Autoincrement")), bAutoIncrement );
-
- if ( aFind != pTypeInfoMap->end() && aColumn.get_Type() != aAddedColumn.get_Type() ) // change column type if necessary
- aColumn.put_Type(aFind->first);
- aAddedColumn.put_Precision(aColumn.get_Precision());
- aAddedColumn.put_NumericScale(aColumn.get_NumericScale());
- aAddedColumn.put_Attributes(aColumn.get_Attributes());
- aAddedColumn.put_SortOrder(aColumn.get_SortOrder());
- aAddedColumn.put_RelatedColumn(aColumn.get_RelatedColumn());
- }
- }
- ADOS::ThrowException(*m_pConnection->getConnection(),static_cast<XTypeProvider*>(this));
-
- return new OAdoColumn(isCaseSensitive(),m_pConnection,pColumn->getColumnImpl());
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OColumns::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- if(!m_aCollection.Delete(_sElementName))
- ADOS::ThrowException(*m_pConnection->getConnection(),static_cast<XTypeProvider*>(this));
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx
deleted file mode 100644
index 82d28617bd..0000000000
--- a/connectivity/source/drivers/ado/AConnection.cxx
+++ /dev/null
@@ -1,633 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AConnection.hxx"
-#include "ado/ADatabaseMetaData.hxx"
-#include "ado/ADriver.hxx"
-#include "ado/AStatement.hxx"
-#include "ado/ACallableStatement.hxx"
-#include "ado/APreparedStatement.hxx"
-#include "ado/ACatalog.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/TransactionIsolation.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include "connectivity/dbexception.hxx"
-#include <osl/file.hxx>
-#include "resource/ado_res.hrc"
-
-#include <o3tl/compat_functional.hxx>
-
-using namespace dbtools;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-
-//------------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OConnection,"com.sun.star.sdbcx.AConnection","com.sun.star.sdbc.Connection");
-// --------------------------------------------------------------------------------
-OConnection::OConnection(ODriver* _pDriver) throw(SQLException, RuntimeException)
- : OSubComponent<OConnection, OConnection_BASE>((::cppu::OWeakObject*)_pDriver, this),
- m_bClosed(sal_False),
- m_xCatalog(NULL),
- m_pDriver(_pDriver),
- m_pAdoConnection(NULL),
- m_bAutocommit(sal_True),
- m_nEngineType(0),
- m_pCatalog(NULL)
-{
- osl_incrementInterlockedCount( &m_refCount );
-
- IClassFactory2* pIUnknown = NULL;
- IUnknown *pOuter = NULL;
- HRESULT hr;
- hr = CoGetClassObject( ADOS::CLSID_ADOCONNECTION_21,
- CLSCTX_INPROC_SERVER,
- NULL,
- IID_IClassFactory2,
- (void**)&pIUnknown );
-
- if( !FAILED( hr ) )
- {
- ADOConnection *pCon = NULL;
- hr = pIUnknown->CreateInstanceLic( pOuter,
- NULL,
- ADOS::IID_ADOCONNECTION_21,
- ADOS::GetKeyStr(),
- (void**) &pCon);
-
- if( !FAILED( hr ) )
- {
- OSL_ENSURE( pCon, "OConnection::OConnection: invalid ADO object!" );
-
- m_pAdoConnection = new WpADOConnection( pCon );
- // CreateInstanceLic returned an object which was already acquired
- pCon->Release( );
-
- }
-
- // Class Factory is no longer needed
- pIUnknown->Release();
- }
-
- osl_decrementInterlockedCount( &m_refCount );
-}
-//-----------------------------------------------------------------------------
-OConnection::~OConnection()
-{
-}
-//-----------------------------------------------------------------------------
-void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyValue >& info)
-{
- osl_incrementInterlockedCount( &m_refCount );
-
- setConnectionInfo(info);
-
- sal_Int32 nLen = url.indexOf(':');
- nLen = url.indexOf(':',nLen+1);
- ::rtl::OUString aDSN(url.copy(nLen+1)),aUID,aPWD;
- if ( aDSN.compareToAscii("access:",7) == 0 )
- aDSN = aDSN.copy(7);
-
- sal_Int32 nTimeout = 20;
- sal_Bool bSilent = sal_True;
- const PropertyValue *pIter = info.getConstArray();
- const PropertyValue *pEnd = pIter + info.getLength();
- for(;pIter != pEnd;++pIter)
- {
- if(!pIter->Name.compareToAscii("Timeout"))
- pIter->Value >>= nTimeout;
- else if(!pIter->Name.compareToAscii("Silent"))
- pIter->Value >>= bSilent;
- else if(!pIter->Name.compareToAscii("user"))
- pIter->Value >>= aUID;
- else if(!pIter->Name.compareToAscii("password"))
- pIter->Value >>= aPWD;
- }
- try
- {
- if(m_pAdoConnection)
- {
- if(m_pAdoConnection->Open(aDSN,aUID,aPWD,adConnectUnspecified))
- m_pAdoConnection->PutCommandTimeout(nTimeout);
- else
- ADOS::ThrowException(*m_pAdoConnection,*this);
- if(m_pAdoConnection->get_State() != adStateOpen)
- throwGenericSQLException( STR_NO_CONNECTION,*this );
-
- WpADOProperties aProps = m_pAdoConnection->get_Properties();
- if(aProps.IsValid())
- {
- OTools::putValue(aProps,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Jet OLEDB:ODBC Parsing")),sal_True);
- OLEVariant aVar(OTools::getValue(aProps,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Jet OLEDB:Engine Type"))));
- if(!aVar.isNull() && !aVar.isEmpty())
- m_nEngineType = aVar;
- }
- buildTypeInfo();
- //bErg = TRUE;
- }
- else
- ::dbtools::throwFunctionSequenceException(*this);
-
- }
- catch(const Exception& )
- {
- osl_decrementInterlockedCount( &m_refCount );
- throw;
- }
- osl_decrementInterlockedCount( &m_refCount );
-}
-//-----------------------------------------------------------------------------
-void SAL_CALL OConnection::release() throw()
-{
- relase_ChildImpl();
-}
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL OConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- OStatement* pStmt = new OStatement(this);
- Reference< XStatement > xStmt = pStmt;
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return pStmt;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- OPreparedStatement* pStmt = new OPreparedStatement(this,m_aTypeInfo,sql);
- Reference< XPreparedStatement > xPStmt = pStmt;
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return xPStmt;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- OCallableStatement* pStmt = new OCallableStatement(this,m_aTypeInfo,sql);
- Reference< XPreparedStatement > xPStmt = pStmt;
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return xPStmt;
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConnection::nativeSQL( const ::rtl::OUString& _sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- ::rtl::OUString sql = _sql;
- WpADOProperties aProps = m_pAdoConnection->get_Properties();
- if(aProps.IsValid())
- {
- OTools::putValue(aProps,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Jet OLEDB:ODBC Parsing")),sal_True);
- WpADOCommand aCommand;
- aCommand.Create();
- aCommand.put_ActiveConnection((IDispatch*)*m_pAdoConnection);
- aCommand.put_CommandText(sql);
- sql = aCommand.get_CommandText();
- }
-
- return sql;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setAutoCommit( sal_Bool autoCommit ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- m_bAutocommit = autoCommit;
- if(!autoCommit)
- m_pAdoConnection->BeginTrans();
- else
- m_pAdoConnection->RollbackTrans();
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::getAutoCommit( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- return m_bAutocommit;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::commit( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- m_pAdoConnection->CommitTrans();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::rollback( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- m_pAdoConnection->RollbackTrans();
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::isClosed( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- return OConnection_BASE::rBHelper.bDisposed && !m_pAdoConnection->get_State();
-}
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL OConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if(!xMetaData.is())
- {
- xMetaData = new ODatabaseMetaData(this);
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
-
- m_pAdoConnection->put_Mode(readOnly ? adModeRead : adModeReadWrite);
- ADOS::ThrowException(*m_pAdoConnection,*this);
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- return m_pAdoConnection->get_Mode() == adModeRead;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- m_pAdoConnection->PutDefaultDatabase(catalog);
- ADOS::ThrowException(*m_pAdoConnection,*this);
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConnection::getCatalog( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- return m_pAdoConnection->GetDefaultDatabase();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 level ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- IsolationLevelEnum eIso;
- switch(level)
- {
- case TransactionIsolation::NONE:
- eIso = adXactUnspecified;
- break;
- case TransactionIsolation::READ_UNCOMMITTED:
- eIso = adXactReadUncommitted;
- break;
- case TransactionIsolation::READ_COMMITTED:
- eIso = adXactReadCommitted;
- break;
- case TransactionIsolation::REPEATABLE_READ:
- eIso = adXactRepeatableRead;
- break;
- case TransactionIsolation::SERIALIZABLE:
- eIso = adXactSerializable;
- break;
- default:
- OSL_FAIL("OConnection::setTransactionIsolation invalid level");
- return;
- }
- m_pAdoConnection->put_IsolationLevel(eIso);
- ADOS::ThrowException(*m_pAdoConnection,*this);
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OConnection::getTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- sal_Int32 nRet = 0;
- switch(m_pAdoConnection->get_IsolationLevel())
- {
- case adXactUnspecified:
- nRet = TransactionIsolation::NONE;
- break;
- case adXactReadUncommitted:
- nRet = TransactionIsolation::READ_UNCOMMITTED;
- break;
- case adXactReadCommitted:
- nRet = TransactionIsolation::READ_COMMITTED;
- break;
- case adXactRepeatableRead:
- nRet = TransactionIsolation::REPEATABLE_READ;
- break;
- case adXactSerializable:
- nRet = TransactionIsolation::SERIALIZABLE;
- break;
- default:
- OSL_FAIL("OConnection::setTransactionIsolation invalid level");
- }
- ADOS::ThrowException(*m_pAdoConnection,*this);
- return nRet;
-}
-// --------------------------------------------------------------------------------
-Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OConnection::getTypeMap( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- return NULL;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setTypeMap( const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setTypeMap", *this );
-}
-// --------------------------------------------------------------------------------
-// XCloseable
-void SAL_CALL OConnection::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-}
-// --------------------------------------------------------------------------------
-// XWarningsSupplier
-Any SAL_CALL OConnection::getWarnings( ) throw(SQLException, RuntimeException)
-{
- return Any();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::clearWarnings( ) throw(SQLException, RuntimeException)
-{
-}
-//--------------------------------------------------------------------
-void OConnection::buildTypeInfo() throw( SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ADORecordset *pRecordset = m_pAdoConnection->getTypeInfo();
- if ( pRecordset )
- {
- pRecordset->AddRef();
- VARIANT_BOOL bIsAtBOF;
- pRecordset->get_BOF(&bIsAtBOF);
-
- sal_Bool bOk = sal_True;
- if ( bIsAtBOF == VARIANT_TRUE )
- bOk = SUCCEEDED(pRecordset->MoveNext());
-
- if ( bOk )
- {
- // HACK for access
- static const ::rtl::OUString s_sVarChar(RTL_CONSTASCII_USTRINGPARAM("VarChar"));
- do
- {
- sal_Int32 nPos = 1;
- OExtendedTypeInfo* aInfo = new OExtendedTypeInfo();
- aInfo->aSimpleType.aTypeName = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->eType = (DataTypeEnum)(sal_Int32)ADOS::getField(pRecordset,nPos++).get_Value();
- if ( aInfo->eType == adWChar && aInfo->aSimpleType.aTypeName == s_sVarChar )
- aInfo->eType = adVarWChar;
- aInfo->aSimpleType.nType = (sal_Int16)ADOS::MapADOType2Jdbc(static_cast<DataTypeEnum>(aInfo->eType));
- aInfo->aSimpleType.nPrecision = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->aSimpleType.aLiteralPrefix = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->aSimpleType.aLiteralSuffix = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->aSimpleType.aCreateParams = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->aSimpleType.bNullable = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->aSimpleType.bCaseSensitive = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->aSimpleType.nSearchType = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->aSimpleType.bUnsigned = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->aSimpleType.bCurrency = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->aSimpleType.bAutoIncrement = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->aSimpleType.aLocalTypeName = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->aSimpleType.nMinimumScale = ADOS::getField(pRecordset,nPos++).get_Value();
- aInfo->aSimpleType.nMaximumScale = ADOS::getField(pRecordset,nPos++).get_Value();
- if ( adCurrency == aInfo->eType && !aInfo->aSimpleType.nMaximumScale)
- {
- aInfo->aSimpleType.nMinimumScale = 4;
- aInfo->aSimpleType.nMaximumScale = 4;
- }
- aInfo->aSimpleType.nNumPrecRadix = ADOS::getField(pRecordset,nPos++).get_Value();
- // Now that we have the type info, save it
- // in the Hashtable if we don't already have an
- // entry for this SQL type.
-
- m_aTypeInfo.insert(OTypeInfoMap::value_type(aInfo->eType,aInfo));
- }
- while ( SUCCEEDED(pRecordset->MoveNext()) );
- }
- pRecordset->Release();
- }
-}
-//------------------------------------------------------------------------------
-void OConnection::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- OConnection_BASE::disposing();
-
- m_bClosed = sal_True;
- m_xMetaData = ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDatabaseMetaData>();
- m_xCatalog = ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbcx::XTablesSupplier>();
- m_pDriver = NULL;
-
- m_pAdoConnection->Close();
-
- OTypeInfoMap::iterator aIter = m_aTypeInfo.begin();
- for (; aIter != m_aTypeInfo.end(); ++aIter)
- delete aIter->second;
-
- m_aTypeInfo.clear();
-
- delete m_pAdoConnection;
- m_pAdoConnection = NULL;
-
- dispose_ChildImpl();
-}
-// -----------------------------------------------------------------------------
-sal_Int64 SAL_CALL OConnection::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw (::com::sun::star::uno::RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ?
- reinterpret_cast< sal_Int64 >( this )
- :
- OConnection_BASE::getSomething(rId);
-}
-// -----------------------------------------------------------------------------
-Sequence< sal_Int8 > OConnection::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-// -----------------------------------------------------------------------------
-const OExtendedTypeInfo* OConnection::getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo,
- DataTypeEnum _nType,
- const ::rtl::OUString& _sTypeName,
- sal_Int32 _nPrecision,
- sal_Int32 _nScale,
- sal_Bool& _brForceToType)
-{
- const OExtendedTypeInfo* pTypeInfo = NULL;
- _brForceToType = sal_False;
- // search for type
- ::std::pair<OTypeInfoMap::const_iterator, OTypeInfoMap::const_iterator> aPair = _rTypeInfo.equal_range(_nType);
- OTypeInfoMap::const_iterator aIter = aPair.first;
- if(aIter != _rTypeInfo.end()) // compare with end is correct here
- {
- for(;aIter != aPair.second;++aIter)
- {
- // search the best matching type
- OExtendedTypeInfo* pInfo = aIter->second;
- #ifdef DBG_UTIL
- ::rtl::OUString sDBTypeName = pInfo->aSimpleType.aTypeName;
- sal_Int32 nDBTypePrecision = pInfo->aSimpleType.nPrecision; (void)nDBTypePrecision;
- sal_Int32 nDBTypeScale = pInfo->aSimpleType.nMaximumScale; (void)nDBTypeScale;
- sal_Int32 nAdoType = pInfo->eType; (void)nAdoType;
- #endif
- if ( ( !_sTypeName.getLength()
- || (pInfo->aSimpleType.aTypeName.equalsIgnoreAsciiCase(_sTypeName))
- )
- && (pInfo->aSimpleType.nPrecision >= _nPrecision)
- && (pInfo->aSimpleType.nMaximumScale >= _nScale)
-
- )
- break;
- }
-
- if (aIter == aPair.second)
- {
- for(aIter = aPair.first; aIter != aPair.second; ++aIter)
- {
- // search the best matching type (now comparing the local names)
- if ( (aIter->second->aSimpleType.aLocalTypeName.equalsIgnoreAsciiCase(_sTypeName))
- && (aIter->second->aSimpleType.nPrecision >= _nPrecision)
- && (aIter->second->aSimpleType.nMaximumScale >= _nScale)
- )
- {
-// we can not assert here because we could be in d&d
-/*
- OSL_FAIL(( ::rtl::OString("getTypeInfoFromType: assuming column type ")
- += ::rtl::OString(aIter->second->aTypeName.getStr(), aIter->second->aTypeName.getLength(), gsl_getSystemTextEncoding())
- += ::rtl::OString("\" (expected type name ")
- += ::rtl::OString(_sTypeName.getStr(), _sTypeName.getLength(), gsl_getSystemTextEncoding())
- += ::rtl::OString(" matches the type's local name).")).getStr());
-*/
- break;
- }
- }
- }
-
- if (aIter == aPair.second)
- { // no match for the names, no match for the local names
- // -> drop the precision and the scale restriction, accept any type with the property
- // type id (nType)
-
- // we can not assert here because we could be in d&d
- pTypeInfo = aPair.first->second;
- _brForceToType = sal_True;
- }
- else
- pTypeInfo = aIter->second;
- }
- else if ( _sTypeName.getLength() )
- {
- ::comphelper::TStringMixEqualFunctor aCase(sal_False);
- // search for typeinfo where the typename is equal _sTypeName
- OTypeInfoMap::const_iterator aFind = ::std::find_if(_rTypeInfo.begin(),
- _rTypeInfo.end(),
- ::o3tl::compose1(
- ::std::bind2nd(aCase, _sTypeName),
- ::o3tl::compose1(
- ::std::mem_fun(&OExtendedTypeInfo::getDBName),
- ::o3tl::select2nd<OTypeInfoMap::value_type>())
- )
- );
- if(aFind != _rTypeInfo.end())
- pTypeInfo = aFind->second;
- }
-
-// we can not assert here because we could be in d&d
-// OSL_ENSURE(pTypeInfo, "getTypeInfoFromType: no type info found for this type!");
- return pTypeInfo;
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaData.cxx b/connectivity/source/drivers/ado/ADatabaseMetaData.cxx
deleted file mode 100644
index c714660c97..0000000000
--- a/connectivity/source/drivers/ado/ADatabaseMetaData.cxx
+++ /dev/null
@@ -1,1086 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/ADatabaseMetaData.hxx"
-#include "ado/ADatabaseMetaDataResultSet.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/TransactionIsolation.hpp>
-#include "ado/AConnection.hxx"
-#include "ado/adoimp.hxx"
-#include "FDatabaseMetaDataResultSet.hxx"
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-
-using namespace ::comphelper;
-
-using namespace connectivity;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-
-
-ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon)
- : ::connectivity::ODatabaseMetaDataBase(_pCon,_pCon->getConnectionInfo())
- ,m_pADOConnection(_pCon->getConnection())
- ,m_pConnection(_pCon)
-{
-}
-// -------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaData::getInt32Property(const ::rtl::OUString& _aProperty) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- connectivity::ado::WpADOProperties aProps(m_pADOConnection->get_Properties());
- // ADOS::ThrowException(*m_pADOConnection,*this);
- OSL_ENSURE(aProps.IsValid(),"There are no properties at the connection");
- ADO_PROP(_aProperty);
- sal_Int32 nValue(0);
- if(!aVar.isNull() && !aVar.isEmpty())
- nValue = aVar;
- return nValue;
-}
-
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::getBoolProperty(const ::rtl::OUString& _aProperty) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- connectivity::ado::WpADOProperties aProps(m_pADOConnection->get_Properties());
- ADOS::ThrowException(*m_pADOConnection,*this);
- OSL_ENSURE(aProps.IsValid(),"There are no properties at the connection");
- ADO_PROP(_aProperty);
- return (!aVar.isNull() && !aVar.isEmpty() ? aVar.getBool() : sal_False);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaData::getStringProperty(const ::rtl::OUString& _aProperty) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- connectivity::ado::WpADOProperties aProps(m_pADOConnection->get_Properties());
- ADOS::ThrowException(*m_pADOConnection,*this);
- OSL_ENSURE(aProps.IsValid(),"There are no properties at the connection");
-
- ADO_PROP(_aProperty);
- ::rtl::OUString aValue;
- if(!aVar.isNull() && !aVar.isEmpty() && aVar.getType() == VT_BSTR)
- aValue = aVar;
-
- return aValue;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > ODatabaseMetaData::impl_getTypeInfo_throw( )
-{
- ADORecordset *pRecordset = m_pADOConnection->getTypeInfo();
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setTypeInfoMap(ADOS::isJetEngine(m_pConnection->getEngineType()));
- Reference< XResultSet > xRef = pResult;
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs( ) throw(SQLException, RuntimeException)
-{
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- ADORecordset *pRecordset = NULL;
- m_pADOConnection->OpenSchema(adSchemaCatalogs,vtEmpty,vtEmpty,&pRecordset);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setCatalogsMap();
- xRef = pResult;
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaData::impl_getCatalogSeparator_throw( )
-{
- return getLiteral(DBLITERAL_CATALOG_SEPARATOR);
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas( ) throw(SQLException, RuntimeException)
-{
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- ADORecordset *pRecordset = NULL;
- m_pADOConnection->OpenSchema(adSchemaSchemata,vtEmpty,vtEmpty,&pRecordset);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setSchemasMap();
- xRef = pResult;
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
- const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- ADORecordset *pRecordset = m_pADOConnection->getColumnPrivileges(catalog,schema,table,columnNamePattern);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setColumnPrivilegesMap();
- xRef = pResult;
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
- const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern,
- const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- ADORecordset *pRecordset = m_pADOConnection->getColumns(catalog,schemaPattern,tableNamePattern,columnNamePattern);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setColumnsMap();
- xRef = pResult;
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
- const Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException)
-{
- ADORecordset *pRecordset = m_pADOConnection->getTables(catalog,schemaPattern,tableNamePattern,types);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setTablesMap();
- xRef = pResult;
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns(
- const Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- ADORecordset *pRecordset = m_pADOConnection->getProcedureColumns(catalog,schemaPattern,procedureNamePattern,columnNamePattern);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setProcedureColumnsMap();
- xRef = pResult;
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
- const Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& procedureNamePattern ) throw(SQLException, RuntimeException)
-{
- // Create elements used in the array
- ADORecordset *pRecordset = m_pADOConnection->getProcedures(catalog,schemaPattern,procedureNamePattern);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setProceduresMap();
- xRef = pResult;
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
-{
- return getMaxSize(DBLITERAL_BINARY_LITERAL);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Maximum Row Size")));
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException)
-{
- return getMaxSize(DBLITERAL_CATALOG_NAME);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException)
-{
- return getMaxSize(DBLITERAL_CHAR_LITERAL);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException)
-{
- return getMaxSize(DBLITERAL_COLUMN_NAME);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException)
-{
- return getMaxSize(DBLITERAL_CURSOR_NAME);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Active Sessions")));
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Max Columns in Table")));
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException)
-{
- return getMaxSize(DBLITERAL_TEXT_COMMAND);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException)
-{
- return getMaxSize(DBLITERAL_TABLE_NAME);
-}
-// -------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaData::impl_getMaxTablesInSelect_throw( )
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Maximum Tables in SELECT")));
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- ADORecordset *pRecordset = m_pADOConnection->getExportedKeys(catalog,schema,table);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- Reference< XResultSet > xRef;
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setCrossReferenceMap();
- xRef = pResult;
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- ADORecordset *pRecordset = m_pADOConnection->getImportedKeys(catalog,schema,table);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setCrossReferenceMap();
- xRef = pResult;
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- ADORecordset *pRecordset = m_pADOConnection->getPrimaryKeys(catalog,schema,table);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setPrimaryKeysMap();
- xRef = pResult;
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
- sal_Bool unique, sal_Bool approximate ) throw(SQLException, RuntimeException)
-{
- ADORecordset *pRecordset = m_pADOConnection->getIndexInfo(catalog,schema,table,unique,approximate);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setIndexInfoMap();
- xRef = pResult;
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
- const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- if(!ADOS::isJetEngine(m_pConnection->getEngineType()))
- { // the jet provider doesn't support this method
- // Create elements used in the array
-
- ADORecordset *pRecordset = m_pADOConnection->getTablePrivileges(catalog,schemaPattern,tableNamePattern);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setTablePrivilegesMap();
- xRef = pResult;
- }
- else
- {
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTablePrivileges);
- xRef = pResult;
- ::connectivity::ODatabaseMetaDataResultSet::ORows aRows;
- ::connectivity::ODatabaseMetaDataResultSet::ORow aRow(8);
- aRows.reserve(8);
-
- aRow[0] = ::connectivity::ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[1] = ::connectivity::ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[2] = new ::connectivity::ORowSetValueDecorator(tableNamePattern);
- aRow[3] = ::connectivity::ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[4] = ::connectivity::ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[5] = new ::connectivity::ORowSetValueDecorator(getUserName());
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getSelectValue();
- aRow[7] = new ::connectivity::ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NO")));
-
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getInsertValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getDeleteValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getUpdateValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getCreateValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getReadValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getAlterValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getDropValue();
- aRows.push_back(aRow);
- pResult->setRows(aRows);
- }
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
- const Any& primaryCatalog, const ::rtl::OUString& primarySchema,
- const ::rtl::OUString& primaryTable, const Any& foreignCatalog,
- const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(SQLException, RuntimeException)
-{
- ADORecordset *pRecordset = m_pADOConnection->getCrossReference(primaryCatalog,primarySchema,primaryTable,foreignCatalog,foreignSchema,foreignTable);
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
- pResult->setCrossReferenceMap();
- xRef = pResult;
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException)
-{
- return getBoolProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Maximum Row Size Includes BLOB")));
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Identifier Case Sensitivity"))) & DBPROPVAL_IC_LOWER) == DBPROPVAL_IC_LOWER ;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Identifier Case Sensitivity"))) & DBPROPVAL_IC_LOWER) == DBPROPVAL_IC_LOWER ;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Identifier Case Sensitivity"))) & DBPROPVAL_IC_MIXED) == DBPROPVAL_IC_MIXED ;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Identifier Case Sensitivity"))) & DBPROPVAL_IC_MIXED) == DBPROPVAL_IC_MIXED ;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Identifier Case Sensitivity"))) & DBPROPVAL_IC_UPPER) == DBPROPVAL_IC_UPPER ;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Identifier Case Sensitivity"))) & DBPROPVAL_IC_UPPER) == DBPROPVAL_IC_UPPER ;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( )
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( )
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Maximum Index Size")));
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NULL Concatenation Behavior"))) == DBPROPVAL_CB_NON_NULL;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException)
-{
- return getStringProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Catalog Term")));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaData::impl_getIdentifierQuoteString_throw( )
-{
- return getLiteral(DBLITERAL_QUOTE_PREFIX);
-
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- return isCapable(DBLITERAL_CORRELATION_NAME);
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_isCatalogAtStart_throw( )
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Catalog Location"))) == DBPROPVAL_CL_START;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Transaction DDL"))) == DBPROPVAL_TC_DDL_IGNORE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Transaction DDL"))) == DBPROPVAL_TC_DDL_COMMIT;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Transaction DDL"))) == DBPROPVAL_TC_DML;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Transaction DDL"))) == DBPROPVAL_TC_ALL;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Prepare Abort Behavior"))) == DBPROPVAL_CB_PRESERVE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Prepare Commit Behavior"))) == DBPROPVAL_CB_PRESERVE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Isolation Retention"))) & DBPROPVAL_TR_COMMIT) == DBPROPVAL_TR_COMMIT;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Isolation Retention"))) & DBPROPVAL_TR_ABORT) == DBPROPVAL_TR_ABORT;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level ) throw(SQLException, RuntimeException)
-{
- sal_Bool bValue(sal_False);
-
- sal_Int32 nTxn = getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Isolation Levels")));
- if(level == TransactionIsolation::NONE)
- bValue = sal_True;
- else if(level == TransactionIsolation::READ_UNCOMMITTED)
- bValue = (nTxn & DBPROPVAL_TI_READUNCOMMITTED) == DBPROPVAL_TI_READUNCOMMITTED;
- else if(level == TransactionIsolation::READ_COMMITTED)
- bValue = (nTxn & DBPROPVAL_TI_READCOMMITTED) == DBPROPVAL_TI_READCOMMITTED;
- else if(level == TransactionIsolation::REPEATABLE_READ)
- bValue = (nTxn & DBPROPVAL_TI_REPEATABLEREAD) == DBPROPVAL_TI_REPEATABLEREAD;
- else if(level == TransactionIsolation::SERIALIZABLE)
- bValue = (nTxn & DBPROPVAL_TI_SERIALIZABLE) == DBPROPVAL_TI_SERIALIZABLE;
-
- return bValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( )
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Schema Usage"))) & DBPROPVAL_SU_DML_STATEMENTS) == DBPROPVAL_SU_DML_STATEMENTS;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nProp = getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL Support")));
- return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ANSI92_FULL) == DBPROPVAL_SQL_ANSI92_FULL);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nProp = getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL Support")));
- return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ANSI92_ENTRY) == DBPROPVAL_SQL_ANSI92_ENTRY);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nProp = getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL Support")));
- return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ANSI89_IEF) == DBPROPVAL_SQL_ANSI89_IEF);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Schema Usage"))) & DBPROPVAL_SU_INDEX_DEFINITION) == DBPROPVAL_SU_INDEX_DEFINITION;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( )
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Schema Usage"))) & DBPROPVAL_SU_TABLE_DEFINITION) == DBPROPVAL_SU_TABLE_DEFINITION;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException)
-{
- if ( ADOS::isJetEngine(m_pConnection->getEngineType()) )
- return sal_True;
- return getBoolProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Outer Join Capabilities")));
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException)
-{
- return new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTableTypes);
-}
-// -------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaData::impl_getMaxStatements_throw( )
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException)
-{
- return getMaxSize(DBLITERAL_PROCEDURE_NAME);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException)
-{
- return getMaxSize(DBLITERAL_SCHEMA_NAME);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Transaction DDL"))) == DBPROPVAL_TC_NONE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- return getBoolProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Read-Only Data Source")));
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NULL Concatenation Behavior"))) == DBPROPVAL_CB_NULL;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException)
-{
- return isCapable(DBLITERAL_COLUMN_ALIAS);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- return isCapable(DBLITERAL_CORRELATION_NAME);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 /*fromType*/, sal_Int32 /*toType*/ ) throw(SQLException, RuntimeException)
-{
- return getBoolProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Rowset Conversions on Command")));
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- return getBoolProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ORDER BY Columns in Select List")));
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GROUP BY Support"))) != DBPROPVAL_GB_NOT_SUPPORTED;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GROUP BY Support"))) != DBPROPVAL_GB_CONTAINS_SELECT;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GROUP BY Support"))) == DBPROPVAL_GB_NO_RELATION;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException)
-{
- return isCapable(DBLITERAL_ESCAPE_PERCENT);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException)
-{
- return getBoolProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ORDER BY Columns in Select List")));
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Identifier Case Sensitivity"))) & DBPROPVAL_IC_MIXED) == DBPROPVAL_IC_MIXED;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Identifier Case Sensitivity"))) & DBPROPVAL_IC_MIXED) == DBPROPVAL_IC_MIXED;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NULL Collation Order"))) & DBPROPVAL_NC_END) == DBPROPVAL_NC_END;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NULL Collation Order"))) & DBPROPVAL_NC_START) == DBPROPVAL_NC_START;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NULL Collation Order"))) & DBPROPVAL_NC_HIGH) == DBPROPVAL_NC_HIGH;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NULL Collation Order"))) & DBPROPVAL_NC_LOW) == DBPROPVAL_NC_LOW;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Schema Usage"))) & DBPROPVAL_SU_PRIVILEGE_DEFINITION) == DBPROPVAL_SU_PRIVILEGE_DEFINITION;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Subquery Support"))) & DBPROPVAL_SQ_CORRELATEDSUBQUERIES) == DBPROPVAL_SQ_CORRELATEDSUBQUERIES;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Subquery Support"))) & DBPROPVAL_SQ_COMPARISON) == DBPROPVAL_SQ_COMPARISON;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Subquery Support"))) & DBPROPVAL_SQ_EXISTS) == DBPROPVAL_SQ_EXISTS;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Subquery Support"))) & DBPROPVAL_SQ_IN) == DBPROPVAL_SQ_IN;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException)
-{
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Subquery Support"))) & DBPROPVAL_SQ_QUANTIFIED) == DBPROPVAL_SQ_QUANTIFIED;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nProp = getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL Support")));
- return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ANSI92_INTERMEDIATE) == DBPROPVAL_SQL_ANSI92_INTERMEDIATE);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:ado:"))+ m_pADOConnection->GetConnectionString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException)
-{
- return getStringProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("User Name")));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException)
-{
- return getStringProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Provider Friendly Name")));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverVersion( ) throw(SQLException, RuntimeException)
-{
- return getStringProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Provider Version")));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException)
-{
- return getStringProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DBMS Version")));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException)
-{
- return getStringProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DBMS Name")));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException)
-{
- return getStringProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Procedure Term")));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException)
-{
- return getStringProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Schema Term")));
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException)
-{
- return 1;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nRet = TransactionIsolation::NONE;
- switch(m_pADOConnection->get_IsolationLevel())
- {
- case adXactReadCommitted:
- nRet = TransactionIsolation::READ_COMMITTED;
- break;
- case adXactRepeatableRead:
- nRet = TransactionIsolation::REPEATABLE_READ;
- break;
- case adXactSerializable:
- nRet = TransactionIsolation::SERIALIZABLE;
- break;
- case adXactReadUncommitted:
- nRet = TransactionIsolation::READ_UNCOMMITTED;
- break;
- default:
- ;
- }
- return nRet;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException)
-{
- ADORecordset *pRecordset = NULL;
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
- m_pADOConnection->OpenSchema(adSchemaDBInfoKeywords,vtEmpty,vtEmpty,&pRecordset);
- OSL_ENSURE(pRecordset,"getSQLKeywords: no resultset!");
- ADOS::ThrowException(*m_pADOConnection,*this);
- if ( pRecordset )
- {
- WpADORecordset aRecordset(pRecordset);
-
- aRecordset.MoveFirst();
- OLEVariant aValue;
- ::rtl::OUString aRet, aComma(RTL_CONSTASCII_USTRINGPARAM(","));
- while(!aRecordset.IsAtEOF())
- {
- WpOLEAppendCollection<ADOFields, ADOField, WpADOField> aFields(aRecordset.GetFields());
- WpADOField aField(aFields.GetItem(0));
- aField.get_Value(aValue);
- aRet = aRet + aValue + aComma;
- aRecordset.MoveNext();
- }
- aRecordset.Close();
- if ( aRet.getLength() )
- return aRet.copy(0,aRet.lastIndexOf(','));
- }
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException)
-{
- return getLiteral(DBLITERAL_ESCAPE_PERCENT);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue.copy(0,aValue.lastIndexOf(','));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue.copy(0,aValue.lastIndexOf(','));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nProp = getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL Support")));
- return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ODBC_EXTENDED) == DBPROPVAL_SQL_ODBC_EXTENDED);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nProp = getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL Support")));
- return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ODBC_CORE) == DBPROPVAL_SQL_ODBC_CORE);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nProp = getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL Support")));
- return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ODBC_MINIMUM) == DBPROPVAL_SQL_ODBC_MINIMUM);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException)
-{
- if ( ADOS::isJetEngine(m_pConnection->getEngineType()) )
- return sal_True;
- return (getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Outer Join Capabilities"))) & 0x00000004L) == 0x00000004L;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return supportsFullOuterJoins( );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Max Columns in GROUP BY")));
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- return getInt32Property(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Max Columns in ORDER BY")));
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException)
-{
- return getMaxSize(DBLITERAL_USER_NAME);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 /*setType*/, sal_Int32 /*concurrency*/ ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- return ResultSetType::FORWARD_ONLY != setType;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- return ResultSetType::FORWARD_ONLY != setType;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- return ResultSetType::FORWARD_ONLY != setType;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- return ResultSetType::FORWARD_ONLY != setType;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- return ResultSetType::FORWARD_ONLY != setType;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- return ResultSetType::FORWARD_ONLY != setType;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- return ResultSetType::FORWARD_ONLY != setType;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- return ResultSetType::FORWARD_ONLY != setType;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- return ResultSetType::FORWARD_ONLY != setType;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getUDTs( const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& /*typeNamePattern*/, const Sequence< sal_Int32 >& /*types*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XDatabaseMetaData::getUDTs", *this );
- return Reference< XResultSet >();
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx
deleted file mode 100644
index e6ac9c9030..0000000000
--- a/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx
+++ /dev/null
@@ -1,610 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/ADatabaseMetaData.hxx"
-#include "ado/ADatabaseMetaDataResultSetMetaData.hxx"
-#include "ado/Awrapado.hxx"
-#include "ado/AGroup.hxx"
-#include "ado/adoimp.hxx"
-#include "ado/AIndex.hxx"
-#include "ado/AKey.hxx"
-#include "ado/ATable.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ProcedureResult.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#ifdef DELETE
-#undef DELETE
-#endif
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbcx/PrivilegeObject.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-
-using namespace connectivity::ado;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::uno;
-
-// -------------------------------------------------------------------------
-void ODatabaseMetaData::fillLiterals()
-{
- ADORecordset *pRecordset = NULL;
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
- m_pADOConnection->OpenSchema(adSchemaDBInfoLiterals,vtEmpty,vtEmpty,&pRecordset);
-
- ADOS::ThrowException(*m_pADOConnection,*this);
-
- OSL_ENSURE(pRecordset,"fillLiterals: no resultset!");
- if ( pRecordset )
- {
- WpADORecordset aRecordset(pRecordset);
-
- aRecordset.MoveFirst();
- OLEVariant aValue;
- LiteralInfo aInfo;
- while(!aRecordset.IsAtEOF())
- {
- WpOLEAppendCollection<ADOFields, ADOField, WpADOField> aFields(aRecordset.GetFields());
- WpADOField aField(aFields.GetItem(1));
- aInfo.pwszLiteralValue = aField.get_Value();
- aField = aFields.GetItem(5);
- aInfo.fSupported = aField.get_Value();
- aField = aFields.GetItem(6);
- aInfo.cchMaxLen = aField.get_Value().getUInt32();
-
- aField = aFields.GetItem(4);
- sal_uInt32 nId = aField.get_Value().getUInt32();
- m_aLiteralInfo[nId] = aInfo;
-
- aRecordset.MoveNext();
- }
- aRecordset.Close();
- }
-}
-// -------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaData::getMaxSize(sal_uInt32 _nId)
-{
- if(!m_aLiteralInfo.size())
- fillLiterals();
-
- sal_Int32 nSize = 0;
- ::std::map<sal_uInt32,LiteralInfo>::const_iterator aIter = m_aLiteralInfo.find(_nId);
- if(aIter != m_aLiteralInfo.end() && (*aIter).second.fSupported)
- nSize = ((*aIter).second.cchMaxLen == (-1)) ? 0 : (*aIter).second.cchMaxLen;
- return nSize;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::isCapable(sal_uInt32 _nId)
-{
- if(!m_aLiteralInfo.size())
- fillLiterals();
- sal_Bool bSupported = sal_False;
- ::std::map<sal_uInt32,LiteralInfo>::const_iterator aIter = m_aLiteralInfo.find(_nId);
- if(aIter != m_aLiteralInfo.end())
- bSupported = (*aIter).second.fSupported;
- return bSupported;
-}
-
-// -------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaData::getLiteral(sal_uInt32 _nId)
-{
- if(!m_aLiteralInfo.size())
- fillLiterals();
- ::rtl::OUString sStr;
- ::std::map<sal_uInt32,LiteralInfo>::const_iterator aIter = m_aLiteralInfo.find(_nId);
- if(aIter != m_aLiteralInfo.end() && (*aIter).second.fSupported)
- sStr = (*aIter).second.pwszLiteralValue;
- return sStr;
-}
-// -----------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setColumnPrivilegesMap()
-{
- m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IS_GRANTABLE")),
- ColumnValue::NULLABLE,
- 3,3,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setColumnsMap()
-{
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TYPE_NAME")),
- ColumnValue::NO_NULLS,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[11] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NULLABLE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REMARKS")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[13] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("COLUMN_DEF")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[14] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_DATA_TYPE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[15] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_DATETIME_SUB")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[16] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CHAR_OCTET_LENGTH")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setTablesMap()
-{
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REMARKS")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setProcedureColumnsMap()
-{
- m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NULLABLE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setPrimaryKeysMap()
-{
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KEY_SEQ")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PK_NAME")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setIndexInfoMap()
-{
- m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NON_UNIQUE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::BIT);
- m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INDEX_QUALIFIER")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[10] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ASC_OR_DESC")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setTablePrivilegesMap()
-{
- m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRIVILEGE")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
- m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IS_GRANTABLE")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setCrossReferenceMap()
-{
- m_mColumns[9] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KEY_SEQ")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setTypeInfoMap()
-{
- m_mColumns[3] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRECISION")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NULLABLE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AUTO_INCREMENT")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::BIT);
- m_mColumns[16] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_DATA_TYPE")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[17] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_DATETIME_SUB")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
- m_mColumns[18] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NUM_PREC_RADIX")),
- ColumnValue::NO_NULLS,
- 1,1,0,
- DataType::INTEGER);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSetMetaData::setProceduresMap()
-{
- m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REMARKS")),
- ColumnValue::NULLABLE,
- 0,0,0,
- DataType::VARCHAR);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isSearchable();
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isAutoIncrement();
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnServiceName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getColumnServiceName();
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getTableName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getTableName();
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getCatalogName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getCatalogName();
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnTypeName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getColumnTypeName();
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isCaseSensitive();
- return sal_True;
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getSchemaName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getSchemaName();
- return ::rtl::OUString();
-}
-// -----------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-ObjectTypeEnum OAdoGroup::MapObjectType(sal_Int32 _ObjType)
-{
- ObjectTypeEnum eNumType= adPermObjTable;
- switch(_ObjType)
- {
- case PrivilegeObject::TABLE:
- break;
- case PrivilegeObject::VIEW:
- eNumType = adPermObjView;
- break;
- case PrivilegeObject::COLUMN:
- eNumType = adPermObjColumn;
- break;
- }
- return eNumType;
-}
-// -------------------------------------------------------------------------
-sal_Int32 OAdoGroup::MapRight(RightsEnum _eNum)
-{
- sal_Int32 nRight = 0;
- if(_eNum & adRightRead)
- nRight |= Privilege::SELECT;
- if(_eNum & adRightInsert)
- nRight |= Privilege::INSERT;
- if(_eNum & adRightUpdate)
- nRight |= Privilege::UPDATE;
- if(_eNum & adRightDelete)
- nRight |= Privilege::DELETE;
- if(_eNum & adRightReadDesign)
- nRight |= Privilege::READ;
- if(_eNum & adRightCreate)
- nRight |= Privilege::CREATE;
- if(_eNum & adRightWriteDesign)
- nRight |= Privilege::ALTER;
- if(_eNum & adRightReference)
- nRight |= Privilege::REFERENCE;
- if(_eNum & adRightDrop)
- nRight |= Privilege::DROP;
-
- return nRight;
-}
-// -------------------------------------------------------------------------
-RightsEnum OAdoGroup::Map2Right(sal_Int32 _eNum)
-{
- sal_Int32 nRight = adRightNone;
- if(_eNum & Privilege::SELECT)
- nRight |= adRightRead;
-
- if(_eNum & Privilege::INSERT)
- nRight |= adRightInsert;
-
- if(_eNum & Privilege::UPDATE)
- nRight |= adRightUpdate;
-
- if(_eNum & Privilege::DELETE)
- nRight |= adRightDelete;
-
- if(_eNum & Privilege::READ)
- nRight |= adRightReadDesign;
-
- if(_eNum & Privilege::CREATE)
- nRight |= adRightCreate;
-
- if(_eNum & Privilege::ALTER)
- nRight |= adRightWriteDesign;
-
- if(_eNum & Privilege::REFERENCE)
- nRight |= adRightReference;
-
- if(_eNum & Privilege::DROP)
- nRight |= adRightDrop;
-
- return (RightsEnum)nRight;
-}
-// -------------------------------------------------------------------------
-void WpADOIndex::Create()
-{
- HRESULT hr = -1;
-
- _ADOIndex* pIndex = NULL;
- hr = CoCreateInstance(ADOS::CLSID_ADOINDEX_25,
- NULL,
- CLSCTX_INPROC_SERVER,
- ADOS::IID_ADOINDEX_25,
- (void**)&pIndex );
-
-
- if( !FAILED( hr ) )
- {
- operator=( pIndex );
- pIndex->Release();
- }
-}
-// -------------------------------------------------------------------------
-void OAdoIndex::fillPropertyValues()
-{
- if(m_aIndex.IsValid())
- {
- m_Name = m_aIndex.get_Name();
- m_IsUnique = m_aIndex.get_Unique();
- m_IsPrimaryKeyIndex = m_aIndex.get_PrimaryKey();
- m_IsClustered = m_aIndex.get_Clustered();
- }
-}
-// -----------------------------------------------------------------------------
-void WpADOKey::Create()
-{
- HRESULT hr = -1;
- _ADOKey* pKey = NULL;
- hr = CoCreateInstance(ADOS::CLSID_ADOKEY_25,
- NULL,
- CLSCTX_INPROC_SERVER,
- ADOS::IID_ADOKEY_25,
- (void**)&pKey );
-
-
- if( !FAILED( hr ) )
- {
- operator=( pKey );
- pKey->Release();
- }
-}
-// -------------------------------------------------------------------------
-void OAdoKey::fillPropertyValues()
-{
- if(m_aKey.IsValid())
- {
- m_aProps->m_Type = MapKeyRule(m_aKey.get_Type());
- m_Name = m_aKey.get_Name();
- m_aProps->m_ReferencedTable = m_aKey.get_RelatedTable();
- m_aProps->m_UpdateRule = MapRule(m_aKey.get_UpdateRule());
- m_aProps->m_DeleteRule = MapRule(m_aKey.get_DeleteRule());
- }
-}
-// -------------------------------------------------------------------------
-sal_Int32 OAdoKey::MapRule(const RuleEnum& _eNum)
-{
- sal_Int32 eNum = KeyRule::NO_ACTION;
- switch(_eNum)
- {
- case adRICascade:
- eNum = KeyRule::CASCADE;
- break;
- case adRISetNull:
- eNum = KeyRule::SET_NULL;
- break;
- case adRINone:
- eNum = KeyRule::NO_ACTION;
- break;
- case adRISetDefault:
- eNum = KeyRule::SET_DEFAULT;
- break;
- }
- return eNum;
-}
-// -------------------------------------------------------------------------
-RuleEnum OAdoKey::Map2Rule(const sal_Int32& _eNum)
-{
- RuleEnum eNum = adRINone;
- switch(_eNum)
- {
- case KeyRule::CASCADE:
- eNum = adRICascade;
- break;
- case KeyRule::SET_NULL:
- eNum = adRISetNull;
- break;
- case KeyRule::NO_ACTION:
- eNum = adRINone;
- break;
- case KeyRule::SET_DEFAULT:
- eNum = adRISetDefault;
- break;
- }
- return eNum;
-}
-// -------------------------------------------------------------------------
-sal_Int32 OAdoKey::MapKeyRule(const KeyTypeEnum& _eNum)
-{
- sal_Int32 nKeyType = KeyType::PRIMARY;
- switch(_eNum)
- {
- case adKeyPrimary:
- nKeyType = KeyType::PRIMARY;
- break;
- case adKeyForeign:
- nKeyType = KeyType::FOREIGN;
- break;
- case adKeyUnique:
- nKeyType = KeyType::UNIQUE;
- break;
- }
- return nKeyType;
-}
-// -------------------------------------------------------------------------
-KeyTypeEnum OAdoKey::Map2KeyRule(const sal_Int32& _eNum)
-{
- KeyTypeEnum eNum( adKeyPrimary );
- switch(_eNum)
- {
- case KeyType::PRIMARY:
- eNum = adKeyPrimary;
- break;
- case KeyType::FOREIGN:
- eNum = adKeyForeign;
- break;
- case KeyType::UNIQUE:
- eNum = adKeyUnique;
- break;
- default:
- OSL_FAIL( "OAdoKey::Map2KeyRule: invalid key type!" );
- }
- return eNum;
-}
-// -----------------------------------------------------------------------------
-void WpADOTable::Create()
-{
- HRESULT hr = -1;
- _ADOTable* pTable = NULL;
- hr = CoCreateInstance(ADOS::CLSID_ADOTABLE_25,
- NULL,
- CLSCTX_INPROC_SERVER,
- ADOS::IID_ADOTABLE_25,
- (void**)&pTable );
-
-
- if( !FAILED( hr ) )
- {
- operator=( pTable );
- pTable->Release();
- }
-}
-// -------------------------------------------------------------------------
-::rtl::OUString WpADOCatalog::GetObjectOwner(const ::rtl::OUString& _rName, ObjectTypeEnum _eNum)
-{
- OLEVariant _rVar;
- _rVar.setNoArg();
- OLEString aBSTR;
- OLEString sStr1(_rName);
- pInterface->GetObjectOwner(sStr1,_eNum,_rVar,&aBSTR);
- return aBSTR;
-}
-// -----------------------------------------------------------------------------
-void OAdoTable::fillPropertyValues()
-{
- if(m_aTable.IsValid())
- {
- m_Name = m_aTable.get_Name();
- m_Type = m_aTable.get_Type();
- {
- WpADOCatalog aCat(m_aTable.get_ParentCatalog());
- if(aCat.IsValid())
- m_CatalogName = aCat.GetObjectOwner(m_aTable.get_Name(),adPermObjTable);
- }
- {
- WpADOProperties aProps = m_aTable.get_Properties();
- if(aProps.IsValid())
- m_Description = OTools::getValue(aProps,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Description")));
- }
- }
-}
-// -----------------------------------------------------------------------------
-void WpADOUser::Create()
-{
- HRESULT hr = -1;
- _ADOUser* pUser = NULL;
- hr = CoCreateInstance(ADOS::CLSID_ADOUSER_25,
- NULL,
- CLSCTX_INPROC_SERVER,
- ADOS::IID_ADOUSER_25,
- (void**)&pUser );
-
-
- if( !FAILED( hr ) )
- {
- operator=( pUser );
- pUser->Release();
- }
-}
-// -------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
deleted file mode 100644
index 845575eaf3..0000000000
--- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
+++ /dev/null
@@ -1,1219 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <comphelper/sequence.hxx>
-#include "ado/ADatabaseMetaDataResultSet.hxx"
-#include "ado/ADatabaseMetaDataResultSetMetaData.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbc/ProcedureResult.hpp>
-#include <com/sun/star/sdbc/IndexType.hpp>
-#include <comphelper/property.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/seqstream.hxx>
-#include "connectivity/dbexception.hxx"
-
-
-#include <oledb.h>
-
-using namespace dbtools;
-using namespace connectivity::ado;
-using namespace cppu;
-using namespace ::comphelper;
-//------------------------------------------------------------------------------
-using namespace ::com::sun::star::lang;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-
-// -------------------------------------------------------------------------
-ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet(ADORecordset* _pRecordSet)
- :ODatabaseMetaDataResultSet_BASE(m_aMutex)
- ,OPropertySetHelper(ODatabaseMetaDataResultSet_BASE::rBHelper)
- ,m_aStatement(NULL)
- ,m_xMetaData(NULL)
- ,m_pRecordSet(_pRecordSet)
- ,m_bEOF(sal_False)
-{
- osl_incrementInterlockedCount( &m_refCount );
- m_aColMapping.push_back(-1);
- if(_pRecordSet)
- {
- m_pRecordSet->AddRef();
- VARIANT_BOOL bIsAtBOF;
- m_pRecordSet->get_BOF(&bIsAtBOF);
- m_bOnFirstAfterOpen = bIsAtBOF != VARIANT_TRUE;
- }
- else
- m_bOnFirstAfterOpen = sal_False;
- osl_decrementInterlockedCount( &m_refCount );
- // allocBuffer();
-}
-
-// -------------------------------------------------------------------------
-ODatabaseMetaDataResultSet::~ODatabaseMetaDataResultSet()
-{
- if(m_pRecordSet)
- m_pRecordSet->Release();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::disposing(void)
-{
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
- if(m_pRecordSet)
- m_pRecordSet->Close();
- m_aStatement = NULL;
-m_xMetaData.clear();
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL ODatabaseMetaDataResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OPropertySetHelper::queryInterface(rType);
- return aRet.hasValue() ? aRet : ODatabaseMetaDataResultSet_BASE::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL ODatabaseMetaDataResultSet::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),ODatabaseMetaDataResultSet_BASE::getTypes());
-}
-// -----------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::checkRecordSet() throw(SQLException)
-{
- if(!m_pRecordSet)
- throwFunctionSequenceException(*this);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
-
-
- Reference< XResultSetMetaData > xMeta = getMetaData();
- sal_Int32 nLen = xMeta->getColumnCount();
- sal_Int32 i = 1;
- for(;i<=nLen;++i)
- if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
- columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
- break;
- return i;
-}
-#define BLOCK_SIZE 256
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- columnIndex = mapColumn(columnIndex);
- WpADOField aField = ADOS::getField(m_pRecordSet,columnIndex);
- if((aField.GetAttributes() & adFldLong) == adFldLong)
- {
- //Copy the data only upto the Actual Size of Field.
- sal_Int32 nSize = aField.GetActualSize();
- Sequence<sal_Int8> aData(nSize);
- long index = 0;
- while(index < nSize)
- {
- m_aValue = aField.GetChunk(BLOCK_SIZE);
- if(m_aValue.isNull())
- break;
- UCHAR chData;
- for(long index2 = 0;index2 < BLOCK_SIZE;++index2)
- {
- HRESULT hr = ::SafeArrayGetElement(m_aValue.parray,&index2,&chData);
- if(SUCCEEDED(hr))
- {
- //Take BYTE by BYTE and advance Memory Location
- aData.getArray()[index++] = chData;
- }
- else
- break;
- }
- }
- return index ? Reference< ::com::sun::star::io::XInputStream >(new SequenceInputStream(aData)) : Reference< ::com::sun::star::io::XInputStream >();
- }
- // else we ask for a bytesequence
- aField.get_Value(m_aValue);
- if(m_aValue.isNull())
- return NULL;
- return new SequenceInputStream(m_aValue);
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResultSet::getCharacterStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getCharacterStream", *this );
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_aValueRange.empty() && columnIndex == 11 && (m_aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end() )
- {
- getValue(2);
- if ( static_cast<sal_Int16>(m_aValue) != adCurrency )
- return sal_False;
- }
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Int8 SAL_CALL ODatabaseMetaDataResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- getValue(columnIndex);
-
- columnIndex = mapColumn(columnIndex);
-
- if(m_aValue.isNull())
- return 0;
- if ( !m_aValueRange.empty() && (m_aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
- return (sal_Int8)(*m_aValueRangeIter).second[(sal_Int32)m_aValue];
- else if(m_aStrValueRange.size() && (m_aStrValueRangeIter = m_aStrValueRange.find(columnIndex)) != m_aStrValueRange.end())
- return (sal_Int8)(*m_aStrValueRangeIter).second[m_aValue];
-
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-
-Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-::com::sun::star::util::Date SAL_CALL ODatabaseMetaDataResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-double SAL_CALL ODatabaseMetaDataResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-float SAL_CALL ODatabaseMetaDataResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- getValue(columnIndex);
-
- columnIndex = mapColumn(columnIndex);
- if(m_aValue.isNull())
- return 0;
-
- if(m_aValueRange.size() && (m_aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
- return (*m_aValueRangeIter).second[(sal_Int32)m_aValue];
- else if(m_aStrValueRange.size() && (m_aStrValueRangeIter = m_aStrValueRange.find(columnIndex)) != m_aStrValueRange.end())
- return (*m_aStrValueRangeIter).second[m_aValue];
-
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getRow( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XResultSet::getRow", *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-
-sal_Int64 SAL_CALL ODatabaseMetaDataResultSet::getLong( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getLong", *this );
- return sal_Int64(0);
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSetMetaData > SAL_CALL ODatabaseMetaDataResultSet::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- if(!m_xMetaData.is())
- m_xMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
-
- return m_xMetaData;
-}
-// -------------------------------------------------------------------------
-Reference< XArray > SAL_CALL ODatabaseMetaDataResultSet::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getRow", *this );
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-
-Reference< XClob > SAL_CALL ODatabaseMetaDataResultSet::getClob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getRow", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XBlob > SAL_CALL ODatabaseMetaDataResultSet::getBlob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getRow", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Reference< XRef > SAL_CALL ODatabaseMetaDataResultSet::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getRow", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL ODatabaseMetaDataResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- columnIndex = mapColumn(columnIndex);
- return Any();
-}
-// -------------------------------------------------------------------------
-
-sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- getValue(columnIndex);
-
- columnIndex = mapColumn(columnIndex);
- if(m_aValue.isNull())
- return 0;
-
- if(m_aValueRange.size() && (m_aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
- return (sal_Int16)(*m_aValueRangeIter).second[(sal_Int32)m_aValue];
- else if(m_aStrValueRange.size() && (m_aStrValueRangeIter = m_aStrValueRange.find(columnIndex)) != m_aStrValueRange.end())
- return (sal_Int16)(*m_aStrValueRangeIter).second[m_aValue];
-
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- getValue(columnIndex);
-
-
- columnIndex = mapColumn(columnIndex);
- if(m_aValue.isNull())
- return ::rtl::OUString();
- if(m_aIntValueRange.size() && (m_aIntValueRangeIter = m_aIntValueRange.find(columnIndex)) != m_aIntValueRange.end())
- return (*m_aIntValueRangeIter).second[m_aValue];
-
- return m_aValue;
-}
-
-// -------------------------------------------------------------------------
-
-
-::com::sun::star::util::Time SAL_CALL ODatabaseMetaDataResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-
-::com::sun::star::util::DateTime SAL_CALL ODatabaseMetaDataResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isAfterLast( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- VARIANT_BOOL bIsAtEOF;
- m_pRecordSet->get_EOF(&bIsAtEOF);
- return bIsAtEOF == VARIANT_TRUE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isFirst( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- return m_nRowPos == 1;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isLast( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- return sal_True;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- if(first())
- previous();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::afterLast( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- if(last())
- next();
- m_bEOF = sal_True;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL ODatabaseMetaDataResultSet::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::first( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
-
- if(!m_pRecordSet)
- return sal_False;
-
- sal_Bool bRet = SUCCEEDED(m_pRecordSet->MoveFirst());
- if ( bRet )
- m_nRowPos = 1;
- return bRet;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::last( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
-
-
- return m_pRecordSet && SUCCEEDED(m_pRecordSet->MoveLast()) ? sal_True : sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
-
- if(first())
- {
- OLEVariant aEmpty;
- aEmpty.setNoArg();
- sal_Bool bRet = SUCCEEDED(m_pRecordSet->Move(row,aEmpty));
- if(bRet)
- m_nRowPos = row;
- return bRet;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
-
- if(!m_pRecordSet)
- return sal_False;
-
- OLEVariant aEmpty;
- aEmpty.setNoArg();
- sal_Bool bRet = SUCCEEDED(m_pRecordSet->Move(row,aEmpty));
- if(bRet)
- m_nRowPos += row;
- return bRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::previous( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
-
- if(!m_pRecordSet)
- return sal_False;
-
- sal_Bool bRet = SUCCEEDED(m_pRecordSet->MovePrevious());
- if(bRet)
- --m_nRowPos;
- return bRet;
-}
-// -------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL ODatabaseMetaDataResultSet::getStatement( ) throw(SQLException, RuntimeException)
-{
- return m_aStatement.get();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowDeleted( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- RecordStatusEnum eRec;
- m_pRecordSet->get_Status((sal_Int32*)&eRec);
- return (eRec & adRecDeleted) == adRecDeleted;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowInserted( ) throw(SQLException, RuntimeException)
-{ ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- RecordStatusEnum eRec;
- m_pRecordSet->get_Status((sal_Int32*)&eRec);
- return (eRec & adRecNew) == adRecNew;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- RecordStatusEnum eRec;
- m_pRecordSet->get_Status((sal_Int32*)&eRec);
- return (eRec & adRecModified) == adRecModified;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
-
- if(!m_pRecordSet)
- return sal_True;
-
- VARIANT_BOOL bIsAtBOF;
- m_pRecordSet->get_BOF(&bIsAtBOF);
- return bIsAtBOF == VARIANT_TRUE;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::next( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
-
- if(!m_pRecordSet)
- return sal_False;
-
- if(m_bOnFirstAfterOpen)
- {
- m_bOnFirstAfterOpen = sal_False;
- return sal_True;
- }
- else
- return SUCCEEDED(m_pRecordSet->MoveNext());
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::wasNull( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- return m_aValue.isNull();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::refreshRow( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- m_pRecordSet->Resync(adAffectCurrent,adResyncAllValues);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL ODatabaseMetaDataResultSet::cancel( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
-
- m_pRecordSet->Cancel();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL ODatabaseMetaDataResultSet::getWarnings( ) throw(SQLException, RuntimeException)
-{
- return Any();
-}
-//------------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaDataResultSet::getResultSetConcurrency() const
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return ResultSetConcurrency::READ_ONLY;
-}
-//------------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaDataResultSet::getResultSetType() const
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return ResultSetType::FORWARD_ONLY;
-}
-//------------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaDataResultSet::getFetchDirection() const
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return FetchDirection::FORWARD;
-}
-//------------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaDataResultSet::getFetchSize() const
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- sal_Int32 nValue=-1;
- if(m_pRecordSet)
- m_pRecordSet->get_CacheSize(&nValue);
- return nValue;
-}
-//------------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaDataResultSet::getCursorName() const
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return ::rtl::OUString();
-}
-
-//------------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setFetchDirection(sal_Int32 /*_par0*/)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "ResultSet::FetchDirection", *this );
-}
-//------------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setFetchSize(sal_Int32 _par0)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- if(m_pRecordSet)
- m_pRecordSet->put_CacheSize(_par0);
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* ODatabaseMetaDataResultSet::createArrayHelper( ) const
-{
-
- Sequence< com::sun::star::beans::Property > aProps(5);
- com::sun::star::beans::Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP0(CURSORNAME, ::rtl::OUString);
- DECL_PROP0(FETCHDIRECTION, sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_PROP0(RESULTSETCONCURRENCY,sal_Int32);
- DECL_PROP0(RESULTSETTYPE, sal_Int32);
-
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & ODatabaseMetaDataResultSet::getInfoHelper()
-{
- return *const_cast<ODatabaseMetaDataResultSet*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaDataResultSet::convertFastPropertyValue(
- Any & rConvertedValue,
- Any & rOldValue,
- sal_Int32 nHandle,
- const Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException)
-{
- switch(nHandle)
- {
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw ::com::sun::star::lang::IllegalArgumentException();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchDirection());
- case PROPERTY_ID_FETCHSIZE:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchSize());
- default:
- ;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const Any& /*rValue*/
- )
- throw (Exception)
-{
- switch(nHandle)
- {
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- throw Exception();
- break;
- default:
- OSL_FAIL("setFastPropertyValue_NoBroadcast: Illegal handle value!");
- }
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::getFastPropertyValue(
- Any& rValue,
- sal_Int32 nHandle
- ) const
-{
- switch(nHandle)
- {
- case PROPERTY_ID_CURSORNAME:
- rValue <<= getCursorName();
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- rValue <<= getResultSetConcurrency();
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- rValue <<= getResultSetType();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- rValue <<= getFetchDirection();
- break;
- case PROPERTY_ID_FETCHSIZE:
- rValue <<= getFetchSize();
- break;
- }
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setProceduresMap()
-{
-
- for(sal_Int32 i=1;i<4;i++)
- m_aColMapping.push_back(i);
- m_aColMapping.push_back(5);
- m_aColMapping.push_back(7);
- m_aColMapping.push_back(8);
- m_aColMapping.push_back(6);
- m_aColMapping.push_back(4);
-
- TInt2IntMap aMap;
- aMap[DB_PT_UNKNOWN] = ProcedureResult::UNKNOWN;
- aMap[DB_PT_PROCEDURE] = ProcedureResult::NONE;
- aMap[DB_PT_FUNCTION] = ProcedureResult::RETURN;
- m_aValueRange[4] = aMap;
-
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
- pMetaData->setProceduresMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setCatalogsMap()
-{
- m_aColMapping.push_back(1);
-
- m_xMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setSchemasMap()
-{
- m_aColMapping.push_back(2);
-
- m_xMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setColumnPrivilegesMap()
-{
-
- m_aColMapping.push_back(3);
- m_aColMapping.push_back(4);
- m_aColMapping.push_back(5);
- m_aColMapping.push_back(6);
- m_aColMapping.push_back(2);
- m_aColMapping.push_back(9);
- m_aColMapping.push_back(10);
-
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
- pMetaData->setColumnPrivilegesMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setColumnsMap()
-{
-
- for(sal_Int32 i=1;i<5;++i)
- m_aColMapping.push_back(i);
-
- m_aColMapping.push_back(12);
- m_aColMapping.push_back(12); // is used as TYPE_NAME
-
- m_aColMapping.push_back(14);
- m_aColMapping.push_back(6);
- m_aColMapping.push_back(17);
- m_aColMapping.push_back(18);
-
- m_aColMapping.push_back(11);
- m_aColMapping.push_back(29);
- m_aColMapping.push_back(9);
- m_aColMapping.push_back(18);
- m_aColMapping.push_back(18);
-
- m_aColMapping.push_back(15);
- m_aColMapping.push_back(7);
- m_aColMapping.push_back(11);
-
- TInt2IntMap aMap;
- aMap[adEmpty] = ADOS::MapADOType2Jdbc(adEmpty);
- aMap[adTinyInt] = ADOS::MapADOType2Jdbc(adTinyInt);
- aMap[adSmallInt] = ADOS::MapADOType2Jdbc(adSmallInt);
- aMap[adInteger] = ADOS::MapADOType2Jdbc(adInteger);
- aMap[adBigInt] = ADOS::MapADOType2Jdbc(adBigInt);
- aMap[adUnsignedTinyInt] = ADOS::MapADOType2Jdbc(adUnsignedTinyInt);
- aMap[adUnsignedSmallInt]= ADOS::MapADOType2Jdbc(adUnsignedSmallInt);
- aMap[adUnsignedInt] = ADOS::MapADOType2Jdbc(adUnsignedInt);
- aMap[adUnsignedBigInt] = ADOS::MapADOType2Jdbc(adUnsignedBigInt);
- aMap[adSingle] = ADOS::MapADOType2Jdbc(adSingle);
- aMap[adDouble] = ADOS::MapADOType2Jdbc(adDouble);
- aMap[adCurrency] = ADOS::MapADOType2Jdbc(adCurrency);
- aMap[adDecimal] = ADOS::MapADOType2Jdbc(adDecimal);
- aMap[adNumeric] = ADOS::MapADOType2Jdbc(adNumeric);
- aMap[adBoolean] = ADOS::MapADOType2Jdbc(adBoolean);
- aMap[adError] = ADOS::MapADOType2Jdbc(adError);
- aMap[adUserDefined] = ADOS::MapADOType2Jdbc(adUserDefined);
- aMap[adVariant] = ADOS::MapADOType2Jdbc(adVariant);
- aMap[adIDispatch] = ADOS::MapADOType2Jdbc(adIDispatch);
- aMap[adIUnknown] = ADOS::MapADOType2Jdbc(adIUnknown);
- aMap[adGUID] = ADOS::MapADOType2Jdbc(adGUID);
- aMap[adDate] = ADOS::MapADOType2Jdbc(adDate);
- aMap[adDBDate] = ADOS::MapADOType2Jdbc(adDBDate);
- aMap[adDBTime] = ADOS::MapADOType2Jdbc(adDBTime);
- aMap[adDBTimeStamp] = ADOS::MapADOType2Jdbc(adDBTimeStamp);
- aMap[adBSTR] = ADOS::MapADOType2Jdbc(adBSTR);
- aMap[adChar] = ADOS::MapADOType2Jdbc(adChar);
- aMap[adVarChar] = ADOS::MapADOType2Jdbc(adVarChar);
- aMap[adLongVarChar] = ADOS::MapADOType2Jdbc(adLongVarChar);
- aMap[adWChar] = ADOS::MapADOType2Jdbc(adWChar);
- aMap[adVarWChar] = ADOS::MapADOType2Jdbc(adVarWChar);
- aMap[adLongVarWChar] = ADOS::MapADOType2Jdbc(adLongVarWChar);
- aMap[adBinary] = ADOS::MapADOType2Jdbc(adBinary);
- aMap[adVarBinary] = ADOS::MapADOType2Jdbc(adVarBinary);
- aMap[adLongVarBinary] = ADOS::MapADOType2Jdbc(adLongVarBinary);
- aMap[adChapter] = ADOS::MapADOType2Jdbc(adChapter);
- aMap[adFileTime] = ADOS::MapADOType2Jdbc(adFileTime);
- aMap[adPropVariant] = ADOS::MapADOType2Jdbc(adPropVariant);
- aMap[adVarNumeric] = ADOS::MapADOType2Jdbc(adVarNumeric);
-
- m_aValueRange[12] = aMap;
-
- ::std::map< sal_Int32,::rtl::OUString> aMap2;
- aMap2[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("YES"));
- aMap2[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NO"));
- m_aIntValueRange[18] = aMap2;
-
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
- pMetaData->setColumnsMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setTablesMap()
-{
-
- for(sal_Int32 i=1;i<5;i++)
- m_aColMapping.push_back(i);
- m_aColMapping.push_back(6);
-
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
- pMetaData->setTablesMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setProcedureColumnsMap()
-{
-
- for(sal_Int32 i=1;i<5;i++)
- m_aColMapping.push_back(i);
- m_aColMapping.push_back(6);
- m_aColMapping.push_back(10);
- m_aColMapping.push_back(16);
- m_aColMapping.push_back(13);
- m_aColMapping.push_back(11);
- m_aColMapping.push_back(12);
-
- m_aColMapping.push_back(9);
- m_aColMapping.push_back(14);
-
- TInt2IntMap aMap;
- aMap[DBTYPE_EMPTY] = DataType::SQLNULL;
- aMap[DBTYPE_NULL] = DataType::SQLNULL;
- aMap[DBTYPE_I2] = DataType::SMALLINT;
- aMap[DBTYPE_I4] = DataType::INTEGER;
- aMap[DBTYPE_R4] = DataType::FLOAT;
- aMap[DBTYPE_R8] = DataType::DOUBLE;
- aMap[DBTYPE_CY] = DataType::BIGINT;
- aMap[DBTYPE_DATE] = DataType::DATE;
- aMap[DBTYPE_BSTR] = DataType::VARCHAR;
- aMap[DBTYPE_IDISPATCH] = DataType::OBJECT;
- aMap[DBTYPE_ERROR] = DataType::OTHER;
- aMap[DBTYPE_BOOL] = DataType::BIT;
- aMap[DBTYPE_VARIANT] = DataType::STRUCT;
- aMap[DBTYPE_IUNKNOWN] = DataType::OTHER;
- aMap[DBTYPE_DECIMAL] = DataType::DECIMAL;
- aMap[DBTYPE_UI1] = DataType::TINYINT;
- aMap[DBTYPE_ARRAY] = DataType::ARRAY;
- aMap[DBTYPE_BYREF] = DataType::REF;
- aMap[DBTYPE_I1] = DataType::CHAR;
- aMap[DBTYPE_UI2] = DataType::SMALLINT;
- aMap[DBTYPE_UI4] = DataType::INTEGER;
-
- // aMap[The] = ;
- // aMap[in] = ;
- aMap[DBTYPE_I8] = DataType::BIGINT;
- aMap[DBTYPE_UI8] = DataType::BIGINT;
- aMap[DBTYPE_GUID] = DataType::OTHER;
- aMap[DBTYPE_VECTOR] = DataType::OTHER;
- aMap[DBTYPE_FILETIME] = DataType::OTHER;
- aMap[DBTYPE_RESERVED] = DataType::OTHER;
-
- // aMap[The] = ;
- aMap[DBTYPE_BYTES] = DataType::VARBINARY;
- aMap[DBTYPE_STR] = DataType::LONGVARCHAR;
- aMap[DBTYPE_WSTR] = DataType::LONGVARCHAR;
- aMap[DBTYPE_NUMERIC] = DataType::NUMERIC;
- aMap[DBTYPE_UDT] = DataType::OTHER;
- aMap[DBTYPE_DBDATE] = DataType::DATE;
- aMap[DBTYPE_DBTIME] = DataType::TIME;
- aMap[DBTYPE_DBTIMESTAMP] = DataType::TIMESTAMP;
- aMap[DBTYPE_HCHAPTER] = DataType::OTHER;
- aMap[DBTYPE_PROPVARIANT] = DataType::OTHER;
- aMap[DBTYPE_VARNUMERIC] = DataType::NUMERIC;
-
- m_aValueRange[10] = aMap;
-
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
- pMetaData->setProcedureColumnsMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setPrimaryKeysMap()
-{
-
- sal_Int32 i=1;
- for(;i<5;i++)
- m_aColMapping.push_back(i);
- m_aColMapping.push_back(7);
- m_aColMapping.push_back(8);
-
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
- pMetaData->setProcedureColumnsMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setIndexInfoMap()
-{
-
- sal_Int32 i=1;
- for(;i<4;i++)
- m_aColMapping.push_back(i);
- m_aColMapping.push_back(8);
- m_aColMapping.push_back(4);
- m_aColMapping.push_back(6);
- m_aColMapping.push_back(10);
- m_aColMapping.push_back(17);
- m_aColMapping.push_back(18);
- m_aColMapping.push_back(21);
- m_aColMapping.push_back(22);
- m_aColMapping.push_back(23);
- m_aColMapping.push_back(24);
-
- TInt2IntMap aMap;
- aMap[DBPROPVAL_IT_HASH] = IndexType::HASHED;
- aMap[DBPROPVAL_IT_CONTENT] = IndexType::OTHER;
- aMap[DBPROPVAL_IT_OTHER] = IndexType::OTHER;
- aMap[DBPROPVAL_IT_BTREE] = IndexType::OTHER;
-
- m_aValueRange[10] = aMap;
-
- TInt2IntMap aMap2;
- aMap[0] = 1;
- aMap[1] = 0;
- m_aValueRange[8] = aMap2;
-
- ::std::map< sal_Int32,::rtl::OUString> aMap3;
- aMap3[0] = ::rtl::OUString();
- aMap3[DB_COLLATION_ASC] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("A"));
- aMap3[DB_COLLATION_DESC] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("D"));
-
- m_aIntValueRange[21] = aMap3;
-
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
- pMetaData->setIndexInfoMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setTablePrivilegesMap()
-{
-
- sal_Int32 i=3;
- for(;i<6;i++)
- m_aColMapping.push_back(i);
- m_aColMapping.push_back(1);
- m_aColMapping.push_back(2);
- m_aColMapping.push_back(6);
- m_aColMapping.push_back(7);
-
- ::std::map< sal_Int32,::rtl::OUString> aMap;
- aMap[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("YES"));
- aMap[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NO"));
- m_aIntValueRange[7] = aMap;
-
-
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
- pMetaData->setTablePrivilegesMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setCrossReferenceMap()
-{
-
- sal_Int32 i=1;
- for(;i<5;i++)
- m_aColMapping.push_back(i);
- for(i=7;i<11;i++)
- m_aColMapping.push_back(i);
-
- m_aColMapping.push_back(13);
- m_aColMapping.push_back(14);
- m_aColMapping.push_back(15);
- m_aColMapping.push_back(17);
- m_aColMapping.push_back(16);
- m_aColMapping.push_back(18);
-
- ::std::map< ::rtl::OUString,sal_Int32> aMap;
- aMap[ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CASCADE"))] = KeyRule::CASCADE;
- aMap[ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RESTRICT"))] = KeyRule::RESTRICT;
- aMap[ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SET NULL"))] = KeyRule::SET_NULL;
- aMap[ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SET DEFAULT"))] = KeyRule::SET_DEFAULT;
- aMap[ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NO ACTION"))] = KeyRule::NO_ACTION;
-
- m_aStrValueRange[14] = aMap;
- m_aStrValueRange[15] = aMap;
-
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
- pMetaData->setCrossReferenceMap();
- m_xMetaData = pMetaData;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setTypeInfoMap(sal_Bool _bJetEngine)
-{
- sal_Int32 i=1;
- for(;i<19;i++)
- m_aColMapping.push_back(i);
-
- ::std::map< ::rtl::OUString,sal_Int32> aMap1;
- aMap1[ ::rtl::OUString()] = 10;
-
- m_aStrValueRange[18] = aMap1;
-
- TInt2IntMap aMap;
- aMap[adEmpty] = ADOS::MapADOType2Jdbc(adEmpty);
- aMap[adTinyInt] = ADOS::MapADOType2Jdbc(adTinyInt);
- aMap[adSmallInt] = ADOS::MapADOType2Jdbc(adSmallInt);
- aMap[adInteger] = ADOS::MapADOType2Jdbc(adInteger);
- aMap[adBigInt] = ADOS::MapADOType2Jdbc(adBigInt);
- aMap[adUnsignedTinyInt] = ADOS::MapADOType2Jdbc(adUnsignedTinyInt);
- aMap[adUnsignedSmallInt]= ADOS::MapADOType2Jdbc(adUnsignedSmallInt);
- aMap[adUnsignedInt] = ADOS::MapADOType2Jdbc(adUnsignedInt);
- aMap[adUnsignedBigInt] = ADOS::MapADOType2Jdbc(adUnsignedBigInt);
- aMap[adSingle] = ADOS::MapADOType2Jdbc(adSingle);
- aMap[adDouble] = ADOS::MapADOType2Jdbc(adDouble);
- aMap[adCurrency] = ADOS::MapADOType2Jdbc(adCurrency);
- aMap[adDecimal] = ADOS::MapADOType2Jdbc(adDecimal);
- aMap[adNumeric] = ADOS::MapADOType2Jdbc(adNumeric);
- aMap[adBoolean] = ADOS::MapADOType2Jdbc(adBoolean);
- aMap[adError] = ADOS::MapADOType2Jdbc(adError);
- aMap[adUserDefined] = ADOS::MapADOType2Jdbc(adUserDefined);
- aMap[adVariant] = ADOS::MapADOType2Jdbc(adVariant);
- aMap[adIDispatch] = ADOS::MapADOType2Jdbc(adIDispatch);
- aMap[adIUnknown] = ADOS::MapADOType2Jdbc(adIUnknown);
- aMap[adGUID] = ADOS::MapADOType2Jdbc(adGUID);
- aMap[adDate] = _bJetEngine ? ADOS::MapADOType2Jdbc(adDBTimeStamp) : ADOS::MapADOType2Jdbc(adDate);
- aMap[adDBDate] = ADOS::MapADOType2Jdbc(adDBDate);
- aMap[adDBTime] = ADOS::MapADOType2Jdbc(adDBTime);
- aMap[adDBTimeStamp] = ADOS::MapADOType2Jdbc(adDBTimeStamp);
- aMap[adBSTR] = ADOS::MapADOType2Jdbc(adBSTR);
- aMap[adChar] = ADOS::MapADOType2Jdbc(adChar);
- aMap[adVarChar] = ADOS::MapADOType2Jdbc(adVarChar);
- aMap[adLongVarChar] = ADOS::MapADOType2Jdbc(adLongVarChar);
- aMap[adWChar] = ADOS::MapADOType2Jdbc(adWChar);
- aMap[adVarWChar] = ADOS::MapADOType2Jdbc(adVarWChar);
- aMap[adLongVarWChar] = ADOS::MapADOType2Jdbc(adLongVarWChar);
- aMap[adBinary] = ADOS::MapADOType2Jdbc(adBinary);
- aMap[adVarBinary] = ADOS::MapADOType2Jdbc(adVarBinary);
- aMap[adLongVarBinary] = ADOS::MapADOType2Jdbc(adLongVarBinary);
- aMap[adChapter] = ADOS::MapADOType2Jdbc(adChapter);
- aMap[adFileTime] = ADOS::MapADOType2Jdbc(adFileTime);
- aMap[adPropVariant] = ADOS::MapADOType2Jdbc(adPropVariant);
- aMap[adVarNumeric] = ADOS::MapADOType2Jdbc(adVarNumeric);
-// aMap[adArray] = ADOS::MapADOType2Jdbc(adArray);
-
- m_aValueRange[2] = aMap;
-
- TInt2IntMap aColumnValueMapping;
- aColumnValueMapping[VARIANT_FALSE] = ColumnValue::NO_NULLS;
- aColumnValueMapping[VARIANT_TRUE] = ColumnValue::NULLABLE;
- m_aValueRange[7] = aColumnValueMapping;
-
- // now adjust the column mapping
- // OJ 24.01.2002 96860
- TInt2IntMap aSerachMapping;
- aSerachMapping[DB_UNSEARCHABLE] = ColumnSearch::NONE;
- aSerachMapping[DB_LIKE_ONLY] = ColumnSearch::CHAR;
- aSerachMapping[DB_ALL_EXCEPT_LIKE] = ColumnSearch::BASIC;
- aSerachMapping[DB_SEARCHABLE] = ColumnSearch::FULL;
-
- m_aValueRange[9] = aSerachMapping;
-
- TInt2IntMap aCurrencyMapping;
- m_aValueRange[11] = aCurrencyMapping;
-
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
- pMetaData->setTypeInfoMap();
- m_xMetaData = pMetaData;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::acquire() throw()
-{
- ODatabaseMetaDataResultSet_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::release() throw()
-{
- ODatabaseMetaDataResultSet_BASE::release();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL ODatabaseMetaDataResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-OLEVariant ODatabaseMetaDataResultSet::getValue(sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
-
- checkRecordSet();
-
- WpADOField aField = ADOS::getField(m_pRecordSet,columnIndex);
- aField.get_Value(m_aValue);
- return m_aValue;
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx
deleted file mode 100644
index e39ea65ead..0000000000
--- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx
+++ /dev/null
@@ -1,235 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/ADatabaseMetaDataResultSetMetaData.hxx"
-#include "ado/Awrapado.hxx"
-#include "connectivity/dbexception.hxx"
-
-
-using namespace connectivity;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-
-// -------------------------------------------------------------------------
-ODatabaseMetaDataResultSetMetaData::~ODatabaseMetaDataResultSetMetaData()
-{
- if(m_pRecordSet)
- m_pRecordSet->Release();
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nSize = 0;
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- nSize = (*m_mColumnsIter).second.getColumnDisplaySize();
- else if(m_pRecordSet)
- {
- WpADOField aField = ADOS::getField(m_pRecordSet,m_vMapping[column]);
- if(aField.IsValid())
- nSize = aField.GetActualSize();
- }
- return nSize;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nType = 0;
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- nType = (*m_mColumnsIter).second.getColumnType();
- else if(m_pRecordSet)
- {
- WpADOField aField = ADOS::getField(m_pRecordSet,m_vMapping[column]);
- nType = ADOS::MapADOType2Jdbc(aField.GetADOType());
- }
- return nType;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnCount( ) throw(SQLException, RuntimeException)
-{
- if(!m_pRecordSet)
- return 0;
- if(m_nColCount != -1)
- return m_nColCount;
-
- if(m_vMapping.size())
- return m_mColumns.size();
-
- ADOFields* pFields = NULL;
- m_pRecordSet->get_Fields(&pFields);
- WpOLEAppendCollection<ADOFields, ADOField, WpADOField> aFields(pFields);
- m_nColCount = aFields.GetItemCount();
- return m_nColCount;
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getColumnName();
- if(!m_pRecordSet)
- return ::rtl::OUString();
- WpADOField aField = ADOS::getField(m_pRecordSet,m_vMapping[column]);
- if(aField.IsValid())
- return aField.GetName();
-
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnLabel( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getColumnLabel();
- return getColumnName(column);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isCurrency( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isCurrency();
- if(!m_pRecordSet)
- return 0;
- WpADOField aField = ADOS::getField(m_pRecordSet,m_vMapping[column]);
- if(aField.IsValid())
- {
- return (aField.GetAttributes() & adFldFixed) == adFldFixed;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isSigned( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isSigned();
- if(!m_pRecordSet)
- return 0;
- WpADOField aField = ADOS::getField(m_pRecordSet,m_vMapping[column]);
- if(aField.IsValid())
- {
- return (aField.GetAttributes() & adFldNegativeScale) == adFldNegativeScale;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getPrecision( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getPrecision();
- if(!m_pRecordSet)
- return 0;
- WpADOField aField = ADOS::getField(m_pRecordSet,m_vMapping[column]);
- if(aField.IsValid())
- return aField.GetPrecision();
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.getScale();
-
- if(!m_pRecordSet)
- return 0;
-
- WpADOField aField = ADOS::getField(m_pRecordSet,m_vMapping[column]);
- if(aField.IsValid())
- return aField.GetNumericScale();
- return 0;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isNullable();
-
- if(!m_pRecordSet)
- return 0;
-
- WpADOField aField = ADOS::getField(m_pRecordSet,m_vMapping[column]);
- if(aField.IsValid())
- {
- return (aField.GetAttributes() & adFldIsNullable) == adFldIsNullable;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isReadOnly( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isReadOnly();
-
- if(!m_pRecordSet)
- return 0;
-
- WpADOField aField = ADOS::getField(m_pRecordSet,m_vMapping[column]);
- if(aField.IsValid())
- {
- // return (aField.GetStatus() & adFieldReadOnly) == adFieldReadOnly;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isDefinitelyWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isDefinitelyWritable();
-
- if(!m_pRecordSet)
- return 0;
-
- WpADOField aField = ADOS::getField(m_pRecordSet,m_vMapping[column]);
- if(aField.IsValid())
- {
- return (aField.GetAttributes() & adFldUpdatable) == adFldUpdatable;
- }
- return sal_False;
-;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
- return (*m_mColumnsIter).second.isWritable();
- return isDefinitelyWritable(column);
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx
deleted file mode 100644
index d209629020..0000000000
--- a/connectivity/source/drivers/ado/ADriver.cxx
+++ /dev/null
@@ -1,306 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define _WIN32_WINNT 0x0501
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/ADriver.hxx"
-#include "ado/AConnection.hxx"
-#include "ado/Awrapadox.hxx"
-#include "ado/ACatalog.hxx"
-#include "ado/Awrapado.hxx"
-#include "ado/adoimp.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/dbexception.hxx"
-#include "resource/ado_res.hrc"
-#include <objbase.h>
-
-
-#include "resource/sharedresources.hxx"
-
-using namespace connectivity;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::lang;
-
-// --------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------
-ODriver::ODriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB)
- : ODriver_BASE(m_aMutex)
- ,m_xORB(_xORB)
-{
- if ( FAILED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)) )
- {
- CoUninitialize();
- int h = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
- (void)h;
- ++h;
- }
-}
-// -------------------------------------------------------------------------
-ODriver::~ODriver()
-{
- CoUninitialize();
- CoInitialize(NULL);
-}
-//------------------------------------------------------------------------------
-void ODriver::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
-
- for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
- {
- Reference< XComponent > xComp(i->get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- }
- m_xConnections.clear();
-
- ODriver_BASE::disposing();
-}
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString ODriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdbc.ado.ODriver"));
-}
-//------------------------------------------------------------------------------
-Sequence< ::rtl::OUString > ODriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
-{
- Sequence< ::rtl::OUString > aSNS( 2 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"));
- aSNS[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Driver"));
- return aSNS;
-}
-//------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL connectivity::ado::ODriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
-{
- return *(new ODriver(_rxFactory));
-}
-
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL ODriver::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-
-// --------------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL ODriver::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-
-// --------------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL ODriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- if ( ! acceptsURL(url) )
- return NULL;
-
- OConnection* pCon = new OConnection(this);
- pCon->construct(url,info);
- Reference< XConnection > xCon = pCon;
- m_xConnections.push_back(WeakReferenceHelper(*pCon));
-
- return xCon;
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL ODriver::acceptsURL( const ::rtl::OUString& url )
- throw(SQLException, RuntimeException)
-{
- return (!url.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:ado:")),9));
-}
-// -----------------------------------------------------------------------------
-void ODriver::impl_checkURL_throw(const ::rtl::OUString& _sUrl)
-{
- if ( !acceptsURL(_sUrl) )
- {
- SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- } // if ( !acceptsURL(_sUrl) )
-}
-// --------------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL ODriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException)
-{
- impl_checkURL_throw(url);
- if ( acceptsURL(url) )
- {
- ::std::vector< DriverPropertyInfo > aDriverInfo;
-
- Sequence< ::rtl::OUString > aBooleanValues(2);
- aBooleanValues[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) );
- aBooleanValues[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) );
-
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IgnoreDriverPrivileges"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Ignore the privileges from the database driver."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EscapeDateTime"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Escape date time format."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TypeInfoSettings"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Defines how the type info of the database metadata should be manipulated."))
- ,sal_False
- ,::rtl::OUString( )
- ,Sequence< ::rtl::OUString > ())
- );
- return Sequence< DriverPropertyInfo >(&aDriverInfo[0],aDriverInfo.size());
- }
- return Sequence< DriverPropertyInfo >();
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODriver::getMajorVersion( ) throw(RuntimeException)
-{
- return 1;
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODriver::getMinorVersion( ) throw(RuntimeException)
-{
- return 0;
-}
-// --------------------------------------------------------------------------------
-// XDataDefinitionSupplier
-Reference< XTablesSupplier > SAL_CALL ODriver::getDataDefinitionByConnection( const Reference< ::com::sun::star::sdbc::XConnection >& connection ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- OConnection* pConnection = NULL;
- Reference< ::com::sun::star::lang::XUnoTunnel> xTunnel(connection,UNO_QUERY);
- if(xTunnel.is())
- {
- OConnection* pSearchConnection = reinterpret_cast< OConnection* >( xTunnel->getSomething(OConnection::getUnoTunnelImplementationId()) );
-
- for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
- {
- if ((OConnection*) Reference< XConnection >::query(i->get().get()).get() == pSearchConnection)
- {
- pConnection = pSearchConnection;
- break;
- }
- }
-
- }
-
- Reference< XTablesSupplier > xTab = NULL;
- if(pConnection)
- {
- WpADOCatalog aCatalog;
- aCatalog.Create();
- if(aCatalog.IsValid())
- {
- aCatalog.putref_ActiveConnection(*pConnection->getConnection());
- OCatalog* pCatalog = new OCatalog(aCatalog,pConnection);
- xTab = pCatalog;
- pConnection->setCatalog(xTab);
- pConnection->setCatalog(pCatalog);
- }
- }
- return xTab;
-}
-// --------------------------------------------------------------------------------
-Reference< XTablesSupplier > SAL_CALL ODriver::getDataDefinitionByURL( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- impl_checkURL_throw(url);
- return getDataDefinitionByConnection(connect(url,info));
-}
-
-// -----------------------------------------------------------------------------
-void ADOS::ThrowException(ADOConnection* _pAdoCon,const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
-{
- ADOErrors *pErrors = NULL;
- _pAdoCon->get_Errors(&pErrors);
- if(!pErrors)
- return; // no error found
-
- pErrors->AddRef( );
-
- // read all noted errors and issue them
- sal_Int32 nLen;
- pErrors->get_Count(&nLen);
- if (nLen)
- {
- ::rtl::OUString sError;
- ::rtl::OUString aSQLState;
- SQLException aException;
- aException.ErrorCode = 1000;
- for (sal_Int32 i = nLen-1; i>=0; --i)
- {
- ADOError *pError = NULL;
- pErrors->get_Item(OLEVariant(i),&pError);
- WpADOError aErr(pError);
- OSL_ENSURE(pError,"No error in collection found! BAD!");
- if(pError)
- {
- if(i==nLen-1)
- aException = SQLException(aErr.GetDescription(),_xInterface,aErr.GetSQLState(),aErr.GetNumber(),Any());
- else
- {
- SQLException aTemp = SQLException(aErr.GetDescription(),
- _xInterface,aErr.GetSQLState(),aErr.GetNumber(),makeAny(aException));
- aTemp.NextException <<= aException;
- aException = aTemp;
- }
- }
- }
- pErrors->Clear();
- pErrors->Release();
- throw aException;
- }
- pErrors->Release();
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AGroup.cxx b/connectivity/source/drivers/ado/AGroup.cxx
deleted file mode 100644
index d02204b1ec..0000000000
--- a/connectivity/source/drivers/ado/AGroup.cxx
+++ /dev/null
@@ -1,190 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "ado/AGroup.hxx"
-#include "ado/AUsers.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "ado/AConnection.hxx"
-#include "TConnection.hxx"
-
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-
-// -------------------------------------------------------------------------
-void WpADOGroup::Create()
-{
- HRESULT hr = -1;
- ADOGroup* pGroup = NULL;
- hr = CoCreateInstance(ADOS::CLSID_ADOGROUP_25,
- NULL,
- CLSCTX_INPROC_SERVER,
- ADOS::IID_ADOGROUP_25,
- (void**)&pGroup );
-
-
- if( !FAILED( hr ) )
- {
- operator=( pGroup );
- pGroup->Release();
- }
-}
-// -------------------------------------------------------------------------
-OAdoGroup::OAdoGroup(OCatalog* _pParent,sal_Bool _bCase, ADOGroup* _pGroup) : OGroup_ADO(_bCase),m_pCatalog(_pParent)
-{
- construct();
- if(_pGroup)
- m_aGroup = WpADOGroup(_pGroup);
- else
- m_aGroup.Create();
-
-}
-// -------------------------------------------------------------------------
-OAdoGroup::OAdoGroup(OCatalog* _pParent,sal_Bool _bCase, const ::rtl::OUString& _Name) : OGroup_ADO(_Name,_bCase),m_pCatalog(_pParent)
-{
- construct();
- m_aGroup.Create();
- m_aGroup.put_Name(_Name);
-}
-// -------------------------------------------------------------------------
-void OAdoGroup::refreshUsers()
-{
- TStringVector aVector;
-
- WpADOUsers aUsers = m_aGroup.get_Users();
- aUsers.fillElementNames(aVector);
-
- if(m_pUsers)
- m_pUsers->reFill(aVector);
- else
- m_pUsers = new OUsers(m_pCatalog,m_aMutex,aVector,aUsers,isCaseSensitive());
-}
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > OAdoGroup::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OAdoGroup::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OGroup_ADO::getSomething(rId);
-}
-
-// -------------------------------------------------------------------------
-void OAdoGroup::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)throw (Exception)
-{
- if(m_aGroup.IsValid())
- {
-
- switch(nHandle)
- {
- case PROPERTY_ID_NAME:
- {
- ::rtl::OUString aVal;
- rValue >>= aVal;
- m_aGroup.put_Name(aVal);
- }
- break;
- }
- }
-}
-// -------------------------------------------------------------------------
-void OAdoGroup::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
-{
- if(m_aGroup.IsValid())
- {
- switch(nHandle)
- {
- case PROPERTY_ID_NAME:
- rValue <<= m_aGroup.get_Name();
- break;
- }
- }
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OAdoGroup::getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- return MapRight(m_aGroup.GetPermissions(objName,MapObjectType(objType)));
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OAdoGroup::getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- RightsEnum eNum = m_aGroup.GetPermissions(objName,MapObjectType(objType));
- if(eNum & adRightWithGrant)
- return MapRight(eNum);
- return 0;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OAdoGroup::grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- m_aGroup.SetPermissions(objName,MapObjectType(objType),adAccessGrant,Map2Right(objPrivileges));
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OAdoGroup::revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- m_aGroup.SetPermissions(objName,MapObjectType(objType),adAccessDeny,Map2Right(objPrivileges));
-}
-
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoGroup::acquire() throw()
-{
- OGroup_ADO::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoGroup::release() throw()
-{
- OGroup_ADO::release();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AGroups.cxx b/connectivity/source/drivers/ado/AGroups.cxx
deleted file mode 100644
index 269a315daa..0000000000
--- a/connectivity/source/drivers/ado/AGroups.cxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AGroups.hxx"
-#include "ado/AGroup.hxx"
-#include "ado/ATable.hxx"
-#include "ado/AConnection.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "connectivity/sdbcx/IRefreshable.hxx"
-#include "TConnection.hxx"
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-#include "resource/ado_res.hrc"
-
-using namespace comphelper;
-using namespace connectivity;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::container;
-
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-// -------------------------------------------------------------------------
-sdbcx::ObjectType OGroups::createObject(const ::rtl::OUString& _rName)
-{
- return new OAdoGroup(m_pCatalog,isCaseSensitive(),_rName);
-}
-// -------------------------------------------------------------------------
-void OGroups::impl_refresh() throw(RuntimeException)
-{
- m_aCollection.Refresh();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OGroups::createDescriptor()
-{
- return new OAdoGroup(m_pCatalog,isCaseSensitive());
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OGroups::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- OAdoGroup* pGroup = NULL;
- if ( !getImplementation(pGroup,descriptor) || pGroup == NULL )
- m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_GROUP_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
-
- m_aCollection.Append( pGroup->getImpl() );
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OGroups::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- m_aCollection.Delete(_sElementName);
-}
-// -----------------------------------------------------------------------------
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AIndex.cxx b/connectivity/source/drivers/ado/AIndex.cxx
deleted file mode 100644
index 906d03fb23..0000000000
--- a/connectivity/source/drivers/ado/AIndex.cxx
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AIndex.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include "ado/AColumns.hxx"
-#include <comphelper/extract.hxx>
-#include "TConnection.hxx"
-#include <comphelper/types.hxx>
-
-using namespace ::comphelper;
-
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-
-// -------------------------------------------------------------------------
-OAdoIndex::OAdoIndex(sal_Bool _bCase,OConnection* _pConnection,ADOIndex* _pIndex)
- : OIndex_ADO(::rtl::OUString(),::rtl::OUString(),sal_False,sal_False,sal_False,_bCase)
- ,m_pConnection(_pConnection)
-{
- construct();
- m_aIndex = WpADOIndex(_pIndex);
- fillPropertyValues();
-}
-// -------------------------------------------------------------------------
-OAdoIndex::OAdoIndex(sal_Bool _bCase,OConnection* _pConnection)
- : OIndex_ADO(_bCase)
- ,m_pConnection(_pConnection)
-{
- construct();
- m_aIndex.Create();
-}
-
-// -------------------------------------------------------------------------
-
-void OAdoIndex::refreshColumns()
-{
- TStringVector aVector;
-
- WpADOColumns aColumns;
- if ( m_aIndex.IsValid() )
- {
- aColumns = m_aIndex.get_Columns();
- aColumns.fillElementNames(aVector);
- }
-
- if ( m_pColumns )
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection);
-}
-
-// -------------------------------------------------------------------------
-Sequence< sal_Int8 > OAdoIndex::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OAdoIndex::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OIndex_ADO::getSomething(rId);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OAdoIndex::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)throw (Exception)
-{
- if(m_aIndex.IsValid())
- {
- switch(nHandle)
- {
- case PROPERTY_ID_NAME:
- {
- ::rtl::OUString aVal;
- rValue >>= aVal;
- m_aIndex.put_Name(aVal);
- }
- break;
- case PROPERTY_ID_CATALOG:
- {
- ::rtl::OUString aVal;
- rValue >>= aVal;
- m_aIndex.put_Name(aVal);
- }
- break;
- case PROPERTY_ID_ISUNIQUE:
- m_aIndex.put_Unique(getBOOL(rValue));
- break;
- case PROPERTY_ID_ISPRIMARYKEYINDEX:
- m_aIndex.put_PrimaryKey(getBOOL(rValue));
- break;
- case PROPERTY_ID_ISCLUSTERED:
- m_aIndex.put_Clustered(getBOOL(rValue));
- break;
- }
- }
- OIndex_ADO::setFastPropertyValue_NoBroadcast(nHandle,rValue);
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoIndex::acquire() throw()
-{
- OIndex_ADO::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoIndex::release() throw()
-{
- OIndex_ADO::release();
-}
-// -----------------------------------------------------------------------------
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AIndexes.cxx b/connectivity/source/drivers/ado/AIndexes.cxx
deleted file mode 100644
index 7b645e6223..0000000000
--- a/connectivity/source/drivers/ado/AIndexes.cxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AIndexes.hxx"
-#include "ado/AIndex.hxx"
-#include "ado/AConnection.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/IndexType.hpp>
-#include "TConnection.hxx"
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-#include "resource/ado_res.hrc"
-using namespace ::comphelper;
-
-
-using namespace connectivity;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::container;
-
-sdbcx::ObjectType OIndexes::createObject(const ::rtl::OUString& _rName)
-{
- return new OAdoIndex(isCaseSensitive(),m_pConnection,m_aCollection.GetItem(_rName));
-}
-// -------------------------------------------------------------------------
-void OIndexes::impl_refresh() throw(RuntimeException)
-{
- m_aCollection.Refresh();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OIndexes::createDescriptor()
-{
- return new OAdoIndex(isCaseSensitive(),m_pConnection);
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OIndexes::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- OAdoIndex* pIndex = NULL;
- if ( !getImplementation(pIndex,descriptor) || pIndex == NULL )
- m_pConnection->throwGenericSQLException( STR_INVALID_INDEX_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
-
- ADOIndexes* pIndexes = m_aCollection;
- if ( FAILED( pIndexes->Append( OLEVariant( _rForName ), OLEVariant( pIndex->getImpl() ) ) ) )
- {
- ADOS::ThrowException(*m_pConnection->getConnection(),static_cast<XTypeProvider*>(this));
- m_pConnection->throwGenericSQLException( STR_INVALID_INDEX_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
- }
-
- return new OAdoIndex(isCaseSensitive(),m_pConnection,pIndex->getImpl());
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OIndexes::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- m_aCollection.Delete(_sElementName);
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AKey.cxx b/connectivity/source/drivers/ado/AKey.cxx
deleted file mode 100644
index 6407881fd4..0000000000
--- a/connectivity/source/drivers/ado/AKey.cxx
+++ /dev/null
@@ -1,169 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AKey.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include "ado/AColumns.hxx"
-#include "ado/AConnection.hxx"
-
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-
-// -------------------------------------------------------------------------
-OAdoKey::OAdoKey(sal_Bool _bCase,OConnection* _pConnection, ADOKey* _pKey)
- : OKey_ADO(_bCase)
- ,m_pConnection(_pConnection)
-{
- construct();
- m_aKey = WpADOKey(_pKey);
- fillPropertyValues();
-}
-// -------------------------------------------------------------------------
-OAdoKey::OAdoKey(sal_Bool _bCase,OConnection* _pConnection)
- : OKey_ADO(_bCase)
- ,m_pConnection(_pConnection)
-{
- construct();
- m_aKey.Create();
-}
-// -------------------------------------------------------------------------
-void OAdoKey::refreshColumns()
-{
- TStringVector aVector;
-
- WpADOColumns aColumns;
- if ( m_aKey.IsValid() )
- {
- aColumns = m_aKey.get_Columns();
- aColumns.fillElementNames(aVector);
- }
-
- if(m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection);
-}
-// -------------------------------------------------------------------------
-Sequence< sal_Int8 > OAdoKey::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OAdoKey::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OKey_ADO::getSomething(rId);
-}
-// -------------------------------------------------------------------------
-void OAdoKey::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)throw (Exception)
-{
- if(m_aKey.IsValid())
- {
- switch(nHandle)
- {
- case PROPERTY_ID_NAME:
- {
- ::rtl::OUString aVal;
- rValue >>= aVal;
- m_aKey.put_Name(aVal);
- ADOS::ThrowException(*m_pConnection->getConnection(),*this);
- }
- break;
- case PROPERTY_ID_TYPE:
- {
- sal_Int32 nVal=0;
- rValue >>= nVal;
- m_aKey.put_Type(Map2KeyRule(nVal));
- ADOS::ThrowException(*m_pConnection->getConnection(),*this);
- }
- break;
- case PROPERTY_ID_REFERENCEDTABLE:
- {
- ::rtl::OUString aVal;
- rValue >>= aVal;
- m_aKey.put_RelatedTable(aVal);
- ADOS::ThrowException(*m_pConnection->getConnection(),*this);
- }
- break;
- case PROPERTY_ID_UPDATERULE:
- {
- sal_Int32 nVal=0;
- rValue >>= nVal;
- m_aKey.put_UpdateRule(Map2Rule(nVal));
- ADOS::ThrowException(*m_pConnection->getConnection(),*this);
- }
- break;
- case PROPERTY_ID_DELETERULE:
- {
- sal_Int32 nVal=0;
- rValue >>= nVal;
- m_aKey.put_DeleteRule(Map2Rule(nVal));
- ADOS::ThrowException(*m_pConnection->getConnection(),*this);
- }
- break;
- }
- }
- OKey_ADO::setFastPropertyValue_NoBroadcast(nHandle,rValue);
-}
-// -------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoKey::acquire() throw()
-{
- OKey_ADO::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoKey::release() throw()
-{
- OKey_ADO::release();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AKeyColumn.cxx b/connectivity/source/drivers/ado/AKeyColumn.cxx
deleted file mode 100644
index ff0bb3cafd..0000000000
--- a/connectivity/source/drivers/ado/AKeyColumn.cxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "adabas/BKeyColumn.hxx"
-
-using namespace connectivity::adabas;
-namespace starbeans = ::com::sun::star::beans;
-// -------------------------------------------------------------------------
-OKeyColumn::OKeyColumn() : OColumn()
-{
- construct();
-}
-// -------------------------------------------------------------------------
-OKeyColumn::OKeyColumn( const ::rtl::OUString& _ReferencedColumn,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _TypeName,
- const ::rtl::OUString& _DefaultValue,
- sal_Int32 _IsNullable,
- sal_Int32 _Precision,
- sal_Int32 _Scale,
- sal_Int32 _Type,
- sal_Bool _IsAutoIncrement
- ) : OColumn(_Name,
- _TypeName,
- _DefaultValue,
- _IsNullable,
- _Precision,
- _Scale,
- _Type,
- _IsAutoIncrement)
- , m_ReferencedColumn(_ReferencedColumn)
-{
- construct();
-}
-
-// -------------------------------------------------------------------------
-void OKeyColumn::construct()
-{
- sal_Int32 nAttrib = isNew() ? 0 : starbeans::PropertyAttribute::READONLY;
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RELATEDCOLUMN), PROPERTY_ID_RELATEDCOLUMN, nAttrib,&m_ReferencedColumn, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AKeyColumns.cxx b/connectivity/source/drivers/ado/AKeyColumns.cxx
deleted file mode 100644
index f7449bf1a3..0000000000
--- a/connectivity/source/drivers/ado/AKeyColumns.cxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "adabas/BKeyColumns.hxx"
-#include "adabas/BKeyColumn.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include "adabas/BTable.hxx"
-
-using namespace connectivity::adabas;
-// -------------------------------------------------------------------------
-sdbcx::ObjectType OKeyColumns::createObject(const ::rtl::OUString& _rName)
-{
-
- Reference< starsdbc::XResultSet >
- xResult = m_pTable->getConnection()->getMetaData()->getImportedKeys(Any(),
- m_pTable->getSchema(),m_pTable->getName());
-
- ::rtl::OUString aRefColumnName;
- if(xResult.is())
- {
- Reference< starsdbc::XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- {
- if(xRow->getString(8) == _rName)
- {
- aRefColumnName = xRow->getString(4);
- break;
- }
- }
- }
-
- xResult = m_pTable->getConnection()->getMetaData()->getColumns(Any(),
- m_pTable->getSchema(),m_pTable->getName(),_rName);
-
- sdbcx::ObjectType xRet = NULL;
- if(xResult.is())
- {
- Reference< starsdbc::XRow > xRow(xResult,UNO_QUERY);
- if(xResult->next())
- {
- if(xRow->getString(4) == _rName)
- {
- OKeyColumn* pRet = new OKeyColumn(aRefColumnName,
- _rName,
- xRow->getString(6),
- xRow->getString(13),
- xRow->getInt(11),
- xRow->getInt(7),
- xRow->getInt(9),
- xRow->getInt(5),
- sal_False);
- xRet = pRet;
- }
- }
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OKeyColumns::createDescriptor()
-{
- OKeyColumn* pNew = new OKeyColumn();
- return pNew;
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AKeys.cxx b/connectivity/source/drivers/ado/AKeys.cxx
deleted file mode 100644
index cfdd4a82d8..0000000000
--- a/connectivity/source/drivers/ado/AKeys.cxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AKeys.hxx"
-#include "ado/AKey.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include "ado/AConnection.hxx"
-#include <comphelper/types.hxx>
-#include "ado/Awrapado.hxx"
-#include <comphelper/property.hxx>
-#include <connectivity/dbexception.hxx>
-#include "resource/ado_res.hrc"
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-
-sdbcx::ObjectType OKeys::createObject(const ::rtl::OUString& _rName)
-{
- return new OAdoKey(isCaseSensitive(),m_pConnection,m_aCollection.GetItem(_rName));
-}
-// -------------------------------------------------------------------------
-void OKeys::impl_refresh() throw(RuntimeException)
-{
- m_aCollection.Refresh();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OKeys::createDescriptor()
-{
- return new OAdoKey(isCaseSensitive(),m_pConnection);
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OKeys::appendObject( const ::rtl::OUString&, const Reference< XPropertySet >& descriptor )
-{
- OAdoKey* pKey = NULL;
- if ( !getImplementation( pKey, descriptor ) || pKey == NULL)
- m_pConnection->throwGenericSQLException( STR_INVALID_KEY_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
-
- // To pass as column parameter to Key's Apppend method
- OLEVariant vOptional;
- vOptional.setNoArg();
-
-#if OSL_DEBUG_LEVEL > 0
- KeyTypeEnum eKey =
-#endif
- OAdoKey::Map2KeyRule(getINT32(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))));
-#if OSL_DEBUG_LEVEL > 0
- (void)eKey;
-#endif
-
- WpADOKey aKey = pKey->getImpl();
- ::rtl::OUString sName = aKey.get_Name();
- if(!sName.getLength())
- aKey.put_Name(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrimaryKey")) );
-
- ADOKeys* pKeys = m_aCollection;
- if ( FAILED(pKeys->Append(OLEVariant((ADOKey*)aKey),
- adKeyPrimary, // must be every time adKeyPrimary
- vOptional)) )
- {
- ADOS::ThrowException(*m_pConnection->getConnection(),static_cast<XTypeProvider*>(this));
- // just make sure that an SQLExceptionis thrown here
- m_pConnection->throwGenericSQLException( STR_INVALID_KEY_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
- }
-
- return new OAdoKey(isCaseSensitive(),m_pConnection,pKey->getImpl());
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OKeys::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- if(!m_aCollection.Delete(OLEVariant(_sElementName)))
- ADOS::ThrowException(*m_pConnection->getConnection(),static_cast<XTypeProvider*>(this));
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/APreparedStatement.cxx b/connectivity/source/drivers/ado/APreparedStatement.cxx
deleted file mode 100644
index eabdef9430..0000000000
--- a/connectivity/source/drivers/ado/APreparedStatement.cxx
+++ /dev/null
@@ -1,566 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/sqlparse.hxx"
-#include "ado/APreparedStatement.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include "ado/AResultSetMetaData.hxx"
-#include "ado/AResultSet.hxx"
-#include "ado/ADriver.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include "connectivity/dbexception.hxx"
-#include "connectivity/dbtools.hxx"
-#include "resource/ado_res.hrc"
-
-#include <limits>
-
-#define CHECK_RETURN(x) \
- if(!x) \
- ADOS::ThrowException(*m_pConnection->getConnection(),*this);
-
-#ifdef max
-# undef max
-#endif
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-using namespace connectivity::ado;
-using namespace connectivity;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::util;
-
-
-IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbcx.APreparedStatement","com.sun.star.sdbc.PreparedStatement");
-
-OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const OTypeInfoMap& _TypeInfo,const ::rtl::OUString& sql)
- : OStatement_Base( _pConnection )
- ,m_aTypeInfo(_TypeInfo)
-{
- osl_incrementInterlockedCount( &m_refCount );
-
- OSQLParser aParser(_pConnection->getDriver()->getORB());
- ::rtl::OUString sErrorMessage;
- ::rtl::OUString sNewSql;
- OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,sql);
- if(pNode)
- { // special handling for parameters
- /* we recusive replace all occurrences of ? in the statement and replace them with name like "æ¬å" */
- sal_Int32 nParameterCount = 0;
- ::rtl::OUString sDefaultName( RTL_CONSTASCII_USTRINGPARAM( "parame" ));
- replaceParameterNodeName(pNode,sDefaultName,nParameterCount);
- pNode->parseNodeToStr( sNewSql, _pConnection );
- delete pNode;
- }
- else
- sNewSql = sql;
- CHECK_RETURN(m_Command.put_CommandText(sNewSql))
- CHECK_RETURN(m_Command.put_Prepared(VARIANT_TRUE))
- m_pParameters = m_Command.get_Parameters();
- m_pParameters->AddRef();
- m_pParameters->Refresh();
-
- osl_decrementInterlockedCount( &m_refCount );
-}
-
-// -------------------------------------------------------------------------
-OPreparedStatement::~OPreparedStatement()
-{
- if (m_pParameters)
- {
- OSL_FAIL( "OPreparedStatement::~OPreparedStatement: not disposed!" );
- m_pParameters->Release();
- m_pParameters = NULL;
- }
-}
-
-// -------------------------------------------------------------------------
-
-Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OStatement_Base::queryInterface(rType);
- return aRet.hasValue() ? aRet : ::cppu::queryInterface( rType,
- static_cast< XPreparedStatement*>(this),
- static_cast< XParameters*>(this),
- static_cast< XPreparedBatchExecution*>(this),
- static_cast< XResultSetMetaDataSupplier*>(this));
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL OPreparedStatement::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const ::com::sun::star::uno::Reference< XPreparedStatement > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< XParameters > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< XResultSetMetaDataSupplier > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< XPreparedBatchExecution > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_Base::getTypes());
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) throw(SQLException, RuntimeException)
-{
- if(!m_xMetaData.is() && m_RecordSet.IsValid())
- m_xMetaData = new OResultSetMetaData(m_RecordSet);
- return m_xMetaData;
-}
-// -------------------------------------------------------------------------
-void OPreparedStatement::disposing()
-{
-m_xMetaData.clear();
- if (m_pParameters)
- {
- m_pParameters->Release();
- m_pParameters = NULL;
- }
- OStatement_Base::disposing();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException)
-{
-
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- SQLWarning warning;
-
- // Reset warnings
-
- clearWarnings ();
-
- // Reset the statement handle, warning and saved Resultset
-
- // reset();
-
- // Call SQLExecute
-
- try {
- ADORecordset* pSet=NULL;
- CHECK_RETURN(m_Command.Execute(m_RecordsAffected,m_Parameters,adCmdUnknown,&pSet))
- m_RecordSet = WpADORecordset(pSet);
- }
- catch (SQLWarning& ex)
- {
-
- // Save pointer to warning and save with ResultSet
- // object once it is created.
-
- warning = ex;
- }
- return m_RecordSet.IsValid();
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- ADORecordset* pSet=NULL;
- CHECK_RETURN(m_Command.Execute(m_RecordsAffected,m_Parameters,adCmdUnknown,&pSet))
- if ( VT_ERROR == m_RecordsAffected.getType() )
- {
- ADOS::ThrowException(*m_pConnection->getConnection(),*this);
- // to be sure that we get the error really thrown
- throw SQLException();
- }
- m_RecordSet = WpADORecordset(pSet);
- return static_cast<sal_Int32>(m_RecordsAffected);
-}
-
-// -------------------------------------------------------------------------
-void OPreparedStatement::setParameter(sal_Int32 parameterIndex, const DataTypeEnum& _eType,
- const sal_Int32& _nSize,const OLEVariant& _Val) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- sal_Int32 nCount = 0;
- m_pParameters->get_Count(&nCount);
- if(nCount < (parameterIndex-1))
- {
- ::rtl::OUString sDefaultName( RTL_CONSTASCII_USTRINGPARAM( "parame" ));
- sDefaultName += ::rtl::OUString::valueOf(parameterIndex);
- ADOParameter* pParam = m_Command.CreateParameter(sDefaultName,_eType,adParamInput,_nSize,_Val);
- if(pParam)
- {
- m_pParameters->Append(pParam);
-#if OSL_DEBUG_LEVEL > 0
- ADOParameter* pParam = NULL;
- m_pParameters->get_Item(OLEVariant(sal_Int32(parameterIndex-1)),&pParam);
- WpADOParameter aParam(pParam);
- if(pParam)
- {
- DataTypeEnum eType = aParam.GetADOType();
- (void)eType;
- }
-#endif
- }
- }
- else
- {
- ADOParameter* pParam = NULL;
- m_pParameters->get_Item(OLEVariant(sal_Int32(parameterIndex-1)),&pParam);
- WpADOParameter aParam(pParam);
- if(pParam)
- {
-#if OSL_DEBUG_LEVEL > 0
- ::rtl::OUString sParam = aParam.GetName();
-
-#endif // OSL_DEBUG_LEVEL
-
- DataTypeEnum eType = aParam.GetADOType();
- if ( _eType != eType && _eType != adDBTimeStamp )
- {
- aParam.put_Type(_eType);
- eType = _eType;
- aParam.put_Size(_nSize);
- }
-
- if ( adVarBinary == eType && aParam.GetAttributes() == adParamLong )
- {
- aParam.AppendChunk(_Val);
- }
- else
- CHECK_RETURN(aParam.PutValue(_Val));
- }
- }
- ADOS::ThrowException(*m_pConnection->getConnection(),*this);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
-{
- setParameter( parameterIndex, adLongVarWChar, ::std::numeric_limits< sal_Int32 >::max(), x );
-}
-// -------------------------------------------------------------------------
-
-Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- return (Reference< XConnection >)m_pConnection;
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- // first clear the old things
-m_xMetaData.clear();
- disposeResultSet();
- if(m_RecordSet.IsValid())
- m_RecordSet.Close();
- m_RecordSet.clear();
-
-
- // the create the new onces
- m_RecordSet.Create();
- OLEVariant aCmd;
- aCmd.setIDispatch(m_Command);
- OLEVariant aCon;
- aCon.setNoArg();
- CHECK_RETURN(m_RecordSet.put_CacheSize(m_nFetchSize))
- CHECK_RETURN(m_RecordSet.put_MaxRecords(m_nMaxRows))
- CHECK_RETURN(m_RecordSet.Open(aCmd,aCon,m_eCursorType,m_eLockType,adOpenUnspecified))
- CHECK_RETURN(m_RecordSet.get_CacheSize(m_nFetchSize))
- CHECK_RETURN(m_RecordSet.get_MaxRecords(m_nMaxRows))
- CHECK_RETURN(m_RecordSet.get_CursorType(m_eCursorType))
- CHECK_RETURN(m_RecordSet.get_LockType(m_eLockType))
-
- OResultSet* pSet = new OResultSet(m_RecordSet,this);
- Reference< XResultSet > xRs = pSet;
- pSet->construct();
- pSet->setMetaData(getMetaData());
- m_xResultSet = WeakReference<XResultSet>(xRs);
-
- return xRs;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,adBoolean,sizeof(x),x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,adTinyInt,sizeof(x),x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const Date& x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,adDBDate,sizeof(x),x);
-}
-// -------------------------------------------------------------------------
-
-
-void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const Time& x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,adDBTime,sizeof(x),x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const DateTime& x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,adDBTimeStamp,sizeof(x),x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,adDouble,sizeof(x),x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,adSingle,sizeof(x),x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,adInteger,sizeof(x),x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,adBigInt,sizeof(x),x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ ) throw(SQLException, RuntimeException)
-{
- OLEVariant aVal;
- aVal.setNull();
- setParameter(parameterIndex,adEmpty,0,aVal);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setClob( sal_Int32 /*parameterIndex*/, const Reference< XClob >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRowUpdate::setClob", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBlob( sal_Int32 /*parameterIndex*/, const Reference< XBlob >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRowUpdate::setBlob", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setArray( sal_Int32 /*parameterIndex*/, const Reference< XArray >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRowUpdate::setArray", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setRef( sal_Int32 /*parameterIndex*/, const Reference< XRef >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRowUpdate::setRef", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 sqlType, sal_Int32 scale ) throw(SQLException, RuntimeException)
-{
- switch(sqlType)
- {
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- setString(parameterIndex,::comphelper::getString(x));
- break;
- default:
- ::dbtools::setObjectWithInfo(this,parameterIndex,x,sqlType,scale);
- break;
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& /*typeName*/ ) throw(SQLException, RuntimeException)
-{
- setNull(parameterIndex,sqlType);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x ) throw(SQLException, RuntimeException)
-{
- if(!::dbtools::implSetObject(this,parameterIndex,x))
- {
- const ::rtl::OUString sError( m_pConnection->getResources().getResourceStringWithSubstitution(
- STR_UNKNOWN_PARA_TYPE,
- "$position$", ::rtl::OUString::valueOf(parameterIndex)
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
- // setObject (parameterIndex, x, sqlType, 0);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,adSmallInt,sizeof(x),x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,adVarBinary,sizeof(sal_Int8)*x.getLength(),x);
-}
-
-// -------------------------------------------------------------------------
-
-
-void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 /*parameterIndex*/, const Reference< ::com::sun::star::io::XInputStream >& /*x*/, sal_Int32 /*length*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setCharacterStream", *this );
-}
-
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- if(x.is())
- {
- Sequence< sal_Int8 > aData;
- x->readBytes(aData,length);
- setBytes(parameterIndex,aData);
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::clearParameters( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- if(m_pParameters)
- {
- sal_Int32 nCount = 0;
- m_pParameters->get_Count(&nCount);
- OLEVariant aVal;
- aVal.setEmpty();
- for(sal_Int32 i=0;i<nCount;++i)
- {
- ADOParameter* pParam = NULL;
- m_pParameters->get_Item(OLEVariant(i),&pParam);
- WpADOParameter aParam(pParam);
- if(pParam)
- {
- ::rtl::OUString sParam = aParam.GetName();
- CHECK_RETURN(aParam.PutValue(aVal));
- }
- }
- // m_pParameters->Delete(OLEVariant(i));
-
- }
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::clearBatch( ) throw(SQLException, RuntimeException)
-{
- // clearParameters( );
- // m_aBatchList.erase();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::addBatch( ) throw(SQLException, RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-
-Sequence< sal_Int32 > SAL_CALL OPreparedStatement::executeBatch( ) throw(SQLException, RuntimeException)
-{
- return Sequence< sal_Int32 > ();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::acquire() throw()
-{
- OStatement_Base::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::release() throw()
-{
- OStatement_Base::release();
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::replaceParameterNodeName(OSQLParseNode* _pNode,
- const ::rtl::OUString& _sDefaultName,
- sal_Int32& _rParameterCount)
-{
- sal_Int32 nCount = _pNode->count();
- for(sal_Int32 i=0;i < nCount;++i)
- {
- OSQLParseNode* pChildNode = _pNode->getChild(i);
- if(SQL_ISRULE(pChildNode,parameter) && pChildNode->count() == 1)
- {
- OSQLParseNode* pNewNode = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":")) ,SQL_NODE_PUNCTUATION,0);
- delete pChildNode->replace(pChildNode->getChild(0),pNewNode);
- ::rtl::OUString sParameterName = _sDefaultName;
- sParameterName += ::rtl::OUString::valueOf(++_rParameterCount);
- pChildNode->append(new OSQLParseNode( sParameterName,SQL_NODE_NAME,0));
- }
- else
- replaceParameterNodeName(pChildNode,_sDefaultName,_rParameterCount);
-
- }
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx
deleted file mode 100644
index 676c38e9b8..0000000000
--- a/connectivity/source/drivers/ado/AResultSet.cxx
+++ /dev/null
@@ -1,1175 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AResultSet.hxx"
-#include "ado/AResultSetMetaData.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbc/IndexType.hpp>
-#include <comphelper/property.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <comphelper/seqstream.hxx>
-#include "connectivity/dbexception.hxx"
-#include "connectivity/dbtools.hxx"
-#include <comphelper/types.hxx>
-
-using namespace ::comphelper;
-
-
-#include <oledb.h>
-
-#define CHECK_RETURN(x) \
- if(!SUCCEEDED(x)) \
- ADOS::ThrowException(*m_pStmt->m_pConnection->getConnection(),*this);
-
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-
-//------------------------------------------------------------------------------
-// IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.AResultSet","com.sun.star.sdbc.ResultSet");
-::rtl::OUString SAL_CALL OResultSet::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) \
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.ado.ResultSet"));
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OResultSet::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(2);
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.ResultSet"));
- aSupported[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.ResultSet"));
- return aSupported;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-// -------------------------------------------------------------------------
-OResultSet::OResultSet(ADORecordset* _pRecordSet,OStatement_Base* pStmt) : OResultSet_BASE(m_aMutex)
- ,OPropertySetHelper(OResultSet_BASE::rBHelper)
- ,m_xStatement(*pStmt)
- ,m_pStmt(pStmt)
- ,m_nRowPos(0)
- ,m_xMetaData(NULL)
- ,m_pRecordSet(_pRecordSet)
- ,m_bEOF(sal_False)
-{
-}
-// -------------------------------------------------------------------------
-OResultSet::OResultSet(ADORecordset* _pRecordSet) : OResultSet_BASE(m_aMutex)
- ,OPropertySetHelper(OResultSet_BASE::rBHelper)
- ,m_xStatement(NULL)
- ,m_xMetaData(NULL)
- ,m_pRecordSet(_pRecordSet)
- ,m_bEOF(sal_False)
-{
-}
-// -----------------------------------------------------------------------------
-void OResultSet::construct()
-{
- osl_incrementInterlockedCount( &m_refCount );
- if (!m_pRecordSet)
- {
- OSL_FAIL( "OResultSet::construct: no RecordSet!" );
- Reference< XInterface > xInt( *this );
- osl_decrementInterlockedCount( &m_refCount );
- ::dbtools::throwFunctionSequenceException( xInt );
- }
- m_pRecordSet->AddRef();
- VARIANT_BOOL bIsAtBOF;
- CHECK_RETURN(m_pRecordSet->get_BOF(&bIsAtBOF))
- m_bOnFirstAfterOpen = bIsAtBOF != VARIANT_TRUE;
- osl_decrementInterlockedCount( &m_refCount );
-}
-// -------------------------------------------------------------------------
-OResultSet::~OResultSet()
-{
- if(m_pRecordSet)
- m_pRecordSet->Release();
-}
-// -------------------------------------------------------------------------
-void OResultSet::disposing(void)
-{
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
- if(m_pRecordSet)
- m_pRecordSet->Close();
-m_xStatement.clear();
-m_xMetaData.clear();
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OPropertySetHelper::queryInterface(rType);
- return aRet.hasValue() ? aRet : OResultSet_BASE::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL OResultSet::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),OResultSet_BASE::getTypes());
-}
-
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- Reference< XResultSetMetaData > xMeta = getMetaData();
- sal_Int32 nLen = xMeta->getColumnCount();
- sal_Int32 i = 1;
- for(;i<=nLen;++i)
- if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
- columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
- break;
- return i;
-}
-#define BLOCK_SIZE 256
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- WpADOField aField = ADOS::getField(m_pRecordSet,columnIndex);
-
- if((aField.GetAttributes() & adFldLong) == adFldLong)
- {
- //Copy the data only upto the Actual Size of Field.
- sal_Int32 nSize = aField.GetActualSize();
- Sequence<sal_Int8> aData(nSize);
- long index = 0;
- while(index < nSize)
- {
- m_aValue = aField.GetChunk(BLOCK_SIZE);
- if(m_aValue.isNull())
- break;
- UCHAR chData;
- for(long index2 = 0;index2 < BLOCK_SIZE;++index2)
- {
- HRESULT hr = ::SafeArrayGetElement(m_aValue.parray,&index2,&chData);
- if(SUCCEEDED(hr))
- {
- //Take BYTE by BYTE and advance Memory Location
- aData.getArray()[index++] = chData;
- }
- else
- break;
- }
- }
-
- return new ::comphelper::SequenceInputStream(aData);
- }
- // else we ask for a bytesequence
- aField.get_Value(m_aValue);
-
- return m_aValue.isNull() ? NULL : new ::comphelper::SequenceInputStream(m_aValue);
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getCharacterStream", *this );
- return NULL;
-}
-// -----------------------------------------------------------------------------
-OLEVariant OResultSet::getValue(sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- WpADOField aField = ADOS::getField(m_pRecordSet,columnIndex);
- aField.get_Value(m_aValue);
- return m_aValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-::com::sun::star::util::Date SAL_CALL OResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSet::getRow( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- PositionEnum_Param aPos;
- m_pRecordSet->get_AbsolutePosition(&aPos);
- return (aPos > 0) ? aPos : m_nRowPos;
- // return the rowcount from driver if the driver doesn't support this return our count
-}
-// -------------------------------------------------------------------------
-
-sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getLong", *this );
- return sal_Int64(0);
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(!m_xMetaData.is())
- m_xMetaData = new OResultSetMetaData(m_pRecordSet);
- return m_xMetaData;
-}
-// -------------------------------------------------------------------------
-Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getArray", *this );
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-
-Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getClob", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XBlob > SAL_CALL OResultSet::getBlob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getBlob", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRow::getRef", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex).makeAny();
-}
-// -------------------------------------------------------------------------
-
-sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL OResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-
-// -------------------------------------------------------------------------
-
-
-::com::sun::star::util::Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-
-::com::sun::star::util::DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- VARIANT_BOOL bIsAtEOF;
- CHECK_RETURN(m_pRecordSet->get_EOF(&bIsAtEOF))
- return bIsAtEOF == VARIANT_TRUE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_nRowPos == 1;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return sal_True;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(first())
- m_bOnFirstAfterOpen = !previous();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::afterLast( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(last())
- next();
- m_bEOF = sal_True;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::first( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(SUCCEEDED(m_pRecordSet->MoveFirst()))
- {
- m_nRowPos = 1;
- m_bOnFirstAfterOpen = sal_False;
- return sal_True;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::last( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- sal_Bool bRet = SUCCEEDED(m_pRecordSet->MoveLast());
- if(bRet)
- {
- m_pRecordSet->get_RecordCount(&m_nRowPos);
- m_bOnFirstAfterOpen = sal_False;
- }
- return bRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(!row) // absolute with zero not allowed
- ::dbtools::throwFunctionSequenceException(*this);
-
- sal_Bool bCheck = sal_True;
- if(row < 0)
- {
- bCheck = SUCCEEDED(m_pRecordSet->MoveLast());
- if ( bCheck )
- {
- while(++row < 0 && bCheck)
- bCheck = SUCCEEDED(m_pRecordSet->MovePrevious());
- }
- }
- else
- {
- first();
- OLEVariant aEmpty;
- aEmpty.setNoArg();
- bCheck = SUCCEEDED(m_pRecordSet->Move(row-1,aEmpty)); // move to row -1 because we stand already on the first
- if(bCheck)
- m_nRowPos = row;
- }
- if(bCheck)
- m_bOnFirstAfterOpen = sal_False;
- return bCheck;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- OLEVariant aEmpty;
- aEmpty.setNoArg();
- sal_Int32 nNewPos = row;
- if ( m_bOnFirstAfterOpen && nNewPos > 0 )
- --nNewPos;
- sal_Bool bRet = SUCCEEDED(m_pRecordSet->Move(row,aEmpty));
- if(bRet)
- {
- m_nRowPos += row;
- m_bOnFirstAfterOpen = sal_False;
- }
- return bRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::previous( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- sal_Bool bRet = SUCCEEDED(m_pRecordSet->MovePrevious());
- if(bRet)
- {
- --m_nRowPos;
- m_bOnFirstAfterOpen = sal_False;
- }
- return bRet;
-}
-// -------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL OResultSet::getStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- return m_xStatement;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::rowDeleted( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- RecordStatusEnum eRec;
- m_pRecordSet->get_Status((sal_Int32*)&eRec);
- sal_Bool bRet = (eRec & adRecDeleted) == adRecDeleted;
- if(bRet)
- --m_nRowPos;
- return bRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::rowInserted( ) throw(SQLException, RuntimeException)
-{ ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- RecordStatusEnum eRec;
- m_pRecordSet->get_Status((sal_Int32*)&eRec);
- sal_Bool bRet = (eRec & adRecNew) == adRecNew;
- if(bRet)
- ++m_nRowPos;
- return bRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- RecordStatusEnum eRec;
- m_pRecordSet->get_Status((sal_Int32*)&eRec);
- return (eRec & adRecModified) == adRecModified;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- OSL_ENSURE(!m_nRowPos,"OResultSet::isBeforeFirst: Error in setting m_nRowPos!");
- VARIANT_BOOL bIsAtBOF = VARIANT_TRUE;
- if(!m_bOnFirstAfterOpen)
- {
- OSL_ENSURE(!m_nRowPos,"OResultSet::isBeforeFirst: Error in setting m_nRowPos!");
- m_pRecordSet->get_BOF(&bIsAtBOF);
- }
- return bIsAtBOF == VARIANT_TRUE;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::next( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- sal_Bool bRet = sal_True;
- if(m_bOnFirstAfterOpen)
- {
- m_bOnFirstAfterOpen = sal_False;
- ++m_nRowPos;
- }
- else
- {
- bRet = SUCCEEDED(m_pRecordSet->MoveNext());
-
- if(bRet)
- {
- VARIANT_BOOL bIsAtEOF;
- CHECK_RETURN(m_pRecordSet->get_EOF(&bIsAtEOF))
- bRet = bIsAtEOF != VARIANT_TRUE;
- ++m_nRowPos;
- }
- else
- ADOS::ThrowException(*m_pStmt->m_pConnection->getConnection(),*this);
- }
-
- return bRet;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::wasNull( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_aValue.isNull();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::cancel( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_pRecordSet->Cancel();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OResultSet::getWarnings( ) throw(SQLException, RuntimeException)
-{
- return Any();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- OLEVariant aEmpty;
- aEmpty.setNoArg();
- m_pRecordSet->AddNew(aEmpty,aEmpty);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- OLEVariant aEmpty;
- aEmpty.setNoArg();
- m_pRecordSet->Update(aEmpty,aEmpty);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::deleteRow( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_pRecordSet->Delete(adAffectCurrent);
- m_pRecordSet->UpdateBatch(adAffectCurrent);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_pRecordSet->CancelUpdate();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::moveToInsertRow( ) throw(SQLException, RuntimeException)
-{
- // ::osl::MutexGuard aGuard( m_aMutex );
- //checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- // if ( getResultSetConcurrency() == ResultSetConcurrency::READ_ONLY )
- // throw SQLException();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::moveToCurrentRow( ) throw(SQLException, RuntimeException)
-{
-}
-// -----------------------------------------------------------------------------
-void OResultSet::updateValue(sal_Int32 columnIndex,const OLEVariant& x)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- WpADOField aField = ADOS::getField(m_pRecordSet,columnIndex);
- aField.PutValue(x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- OLEVariant x;
- x.setNull();
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -----------------------------------------------------------------------
-void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- if(!x.is())
- ::dbtools::throwFunctionSequenceException(*this);
-
- Sequence<sal_Int8> aSeq;
- x->readBytes(aSeq,length);
- updateBytes(columnIndex,aSeq);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- if(!x.is())
- ::dbtools::throwFunctionSequenceException(*this);
-
- Sequence<sal_Int8> aSeq;
- x->readBytes(aSeq,length);
- updateBytes(columnIndex,aSeq);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_pRecordSet->Resync(adAffectCurrent,adResyncAllValues);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException)
-{
- if (!::dbtools::implUpdateObject(this, columnIndex, x))
- throw SQLException();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 /*scale*/ ) throw(SQLException, RuntimeException)
-{
- if (!::dbtools::implUpdateObject(this, columnIndex, x))
- throw SQLException();
-}
-//------------------------------------------------------------------------------
-// XRowLocate
-Any SAL_CALL OResultSet::getBookmark( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- if(m_nRowPos < (sal_Int32)m_aBookmarks.size()) // this bookmark was already fetched
- return makeAny(sal_Int32(m_nRowPos-1));
-
- OLEVariant aVar;
- m_pRecordSet->get_Bookmark(&aVar);
- m_aBookmarks.push_back(aVar);
- return makeAny((sal_Int32)(m_aBookmarks.size()-1));
-
-}
-//------------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::moveToBookmark( const Any& bookmark ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- sal_Int32 nPos;
- bookmark >>= nPos;
- OSL_ENSURE(nPos >= 0 && nPos < (sal_Int32)m_aBookmarks.size(),"Invalid Index for vector");
- if(nPos < 0 || nPos >= (sal_Int32)m_aBookmarks.size())
- ::dbtools::throwFunctionSequenceException(*this);
-
- return SUCCEEDED(m_pRecordSet->Move(0,m_aBookmarks[nPos]));
-}
-//------------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- sal_Int32 nPos;
- bookmark >>= nPos;
- nPos += rows;
- OSL_ENSURE(nPos >= 0 && nPos < (sal_Int32)m_aBookmarks.size(),"Invalid Index for vector");
- if(nPos < 0 || nPos >= (sal_Int32)m_aBookmarks.size())
- ::dbtools::throwFunctionSequenceException(*this);
- return SUCCEEDED(m_pRecordSet->Move(rows,m_aBookmarks[nPos]));
-}
-//------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSet::compareBookmarks( const Any& first, const Any& second ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nPos1;
- first >>= nPos1;
- sal_Int32 nPos2;
- second >>= nPos2;
- if(nPos1 == nPos2) // they should be equal
- return sal_True;
-
- OSL_ENSURE((nPos1 >= 0 && nPos1 < (sal_Int32)m_aBookmarks.size()) || (nPos1 >= 0 && nPos2 < (sal_Int32)m_aBookmarks.size()),"Invalid Index for vector");
-
- CompareEnum eNum;
- m_pRecordSet->CompareBookmarks(m_aBookmarks[nPos1],m_aBookmarks[nPos2],&eNum);
- return ((sal_Int32)eNum) +1;
-}
-//------------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- ADOProperties* pProps = NULL;
- m_pRecordSet->get_Properties(&pProps);
- WpADOProperties aProps;
- aProps.setWithOutAddRef(pProps);
- ADOS::ThrowException(*((OConnection*)m_pStmt->getConnection().get())->getConnection(),*this);
- OSL_ENSURE(aProps.IsValid(),"There are no properties at the connection");
-
- WpADOProperty aProp(aProps.GetItem(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Bookmarks Ordered"))));
- OLEVariant aVar;
- if(aProp.IsValid())
- aVar = aProp.GetValue();
- else
- ADOS::ThrowException(*((OConnection*)m_pStmt->getConnection().get())->getConnection(),*this);
-
- sal_Bool bValue(sal_False);
- if(!aVar.isNull() && !aVar.isEmpty())
- bValue = aVar;
- return bValue;
-}
-//------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSet::hashBookmark( const Any& bookmark ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- sal_Int32 nPos;
- bookmark >>= nPos;
- return nPos;
-}
-//------------------------------------------------------------------------------
-// XDeleteRows
-Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& rows ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- OLEVariant aVar;
- sal_Int32 nPos;
-
- // Create SafeArray Bounds and initialize the array
- SAFEARRAYBOUND rgsabound[1];
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = rows.getLength();
- SAFEARRAY *psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- const Any* pBegin = rows.getConstArray();
- const Any* pEnd = pBegin + rows.getLength();
- for(sal_Int32 i=0;pBegin != pEnd ;++pBegin,++i)
- {
- *pBegin >>= nPos;
- SafeArrayPutElement(psa,&i,&m_aBookmarks[nPos]);
- }
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- m_pRecordSet->put_Filter(vsa);
- m_pRecordSet->Delete(adAffectGroup);
- m_pRecordSet->UpdateBatch(adAffectGroup);
-
- Sequence< sal_Int32 > aSeq(rows.getLength());
- if(first())
- {
- sal_Int32* pSeq = aSeq.getArray();
- sal_Int32 i=0;
- do
- {
- OSL_ENSURE(i<aSeq.getLength(),"Index greater than length of sequence");
- m_pRecordSet->get_Status(&pSeq[i]);
- if(pSeq[i++] == adRecDeleted)
- --m_nRowPos;
- }
- while(next());
- }
- return aSeq;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OResultSet::getResultSetConcurrency() const
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- sal_Int32 nValue=ResultSetConcurrency::READ_ONLY;
- LockTypeEnum eRet;
- if(!SUCCEEDED(m_pRecordSet->get_LockType(&eRet)))
- {
- switch(eRet)
- {
- case adLockReadOnly:
- nValue = ResultSetConcurrency::READ_ONLY;
- break;
- default:
- nValue = ResultSetConcurrency::UPDATABLE;
- break;
- }
- }
- return nValue;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OResultSet::getResultSetType() const
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- sal_Int32 nValue=0;
- CursorTypeEnum eRet;
- if(!SUCCEEDED(m_pRecordSet->get_CursorType(&eRet)))
- {
- switch(eRet)
- {
- case adOpenUnspecified:
- case adOpenForwardOnly:
- nValue = ResultSetType::FORWARD_ONLY;
- break;
- case adOpenStatic:
- case adOpenKeyset:
- nValue = ResultSetType::SCROLL_INSENSITIVE;
- break;
- case adOpenDynamic:
- nValue = ResultSetType::SCROLL_SENSITIVE;
- break;
- }
- }
- return nValue;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OResultSet::getFetchDirection() const
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return FetchDirection::FORWARD;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OResultSet::getFetchSize() const
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- sal_Int32 nValue=-1;
- m_pRecordSet->get_CacheSize(&nValue);
- return nValue;
-}
-//------------------------------------------------------------------------------
-::rtl::OUString OResultSet::getCursorName() const
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return ::rtl::OUString();
-}
-
-//------------------------------------------------------------------------------
-void OResultSet::setFetchDirection(sal_Int32 /*_par0*/)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "ResultSet::FetchDirection", *this );
-}
-//------------------------------------------------------------------------------
-void OResultSet::setFetchSize(sal_Int32 _par0)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_pRecordSet->put_CacheSize(_par0);
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
-{
- Sequence< com::sun::star::beans::Property > aProps(5);
- com::sun::star::beans::Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
-
- // DECL_PROP1IMPL(CURSORNAME, ::rtl::OUString) PropertyAttribute::READONLY);
- DECL_PROP0(FETCHDIRECTION, sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
- DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
- DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
-
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OResultSet::getInfoHelper()
-{
- return *const_cast<OResultSet*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool OResultSet::convertFastPropertyValue(
- Any & rConvertedValue,
- Any & rOldValue,
- sal_Int32 nHandle,
- const Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException)
-{
- switch(nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw ::com::sun::star::lang::IllegalArgumentException();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchDirection());
- case PROPERTY_ID_FETCHSIZE:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchSize());
- default:
- ;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void OResultSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)throw (Exception)
-{
- switch(nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw Exception();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- setFetchDirection(getINT32(rValue));
- break;
- case PROPERTY_ID_FETCHSIZE:
- setFetchSize(getINT32(rValue));
- break;
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-void OResultSet::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
-{
- switch(nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- {
- VARIANT_BOOL bBool;
- m_pRecordSet->Supports(adBookmark,&bBool);
- sal_Bool bRet = bBool == VARIANT_TRUE;
- rValue.setValue(&bRet, ::getCppuBooleanType() );
- }
- break;
- case PROPERTY_ID_CURSORNAME:
- rValue <<= getCursorName();
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- rValue <<= getResultSetConcurrency();
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- rValue <<= getResultSetType();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- rValue <<= getFetchDirection();
- break;
- case PROPERTY_ID_FETCHSIZE:
- rValue <<= getFetchSize();
- break;
- }
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OResultSet::acquire() throw()
-{
- OResultSet_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OResultSet::release() throw()
-{
- OResultSet_BASE::release();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AResultSetMetaData.cxx b/connectivity/source/drivers/ado/AResultSetMetaData.cxx
deleted file mode 100644
index 66def0a9cb..0000000000
--- a/connectivity/source/drivers/ado/AResultSetMetaData.cxx
+++ /dev/null
@@ -1,264 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AResultSetMetaData.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include "ado/Awrapado.hxx"
-#include "connectivity/dbexception.hxx"
-
-using namespace connectivity;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-
-OResultSetMetaData::OResultSetMetaData( ADORecordset* _pRecordSet)
- : m_pRecordSet(_pRecordSet),
- m_nColCount(-1)
-{
- if ( m_pRecordSet )
- m_pRecordSet->AddRef();
-}
-// -------------------------------------------------------------------------
-OResultSetMetaData::~OResultSetMetaData()
-{
- if ( m_pRecordSet )
- m_pRecordSet->Release();
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- if(aField.IsValid() && aField.GetActualSize() != -1)
- return aField.GetActualSize();
- return 0;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- return ADOS::MapADOType2Jdbc(aField.GetADOType());
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSetMetaData::getColumnCount( ) throw(SQLException, RuntimeException)
-{
- if(m_nColCount != -1 )
- return m_nColCount;
-
- if ( !m_pRecordSet )
- return 0;
-
- ADOFields* pFields = NULL;
- m_pRecordSet->get_Fields(&pFields);
- WpOLEAppendCollection<ADOFields, ADOField, WpADOField> aFields(pFields);
- m_nColCount = aFields.GetItemCount();
- return m_nColCount;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- sal_Bool bRet = sal_False;
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- if ( aField.IsValid() )
- {
- WpADOProperties aProps( aField.get_Properties() );
- if ( aProps.IsValid() )
- bRet = OTools::getValue( aProps, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ISCASESENSITIVE")) );
- }
- return bRet;
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL OResultSetMetaData::getSchemaName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- if(aField.IsValid())
- return aField.GetName();
-
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getTableName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString sTableName;
-
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- if ( aField.IsValid() )
- {
- WpADOProperties aProps( aField.get_Properties() );
- if ( aProps.IsValid() )
- sTableName = OTools::getValue( aProps, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BASETABLENAME")) );
- }
- return sTableName;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getCatalogName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnTypeName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnLabel( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return getColumnName(column);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnServiceName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isCurrency( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- if(aField.IsValid())
- {
- return ((aField.GetAttributes() & adFldFixed) == adFldFixed) && (aField.GetADOType() == adCurrency);
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- sal_Bool bRet = sal_False;
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- if ( aField.IsValid() )
- {
- WpADOProperties aProps( aField.get_Properties() );
- if ( aProps.IsValid() )
- {
- bRet = OTools::getValue( aProps, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ISAUTOINCREMENT")) );
-#if OSL_DEBUG_LEVEL > 0
- sal_Int32 nCount = aProps.GetItemCount();
- for (sal_Int32 i = 0; i<nCount; ++i)
- {
- WpADOProperty aProp = aProps.GetItem(i);
- ::rtl::OUString sName = aProp.GetName();
- ::rtl::OUString sVal = aProp.GetValue();
- }
-#endif
- }
- }
- return bRet;
-}
-// -------------------------------------------------------------------------
-
-
-sal_Bool SAL_CALL OResultSetMetaData::isSigned( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- if(aField.IsValid())
- {
- DataTypeEnum eType = aField.GetADOType();
- return !(eType == adUnsignedBigInt || eType == adUnsignedInt || eType == adUnsignedSmallInt || eType == adUnsignedTinyInt);
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getPrecision( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- if(aField.IsValid())
- return aField.GetPrecision();
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- if(aField.IsValid())
- return aField.GetNumericScale();
- return 0;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- if(aField.IsValid())
- {
- return (aField.GetAttributes() & adFldIsNullable) == adFldIsNullable;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isSearchable( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isReadOnly( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- if(aField.IsValid())
- {
- // return (aField.GetStatus() & adFieldReadOnly) == adFieldReadOnly;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isDefinitelyWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- WpADOField aField = ADOS::getField(m_pRecordSet,column);
- if(aField.IsValid())
- {
- return (aField.GetAttributes() & adFldUpdatable) == adFldUpdatable;
- }
- return sal_False;
-;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSetMetaData::isWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return isDefinitelyWritable(column);
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AStatement.cxx b/connectivity/source/drivers/ado/AStatement.cxx
deleted file mode 100644
index fb7daaedcf..0000000000
--- a/connectivity/source/drivers/ado/AStatement.cxx
+++ /dev/null
@@ -1,844 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AStatement.hxx"
-#include "ado/AConnection.hxx"
-#include "ado/AResultSet.hxx"
-#include <comphelper/property.hxx>
-#include <comphelper/uno3.hxx>
-#include <osl/thread.h>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include "connectivity/dbexception.hxx"
-#include <comphelper/types.hxx>
-
-#undef max
-
-#include <algorithm>
-
-using namespace ::comphelper;
-
-#define CHECK_RETURN(x) \
- if(!x) \
- ADOS::ThrowException(*m_pConnection->getConnection(),*this);
-
-
-
-using namespace connectivity::ado;
-
-//------------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace ::std;
-//------------------------------------------------------------------------------
-OStatement_Base::OStatement_Base(OConnection* _pConnection ) : OStatement_BASE(m_aMutex)
- ,OPropertySetHelper(OStatement_BASE::rBHelper)
- ,OSubComponent<OStatement_Base, OStatement_BASE>((::cppu::OWeakObject*)_pConnection, this)
- ,m_pConnection(_pConnection)
- ,m_nFetchSize(1)
- ,m_nMaxRows(0)
- ,m_eLockType(adLockReadOnly)
- ,m_eCursorType(adOpenForwardOnly)
-{
- osl_incrementInterlockedCount( &m_refCount );
-
- m_Command.Create();
- if(m_Command.IsValid())
- m_Command.putref_ActiveConnection(m_pConnection->getConnection());
- else
- ADOS::ThrowException(*m_pConnection->getConnection(),*this);
-
- m_RecordsAffected.setNoArg();
- m_Parameters.setNoArg();
-
- m_pConnection->acquire();
-
- osl_decrementInterlockedCount( &m_refCount );
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::disposeResultSet()
-{
- // free the cursor if alive
- Reference< XComponent > xComp(m_xResultSet.get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- m_xResultSet = Reference< XResultSet>();
-}
-
-//------------------------------------------------------------------------------
-void OStatement_Base::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
-
- disposeResultSet();
-
- if ( m_Command.IsValid() )
- m_Command.putref_ActiveConnection( NULL );
- m_Command.clear();
-
- if ( m_RecordSet.IsValid() )
- m_RecordSet.PutRefDataSource( NULL );
- m_RecordSet.clear();
-
- if (m_pConnection)
- m_pConnection->release();
-
- dispose_ChildImpl();
- OStatement_BASE::disposing();
-}
-//-----------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::release() throw()
-{
- relase_ChildImpl();
-}
-//-----------------------------------------------------------------------------
-Any SAL_CALL OStatement_Base::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OStatement_BASE::queryInterface(rType);
- return aRet.hasValue() ? aRet : OPropertySetHelper::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL OStatement_Base::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_BASE::getTypes());
-}
-
-// -------------------------------------------------------------------------
-
-void SAL_CALL OStatement_Base::cancel( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- CHECK_RETURN(m_Command.Cancel())
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OStatement_Base::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OStatement::clearBatch( ) throw(SQLException, RuntimeException)
-{
-
-}
-// -------------------------------------------------------------------------
-
-void OStatement_Base::reset() throw (SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- clearWarnings ();
-
- if (m_xResultSet.get().is())
- clearMyResultSet();
-}
-//--------------------------------------------------------------------
-// clearMyResultSet
-// If a ResultSet was created for this Statement, close it
-//--------------------------------------------------------------------
-
-void OStatement_Base::clearMyResultSet () throw (SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- try
- {
- Reference<XCloseable> xCloseable;
- if ( ::comphelper::query_interface( m_xResultSet.get(), xCloseable ) )
- xCloseable->close();
- }
- catch( const DisposedException& ) { }
-
- m_xResultSet = Reference< XResultSet >();
-}
-//--------------------------------------------------------------------
-sal_Int32 OStatement_Base::getRowCount () throw( SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- return m_RecordsAffected;
-}
-//--------------------------------------------------------------------
-// getPrecision
-// Given a SQL type, return the maximum precision for the column.
-// Returns -1 if not known
-//--------------------------------------------------------------------
-
-sal_Int32 OStatement_Base::getPrecision ( sal_Int32 sqlType)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- sal_Int32 prec = -1;
- OTypeInfo aInfo;
- aInfo.nType = (sal_Int16)sqlType;
- if (!m_aTypeInfo.empty())
- {
- ::std::vector<OTypeInfo>::const_iterator aIter = ::std::find(m_aTypeInfo.begin(),m_aTypeInfo.end(),aInfo);
- for(;aIter != m_aTypeInfo.end();++aIter)
- {
- prec = ::std::max(prec,(*aIter).nPrecision);
- }
- }
-
- return prec;
-}
-//--------------------------------------------------------------------
-// setWarning
-// Sets the warning
-//--------------------------------------------------------------------
-
-void OStatement_Base::setWarning (const SQLWarning &ex) throw( SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- m_aLastWarning = ex;
-}
-// -------------------------------------------------------------------------
-void OStatement_Base::assignRecordSet( ADORecordset* _pRS )
-{
- WpADORecordset aOldRS( m_RecordSet );
- m_RecordSet = WpADORecordset( _pRS );
-
- if ( aOldRS.IsValid() )
- aOldRS.PutRefDataSource( NULL );
-
- if ( m_RecordSet.IsValid() )
- m_RecordSet.PutRefDataSource( (IDispatch*)m_Command );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- // Reset the statement handle and warning
-
- reset();
-
- try
- {
- ADORecordset* pSet = NULL;
- CHECK_RETURN(m_Command.put_CommandText(sql))
- CHECK_RETURN(m_Command.Execute(m_RecordsAffected,m_Parameters,adCmdText,&pSet))
-
- assignRecordSet( pSet );
- }
- catch (SQLWarning& ex)
- {
-
- // Save pointer to warning and save with ResultSet
- // object once it is created.
-
- m_aLastWarning = ex;
- }
-
- return m_RecordSet.IsValid();
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- reset();
-
- m_xResultSet = WeakReference<XResultSet>(NULL);
-
- WpADORecordset aSet;
- aSet.Create();
- CHECK_RETURN(m_Command.put_CommandText(sql))
- OLEVariant aCmd;
- aCmd.setIDispatch(m_Command);
- OLEVariant aCon;
- aCon.setNoArg();
- CHECK_RETURN(aSet.put_CacheSize(m_nFetchSize))
- CHECK_RETURN(aSet.put_MaxRecords(m_nMaxRows))
- CHECK_RETURN(aSet.Open(aCmd,aCon,m_eCursorType,m_eLockType,adOpenUnspecified))
-
-
- CHECK_RETURN(aSet.get_CacheSize(m_nFetchSize))
- CHECK_RETURN(aSet.get_MaxRecords(m_nMaxRows))
- CHECK_RETURN(aSet.get_CursorType(m_eCursorType))
- CHECK_RETURN(aSet.get_LockType(m_eLockType))
-
- OResultSet* pSet = new OResultSet(aSet,this);
- Reference< XResultSet > xRs = pSet;
- pSet->construct();
-
- m_xResultSet = WeakReference<XResultSet>(xRs);
-
- return xRs;
-}
-// -------------------------------------------------------------------------
-
-Reference< XConnection > SAL_CALL OStatement_Base::getConnection( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- return (Reference< XConnection >)m_pConnection;
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL OStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ::cppu::queryInterface(rType,static_cast< XBatchExecution*> (this));
- return aRet.hasValue() ? aRet : OStatement_Base::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OStatement::addBatch( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- m_aBatchList.push_back(sql);
-}
-// -------------------------------------------------------------------------
-Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- reset();
-
- ::rtl::OUString aBatchSql;
- sal_Int32 nLen = 0;
- for(::std::list< ::rtl::OUString>::const_iterator i=m_aBatchList.begin();i != m_aBatchList.end();++i,++nLen)
- aBatchSql = aBatchSql + *i + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";"));
-
-
- if ( m_RecordSet.IsValid() )
- m_RecordSet.PutRefDataSource( NULL );
- m_RecordSet.clear();
- m_RecordSet.Create();
-
- CHECK_RETURN(m_Command.put_CommandText(aBatchSql))
- if ( m_RecordSet.IsValid() )
- m_RecordSet.PutRefDataSource((IDispatch*)m_Command);
-
- CHECK_RETURN(m_RecordSet.UpdateBatch(adAffectAll))
-
- ADORecordset* pSet=NULL;
- Sequence< sal_Int32 > aRet(nLen);
- sal_Int32* pArray = aRet.getArray();
- for(sal_Int32 j=0;j<nLen;++j)
- {
- pSet = NULL;
- OLEVariant aRecordsAffected;
- if(m_RecordSet.NextRecordset(aRecordsAffected,&pSet) && pSet)
- {
- assignRecordSet( pSet );
-
- ADO_LONGPTR nValue;
- if(m_RecordSet.get_RecordCount(nValue))
- pArray[j] = nValue;
- }
- }
- return aRet;
-}
-// -------------------------------------------------------------------------
-
-
-sal_Int32 SAL_CALL OStatement_Base::executeUpdate( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- reset();
-
- try {
- ADORecordset* pSet = NULL;
- CHECK_RETURN(m_Command.put_CommandText(sql))
- CHECK_RETURN(m_Command.Execute(m_RecordsAffected,m_Parameters,adCmdText|adExecuteNoRecords,&pSet))
- }
- catch (SQLWarning& ex) {
-
- // Save pointer to warning and save with ResultSet
- // object once it is created.
-
- m_aLastWarning = ex;
- }
- if(!m_RecordsAffected.isEmpty() && !m_RecordsAffected.isNull() && m_RecordsAffected.getType() != VT_ERROR)
- return m_RecordsAffected;
-
- return 0;
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL OStatement_Base::getResultSet( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- return m_xResultSet;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OStatement_Base::getUpdateCount( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- ADO_LONGPTR nRet;
- if(m_RecordSet.IsValid() && m_RecordSet.get_RecordCount(nRet))
- return nRet;
- return -1;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OStatement_Base::getMoreResults( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- SQLWarning warning;
-
- // clear previous warnings
-
- clearWarnings ();
-
- // Call SQLMoreResults
-
- try
- {
- ADORecordset* pSet=NULL;
- OLEVariant aRecordsAffected;
- if(m_RecordSet.IsValid() && m_RecordSet.NextRecordset(aRecordsAffected,&pSet) && pSet)
- assignRecordSet( pSet );
- }
- catch (SQLWarning &ex)
- {
-
- // Save pointer to warning and save with ResultSet
- // object once it is created.
-
- warning = ex;
- }
- return m_RecordSet.IsValid();
-}
-// -------------------------------------------------------------------------
-
-// -------------------------------------------------------------------------
-Any SAL_CALL OStatement_Base::getWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- return makeAny(m_aLastWarning);
-}
-// -------------------------------------------------------------------------
-
-// -------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- m_aLastWarning = SQLWarning();
-}
-// -------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getQueryTimeOut() const throw(SQLException, RuntimeException)
-{
- return m_Command.get_CommandTimeout();
-}
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getMaxRows() const throw(SQLException, RuntimeException)
-{
- ADO_LONGPTR nRet=-1;
- if(!(m_RecordSet.IsValid() && m_RecordSet.get_MaxRecords(nRet)))
- ::dbtools::throwFunctionSequenceException(NULL);
- return nRet;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getResultSetConcurrency() const throw(SQLException, RuntimeException)
-{
- return m_eLockType;
- sal_Int32 nValue=0;
- switch(m_eLockType)
- {
- case adLockReadOnly:
- nValue = ResultSetConcurrency::READ_ONLY;
- break;
- default:
- nValue = ResultSetConcurrency::UPDATABLE;
- break;
- }
-
- return nValue;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getResultSetType() const throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue=0;
- switch(m_eCursorType)
- {
- case adOpenUnspecified:
- case adOpenForwardOnly:
- nValue = ResultSetType::FORWARD_ONLY;
- break;
- case adOpenStatic:
- case adOpenKeyset:
- nValue = ResultSetType::SCROLL_INSENSITIVE;
- break;
- case adOpenDynamic:
- nValue = ResultSetType::SCROLL_SENSITIVE;
- break;
- }
- return nValue;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getFetchDirection() const throw(SQLException, RuntimeException)
-{
- return FetchDirection::FORWARD;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getFetchSize() const throw(SQLException, RuntimeException)
-{
- return m_nFetchSize;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getMaxFieldSize() const throw(SQLException, RuntimeException)
-{
- return 0;
-}
-//------------------------------------------------------------------------------
-::rtl::OUString OStatement_Base::getCursorName() const throw(SQLException, RuntimeException)
-{
- return m_Command.GetName();
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setQueryTimeOut(sal_Int32 seconds) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- m_Command.put_CommandTimeout(seconds);
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setMaxRows(sal_Int32 _par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- m_nMaxRows = _par0;
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setResultSetConcurrency(sal_Int32 _par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- switch(_par0)
- {
- case ResultSetConcurrency::READ_ONLY:
- m_eLockType = adLockReadOnly;
- break;
- default:
- m_eLockType = adLockOptimistic;
- break;
- }
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setResultSetType(sal_Int32 _par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- switch(_par0)
- {
- case ResultSetType::FORWARD_ONLY:
- m_eCursorType = adOpenForwardOnly;
- break;
- case ResultSetType::SCROLL_INSENSITIVE:
- m_eCursorType = adOpenKeyset;
- break;
- case ResultSetType::SCROLL_SENSITIVE:
- m_eCursorType = adOpenDynamic;
- break;
- }
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setFetchDirection(sal_Int32 /*_par0*/) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedException( "Statement::FetchDirection", *this );
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setFetchSize(sal_Int32 _par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- m_nFetchSize = _par0;
- // m_RecordSet.put_CacheSize(_par0);
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setMaxFieldSize(sal_Int32 /*_par0*/) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedException( "Statement::MaxFieldSize", *this );
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setCursorName(const ::rtl::OUString &_par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- m_Command.put_Name(_par0);
-}
-
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OStatement_Base::createArrayHelper( ) const
-{
- Sequence< com::sun::star::beans::Property > aProps(10);
- com::sun::star::beans::Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP0(CURSORNAME, ::rtl::OUString);
- DECL_BOOL_PROP0(ESCAPEPROCESSING);
- DECL_PROP0(FETCHDIRECTION,sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_PROP0(MAXFIELDSIZE,sal_Int32);
- DECL_PROP0(MAXROWS, sal_Int32);
- DECL_PROP0(QUERYTIMEOUT,sal_Int32);
- DECL_PROP0(RESULTSETCONCURRENCY,sal_Int32);
- DECL_PROP0(RESULTSETTYPE,sal_Int32);
- DECL_BOOL_PROP0(USEBOOKMARKS);
-
-
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OStatement_Base::getInfoHelper()
-{
- return *const_cast<OStatement_Base*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool OStatement_Base::convertFastPropertyValue(
- Any & rConvertedValue,
- Any & rOldValue,
- sal_Int32 nHandle,
- const Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException)
-{
- sal_Bool bModified = sal_False;
-
- sal_Bool bValidAdoRS = m_RecordSet.IsValid();
- // some of the properties below, when set, are remembered in a member, and applied in the next execute
- // For these properties, the record set does not need to be valid to allow setting them.
- // For all others (where the values are forwarded to the ADO RS directly), the recordset must be valid.
-
- try
- {
- switch(nHandle)
- {
- case PROPERTY_ID_MAXROWS:
- bModified = ::comphelper::tryPropertyValue( rConvertedValue, rOldValue, rValue, bValidAdoRS ? getMaxRows() : m_nMaxRows );
- break;
-
- case PROPERTY_ID_RESULTSETTYPE:
- bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getResultSetType());
- break;
- case PROPERTY_ID_FETCHSIZE:
- bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchSize());
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getResultSetConcurrency());
- break;
- case PROPERTY_ID_QUERYTIMEOUT:
- bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getQueryTimeOut());
- break;
- case PROPERTY_ID_MAXFIELDSIZE:
- bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getMaxFieldSize());
- break;
- case PROPERTY_ID_CURSORNAME:
- bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getCursorName());
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchDirection());
- break;
- }
- }
- catch( const Exception& e )
- {
- bModified = sal_True; // will ensure that the property is set
- OSL_FAIL( "OStatement_Base::convertFastPropertyValue: caught something strange!" );
- (void)e;
- }
- return bModified;
-}
-// -------------------------------------------------------------------------
-void OStatement_Base::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception)
-{
- switch(nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- setQueryTimeOut(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_MAXFIELDSIZE:
- setMaxFieldSize(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_MAXROWS:
- setMaxRows(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_CURSORNAME:
- setCursorName(comphelper::getString(rValue));
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- setResultSetConcurrency(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- setResultSetType(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- setFetchDirection(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_FETCHSIZE:
- setFetchSize(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_ESCAPEPROCESSING:
- // return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bAsLink);
- case PROPERTY_ID_USEBOOKMARKS:
- // return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bAsLink);
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-void OStatement_Base::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
-{
- switch(nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- rValue <<= getQueryTimeOut();
- break;
- case PROPERTY_ID_MAXFIELDSIZE:
- rValue <<= getMaxFieldSize();
- break;
- case PROPERTY_ID_MAXROWS:
- rValue <<= getMaxRows();
- break;
- case PROPERTY_ID_CURSORNAME:
- rValue <<= getCursorName();
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- rValue <<= getResultSetConcurrency();
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- rValue <<= getResultSetType();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- rValue <<= getFetchDirection();
- break;
- case PROPERTY_ID_FETCHSIZE:
- rValue <<= getFetchSize();
- break;
- case PROPERTY_ID_ESCAPEPROCESSING:
- rValue <<= sal_True;
- break;
- case PROPERTY_ID_USEBOOKMARKS:
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-OStatement::~OStatement()
-{
-}
-IMPLEMENT_SERVICE_INFO(OStatement,"com.sun.star.sdbcx.AStatement","com.sun.star.sdbc.Statement");
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::acquire() throw()
-{
- OStatement_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement::acquire() throw()
-{
- OStatement_Base::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement::release() throw()
-{
- OStatement_Base::release();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OStatement_Base::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/ATable.cxx b/connectivity/source/drivers/ado/ATable.cxx
deleted file mode 100644
index a4fadaa02b..0000000000
--- a/connectivity/source/drivers/ado/ATable.cxx
+++ /dev/null
@@ -1,259 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/ATable.hxx"
-#include "ado/AIndexes.hxx"
-#include "ado/AColumns.hxx"
-#include "ado/AColumn.hxx"
-#include "ado/AKeys.hxx"
-#include "ado/AConnection.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include "ado/Awrapado.hxx"
-#include <comphelper/sequence.hxx>
-#include "TConnection.hxx"
-#include <comphelper/types.hxx>
-
-using namespace ::comphelper;
-
-using namespace connectivity;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::container;
-using namespace com::sun::star::lang;
-
-// -------------------------------------------------------------------------
-OAdoTable::OAdoTable(sdbcx::OCollection* _pTables,sal_Bool _bCase,OCatalog* _pCatalog,_ADOTable* _pTable)
- : OTable_TYPEDEF(_pTables,_bCase,::rtl::OUString(),::rtl::OUString())
- ,m_pCatalog(_pCatalog)
-{
- construct();
- m_aTable = WpADOTable(_pTable);
- // m_aTable.putref_ParentCatalog(_pCatalog->getCatalog());
- fillPropertyValues();
-
-}
-// -----------------------------------------------------------------------------
-OAdoTable::OAdoTable(sdbcx::OCollection* _pTables,sal_Bool _bCase,OCatalog* _pCatalog)
- : OTable_TYPEDEF(_pTables,_bCase)
- ,m_pCatalog(_pCatalog)
-{
- construct();
- m_aTable.Create();
- m_aTable.putref_ParentCatalog(_pCatalog->getCatalog());
-
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoTable::disposing(void)
-{
- OTable_TYPEDEF::disposing();
- m_aTable.clear();
-}
-// -------------------------------------------------------------------------
-void OAdoTable::refreshColumns()
-{
- TStringVector aVector;
-
- WpADOColumns aColumns;
- if ( m_aTable.IsValid() )
- {
- aColumns = m_aTable.get_Columns();
- aColumns.fillElementNames(aVector);
- }
-
- if(m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pCatalog->getConnection());
-}
-// -------------------------------------------------------------------------
-void OAdoTable::refreshKeys()
-{
- TStringVector aVector;
-
- WpADOKeys aKeys;
- if(m_aTable.IsValid())
- {
- aKeys = m_aTable.get_Keys();
- aKeys.fillElementNames(aVector);
- }
-
- if(m_pKeys)
- m_pKeys->reFill(aVector);
- else
- m_pKeys = new OKeys(*this,m_aMutex,aVector,aKeys,isCaseSensitive(),m_pCatalog->getConnection());
-}
-// -------------------------------------------------------------------------
-void OAdoTable::refreshIndexes()
-{
- TStringVector aVector;
-
- WpADOIndexes aIndexes;
- if(m_aTable.IsValid())
- {
- aIndexes = m_aTable.get_Indexes();
- aIndexes.fillElementNames(aVector);
- }
-
- if(m_pIndexes)
- m_pIndexes->reFill(aVector);
- else
- m_pIndexes = new OIndexes(*this,m_aMutex,aVector,aIndexes,isCaseSensitive(),m_pCatalog->getConnection());
-}
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > OAdoTable::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OAdoTable::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OTable_TYPEDEF::getSomething(rId);
-}
-// -------------------------------------------------------------------------
-// XRename
-void SAL_CALL OAdoTable::rename( const ::rtl::OUString& newName ) throw(SQLException, ElementExistException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OTableDescriptor_BASE_TYPEDEF::rBHelper.bDisposed);
-
- m_aTable.put_Name(newName);
- ADOS::ThrowException(*(m_pCatalog->getConnection()->getConnection()),*this);
-
- OTable_TYPEDEF::rename(newName);
-}
-// -----------------------------------------------------------------------------
-Reference< XDatabaseMetaData> OAdoTable::getMetaData() const
-{
- return m_pCatalog->getConnection()->getMetaData();
-}
-// -------------------------------------------------------------------------
-// XAlterTable
-void SAL_CALL OAdoTable::alterColumnByName( const ::rtl::OUString& colName, const Reference< XPropertySet >& descriptor ) throw(SQLException, NoSuchElementException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OTableDescriptor_BASE_TYPEDEF::rBHelper.bDisposed);
-
- sal_Bool bError = sal_True;
- OAdoColumn* pColumn = NULL;
- if(::comphelper::getImplementation(pColumn,descriptor) && pColumn != NULL)
- {
- WpADOColumns aColumns = m_aTable.get_Columns();
- bError = !aColumns.Delete(colName);
- bError = bError || !aColumns.Append(pColumn->getColumnImpl());
- }
- if(bError)
- ADOS::ThrowException(*(m_pCatalog->getConnection()->getConnection()),*this);
-
- m_pColumns->refresh();
- refreshColumns();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OAdoTable::alterColumnByIndex( sal_Int32 index, const Reference< XPropertySet >& descriptor ) throw(SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OTableDescriptor_BASE_TYPEDEF::rBHelper.bDisposed);
-
- Reference< XPropertySet > xOld;
- m_pColumns->getByIndex(index) >>= xOld;
- if(xOld.is())
- alterColumnByName(getString(xOld->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))),descriptor);
-}
-// -------------------------------------------------------------------------
-void OAdoTable::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)throw (Exception)
-{
- if(m_aTable.IsValid())
- {
- switch(nHandle)
- {
- case PROPERTY_ID_NAME:
- m_aTable.put_Name(getString(rValue));
- break;
-
- case PROPERTY_ID_TYPE:
- OTools::putValue( m_aTable.get_Properties(),
- OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE),
- getString(rValue));
- break;
-
- case PROPERTY_ID_DESCRIPTION:
- OTools::putValue( m_aTable.get_Properties(),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Description")),
- getString(rValue));
- break;
-
- case PROPERTY_ID_SCHEMANAME:
- break;
-
- default:
- throw Exception();
- }
- }
- OTable_TYPEDEF::setFastPropertyValue_NoBroadcast(nHandle,rValue);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OAdoTable::acquire() throw()
-{
- OTable_TYPEDEF::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoTable::release() throw()
-{
- OTable_TYPEDEF::release();
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OAdoTable::getName() throw(::com::sun::star::uno::RuntimeException)
-{
- return m_aTable.get_Name();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/ATables.cxx b/connectivity/source/drivers/ado/ATables.cxx
deleted file mode 100644
index c9872c4bc7..0000000000
--- a/connectivity/source/drivers/ado/ATables.cxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/ATables.hxx"
-#include "ado/ATable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include "ado/ACatalog.hxx"
-#include "ado/AConnection.hxx"
-#include "ado/Awrapado.hxx"
-#include "TConnection.hxx"
-#include <comphelper/types.hxx>
-#include <cppuhelper/interfacecontainer.h>
-#include <connectivity/dbexception.hxx>
-#include "resource/ado_res.hrc"
-
-using namespace ::cppu;
-using namespace connectivity;
-using namespace comphelper;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::container;
-using namespace com::sun::star::lang;
-
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OTables::createObject(const ::rtl::OUString& _rName)
-{
- OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid");
- return new OAdoTable(this,isCaseSensitive(),m_pCatalog,m_aCollection.GetItem(_rName));
-}
-// -------------------------------------------------------------------------
-void OTables::impl_refresh( ) throw(RuntimeException)
-{
- OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid");
- m_aCollection.Refresh();
- m_pCatalog->refreshTables();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OTables::createDescriptor()
-{
- return new OAdoTable(this,isCaseSensitive(),m_pCatalog);
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OTables::appendObject( const ::rtl::OUString&, const Reference< XPropertySet >& descriptor )
-{
- OAdoTable* pTable = NULL;
- if ( !getImplementation( pTable, descriptor ) || pTable == NULL )
- m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_TABLE_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
-
- OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid");
- if(!m_aCollection.Append(pTable->getImpl()))
- ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),static_cast<XTypeProvider*>(this));
- m_aCollection.Refresh();
-
- return new OAdoTable(this,isCaseSensitive(),m_pCatalog,pTable->getImpl());
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OTables::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid");
- if ( !m_aCollection.Delete(_sElementName) )
- ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),static_cast<XTypeProvider*>(this));
-}
-// -----------------------------------------------------------------------------
-void OTables::appendNew(const ::rtl::OUString& _rsNewTable)
-{
- OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid");
- m_aCollection.Refresh();
-
- insertElement(_rsNewTable,NULL);
-
- // notify our container listeners
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rsNewTable), Any(), Any());
- OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
- while (aListenerLoop.hasMoreElements())
- static_cast<XContainerListener*>(aListenerLoop.next())->elementInserted(aEvent);
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AUser.cxx b/connectivity/source/drivers/ado/AUser.cxx
deleted file mode 100644
index 350f0362ab..0000000000
--- a/connectivity/source/drivers/ado/AUser.cxx
+++ /dev/null
@@ -1,227 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AUser.hxx"
-#include "ado/ACatalog.hxx"
-#include "ado/AGroups.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "ado/AConnection.hxx"
-#include "ado/Awrapado.hxx"
-
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-
-// -------------------------------------------------------------------------
-OAdoUser::OAdoUser(OCatalog* _pParent,sal_Bool _bCase, ADOUser* _pUser)
- : OUser_TYPEDEF(_bCase)
- ,m_pCatalog(_pParent)
-{
- construct();
-
- if(_pUser)
- m_aUser = WpADOUser(_pUser);
- else
- m_aUser.Create();
-}
-// -------------------------------------------------------------------------
-OAdoUser::OAdoUser(OCatalog* _pParent,sal_Bool _bCase, const ::rtl::OUString& _Name)
- : OUser_TYPEDEF(_Name,_bCase)
- , m_pCatalog(_pParent)
-{
- construct();
- m_aUser.Create();
- m_aUser.put_Name(_Name);
-}
-// -------------------------------------------------------------------------
-void OAdoUser::refreshGroups()
-{
- TStringVector aVector;
- WpADOGroups aGroups(m_aUser.get_Groups());
- aGroups.fillElementNames(aVector);
- if(m_pGroups)
- m_pGroups->reFill(aVector);
- else
- m_pGroups = new OGroups(m_pCatalog,m_aMutex,aVector,aGroups,isCaseSensitive());
-}
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > OAdoUser::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OAdoUser::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OUser_TYPEDEF::getSomething(rId);
-}
-
-// -------------------------------------------------------------------------
-void OAdoUser::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)throw (Exception)
-{
- if(m_aUser.IsValid())
- {
-
- switch(nHandle)
- {
- case PROPERTY_ID_NAME:
- {
- ::rtl::OUString aVal;
- rValue >>= aVal;
- m_aUser.put_Name(aVal);
- }
- break;
- }
- }
-}
-// -------------------------------------------------------------------------
-void OAdoUser::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
-{
- if(m_aUser.IsValid())
- {
- switch(nHandle)
- {
- case PROPERTY_ID_NAME:
- rValue <<= m_aUser.get_Name();
- break;
- }
- }
-}
-// -------------------------------------------------------------------------
-OUserExtend::OUserExtend(OCatalog* _pParent,sal_Bool _bCase, ADOUser* _pUser)
- : OAdoUser(_pParent,_bCase,_pUser)
-{
-}
-// -------------------------------------------------------------------------
-OUserExtend::OUserExtend(OCatalog* _pParent,sal_Bool _bCase, const ::rtl::OUString& _Name)
- : OAdoUser(_pParent,_bCase,_Name)
-{
-}
-
-// -------------------------------------------------------------------------
-void OUserExtend::construct()
-{
- OUser_TYPEDEF::construct();
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD), PROPERTY_ID_PASSWORD,0,&m_Password,::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
-}
-// -----------------------------------------------------------------------------
-cppu::IPropertyArrayHelper* OUserExtend::createArrayHelper() const
-{
- Sequence< com::sun::star::beans::Property > aProps;
- describeProperties(aProps);
- return new cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-cppu::IPropertyArrayHelper & OUserExtend::getInfoHelper()
-{
- return *OUserExtend_PROP::getArrayHelper();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoUser::acquire() throw()
-{
- OUser_TYPEDEF::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoUser::release() throw()
-{
- OUser_TYPEDEF::release();
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OAdoUser::getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_TYPEDEF::rBHelper.bDisposed);
-
- return ADOS::mapAdoRights2Sdbc(m_aUser.GetPermissions(objName, ADOS::mapObjectType2Ado(objType)));
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OAdoUser::getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_TYPEDEF::rBHelper.bDisposed);
-
- sal_Int32 nRights = 0;
- RightsEnum eRights = m_aUser.GetPermissions(objName, ADOS::mapObjectType2Ado(objType));
- if((eRights & adRightWithGrant) == adRightWithGrant)
- nRights = ADOS::mapAdoRights2Sdbc(eRights);
- ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),*this);
- return nRights;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OAdoUser::grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_TYPEDEF::rBHelper.bDisposed);
- m_aUser.SetPermissions(objName,ADOS::mapObjectType2Ado(objType),adAccessGrant,RightsEnum(ADOS::mapRights2Ado(objPrivileges)));
- ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),*this);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OAdoUser::revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_TYPEDEF::rBHelper.bDisposed);
- m_aUser.SetPermissions(objName,ADOS::mapObjectType2Ado(objType),adAccessRevoke,RightsEnum(ADOS::mapRights2Ado(objPrivileges)));
- ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),*this);
-}
-// -----------------------------------------------------------------------------
-// XUser
-void SAL_CALL OAdoUser::changePassword( const ::rtl::OUString& objPassword, const ::rtl::OUString& newPassword ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_TYPEDEF::rBHelper.bDisposed);
- m_aUser.ChangePassword(objPassword,newPassword);
- ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),*this);
-}
-// -----------------------------------------------------------------------------
-
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AUsers.cxx b/connectivity/source/drivers/ado/AUsers.cxx
deleted file mode 100644
index e1abe6f2c9..0000000000
--- a/connectivity/source/drivers/ado/AUsers.cxx
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AUsers.hxx"
-#include "ado/AUser.hxx"
-#include "ado/ATable.hxx"
-#include "ado/AConnection.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "connectivity/sdbcx/IRefreshable.hxx"
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-#include "resource/ado_res.hrc"
-
-using namespace comphelper;
-using namespace connectivity;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::container;
-
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OUsers::createObject(const ::rtl::OUString& _rName)
-{
- return new OAdoUser(m_pCatalog,isCaseSensitive(),_rName);
-}
-// -------------------------------------------------------------------------
-void OUsers::impl_refresh() throw(RuntimeException)
-{
- m_aCollection.Refresh();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OUsers::createDescriptor()
-{
- return new OUserExtend(m_pCatalog,isCaseSensitive());
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OUsers::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- OUserExtend* pUser = NULL;
- if ( !getImplementation( pUser, descriptor ) || pUser == NULL )
- m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_USER_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
-
- ADOUsers* pUsers = (ADOUsers*)m_aCollection;
- pUsers->Append(OLEVariant(pUser->getImpl()),OLEString(pUser->getPassword()));
-
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OUsers::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- m_aCollection.Delete(_sElementName);
-}
-// -------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AView.cxx b/connectivity/source/drivers/ado/AView.cxx
deleted file mode 100644
index a5bc0d5491..0000000000
--- a/connectivity/source/drivers/ado/AView.cxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AView.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "ado/adoimp.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include "ado/Awrapado.hxx"
-#include <comphelper/sequence.hxx>
-#include <comphelper/types.hxx>
-#include "TConnection.hxx"
-
-// -------------------------------------------------------------------------
-using namespace comphelper;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-
-// IMPLEMENT_SERVICE_INFO(OAdoView,"com.sun.star.sdbcx.AView","com.sun.star.sdbcx.View");
-// -------------------------------------------------------------------------
-OAdoView::OAdoView(sal_Bool _bCase,ADOView* _pView) : OView_ADO(_bCase,NULL)
-,m_aView(_pView)
-{
-}
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > OAdoView::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OAdoView::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OView_ADO::getSomething(rId);
-}
-
-// -------------------------------------------------------------------------
-void OAdoView::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
-{
- if(m_aView.IsValid())
- {
- switch(nHandle)
- {
- case PROPERTY_ID_NAME:
- rValue <<= m_aView.get_Name();
- break;
- case PROPERTY_ID_CATALOGNAME:
- break;
- case PROPERTY_ID_SCHEMANAME:
- // rValue <<= m_aView.get_Type();
- break;
- case PROPERTY_ID_COMMAND:
- {
- OLEVariant aVar;
- m_aView.get_Command(aVar);
- if(!aVar.isNull() && !aVar.isEmpty())
- {
- ADOCommand* pCom = (ADOCommand*)aVar.getIDispatch();
- OLEString aBSTR;
- pCom->get_CommandText(&aBSTR);
- rValue <<= (::rtl::OUString) aBSTR;
- }
- }
- break;
- }
- }
- else
- OView_ADO::getFastPropertyValue(rValue,nHandle);
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoView::acquire() throw()
-{
- OView_ADO::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OAdoView::release() throw()
-{
- OView_ADO::release();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/AViews.cxx b/connectivity/source/drivers/ado/AViews.cxx
deleted file mode 100644
index bf99464dfa..0000000000
--- a/connectivity/source/drivers/ado/AViews.cxx
+++ /dev/null
@@ -1,106 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/AViews.hxx"
-#include "ado/AView.hxx"
-#include "ado/ATables.hxx"
-#include "ado/ACatalog.hxx"
-#include "ado/AConnection.hxx"
-#include "ado/Awrapado.hxx"
-#include "TConnection.hxx"
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-#include "resource/ado_res.hrc"
-
-using namespace ::comphelper;
-
-using namespace connectivity;
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::container;
-
-sdbcx::ObjectType OViews::createObject(const ::rtl::OUString& _rName)
-{
- OAdoView* pView = new OAdoView(isCaseSensitive(),m_aCollection.GetItem(_rName));
- pView->setNew(sal_False);
- return pView;
-}
-// -------------------------------------------------------------------------
-void OViews::impl_refresh( ) throw(RuntimeException)
-{
- m_aCollection.Refresh();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OViews::createDescriptor()
-{
- return new OAdoView(isCaseSensitive());
-}
-
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OViews::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- OAdoView* pView = NULL;
- if ( !getImplementation( pView, descriptor ) || pView == NULL )
- m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_VIEW_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
-
- WpADOCommand aCommand;
- aCommand.Create();
- if ( !aCommand.IsValid() )
- m_pCatalog->getConnection()->throwGenericSQLException( STR_VIEW_NO_COMMAND_ERROR,static_cast<XTypeProvider*>(this) );
-
- ::rtl::OUString sName( _rForName );
- aCommand.put_Name(sName);
- aCommand.put_CommandText(getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_COMMAND))));
- ADOViews* pViews = (ADOViews*)m_aCollection;
- if(FAILED(pViews->Append(OLEString(sName),aCommand)))
- ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),static_cast<XTypeProvider*>(this));
-
- OTables* pTables = static_cast<OTables*>(static_cast<OCatalog&>(m_rParent).getPrivateTables());
- if ( pTables )
- pTables->appendNew(sName);
-
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OViews::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- if(!m_aCollection.Delete(_sElementName))
- ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),static_cast<XTypeProvider*>(this));
-}
-// -------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/Aolevariant.cxx b/connectivity/source/drivers/ado/Aolevariant.cxx
deleted file mode 100644
index c22e7e2c90..0000000000
--- a/connectivity/source/drivers/ado/Aolevariant.cxx
+++ /dev/null
@@ -1,794 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/Aolevariant.hxx"
-#include "connectivity/dbconversion.hxx"
-#include <com/sun/star/sdbc/SQLException.hpp>
-#include <com/sun/star/util/Time.hpp>
-#include <com/sun/star/util/Date.hpp>
-#include <com/sun/star/util/DateTime.hpp>
-#include "diagnose_ex.h"
-#include "resource/sharedresources.hxx"
-#include "resource/ado_res.hrc"
-#include "com/sun/star/bridge/oleautomation/Date.hpp"
-#include "com/sun/star/bridge/oleautomation/Currency.hpp"
-#include "com/sun/star/bridge/oleautomation/SCode.hpp"
-#include "com/sun/star/bridge/oleautomation/Decimal.hpp"
-
-using namespace com::sun::star::beans;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::bridge::oleautomation;
-using namespace connectivity::ado;
-using ::rtl::OUString;
-
-OLEString::OLEString()
- :m_sStr(NULL)
-{
-}
-OLEString::OLEString(const BSTR& _sBStr)
- :m_sStr(_sBStr)
-{
-}
-OLEString::OLEString(const ::rtl::OUString& _sBStr)
-{
- m_sStr = ::SysAllocString(reinterpret_cast<LPCOLESTR>(_sBStr.getStr()));
-}
-OLEString::~OLEString()
-{
- if(m_sStr)
- ::SysFreeString(m_sStr);
-}
-OLEString& OLEString::operator=(const ::rtl::OUString& _rSrc)
-{
- if(m_sStr)
- ::SysFreeString(m_sStr);
- m_sStr = ::SysAllocString(reinterpret_cast<LPCOLESTR>(_rSrc.getStr()));
- return *this;
-}
-OLEString& OLEString::operator=(const OLEString& _rSrc)
-{
- if(this != &_rSrc)
- {
- if(m_sStr)
- ::SysFreeString(m_sStr);
- m_sStr = ::SysAllocString(_rSrc.m_sStr);
- }
- return *this;
-}
-OLEString& OLEString::operator=(const BSTR& _rSrc)
-{
- if(m_sStr)
- ::SysFreeString(m_sStr);
- m_sStr = _rSrc;
- return *this;
-}
-OLEString::operator ::rtl::OUString() const
-{
- return (m_sStr != NULL) ? ::rtl::OUString(reinterpret_cast<const sal_Unicode*>(LPCOLESTR(m_sStr)),::SysStringLen(m_sStr)) : ::rtl::OUString();
-}
-OLEString::operator BSTR() const
-{
- return m_sStr;
-}
-BSTR* OLEString::operator &()
-{
- return &m_sStr;
-}
-sal_Int32 OLEString::length() const
-{
- return (m_sStr != NULL) ? ::SysStringLen(m_sStr) : 0;
-}
-
-OLEVariant::OLEVariant()
-{
- VariantInit(this);
-}
-OLEVariant::OLEVariant(const VARIANT& varSrc)
-{
- ::VariantInit(this);
- HRESULT eRet = ::VariantCopy(this, const_cast<VARIANT*>(&varSrc));
- OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!");
- OSL_UNUSED(eRet);
-}
-OLEVariant::OLEVariant(const OLEVariant& varSrc)
-{
- ::VariantInit(this);
- HRESULT eRet = ::VariantCopy(this, const_cast<VARIANT*>(static_cast<const VARIANT*>(&varSrc)));
- OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!");
- OSL_UNUSED(eRet);
-}
-
-OLEVariant::OLEVariant(sal_Bool x) { VariantInit(this); vt = VT_BOOL; boolVal = (x ? VARIANT_TRUE : VARIANT_FALSE);}
-OLEVariant::OLEVariant(sal_Int8 n) { VariantInit(this); vt = VT_I1; bVal = n;}
-OLEVariant::OLEVariant(sal_Int16 n) { VariantInit(this); vt = VT_I2; intVal = n;}
-OLEVariant::OLEVariant(sal_Int32 n) { VariantInit(this); vt = VT_I4; lVal = n;}
-OLEVariant::OLEVariant(sal_Int64 x) { VariantInit(this); vt = VT_I4; lVal = (LONG)x;}
-
-OLEVariant::OLEVariant(const rtl::OUString& us)
-{
- ::VariantInit(this);
- vt = VT_BSTR;
- bstrVal = SysAllocString(reinterpret_cast<LPCOLESTR>(us.getStr()));
-}
-OLEVariant::~OLEVariant()
-{
- HRESULT eRet = ::VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
-} // clears all the memory that was allocated before
-
-OLEVariant::OLEVariant(const ::com::sun::star::util::Date& x )
-{
- VariantInit(this);
- vt = VT_DATE;
- dblVal = ::dbtools::DBTypeConversion::toDouble(x,::com::sun::star::util::Date(30,12,1899));
-}
-OLEVariant::OLEVariant(const ::com::sun::star::util::Time& x )
-{
- VariantInit(this);
- vt = VT_DATE;
- dblVal = ::dbtools::DBTypeConversion::toDouble(x);
-}
-OLEVariant::OLEVariant(const ::com::sun::star::util::DateTime& x )
-{
- VariantInit(this);
- vt = VT_DATE;
- dblVal = ::dbtools::DBTypeConversion::toDouble(x,::com::sun::star::util::Date(30,12,1899));
-}
-OLEVariant::OLEVariant(const float &x)
-{
- VariantInit(this);
- vt = VT_R4;
- fltVal = x;
-}
-OLEVariant::OLEVariant(const double &x)
-{
- VariantInit(this);
- vt = VT_R8;
- dblVal = x;
-}
-
-
-OLEVariant::OLEVariant(IDispatch* pDispInterface)
-{
- VariantInit(this);
- setIDispatch( pDispInterface );
-}
-
-OLEVariant::OLEVariant(const ::com::sun::star::uno::Sequence< sal_Int8 >& x)
-{
- VariantInit(this);
-
- vt = VT_ARRAY|VT_UI1;
-
- SAFEARRAYBOUND rgsabound[1];
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = x.getLength();
- // parray = SafeArrayCreate(VT_UI1,1,rgsabound);
- parray = SafeArrayCreateVector(VT_UI1, 0, x.getLength());
- const sal_Int8* pBegin = x.getConstArray();
- const sal_Int8* pEnd = pBegin + x.getLength();
-
- for(sal_Int32 i=0;pBegin != pEnd;++i,++pBegin)
- {
- sal_Int32 nData = *pBegin;
- HRESULT rs = SafeArrayPutElement(parray,&i,&nData);
- OSL_ENSURE(S_OK == rs,"Error while copy byte data");
- OSL_UNUSED(rs);
- }
-}
-//
-OLEVariant& OLEVariant::operator=(const OLEVariant& varSrc)
-{
- HRESULT eRet = ::VariantCopy(this, const_cast<VARIANT*>(static_cast<const VARIANT*>(&varSrc)));
- OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!");
- OSL_UNUSED(eRet);
- return *this;
-}
-// Assign a const VARIANT& (::VariantCopy handles everything)
-//
-OLEVariant& OLEVariant::operator=(const tagVARIANT& varSrc)
-{
- HRESULT eRet = ::VariantCopy(this, const_cast<VARIANT*>(&varSrc));
- OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!");
- OSL_UNUSED(eRet);
-
- return *this;
-}
-
-// Assign a const VARIANT* (::VariantCopy handles everything)
-//
-OLEVariant& OLEVariant::operator=(const VARIANT* pSrc)
-{
- HRESULT eRet = ::VariantCopy(this, const_cast<VARIANT*>(pSrc));
- OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!");
- OSL_UNUSED(eRet);
-
- return *this;
-}
-
-void OLEVariant::setByte(sal_uInt8 n)
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_UI1;
- bVal = n;
-}
-void OLEVariant::setInt16(sal_Int16 n)
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_I2;
- iVal = n;
-}
-void OLEVariant::setInt32(sal_Int32 n)
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_I4;
- lVal = n;
-}
-void OLEVariant::setFloat(float f)
-{ HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_R4;
- fltVal = f;
-}
-void OLEVariant::setDouble(double d)
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_R8;
- dblVal = d;
-}
-void OLEVariant::setDate(DATE d)
-{ HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_DATE;
- date = d;
-}
-void OLEVariant::setChar(unsigned char a)
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_UI1;
- bVal = a;
-}
-void OLEVariant::setCurrency(double aCur)
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_CY;
- set(aCur*10000);
-}
-void OLEVariant::setBool(sal_Bool b)
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_BOOL;
- boolVal = b ? VARIANT_TRUE : VARIANT_FALSE;
-}
-void OLEVariant::setString(const rtl::OUString& us)
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_BSTR;
- bstrVal = ::SysAllocString(reinterpret_cast<LPCOLESTR>(us.getStr()));
-}
-void OLEVariant::setNoArg()
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_ERROR;
- scode = DISP_E_PARAMNOTFOUND;
-}
-
-void OLEVariant::setNull()
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_NULL;
-}
-void OLEVariant::setEmpty()
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_EMPTY;
-}
-
-void OLEVariant::setUI1SAFEARRAYPtr(SAFEARRAY* pSafeAr)
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = VT_ARRAY|VT_UI1; parray = pSafeAr;
-}
-
-void OLEVariant::setArray(SAFEARRAY* pSafeArray, VARTYPE vtType)
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
- vt = (VARTYPE)(VT_ARRAY|vtType);
- parray = pSafeArray;
-}
-
-void OLEVariant::setIDispatch(IDispatch* pDispInterface)
-{
- HRESULT eRet = VariantClear(this);
- OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!");
- OSL_UNUSED(eRet);
-
- vt = VT_DISPATCH;
- pdispVal = pDispInterface;
-
- if ( pDispInterface )
- pDispInterface->AddRef();
-}
-
-
-sal_Bool OLEVariant::isNull() const { return (vt == VT_NULL); }
-sal_Bool OLEVariant::isEmpty() const { return (vt == VT_EMPTY); }
-
-VARTYPE OLEVariant::getType() const { return vt; }
-
-OLEVariant::operator ::com::sun::star::util::Date() const
-{
- return isNull() ? ::com::sun::star::util::Date(30,12,1899) : ::dbtools::DBTypeConversion::toDate(getDate(),::com::sun::star::util::Date(30,12,1899));
-}
-OLEVariant::operator ::com::sun::star::util::Time() const
-{
- return isNull() ? ::com::sun::star::util::Time() : ::dbtools::DBTypeConversion::toTime(getDate());
-}
-OLEVariant::operator ::com::sun::star::util::DateTime()const
-{
- return isNull() ? ::com::sun::star::util::DateTime() : ::dbtools::DBTypeConversion::toDateTime(getDate(),::com::sun::star::util::Date(30,12,1899));
-}
-
-VARIANT_BOOL OLEVariant::VariantBool(sal_Bool bEinBoolean)
-{
- return (bEinBoolean ? VARIANT_TRUE : VARIANT_FALSE);
-}
-
-void OLEVariant::CHS()
-{
- cyVal.Lo ^= (sal_uInt32)-1;
- cyVal.Hi ^= -1;
- cyVal.Lo++;
- if( !cyVal.Lo )
- cyVal.Hi++;
-}
-
-void OLEVariant::set(double n)
-{
- if( n >= 0 )
- {
- cyVal.Hi = (sal_Int32)(n / (double)4294967296.0);
- cyVal.Lo = (sal_uInt32)(n - ((double)cyVal.Hi * (double)4294967296.0));
- }
- else {
- cyVal.Hi = (sal_Int32)(-n / (double)4294967296.0);
- cyVal.Lo = (sal_uInt32)(-n - ((double)cyVal.Hi * (double)4294967296.0));
- CHS();
- }
-}
-
-OLEVariant::operator rtl::OUString() const
-{
- if (V_VT(this) == VT_BSTR)
- return reinterpret_cast<const sal_Unicode*>(LPCOLESTR(V_BSTR(this)));
-
- if(isNull())
- return ::rtl::OUString();
-
- OLEVariant varDest;
-
- varDest.ChangeType(VT_BSTR, this);
-
- return reinterpret_cast<const sal_Unicode*>(LPCOLESTR(V_BSTR(&varDest)));
-}
-
-// -----------------------------------------------------------------------------
-void OLEVariant::ChangeType(VARTYPE vartype, const OLEVariant* pSrc)
-{
- //
- // If pDest is NULL, convert type in place
- //
- if (pSrc == NULL)
- pSrc = this;
-
- if ( ( this != pSrc )
- || ( vartype != V_VT( this ) )
- )
- {
- if ( FAILED( ::VariantChangeType( static_cast< VARIANT* >( this ),
- const_cast< VARIANT* >( static_cast< const VARIANT* >( pSrc ) ),
- 0,
- vartype ) ) )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(STR_TYPE_NOT_CONVERT));
- throw ::com::sun::star::sdbc::SQLException(
- sError,
- NULL,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "S1000" )),
- 1000,
- ::com::sun::star::uno::Any()
- );
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-OLEVariant::operator ::com::sun::star::uno::Sequence< sal_Int8 >() const
-{
- ::com::sun::star::uno::Sequence< sal_Int8 > aRet;
- if(V_VT(this) == VT_BSTR)
- {
- OLEString sStr(V_BSTR(this));
- aRet = ::com::sun::star::uno::Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>((const wchar_t*)sStr),sizeof(sal_Unicode)*sStr.length());
- }
- else if(!isNull())
- {
- SAFEARRAY* pArray = getUI1SAFEARRAYPtr();
-
- if(pArray)
- {
- HRESULT hresult1,hresult2;
- long lBound,uBound;
- // Verify that the SafeArray is the proper shape.
- hresult1 = ::SafeArrayGetLBound(pArray, 1, &lBound);
- hresult2 = ::SafeArrayGetUBound(pArray, 1, &uBound);
- if ( SUCCEEDED(hresult1) && SUCCEEDED(hresult2) )
- {
- long nCount = uBound-lBound+1;
- aRet.realloc(nCount);
- sal_Int8* pData = aRet.getArray();
- for(long i=0; SUCCEEDED(hresult1) && lBound <= uBound ;++i,++lBound)
- {
- sal_Int32 nData = 0;
- hresult1 = ::SafeArrayGetElement(pArray,&lBound,&nData);
- if ( SUCCEEDED(hresult1) )
- {
- *pData = static_cast<sal_Int8>(nData);
- ++pData;
- }
- }
- }
- }
- }
-
- return aRet;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OLEVariant::getString() const
-{
- if(isNull())
- return ::rtl::OUString();
- else
- return *this;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OLEVariant::getBool() const
-{
- if (V_VT(this) == VT_BOOL)
- return V_BOOL(this) == VARIANT_TRUE ? sal_True : sal_False;
- if(isNull())
- return sal_False;
-
- OLEVariant varDest;
-
- varDest.ChangeType(VT_BOOL, this);
-
- return V_BOOL(&varDest) == VARIANT_TRUE ? sal_True : sal_False;
-}
-// -----------------------------------------------------------------------------
-IUnknown* OLEVariant::getIUnknown() const
-{
- if (V_VT(this) == VT_UNKNOWN)
- {
- return V_UNKNOWN(this);
- }
- if(isNull())
- return NULL;
-
- OLEVariant varDest;
-
- varDest.ChangeType(VT_UNKNOWN, this);
-
- V_UNKNOWN(&varDest)->AddRef();
- return V_UNKNOWN(&varDest);
-}
-// -----------------------------------------------------------------------------
-IDispatch* OLEVariant::getIDispatch() const
-{
- if (V_VT(this) == VT_DISPATCH)
- {
- return V_DISPATCH(this);
- }
-
- if(isNull())
- return NULL;
-
- OLEVariant varDest;
-
- varDest.ChangeType(VT_DISPATCH, this);
-
- V_DISPATCH(&varDest)->AddRef();
- return V_DISPATCH(&varDest);
-}
-// -----------------------------------------------------------------------------
-sal_uInt8 OLEVariant::getByte() const
-{
- if (V_VT(this) == VT_UI1)
- return V_UI1(this);
-
- if(isNull())
- return sal_Int8(0);
- OLEVariant varDest;
-
- varDest.ChangeType(VT_UI1, this);
-
- return V_UI1(&varDest);
-}
-// -----------------------------------------------------------------------------
-sal_Int16 OLEVariant::getInt16() const
-{
- if (V_VT(this) == VT_I2)
- return V_I2(this);
-
- if(isNull())
- return sal_Int16(0);
- OLEVariant varDest;
-
- varDest.ChangeType(VT_I2, this);
-
- return V_I2(&varDest);
-}
-// -----------------------------------------------------------------------------
-sal_Int8 OLEVariant::getInt8() const
-{
- if (V_VT(this) == VT_I1)
- return V_I1(this);
-
- if(isNull())
- return sal_Int8(0);
-
- OLEVariant varDest;
-
- varDest.ChangeType(VT_I1, this);
-
- return V_I1(&varDest);
-}
-// -----------------------------------------------------------------------------
-sal_Int32 OLEVariant::getInt32() const
-{
- if (V_VT(this) == VT_I4)
- return V_I4(this);
-
- if(isNull())
- return sal_Int32(0);
-
- OLEVariant varDest;
-
- varDest.ChangeType(VT_I4, this);
-
- return V_I4(&varDest);
-}
-// -----------------------------------------------------------------------------
-sal_uInt32 OLEVariant::getUInt32() const
-{
- if (V_VT(this) == VT_UI4)
- return V_UI4(this);
-
- if(isNull())
- return sal_uInt32(0);
-
- OLEVariant varDest;
-
- varDest.ChangeType(VT_UI4, this);
-
- return V_UI4(&varDest);
-}
-// -----------------------------------------------------------------------------
-float OLEVariant::getFloat() const
-{
- if (V_VT(this) == VT_R4)
- return V_R4(this);
-
- if(isNull())
- return float(0);
- OLEVariant varDest;
-
- varDest.ChangeType(VT_R4, this);
-
- return V_R4(&varDest);
-}
-// -----------------------------------------------------------------------------
-double OLEVariant::getDouble() const
-{
- if (V_VT(this) == VT_R8)
- return V_R8(this);
-
- if(isNull())
- return double(0);
- OLEVariant varDest;
-
- varDest.ChangeType(VT_R8, this);
-
- return V_R8(&varDest);
-}
-// -----------------------------------------------------------------------------
-double OLEVariant::getDate() const
-{
- if (V_VT(this) == VT_DATE)
- return V_DATE(this);
-
- if(isNull())
- return double(0);
- OLEVariant varDest;
-
- varDest.ChangeType(VT_DATE, this);
-
- return V_DATE(&varDest);
-}
-// -----------------------------------------------------------------------------
-CY OLEVariant::getCurrency() const
-{
- if (V_VT(this) == VT_CY)
- return V_CY(this);
-
- if(isNull())
- {
- CY aVar;
- aVar.int64 = sal_Int64(0);
- return aVar;
- }
- OLEVariant varDest;
-
- varDest.ChangeType(VT_CY, this);
-
- return V_CY(&varDest);
-}
-// -----------------------------------------------------------------------------
-SAFEARRAY* OLEVariant::getUI1SAFEARRAYPtr() const
-{
- if (V_VT(this) == (VT_ARRAY|VT_UI1))
- return V_ARRAY(this);
-
- if(isNull())
- return (0);
- OLEVariant varDest;
-
- varDest.ChangeType((VT_ARRAY|VT_UI1), this);
-
- return V_ARRAY(&varDest);
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Any OLEVariant::makeAny() const
-{
- ::com::sun::star::uno::Any aValue;
- switch (V_VT(this))
- {
- case VT_EMPTY:
- case VT_NULL:
- aValue.setValue(NULL, Type());
- break;
- case VT_I2:
- aValue.setValue( & iVal, getCppuType( (sal_Int16*)0));
- break;
- case VT_I4:
- aValue.setValue( & lVal, getCppuType( (sal_Int32*)0));
- break;
- case VT_R4:
- aValue.setValue( & fltVal, getCppuType( (float*)0));
- break;
- case VT_R8:
- aValue.setValue(& dblVal, getCppuType( (double*)0));
- break;
- case VT_CY:
- {
- Currency cy(cyVal.int64);
- aValue <<= cy;
- break;
- }
- case VT_DATE:
- {
- aValue <<= (::com::sun::star::util::Date)*this;
- break;
- }
- case VT_BSTR:
- {
- OUString b(reinterpret_cast<const sal_Unicode*>(bstrVal));
- aValue.setValue( &b, getCppuType( &b));
- break;
- }
- case VT_BOOL:
- {
- sal_Bool b= boolVal == VARIANT_TRUE;
- aValue.setValue( &b, getCppuType( &b));
- break;
- }
- case VT_I1:
- aValue.setValue( & cVal, getCppuType((sal_Int8*)0));
- break;
- case VT_UI1: // there is no unsigned char in UNO
- aValue.setValue( & bVal, getCppuType( (sal_Int8*)0));
- break;
- case VT_UI2:
- aValue.setValue( & uiVal, getCppuType( (sal_uInt16*)0));
- break;
- case VT_UI4:
- aValue.setValue( & ulVal, getCppuType( (sal_uInt32*)0));
- break;
- case VT_INT:
- aValue.setValue( & intVal, getCppuType( (sal_Int32*)0));
- break;
- case VT_UINT:
- aValue.setValue( & uintVal, getCppuType( (sal_uInt32*)0));
- break;
- case VT_VOID:
- aValue.setValue( NULL, Type());
- break;
- case VT_DECIMAL:
- {
- Decimal dec;
- dec.Scale = decVal.scale;
- dec.Sign = decVal.sign;
- dec.LowValue = decVal.Lo32;
- dec.MiddleValue = decVal.Mid32;
- dec.HighValue = decVal.Hi32;
- aValue <<= dec;
- break;
- }
-
- default:
- break;
- }
- return aValue;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/Aservices.cxx b/connectivity/source/drivers/ado/Aservices.cxx
deleted file mode 100644
index 210cf52792..0000000000
--- a/connectivity/source/drivers/ado/Aservices.cxx
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ado/ADriver.hxx"
-#include <cppuhelper/factory.hxx>
-
-using namespace connectivity::ado;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames ,
- rtl_ModuleCount* _pT
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString(RTL_CONSTASCII_USTRINGPARAM(pImplementationName)))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **ppEnvTypeName,
- uno_Environment ** /*ppEnv*/)
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ":affine";
-}
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- ODriver::getImplementationName_Static(),
- ODriver::getSupportedServiceNames_Static(),
- ODriver_CreateInstance, ::cppu::createSingleFactory)
- ;
-
- if(aReq.xRet.is())
- aReq.xRet->acquire();
-
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx
deleted file mode 100644
index 47886990a6..0000000000
--- a/connectivity/source/drivers/ado/Awrapado.cxx
+++ /dev/null
@@ -1,2205 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <sal/macros.h>
-#include "ado/Awrapado.hxx"
-#include "ado/Awrapadox.hxx"
-#include <comphelper/types.hxx>
-#include <rtl/ustrbuf.hxx>
-#include "diagnose_ex.h"
-
-namespace connectivity
-{
- namespace ado
- {
- sal_Int32 nAdoObjectCounter = 0;
- }
-}
-
-using namespace connectivity::ado;
-
-void WpADOCatalog::Create()
-{
- HRESULT hr = -1;
- _ADOCatalog* pCommand;
- hr = CoCreateInstance(ADOS::CLSID_ADOCATALOG_25,
- NULL,
- CLSCTX_INPROC_SERVER,
- ADOS::IID_ADOCATALOG_25,
- (void**)&pCommand );
-
-
- if( !FAILED( hr ) )
- setWithOutAddRef(pCommand);
-}
-
-
-WpADOProperties WpADOConnection::get_Properties() const
-{
- ADOProperties* pProps=NULL;
- pInterface->get_Properties(&pProps);
- WpADOProperties aProps;
- aProps.setWithOutAddRef(pProps);
- return aProps;
-}
-
-rtl::OUString WpADOConnection::GetConnectionString() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_ConnectionString(&aBSTR);
- return aBSTR;
-}
-
-sal_Bool WpADOConnection::PutConnectionString(const ::rtl::OUString &aCon) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString bstr(aCon);
- sal_Bool bErg = SUCCEEDED(pInterface->put_ConnectionString(bstr));
-
- return bErg;
-}
-
-sal_Int32 WpADOConnection::GetCommandTimeout() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 nRet=0;
- pInterface->get_CommandTimeout(&nRet);
- return nRet;
-}
-
-void WpADOConnection::PutCommandTimeout(sal_Int32 nRet)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_CommandTimeout(nRet);
-}
-
-sal_Int32 WpADOConnection::GetConnectionTimeout() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 nRet=0;
- pInterface->get_ConnectionTimeout(&nRet);
- return nRet;
-}
-
-void WpADOConnection::PutConnectionTimeout(sal_Int32 nRet)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_ConnectionTimeout(nRet);
-}
-
-sal_Bool WpADOConnection::Close( )
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->Close()));
-}
-
-sal_Bool WpADOConnection::Execute(const ::rtl::OUString& _CommandText,OLEVariant& RecordsAffected,long Options, WpADORecordset** ppiRset)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString sStr1(_CommandText);
- sal_Bool bErg = SUCCEEDED(pInterface->Execute(sStr1,&RecordsAffected,Options,(_ADORecordset**)ppiRset));
- return bErg;
-}
-
-sal_Bool WpADOConnection::BeginTrans()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 nIso=0;
- return SUCCEEDED(pInterface->BeginTrans(&nIso));
-}
-
-sal_Bool WpADOConnection::CommitTrans( )
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->CommitTrans());
-}
-
-sal_Bool WpADOConnection::RollbackTrans( )
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->RollbackTrans());
-}
-
-sal_Bool WpADOConnection::Open(const ::rtl::OUString& ConnectionString, const ::rtl::OUString& UserID,const ::rtl::OUString& Password,long Options)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString sStr1(ConnectionString);
- OLEString sStr2(UserID);
- OLEString sStr3(Password);
- sal_Bool bErg = SUCCEEDED(pInterface->Open(sStr1,sStr2,sStr3,Options));
- return bErg;
-}
-
-sal_Bool WpADOConnection::GetErrors(ADOErrors** pErrors)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->get_Errors(pErrors));
-}
-
-::rtl::OUString WpADOConnection::GetDefaultDatabase() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR; pInterface->get_DefaultDatabase(&aBSTR);
- return aBSTR;
-}
-
-sal_Bool WpADOConnection::PutDefaultDatabase(const ::rtl::OUString& _bstr)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString bstr(_bstr);
- sal_Bool bErg = SUCCEEDED(pInterface->put_DefaultDatabase(bstr));
-
- return bErg;
-}
-
-IsolationLevelEnum WpADOConnection::get_IsolationLevel() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- IsolationLevelEnum eNum=adXactUnspecified;
- pInterface->get_IsolationLevel(&eNum);
- return eNum;
-}
-
-sal_Bool WpADOConnection::put_IsolationLevel(const IsolationLevelEnum& eNum)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->put_IsolationLevel(eNum));
-}
-
-sal_Int32 WpADOConnection::get_Attributes() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 nRet=0;
- pInterface->get_Attributes(&nRet);
- return nRet;
-}
-
-sal_Bool WpADOConnection::put_Attributes(sal_Int32 nRet)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->put_Attributes(nRet));
-}
-
-CursorLocationEnum WpADOConnection::get_CursorLocation() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- CursorLocationEnum eNum=adUseNone;
- pInterface->get_CursorLocation(&eNum);
- return eNum;
-}
-
-sal_Bool WpADOConnection::put_CursorLocation(const CursorLocationEnum &eNum)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->put_CursorLocation(eNum));
-}
-
-ConnectModeEnum WpADOConnection::get_Mode() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ConnectModeEnum eNum=adModeUnknown;
- pInterface->get_Mode(&eNum);
- return eNum;
-}
-
-sal_Bool WpADOConnection::put_Mode(const ConnectModeEnum &eNum)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->put_Mode(eNum));
-}
-
-::rtl::OUString WpADOConnection::get_Provider() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR; pInterface->get_Provider(&aBSTR);
- return aBSTR;
-}
-
-sal_Bool WpADOConnection::put_Provider(const ::rtl::OUString& _bstr)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString bstr(_bstr);
- return SUCCEEDED(pInterface->put_Provider(bstr));
-}
-
-sal_Int32 WpADOConnection::get_State() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 nRet=0;
- pInterface->get_State(&nRet);
- return nRet;
-}
-
-sal_Bool WpADOConnection::OpenSchema(SchemaEnum eNum,OLEVariant& Restrictions,OLEVariant& SchemaID,ADORecordset**pprset)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->OpenSchema(eNum,Restrictions,SchemaID,pprset));
-}
-
-::rtl::OUString WpADOConnection::get_Version() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Version(&aBSTR);
- return aBSTR;
-}
-
-sal_Bool WpADOCommand::putref_ActiveConnection( WpADOConnection *pCon)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- if(pCon)
- return SUCCEEDED(pInterface->putref_ActiveConnection(pCon->pInterface));
- else
- return SUCCEEDED(pInterface->putref_ActiveConnection(NULL));
-}
-
-void WpADOCommand::put_ActiveConnection(/* [in] */ const OLEVariant& vConn)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_ActiveConnection(vConn);
-}
-
-void WpADOCommand::Create()
-{
- IClassFactory2* pInterface2 = NULL;
- IUnknown *pOuter = NULL;
- HRESULT hr;
- hr = CoGetClassObject( ADOS::CLSID_ADOCOMMAND_21,
- CLSCTX_INPROC_SERVER,
- NULL,
- IID_IClassFactory2,
- (void**)&pInterface2 );
-
- if( !FAILED( hr ) )
- {
- ADOCommand* pCommand=NULL;
-
- hr = pInterface2->CreateInstanceLic( pOuter,
- NULL,
- ADOS::IID_ADOCOMMAND_21,
- ADOS::GetKeyStr(),
- (void**) &pCommand);
-
- if( !FAILED( hr ) )
- {
- operator=(pCommand);
- pCommand->Release();
- }
-
- pInterface2->Release();
- }
-}
-
-sal_Int32 WpADOCommand::get_State() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 nRet=0;
- pInterface->get_State(&nRet);
- return nRet;
-}
-
-::rtl::OUString WpADOCommand::get_CommandText() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_CommandText(&aBSTR);
- return aBSTR;
-}
-
-sal_Bool WpADOCommand::put_CommandText(const ::rtl::OUString &aCon)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString bstr(aCon);
- sal_Bool bErg = SUCCEEDED(pInterface->put_CommandText(bstr));
-
- return bErg;
-}
-
-sal_Int32 WpADOCommand::get_CommandTimeout() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 nRet=0;
- pInterface->get_CommandTimeout(&nRet);
- return nRet;
-}
-
-void WpADOCommand::put_CommandTimeout(sal_Int32 nRet)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_CommandTimeout(nRet);
-}
-
-sal_Bool WpADOCommand::get_Prepared() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- VARIANT_BOOL bPrepared = VARIANT_FALSE;
- pInterface->get_Prepared(&bPrepared);
- return bPrepared == VARIANT_TRUE;
-}
-
-sal_Bool WpADOCommand::put_Prepared(VARIANT_BOOL bPrepared) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->put_Prepared(bPrepared));
-}
-
-sal_Bool WpADOCommand::Execute(OLEVariant& RecordsAffected,OLEVariant& Parameters,long Options, ADORecordset** ppiRset)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->Execute(&RecordsAffected,&Parameters,Options,ppiRset));
-}
-
-ADOParameter* WpADOCommand::CreateParameter(const ::rtl::OUString &_bstr,DataTypeEnum Type,ParameterDirectionEnum Direction,long nSize,const OLEVariant &Value)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOParameter* pPara = NULL;
- OLEString bstr(_bstr);
- sal_Bool bErg = SUCCEEDED(pInterface->CreateParameter(bstr,Type,Direction,nSize,Value,&pPara));
-
- return bErg ? pPara : NULL;
-}
-
-ADOParameters* WpADOCommand::get_Parameters() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOParameters* pPara=NULL;
- pInterface->get_Parameters(&pPara);
- return pPara;
-}
-
-sal_Bool WpADOCommand::put_CommandType( /* [in] */ CommandTypeEnum lCmdType)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->put_CommandType(lCmdType));
-}
-
-CommandTypeEnum WpADOCommand::get_CommandType( ) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- CommandTypeEnum eNum=adCmdUnspecified;
- pInterface->get_CommandType(&eNum);
- return eNum;
-}
-
-// returns the name of the field
-::rtl::OUString WpADOCommand::GetName() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Name(&aBSTR);
- return aBSTR;
-}
-
-sal_Bool WpADOCommand::put_Name(const ::rtl::OUString& _Name)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString bstr(_Name);
- sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
-
- return bErg;
-}
-sal_Bool WpADOCommand::Cancel()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->Cancel());
-}
-
-::rtl::OUString WpADOError::GetDescription() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Description(&aBSTR);
- return aBSTR;
-}
-
- ::rtl::OUString WpADOError::GetSource() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Source(&aBSTR);
- return aBSTR;
-}
-
- sal_Int32 WpADOError::GetNumber() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 nErrNr=0;
- pInterface->get_Number(&nErrNr);
- return nErrNr;
-}
-
- ::rtl::OUString WpADOError::GetSQLState() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_SQLState(&aBSTR);
- return aBSTR;
-}
-
- sal_Int32 WpADOError::GetNativeError() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 nErrNr=0;
- pInterface->get_NativeError(&nErrNr);
- return nErrNr;
-}
-WpADOProperties WpADOField::get_Properties()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOProperties* pProps = NULL;
- pInterface->get_Properties(&pProps);
- WpADOProperties aProps;
-
- aProps.setWithOutAddRef(pProps);
- return aProps;
-}
-
- sal_Int32 WpADOField::GetActualSize() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADO_LONGPTR nActualSize=0;
- pInterface->get_ActualSize(&nActualSize);
- return nActualSize;
-}
-
- sal_Int32 WpADOField::GetAttributes() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 eADOSFieldAttributes=0;
- pInterface->get_Attributes(&eADOSFieldAttributes);
- return eADOSFieldAttributes;
-}
-
-sal_Int32 WpADOField::GetStatus() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 eADOSFieldAttributes=0;
- // pInterface->get_Status(&eADOSFieldAttributes);
- return eADOSFieldAttributes;
-}
-
-sal_Int32 WpADOField::GetDefinedSize() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADO_LONGPTR nDefinedSize=0;
- pInterface->get_DefinedSize(&nDefinedSize);
- return nDefinedSize;
-}
-
-// returns the name of the field
-::rtl::OUString WpADOField::GetName() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Name(&aBSTR);
- return aBSTR;
-}
-
- DataTypeEnum WpADOField::GetADOType() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- DataTypeEnum eType=adEmpty;
- pInterface->get_Type(&eType);
- return eType;
-}
-
- void WpADOField::get_Value(OLEVariant& aValVar) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- aValVar.setEmpty();
- sal_Bool bOk = SUCCEEDED(pInterface->get_Value(&aValVar));
- (void)bOk;
-}
-
- OLEVariant WpADOField::get_Value() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEVariant aValVar;
- pInterface->get_Value(&aValVar);
- return aValVar;
-}
-
- sal_Bool WpADOField::PutValue(const OLEVariant& aVariant)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->put_Value(aVariant)));
-}
-
-sal_Int32 WpADOField::GetPrecision() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_uInt8 eType=0;
- pInterface->get_Precision(&eType);
- return eType;
-}
-
- sal_Int32 WpADOField::GetNumericScale() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_uInt8 eType=0;
- pInterface->get_NumericScale(&eType);
- return eType;
-}
-
- sal_Bool WpADOField::AppendChunk(const OLEVariant& _Variant)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->AppendChunk(_Variant)));
-}
-
-OLEVariant WpADOField::GetChunk(long Length) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEVariant aValVar;
- pInterface->GetChunk(Length,&aValVar);
- return aValVar;
-}
-
-void WpADOField::GetChunk(long Length,OLEVariant &aValVar) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->GetChunk(Length,&aValVar);
-}
-
-OLEVariant WpADOField::GetOriginalValue() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEVariant aValVar;
- pInterface->get_OriginalValue(&aValVar);
- return aValVar;
-}
-
-void WpADOField::GetOriginalValue(OLEVariant &aValVar) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->get_OriginalValue(&aValVar);
-}
-
-OLEVariant WpADOField::GetUnderlyingValue() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEVariant aValVar;
- pInterface->get_UnderlyingValue(&aValVar);
- return aValVar;
-}
-
- void WpADOField::GetUnderlyingValue(OLEVariant &aValVar) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->get_UnderlyingValue(&aValVar);
-}
-
- sal_Bool WpADOField::PutPrecision(sal_Int8 _prec)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->put_Precision(_prec)));
-}
-
- sal_Bool WpADOField::PutNumericScale(sal_Int8 _prec)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->put_NumericScale(_prec)));
-}
-
- void WpADOField::PutADOType(DataTypeEnum eType)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_Type(eType);
-}
-
- sal_Bool WpADOField::PutDefinedSize(sal_Int32 _nDefSize)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->put_DefinedSize(_nDefSize)));
-}
-
- sal_Bool WpADOField::PutAttributes(sal_Int32 _nDefSize)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->put_Attributes(_nDefSize)));
-}
-
-OLEVariant WpADOProperty::GetValue() const
-{
- OLEVariant aValVar;
- if(pInterface)
- pInterface->get_Value(&aValVar);
- return aValVar;
-}
-
-void WpADOProperty::GetValue(OLEVariant &aValVar) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- if(pInterface)
- pInterface->get_Value(&aValVar);
-}
-
-sal_Bool WpADOProperty::PutValue(const OLEVariant &aValVar)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->put_Value(aValVar)));
-}
-
- ::rtl::OUString WpADOProperty::GetName() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Name(&aBSTR);
- return aBSTR;
-}
-
- DataTypeEnum WpADOProperty::GetADOType() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- DataTypeEnum eType=adEmpty;
- pInterface->get_Type(&eType);
- return eType;
-}
-
- sal_Int32 WpADOProperty::GetAttributes() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 eADOSFieldAttributes=0;
- pInterface->get_Attributes(&eADOSFieldAttributes);
- return eADOSFieldAttributes;
-}
-
- sal_Bool WpADOProperty::PutAttributes(sal_Int32 _nDefSize)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->put_Attributes(_nDefSize)));
-}
- void WpADORecordset::Create()
-{
- IClassFactory2* pInterface2 = NULL;
- IUnknown *pOuter = NULL;
- HRESULT hr;
- hr = CoGetClassObject( ADOS::CLSID_ADORECORDSET_21,
- CLSCTX_INPROC_SERVER,
- NULL,
- IID_IClassFactory2,
- (void**)&pInterface2 );
-
- if( !FAILED( hr ) )
- {
- ADORecordset *pRec = NULL;
- hr = pInterface2->CreateInstanceLic( pOuter,
- NULL,
- ADOS::IID_ADORECORDSET_21,
- ADOS::GetKeyStr(),
- (void**) &pRec);
-
- if( !FAILED( hr ) )
- {
- operator=(pRec);
- pRec->Release();
- }
-
- pInterface2->Release();
- }
-}
-
- sal_Bool WpADORecordset::Open(
- /* [optional][in] */ VARIANT Source,
- /* [optional][in] */ VARIANT ActiveConnection,
- /* [defaultvalue][in] */ CursorTypeEnum CursorType,
- /* [defaultvalue][in] */ LockTypeEnum LockType,
- /* [defaultvalue][in] */ sal_Int32 Options)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->Open(Source,ActiveConnection,CursorType,LockType,Options)));
-}
-
-
-LockTypeEnum WpADORecordset::GetLockType()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- LockTypeEnum eType=adLockUnspecified;
- pInterface->get_LockType(&eType);
- return eType;
-}
-
-void WpADORecordset::Close()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->Close();
-}
-
- sal_Bool WpADORecordset::Cancel() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->Cancel()));
-}
-
- sal_Int32 WpADORecordset::get_State( )
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 nState = 0;
- pInterface->get_State(&nState);
- return nState;
-}
-
- sal_Bool WpADORecordset::Supports( /* [in] */ CursorOptionEnum CursorOptions)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- VARIANT_BOOL bSupports=VARIANT_FALSE;
- pInterface->Supports(CursorOptions,&bSupports);
- return bSupports == VARIANT_TRUE;
-}
-
-PositionEnum_Param WpADORecordset::get_AbsolutePosition()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- PositionEnum_Param aTemp=adPosUnknown;
- pInterface->get_AbsolutePosition(&aTemp);
- return aTemp;
-}
-
- void WpADORecordset::GetDataSource(IUnknown** _pInterface) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->get_DataSource(_pInterface);
-}
-
- void WpADORecordset::PutRefDataSource(IUnknown* _pInterface)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->putref_DataSource(_pInterface);
-}
-
- void WpADORecordset::GetBookmark(VARIANT& var)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->get_Bookmark(&var);
-}
-
- OLEVariant WpADORecordset::GetBookmark()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEVariant var;
- pInterface->get_Bookmark(&var);
- return var;
-}
-
-CompareEnum WpADORecordset::CompareBookmarks(const OLEVariant& left,const OLEVariant& right)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- CompareEnum eNum=adCompareNotComparable;
- pInterface->CompareBookmarks(left,right,&eNum);
- return eNum;
-}
-
- sal_Bool WpADORecordset::SetBookmark(const OLEVariant &pSafeAr)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->put_Bookmark(pSafeAr));
-}
-
-
-WpADOFields WpADORecordset::GetFields() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOFields* pFields=NULL;
- pInterface->get_Fields(&pFields);
- WpADOFields aFields;
- aFields.setWithOutAddRef(pFields);
- return aFields;
-}
-
-
- sal_Bool WpADORecordset::Move(sal_Int32 nRows, VARIANT aBmk) {return pInterface && SUCCEEDED(pInterface->Move(nRows, aBmk));}
- sal_Bool WpADORecordset::MoveNext() {return pInterface && SUCCEEDED(pInterface->MoveNext());}
- sal_Bool WpADORecordset::MovePrevious() {return pInterface && SUCCEEDED(pInterface->MovePrevious());}
- sal_Bool WpADORecordset::MoveFirst() {return pInterface && SUCCEEDED(pInterface->MoveFirst());}
- sal_Bool WpADORecordset::MoveLast() {return pInterface && SUCCEEDED(pInterface->MoveLast());}
-
- sal_Bool WpADORecordset::IsAtBOF() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- VARIANT_BOOL bIsAtBOF=VARIANT_FALSE;
- pInterface->get_BOF(&bIsAtBOF);
- return bIsAtBOF == VARIANT_TRUE;
-}
-
- sal_Bool WpADORecordset::IsAtEOF() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- VARIANT_BOOL bIsAtEOF=VARIANT_FALSE;
- pInterface->get_EOF(&bIsAtEOF);
- return bIsAtEOF == VARIANT_TRUE;
-}
-
- sal_Bool WpADORecordset::Delete(AffectEnum eNum)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->Delete(eNum));
-}
-
- sal_Bool WpADORecordset::AddNew(const OLEVariant &FieldList,const OLEVariant &Values)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->AddNew(FieldList,Values));
-}
-
- sal_Bool WpADORecordset::Update(const OLEVariant &FieldList,const OLEVariant &Values)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->Update(FieldList,Values));
-}
-
- sal_Bool WpADORecordset::CancelUpdate()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->CancelUpdate());
-}
-
-WpADOProperties WpADORecordset::get_Properties() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOProperties* pProps=NULL;
- pInterface->get_Properties(&pProps);
- WpADOProperties aProps;
- aProps.setWithOutAddRef(pProps);
- return aProps;
-}
-
- sal_Bool WpADORecordset::NextRecordset(OLEVariant& RecordsAffected,ADORecordset** ppiRset)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->NextRecordset(&RecordsAffected,ppiRset));
-}
-
- sal_Bool WpADORecordset::get_RecordCount(ADO_LONGPTR &_nRet) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->get_RecordCount(&_nRet));
-}
-
- sal_Bool WpADORecordset::get_MaxRecords(ADO_LONGPTR &_nRet) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->get_MaxRecords(&_nRet));
-}
-
- sal_Bool WpADORecordset::put_MaxRecords(ADO_LONGPTR _nRet)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->put_MaxRecords(_nRet));
-}
-
- sal_Bool WpADORecordset::get_CursorType(CursorTypeEnum &_nRet) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->get_CursorType(&_nRet));
-}
-
- sal_Bool WpADORecordset::put_CursorType(CursorTypeEnum _nRet)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->put_CursorType(_nRet));
-}
-
- sal_Bool WpADORecordset::get_LockType(LockTypeEnum &_nRet) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->get_LockType(&_nRet));
-}
-
- sal_Bool WpADORecordset::put_LockType(LockTypeEnum _nRet)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->put_LockType(_nRet));
-}
-
- sal_Bool WpADORecordset::get_CacheSize(sal_Int32 &_nRet) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->get_CacheSize(&_nRet));
-}
-
- sal_Bool WpADORecordset::put_CacheSize(sal_Int32 _nRet)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->put_CacheSize(_nRet));
-}
-
- sal_Bool WpADORecordset::UpdateBatch(AffectEnum AffectRecords)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->UpdateBatch(AffectRecords));
-}
-
- ::rtl::OUString WpADOParameter::GetName() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Name(&aBSTR);
- return aBSTR;
-}
-
- DataTypeEnum WpADOParameter::GetADOType() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- DataTypeEnum eType=adEmpty;
- pInterface->get_Type(&eType);
- return eType;
-}
-
-void WpADOParameter::put_Type(const DataTypeEnum& _eType)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_Type(_eType);
-}
-
- sal_Int32 WpADOParameter::GetAttributes() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 eADOSFieldAttributes=0;
- pInterface->get_Attributes(&eADOSFieldAttributes);
- return eADOSFieldAttributes;
-}
-
- sal_Int32 WpADOParameter::GetPrecision() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_uInt8 eType=0;
- pInterface->get_Precision(&eType);
- return eType;
-}
-
- sal_Int32 WpADOParameter::GetNumericScale() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_uInt8 eType=0;
- pInterface->get_NumericScale(&eType);
- return eType;
-}
-
- ParameterDirectionEnum WpADOParameter::get_Direction() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ParameterDirectionEnum alParmDirection=adParamUnknown;
- pInterface->get_Direction(&alParmDirection);
- return alParmDirection;
-}
-
- void WpADOParameter::GetValue(OLEVariant& aValVar) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->get_Value(&aValVar);
-}
-
- OLEVariant WpADOParameter::GetValue() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEVariant aValVar;
- pInterface->get_Value(&aValVar);
- return aValVar;
-}
-
-sal_Bool WpADOParameter::PutValue(const OLEVariant& aVariant)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->put_Value(aVariant)));
-}
-sal_Bool WpADOParameter::AppendChunk(const OLEVariant& aVariant)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->AppendChunk(aVariant)));
-}
-sal_Bool WpADOParameter::put_Size(const sal_Int32& _nSize)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return (SUCCEEDED(pInterface->put_Size(_nSize)));
-}
-
- ::rtl::OUString WpADOColumn::get_Name() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Name(&aBSTR);
- return aBSTR;
-}
-
-::rtl::OUString WpADOColumn::get_RelatedColumn() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_RelatedColumn(&aBSTR);
- return aBSTR;
-}
-
-void WpADOColumn::put_Name(const ::rtl::OUString& _rName)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString bstr(_rName);
- sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
- (void)bErg;
-}
-void WpADOColumn::put_RelatedColumn(const ::rtl::OUString& _rName)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString bstr(_rName);
- sal_Bool bErg = SUCCEEDED(pInterface->put_RelatedColumn(bstr));
- (void)bErg;
-}
-
-DataTypeEnum WpADOColumn::get_Type() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- DataTypeEnum eNum = adVarChar;
- pInterface->get_Type(&eNum);
- return eNum;
-}
-
-void WpADOColumn::put_Type(const DataTypeEnum& _eNum)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_Type(_eNum);
-}
-
-sal_Int32 WpADOColumn::get_Precision() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 nPrec=0;
- pInterface->get_Precision(&nPrec);
- return nPrec;
-}
-
-void WpADOColumn::put_Precision(sal_Int32 _nPre)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_Precision(_nPre);
-}
-
-sal_Int32 WpADOColumn::get_DefinedSize() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Int32 nPrec=0;
- pInterface->get_DefinedSize(&nPrec);
- return nPrec;
-}
-sal_uInt8 WpADOColumn::get_NumericScale() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_uInt8 nPrec=0;
- pInterface->get_NumericScale(&nPrec);
- return nPrec;
-}
-
-void WpADOColumn::put_NumericScale(sal_Int8 _nScale)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_NumericScale(_nScale);
-}
-
-SortOrderEnum WpADOColumn::get_SortOrder() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- SortOrderEnum nPrec=adSortAscending;
- pInterface->get_SortOrder(&nPrec);
- return nPrec;
-}
-
-void WpADOColumn::put_SortOrder(SortOrderEnum _nScale)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_SortOrder(_nScale);
-}
-
-ColumnAttributesEnum WpADOColumn::get_Attributes() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ColumnAttributesEnum eNum=adColNullable;
- pInterface->get_Attributes(&eNum);
- return eNum;
-}
-
-sal_Bool WpADOColumn::put_Attributes(const ColumnAttributesEnum& _eNum)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- return SUCCEEDED(pInterface->put_Attributes(_eNum));
-}
-
-WpADOProperties WpADOColumn::get_Properties() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOProperties* pProps = NULL;
- pInterface->get_Properties(&pProps);
- WpADOProperties aProps;
-
- aProps.setWithOutAddRef(pProps);
- return aProps;
-}
-
-::rtl::OUString WpADOKey::get_Name() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Name(&aBSTR);
- return aBSTR;
-}
-
-void WpADOKey::put_Name(const ::rtl::OUString& _rName)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString bstr(_rName);
- sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
- (void)bErg;
-}
-
-KeyTypeEnum WpADOKey::get_Type() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- KeyTypeEnum eNum=adKeyPrimary;
- pInterface->get_Type(&eNum);
- return eNum;
-}
-
-void WpADOKey::put_Type(const KeyTypeEnum& _eNum)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_Type(_eNum);
-}
-
-::rtl::OUString WpADOKey::get_RelatedTable() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_RelatedTable(&aBSTR);
- return aBSTR;
-}
-
-void WpADOKey::put_RelatedTable(const ::rtl::OUString& _rName)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString bstr(_rName);
- sal_Bool bErg = SUCCEEDED(pInterface->put_RelatedTable(bstr));
- (void)bErg;
-}
-
-RuleEnum WpADOKey::get_DeleteRule() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- RuleEnum eNum = adRINone;
- pInterface->get_DeleteRule(&eNum);
- return eNum;
-}
-
-void WpADOKey::put_DeleteRule(const RuleEnum& _eNum)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_DeleteRule(_eNum);
-}
-
-RuleEnum WpADOKey::get_UpdateRule() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- RuleEnum eNum = adRINone;
- pInterface->get_UpdateRule(&eNum);
- return eNum;
-}
-
-void WpADOKey::put_UpdateRule(const RuleEnum& _eNum)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_UpdateRule(_eNum);
-}
-
-WpADOColumns WpADOKey::get_Columns() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOColumns* pCols = NULL;
- pInterface->get_Columns(&pCols);
- WpADOColumns aCols;
- aCols.setWithOutAddRef(pCols);
- return aCols;
-}
-
-::rtl::OUString WpADOIndex::get_Name() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Name(&aBSTR);
- return aBSTR;
-}
-
-void WpADOIndex::put_Name(const ::rtl::OUString& _rName)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString bstr(_rName);
- sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
- (void)bErg;
-}
-
-sal_Bool WpADOIndex::get_Clustered() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- VARIANT_BOOL eNum = VARIANT_FALSE;
- pInterface->get_Clustered(&eNum);
- return eNum == VARIANT_TRUE;
-}
-
-void WpADOIndex::put_Clustered(sal_Bool _b)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_Clustered(_b ? VARIANT_TRUE : VARIANT_FALSE);
-}
-
-sal_Bool WpADOIndex::get_Unique() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- VARIANT_BOOL eNum = VARIANT_FALSE;
- pInterface->get_Unique(&eNum);
- return eNum == VARIANT_TRUE;
-}
-
-void WpADOIndex::put_Unique(sal_Bool _b)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_Unique(_b ? VARIANT_TRUE : VARIANT_FALSE);
-}
-
-sal_Bool WpADOIndex::get_PrimaryKey() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- VARIANT_BOOL eNum = VARIANT_FALSE;
- pInterface->get_PrimaryKey(&eNum);
- return eNum == VARIANT_TRUE;
-}
-
-void WpADOIndex::put_PrimaryKey(sal_Bool _b)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->put_PrimaryKey(_b ? VARIANT_TRUE : VARIANT_FALSE);
-}
-
-WpADOColumns WpADOIndex::get_Columns() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOColumns* pCols = NULL;
- pInterface->get_Columns(&pCols);
- WpADOColumns aCols;
- aCols.setWithOutAddRef(pCols);
- return aCols;
-}
-
-void WpADOCatalog::putref_ActiveConnection(IDispatch* pCon)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->putref_ActiveConnection(pCon);
-}
-
-WpADOTables WpADOCatalog::get_Tables()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOTables* pRet = NULL;
- pInterface->get_Tables(&pRet);
- WpADOTables aRet;
- aRet.setWithOutAddRef(pRet);
- return aRet;
-}
-
-WpADOViews WpADOCatalog::get_Views()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOViews* pRet = NULL;
- pInterface->get_Views(&pRet);
- WpADOViews aRet;
- aRet.setWithOutAddRef(pRet);
- return aRet;
-}
-
-WpADOGroups WpADOCatalog::get_Groups()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOGroups* pRet = NULL;
- pInterface->get_Groups(&pRet);
- WpADOGroups aRet;
- aRet.setWithOutAddRef(pRet);
- return aRet;
-}
-
-WpADOUsers WpADOCatalog::get_Users()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOUsers* pRet = NULL;
- pInterface->get_Users(&pRet);
- WpADOUsers aRet;
- aRet.setWithOutAddRef(pRet);
- return aRet;
-}
-
-ADOProcedures* WpADOCatalog::get_Procedures()
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOProcedures* pRet = NULL;
- pInterface->get_Procedures(&pRet);
- return pRet;
-}
-
-::rtl::OUString WpADOTable::get_Name() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Name(&aBSTR);
- return aBSTR;
-}
-
-void WpADOTable::put_Name(const ::rtl::OUString& _rName)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString bstr(_rName);
- sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
- (void)bErg;
-}
-
-::rtl::OUString WpADOTable::get_Type() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Type(&aBSTR);
- return aBSTR;
-}
-
-WpADOColumns WpADOTable::get_Columns() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOColumns* pCols = NULL;
- pInterface->get_Columns(&pCols);
- WpADOColumns aCols;
- aCols.setWithOutAddRef(pCols);
- return aCols;
-}
-
-WpADOIndexes WpADOTable::get_Indexes() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOIndexes* pCols = NULL;
- pInterface->get_Indexes(&pCols);
- WpADOIndexes aRet;
- aRet.setWithOutAddRef(pCols);
- return aRet;
-}
-
-WpADOKeys WpADOTable::get_Keys() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOKeys* pCols = NULL;
- pInterface->get_Keys(&pCols);
- WpADOKeys aRet;
- aRet.setWithOutAddRef(pCols);
- return aRet;
-}
-
-WpADOCatalog WpADOTable::get_ParentCatalog() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOCatalog* pCat = NULL;
- pInterface->get_ParentCatalog(&pCat);
- WpADOCatalog aRet;
- aRet.setWithOutAddRef(pCat);
- return aRet;
-}
-
-WpADOProperties WpADOTable::get_Properties() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- ADOProperties* pProps = NULL;
- pInterface->get_Properties(&pProps);
- WpADOProperties aProps;
- aProps.setWithOutAddRef(pProps);
- return aProps;
-}
-
-::rtl::OUString WpADOView::get_Name() const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- OLEString aBSTR;
- pInterface->get_Name(&aBSTR);
- return aBSTR;
-}
-
-void WpADOView::get_Command(OLEVariant& _rVar) const
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- pInterface->get_Command(&_rVar);
-}
-
-void WpADOView::put_Command(OLEVariant& _rVar)
-{
- pInterface->put_Command(_rVar);
-}
-
-::rtl::OUString WpADOGroup::get_Name() const
-{
- OLEString aBSTR;
- pInterface->get_Name(&aBSTR);
- return aBSTR;
-}
-
-void WpADOGroup::put_Name(const ::rtl::OUString& _rName)
-{
- OLEString bstr(_rName);
- sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
- (void)bErg;
-}
-
-RightsEnum WpADOGroup::GetPermissions(
- /* [in] */ const OLEVariant& Name,
- /* [in] */ ObjectTypeEnum ObjectType)
-{
- RightsEnum Rights=adRightNone;
- OLEVariant ObjectTypeId;
- ObjectTypeId.setNoArg();
- pInterface->GetPermissions(Name,ObjectType,ObjectTypeId,&Rights);
- return Rights;
-}
-
-sal_Bool WpADOGroup::SetPermissions(
- /* [in] */ const OLEVariant& Name,
- /* [in] */ ObjectTypeEnum ObjectType,
- /* [in] */ ActionEnum Action,
- /* [in] */ RightsEnum Rights)
-{
- OLEVariant ObjectTypeId;
- ObjectTypeId.setNoArg();
- return SUCCEEDED(pInterface->SetPermissions(Name,ObjectType,Action,Rights,adInheritNone,ObjectTypeId));
-}
-
-WpADOUsers WpADOGroup::get_Users( )
-{
- ADOUsers* pRet = NULL;
- pInterface->get_Users( &pRet);
- WpADOUsers aRet;
- aRet.setWithOutAddRef(pRet);
- return aRet;
-}
-
-::rtl::OUString WpADOUser::get_Name() const
-{
- OLEString aBSTR;
- pInterface->get_Name(&aBSTR);
- return aBSTR;
-}
-
-void WpADOUser::put_Name(const ::rtl::OUString& _rName)
-{
- OLEString bstr(_rName);
- sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr));
- (void)bErg;
-}
-
-sal_Bool WpADOUser::ChangePassword(const ::rtl::OUString& _rPwd,const ::rtl::OUString& _rNewPwd)
-{
- OLEString sStr1(_rPwd);
- OLEString sStr2(_rNewPwd);
- sal_Bool bErg = SUCCEEDED(pInterface->ChangePassword(sStr1,sStr2));
- return bErg;
-}
-
-WpADOGroups WpADOUser::get_Groups()
-{
- ADOGroups* pRet = NULL;
- pInterface->get_Groups(&pRet);
- WpADOGroups aRet;
- aRet.setWithOutAddRef(pRet);
- return aRet;
-}
-
-RightsEnum WpADOUser::GetPermissions(
- /* [in] */ const OLEVariant& Name,
- /* [in] */ ObjectTypeEnum ObjectType)
-{
- RightsEnum Rights=adRightNone;
- OLEVariant ObjectTypeId;
- ObjectTypeId.setNoArg();
- pInterface->GetPermissions(Name,ObjectType,ObjectTypeId,&Rights);
- return Rights;
-}
-
-sal_Bool WpADOUser::SetPermissions(
- /* [in] */ const OLEVariant& Name,
- /* [in] */ ObjectTypeEnum ObjectType,
- /* [in] */ ActionEnum Action,
- /* [in] */ RightsEnum Rights)
-{
- OLEVariant ObjectTypeId;
- ObjectTypeId.setNoArg();
- return SUCCEEDED(pInterface->SetPermissions(Name,ObjectType,Action,Rights,adInheritNone,ObjectTypeId));
-}
-
-WpBase::WpBase() : pIUnknown(NULL)
-{
-}
-WpBase::WpBase(IDispatch* pInt)
- :pIUnknown(pInt)
-{
- if (pIUnknown)
- {
- ULONG nCount = pIUnknown->AddRef();
- (void)nCount;
- // OSL_ENSURE(nCount == 1,"Count is greater than 1");
- }
-}
-
-//inline
-WpBase& WpBase::operator=(const WpBase& rhs)
-{
- if (rhs.pIUnknown != pIUnknown)
- {
- if (pIUnknown)
- pIUnknown->Release();
- pIUnknown = rhs.pIUnknown;
- if (pIUnknown)
- pIUnknown->AddRef();
- }
- return *this;
-};
-
-WpBase& WpBase::operator=(IDispatch* rhs)
-{
- if (pIUnknown != rhs)
- {
- if (pIUnknown)
- pIUnknown->Release();
- pIUnknown = rhs;
- if (pIUnknown)
- pIUnknown->AddRef();
- }
- return *this;
-}
-
-WpBase::WpBase(const WpBase& aWrapper)
-{
- operator=(aWrapper);
-}
-
-WpBase::~WpBase()
-{
- if (pIUnknown)
- {
- pIUnknown->Release();
- pIUnknown = NULL;
- }
-}
-
-void WpBase::clear()
-{
- if (pIUnknown)
- {
- pIUnknown->Release();
- pIUnknown = NULL;
- }
-}
-
-
-sal_Bool WpBase::IsValid() const
-{
- return pIUnknown != NULL;
-}
-WpBase::operator IDispatch*()
-{
- return pIUnknown;
-}
-
-ADORecordset* WpADOConnection::getExportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table )
-{
- // Create elements used in the array
- HRESULT hr = S_OK;
- SAFEARRAYBOUND rgsabound[1];
- SAFEARRAY *psa = NULL;
- OLEVariant varCriteria[6];
-
- // Create SafeArray Bounds and initialize the array
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = SAL_N_ELEMENTS( varCriteria );
- psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- sal_Int32 nPos=0;
- if(catalog.hasValue())
- varCriteria[nPos].setString(::comphelper::getString(catalog));
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- if(schema.getLength() && schema.toChar() != '%')
- varCriteria[nPos].setString(schema);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
-
- varCriteria[nPos].setString(table);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- ADORecordset *pRecordset = NULL;
- OpenSchema(adSchemaForeignKeys,vsa,vtEmpty,&pRecordset);
- return pRecordset;
-}
-// -----------------------------------------------------------------------------
-ADORecordset* WpADOConnection::getImportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table )
-{
- // Create elements used in the array
- HRESULT hr = S_OK;
- SAFEARRAYBOUND rgsabound[1];
- SAFEARRAY *psa = NULL;
- OLEVariant varCriteria[6];
-
- // Create SafeArray Bounds and initialize the array
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = SAL_N_ELEMENTS( varCriteria );
- psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- sal_Int32 nPos=0;
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
- if(catalog.hasValue())
- varCriteria[nPos].setString(::comphelper::getString(catalog));
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- if(schema.getLength() && schema.toChar() != '%')
- varCriteria[nPos].setString(schema);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
-
- varCriteria[nPos].setString(table);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- ADORecordset *pRecordset = NULL;
- OpenSchema(adSchemaForeignKeys,vsa,vtEmpty,&pRecordset);
-
- return pRecordset;
-
-}
-// -----------------------------------------------------------------------------
-ADORecordset* WpADOConnection::getPrimaryKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table )
-{
- // Create elements used in the array
- HRESULT hr = S_OK;
- SAFEARRAYBOUND rgsabound[1];
- SAFEARRAY *psa = NULL;
- OLEVariant varCriteria[3];
-
- // Create SafeArray Bounds and initialize the array
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = SAL_N_ELEMENTS( varCriteria );
- psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- sal_Int32 nPos=0;
- if(catalog.hasValue())
- varCriteria[nPos].setString(::comphelper::getString(catalog));
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- if(schema.getLength() && schema.toChar() != '%')
- varCriteria[nPos].setString(schema);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
-
- varCriteria[nPos].setString(table);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
-
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- ADORecordset *pRecordset = NULL;
- OpenSchema(adSchemaPrimaryKeys,vsa,vtEmpty,&pRecordset);
-
- return pRecordset;
-}
-// -----------------------------------------------------------------------------
-ADORecordset* WpADOConnection::getIndexInfo(
- const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
- sal_Bool /*unique*/, sal_Bool /*approximate*/ )
-{
- // Create elements used in the array
- HRESULT hr = S_OK;
- SAFEARRAYBOUND rgsabound[1];
- SAFEARRAY *psa = NULL;
- OLEVariant varCriteria[5];
-
- // Create SafeArray Bounds and initialize the array
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = SAL_N_ELEMENTS( varCriteria );
- psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- sal_Int32 nPos=0;
- if(catalog.hasValue())
- varCriteria[nPos].setString(::comphelper::getString(catalog));
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- if(schema.getLength() && schema.toChar() != '%')
- varCriteria[nPos].setString(schema);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// INDEX_NAME
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TYPE
-
- varCriteria[nPos].setString(table);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- ADORecordset *pRecordset = NULL;
- OpenSchema(adSchemaIndexes,vsa,vtEmpty,&pRecordset);
-
- return pRecordset;
-}
-// -----------------------------------------------------------------------------
-ADORecordset* WpADOConnection::getTablePrivileges( const ::com::sun::star::uno::Any& catalog,
- const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern )
-{
- HRESULT hr = S_OK;
- SAFEARRAYBOUND rgsabound[1];
- SAFEARRAY *psa = NULL;
- OLEVariant varCriteria[5];
-
- // Create SafeArray Bounds and initialize the array
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = SAL_N_ELEMENTS( varCriteria );
- psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- sal_Int32 nPos=0;
- if(catalog.hasValue())
- varCriteria[nPos].setString(::comphelper::getString(catalog));
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- if(schemaPattern.getLength() && schemaPattern.toChar() != '%')
- varCriteria[nPos].setString(schemaPattern);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
-
- if(tableNamePattern.toChar() != '%')
- varCriteria[nPos].setString(tableNamePattern);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// GRANTOR
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// GRANTEE
-
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- ADORecordset *pRecordset = NULL;
- OpenSchema(adSchemaTablePrivileges,vsa,vtEmpty,&pRecordset);
-
- return pRecordset;
-}
-// -----------------------------------------------------------------------------
-ADORecordset* WpADOConnection::getCrossReference( const ::com::sun::star::uno::Any& primaryCatalog,
- const ::rtl::OUString& primarySchema,
- const ::rtl::OUString& primaryTable,
- const ::com::sun::star::uno::Any& foreignCatalog,
- const ::rtl::OUString& foreignSchema,
- const ::rtl::OUString& foreignTable)
-{
- // Create elements used in the array
- HRESULT hr = S_OK;
- SAFEARRAYBOUND rgsabound[1];
- SAFEARRAY *psa = NULL;
- OLEVariant varCriteria[6];
-
- // Create SafeArray Bounds and initialize the array
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = SAL_N_ELEMENTS( varCriteria );
- psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- sal_Int32 nPos=0;
- if(primaryCatalog.hasValue())
- varCriteria[nPos].setString(::comphelper::getString(primaryCatalog));
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- if(primarySchema.getLength() && primarySchema.toChar() != '%')
- varCriteria[nPos].setString(primarySchema);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
-
- varCriteria[nPos].setString(primaryTable);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
- if(foreignCatalog.hasValue())
- varCriteria[nPos].setString(::comphelper::getString(foreignCatalog));
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- if(foreignSchema.getLength() && foreignSchema.toChar() != '%')
- varCriteria[nPos].setString(foreignSchema);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
-
- varCriteria[nPos].setString(foreignTable);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- ADORecordset *pRecordset = NULL;
- OpenSchema(adSchemaForeignKeys,vsa,vtEmpty,&pRecordset);
-
- return pRecordset;
-}
-// -----------------------------------------------------------------------------
-ADORecordset* WpADOConnection::getProcedures( const ::com::sun::star::uno::Any& catalog,
- const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& procedureNamePattern )
-{
- HRESULT hr = S_OK;
- SAFEARRAYBOUND rgsabound[1];
- SAFEARRAY *psa = NULL;
- OLEVariant varCriteria[3];
-
- // Create SafeArray Bounds and initialize the array
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = SAL_N_ELEMENTS( varCriteria );
- psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- sal_Int32 nPos=0;
- if(catalog.hasValue())
- varCriteria[nPos].setString(::comphelper::getString(catalog));
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- if(schemaPattern.getLength() && schemaPattern.toChar() != '%')
- varCriteria[nPos].setString(schemaPattern);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
-
- if(procedureNamePattern.toChar() != '%')
- varCriteria[nPos].setString(procedureNamePattern);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- ADORecordset *pRecordset = NULL;
- OpenSchema(adSchemaProcedures,vsa,vtEmpty,&pRecordset);
-
- return pRecordset;
-}
-// -----------------------------------------------------------------------------
-ADORecordset* WpADOConnection::getProcedureColumns( const ::com::sun::star::uno::Any& catalog,
- const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& procedureNamePattern,
- const ::rtl::OUString& columnNamePattern )
-{
- // Create elements used in the array
- HRESULT hr = S_OK;
- SAFEARRAYBOUND rgsabound[1];
- SAFEARRAY *psa = NULL;
- OLEVariant varCriteria[4];
-
- // Create SafeArray Bounds and initialize the array
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = SAL_N_ELEMENTS( varCriteria );
- psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- sal_Int32 nPos=0;
- if(catalog.hasValue())
- varCriteria[nPos].setString(::comphelper::getString(catalog));
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- if(schemaPattern.getLength() && schemaPattern.toChar() != '%')
- varCriteria[nPos].setString(schemaPattern);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
-
- if(procedureNamePattern.toChar() != '%')
- varCriteria[nPos].setString(procedureNamePattern);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
- if(columnNamePattern.toChar() != '%')
- varCriteria[nPos].setString(columnNamePattern);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// COLUMN_NAME
-
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- ADORecordset *pRecordset = NULL;
- OpenSchema(adSchemaProcedureParameters,vsa,vtEmpty,&pRecordset);
-
- return pRecordset;
-}
-// -----------------------------------------------------------------------------
-ADORecordset* WpADOConnection::getTables( const ::com::sun::star::uno::Any& catalog,
- const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern,
- const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types )
-{
- // Create elements used in the array
- HRESULT hr = S_OK;
- OLEVariant varCriteria[4];
-
- sal_Int32 nPos=0;
- ::rtl::OUString sCatalog;
- if ( catalog.hasValue() && (catalog >>= sCatalog) )
- varCriteria[nPos].setString(sCatalog);
-
- ++nPos;
- if(schemaPattern.getLength() && schemaPattern.toChar() != '%')
- varCriteria[nPos].setString(schemaPattern);
-
- ++nPos;
- if(tableNamePattern.toChar() != '%')
- varCriteria[nPos].setString(tableNamePattern);
-
- ++nPos;
- ::rtl::OUStringBuffer aTypes;
- ::rtl::OUString aComma( RTL_CONSTASCII_USTRINGPARAM( "," ));
- const ::rtl::OUString* pIter = types.getConstArray();
- const ::rtl::OUString* pEnd = pIter + types.getLength();
- for( ; pIter != pEnd ; ++pIter)
- {
- if ( aTypes.getLength() )
- aTypes.append(aComma);
- aTypes.append(*pIter);
- }
-
- ::rtl::OUString sTypeNames = aTypes.makeStringAndClear();
- if ( sTypeNames.getLength() )
- varCriteria[nPos].setString(sTypeNames);
-
- // Create SafeArray Bounds and initialize the array
- const sal_Int32 nCrit = SAL_N_ELEMENTS( varCriteria );
- SAFEARRAYBOUND rgsabound[1];
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = nCrit;
- SAFEARRAY *psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- // Set the values for each element of the array
- for( long i = 0 ; i < nCrit && SUCCEEDED( hr );i++)
- {
- hr = SafeArrayPutElement(psa, &i,&varCriteria[i]);
- }
-
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- ADORecordset *pRecordset = NULL;
- OpenSchema(adSchemaTables,vsa,vtEmpty,&pRecordset);
-
- return pRecordset;
-}
-// -----------------------------------------------------------------------------
-ADORecordset* WpADOConnection::getColumns( const ::com::sun::star::uno::Any& catalog,
- const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern,
- const ::rtl::OUString& columnNamePattern )
-{
- // Create elements used in the array
- HRESULT hr = S_OK;
- SAFEARRAYBOUND rgsabound[1];
- SAFEARRAY *psa = NULL;
- OLEVariant varCriteria[4];
-
- // Create SafeArray Bounds and initialize the array
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = SAL_N_ELEMENTS( varCriteria );
- psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- sal_Int32 nPos=0;
- if(catalog.hasValue())
- varCriteria[nPos].setString(::comphelper::getString(catalog));
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- if(schemaPattern.getLength() && schemaPattern.toChar() != '%')
- varCriteria[nPos].setString(schemaPattern);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
-
- if(tableNamePattern.toChar() != '%')
- varCriteria[nPos].setString(tableNamePattern);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
- varCriteria[nPos].setString(columnNamePattern);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// COLUMN_NAME
-
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- ADORecordset *pRecordset = NULL;
- OpenSchema(adSchemaColumns,vsa,vtEmpty,&pRecordset);
-
- return pRecordset;
-}
-// -----------------------------------------------------------------------------
-ADORecordset* WpADOConnection::getColumnPrivileges( const ::com::sun::star::uno::Any& catalog,
- const ::rtl::OUString& schema,
- const ::rtl::OUString& table,
- const ::rtl::OUString& columnNamePattern )
-{
- // Create elements used in the array
- HRESULT hr = S_OK;
- SAFEARRAYBOUND rgsabound[1];
- SAFEARRAY *psa = NULL;
- OLEVariant varCriteria[4];
-
- // Create SafeArray Bounds and initialize the array
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = SAL_N_ELEMENTS( varCriteria );
- psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- sal_Int32 nPos=0;
- if(catalog.hasValue())
- varCriteria[nPos].setString(::comphelper::getString(catalog));
-
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_CATALOG
- if(schema.getLength() && schema.toChar() != '%')
- varCriteria[nPos].setString(schema);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_SCHEMA
-
- varCriteria[nPos].setString(table);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// TABLE_NAME
-
- varCriteria[nPos].setString(columnNamePattern);
- hr = SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;// COLUMN_NAME
-
- OLEVariant vtEmpty;
- vtEmpty.setNoArg();
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- ADORecordset *pRecordset = NULL;
- OpenSchema(adSchemaColumnPrivileges,vsa,vtEmpty,&pRecordset);
-
- return pRecordset;
-}
-// -----------------------------------------------------------------------------
-ADORecordset* WpADOConnection::getTypeInfo(DataTypeEnum /*_eType*/)
-{
- // Create elements used in the array
- OLEVariant varCriteria[2];
- const int nCrit = SAL_N_ELEMENTS( varCriteria );
- // Create SafeArray Bounds and initialize the array
- SAFEARRAYBOUND rgsabound[1];
- rgsabound[0].lLbound = 0;
- rgsabound[0].cElements = nCrit;
- SAFEARRAY *psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
-
- sal_Int32 nPos = 0;
- SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;
- SafeArrayPutElement(psa,&nPos,&varCriteria[nPos]);nPos++;
-
- // Initialize and fill the SafeArray
- OLEVariant vsa;
- vsa.setArray(psa,VT_VARIANT);
-
- OLEVariant aEmpty;
- aEmpty.setNoArg();
-
- ADORecordset *pRec=NULL;
- OpenSchema(adSchemaProviderTypes,vsa,aEmpty,&pRec);
-
- return pRec;
-}
-// -----------------------------------------------------------------------------
-void WpADOColumn::put_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Bool bRet = SUCCEEDED(pInterface->put_ParentCatalog(ppvObject));
- OSL_ENSURE(bRet,"Could not set ParentCatalog!");
- OSL_UNUSED(bRet);
-}
-// -----------------------------------------------------------------------------
-void WpADOTable::putref_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject)
-{
- OSL_ENSURE(pInterface,"Interface is null!");
- sal_Bool bRet = SUCCEEDED(pInterface->putref_ParentCatalog(ppvObject));
- OSL_ENSURE(bRet,"Could not set ParentCatalog!");
- OSL_UNUSED(bRet);
-}
-// -----------------------------------------------------------------------------
-void WpBase::setIDispatch(IDispatch* _pIUnknown)
-{
- pIUnknown = _pIUnknown;
-}
-// -----------------------------------------------------------------------------
-void OTools::putValue(const WpADOProperties& _rProps,const OLEVariant &_aPosition,const OLEVariant &_aValVar)
-{
- OSL_ENSURE(_rProps.IsValid(),"Properties are not valid!");
- WpADOProperty aProp(_rProps.GetItem(_aPosition));
- if ( aProp.IsValid() )
- {
- sal_Bool bRet = aProp.PutValue(_aValVar);
- OSL_ENSURE(bRet,"Could not put value!");
- OSL_UNUSED(bRet);
- }
-}
-// -----------------------------------------------------------------------------
-OLEVariant OTools::getValue(const WpADOProperties& _rProps,const OLEVariant &_aPosition)
-{
- WpADOProperty aProp(_rProps.GetItem(_aPosition));
- return aProp.GetValue();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/ado.component b/connectivity/source/drivers/ado/ado.component
deleted file mode 100755
index 1962a6b710..0000000000
--- a/connectivity/source/drivers/ado/ado.component
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.sdbc.ado.ODriver">
- <service name="com.sun.star.sdbc.Driver"/>
- <service name="com.sun.star.sdbcx.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/ado/ado.xcu b/connectivity/source/drivers/ado/ado.xcu
deleted file mode 100644
index 3ef8b4c506..0000000000
--- a/connectivity/source/drivers/ado/ado.xcu
+++ /dev/null
@@ -1,269 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:ado:*" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.ado.ODriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">ADO</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="CharSet" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- </node>
- <node oor:name="Features">
- <node oor:name="GeneratedValues" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="AppendTableAliasInSelect" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseBracketedOuterJoinSyntax" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="IgnoreDriverPrivileges" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="DisplayVersionColumns" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseCatalogInSelect" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseSchemaInSelect" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseIndexDirectionKeyword" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseDOSLineEnds" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="BooleanComparisonMode" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FormsCheckRequiredFields" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="PrimaryKeySupport" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="RespectDriverResultSetType" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsTableCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="SupportsBrowsing" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="Authentication" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>UserPassword</value>
- </prop>
- </node>
- <node oor:name="SupportsColumnDescription" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=*" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.ado.ODriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Microsoft Access</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="CharSet" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="BooleanComparisonMode" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:int">
- <value>3</value>
- </prop>
- </node>
- <node oor:name="ColumnAliasInOrderBy" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="TypeInfoSettings" oor:op="replace">
- <prop oor:name="Value" oor:type="oor:string-list">
- <value oor:separator=",">Column(2) = 16,Column(3) = 1</value>
- </prop>
- </node>
- </node>
- <node oor:name="Features">
- <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="AppendTableAliasInSelect" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseBracketedOuterJoinSyntax" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseDOSLineEnds" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="BooleanComparisonMode" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FormsCheckRequiredFields" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="ColumnAliasInOrderBy" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="SupportsTableCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="SupportsBrowsing" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FileSystemBased" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="MediaType" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>application/msaccess</value>
- </prop>
- </node>
- <node oor:name="Extension" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>mdb</value>
- </prop>
- </node>
- <node oor:name="SupportsColumnDescription" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=*" oor:op="replace">
- <prop oor:name="ParentURLPattern">
- <value>sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=*</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Microsoft Access 2007</value>
- </prop>
- <node oor:name="MetaData">
- <node oor:name="Extension" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/ado/ado.xml b/connectivity/source/drivers/ado/ado.xml
deleted file mode 100755
index 2be460df8f..0000000000
--- a/connectivity/source/drivers/ado/ado.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name> ado </module-name>
- <component-description>
- <author>Ocke Janssen</author>
- <name>com.sun.star.comp.sdbc.ado.ODriver</name>
- <description>
- This is the implementation of the ado-sdbc bridge.
- </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service> com.sun.star.sdbc.Driver</supported-service>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>osl</runtime-module-dependency>
- <runtime-module-dependency>dbtools</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
-
-
diff --git a/connectivity/source/drivers/ado/ado_post_sys_include.h b/connectivity/source/drivers/ado/ado_post_sys_include.h
deleted file mode 100755
index 459fa29489..0000000000
--- a/connectivity/source/drivers/ado/ado_post_sys_include.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#undef ADO_REDUCED_WARN_LEVEL
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/ado_pre_sys_include.h b/connectivity/source/drivers/ado/ado_pre_sys_include.h
deleted file mode 100755
index b1ac0e3e51..0000000000
--- a/connectivity/source/drivers/ado/ado_pre_sys_include.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef ADO_REDUCED_WARN_LEVEL
- #error "ado_pre_sys_include.h included twice!"
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(push,1)
-#pragma warning(disable:4917)
-#endif
-
-#define ADO_REDUCED_WARN_LEVEL
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/adoimp.cxx b/connectivity/source/drivers/ado/adoimp.cxx
deleted file mode 100644
index b1075a2f0f..0000000000
--- a/connectivity/source/drivers/ado/adoimp.cxx
+++ /dev/null
@@ -1,339 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbcx/PrivilegeObject.hpp>
-#include "connectivity/dbexception.hxx"
-#include "ado/Awrapado.hxx"
-#include "ado/adoimp.hxx"
-#include <osl/diagnose.h>
-#include <com/sun/star/sdbc/DataType.hpp>
-
-
-using namespace connectivity::ado;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-
-
-#define MYADOID(l) {l, 0,0x10,0x80,0,0,0xAA,0,0x6D,0x2E,0xA4};
-
-const CLSID ADOS::CLSID_ADOCONNECTION_21 = MYADOID(0x00000514);
-const IID ADOS::IID_ADOCONNECTION_21 = MYADOID(0x00000550);
-
-const CLSID ADOS::CLSID_ADOCOMMAND_21 = MYADOID(0x00000507);
-const IID ADOS::IID_ADOCOMMAND_21 = MYADOID(0x0000054E);
-
-const CLSID ADOS::CLSID_ADORECORDSET_21 = MYADOID(0x00000535);
-const IID ADOS::IID_ADORECORDSET_21 = MYADOID(0x0000054F);
-
-const CLSID ADOS::CLSID_ADOCATALOG_25 = MYADOID(0x00000602);
-const IID ADOS::IID_ADOCATALOG_25 = MYADOID(0x00000603);
-
-const CLSID ADOS::CLSID_ADOINDEX_25 = MYADOID(0x0000061E);
-const IID ADOS::IID_ADOINDEX_25 = MYADOID(0x0000061F);
-
-const CLSID ADOS::CLSID_ADOTABLE_25 = MYADOID(0x00000609);
-const IID ADOS::IID_ADOTABLE_25 = MYADOID(0x00000610);
-
-const CLSID ADOS::CLSID_ADOKEY_25 = MYADOID(0x00000621);
-const IID ADOS::IID_ADOKEY_25 = MYADOID(0x00000622);
-
-const CLSID ADOS::CLSID_ADOCOLUMN_25 = MYADOID(0x0000061B);
-const IID ADOS::IID_ADOCOLUMN_25 = MYADOID(0x0000061C);
-
-const CLSID ADOS::CLSID_ADOGROUP_25 = MYADOID(0x00000615);
-const IID ADOS::IID_ADOGROUP_25 = MYADOID(0x00000616);
-
-const CLSID ADOS::CLSID_ADOUSER_25 = MYADOID(0x00000618);
-const IID ADOS::IID_ADOUSER_25 = MYADOID(0x00000619);
-
-const CLSID ADOS::CLSID_ADOVIEW_25 = MYADOID(0x00000612);
-const IID ADOS::IID_ADOVIEW_25 = MYADOID(0x00000613);
-
-OLEString& ADOS::GetKeyStr()
-{
- static OLEString sKeyStr(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("gxwaezucfyqpwjgqbcmtsncuhwsnyhiohwxz")));
- return sKeyStr;
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 ADOS::MapADOType2Jdbc(DataTypeEnum eType)
-{
- sal_Int32 nType = DataType::VARCHAR;;
- switch (eType)
- {
- case adUnsignedSmallInt:
- case adSmallInt: nType = DataType::SMALLINT; break;
- case adUnsignedInt:
- case adInteger: nType = DataType::INTEGER; break;
- case adUnsignedBigInt:
- case adBigInt: nType = DataType::BIGINT; break;
- case adSingle: nType = DataType::FLOAT; break;
- case adDouble: nType = DataType::DOUBLE; break;
- case adCurrency: nType = DataType::DOUBLE; break;
- case adVarNumeric:
- case adNumeric: nType = DataType::NUMERIC; break;
- case adDecimal: nType = DataType::DECIMAL; break;
- case adDBDate: nType = DataType::DATE; break;
- case adDBTime: nType = DataType::TIME; break;
- case adDate:
- case adDBTimeStamp: nType = DataType::TIMESTAMP; break;
- case adBoolean: nType = DataType::BOOLEAN; break;
-// case adArray: nType = DataType::ARRAY; break;
- case adBinary: nType = DataType::BINARY; break;
- case adGUID: nType = DataType::OBJECT; break;
- case adBSTR:
- case adVarWChar:
- case adWChar:
- case adVarChar: nType = DataType::VARCHAR; break;
- case adLongVarWChar:
- case adLongVarChar: nType = DataType::LONGVARCHAR; break;
- case adVarBinary: nType = DataType::VARBINARY; break;
- case adLongVarBinary: nType = DataType::LONGVARBINARY;break;
- case adChar: nType = DataType::CHAR; break;
- case adUnsignedTinyInt:
- case adTinyInt: nType = DataType::TINYINT; break;
- case adEmpty: nType = DataType::SQLNULL; break;
- case adUserDefined:
- case adPropVariant:
- case adFileTime:
- case adChapter:
- case adIDispatch:
- case adIUnknown:
- case adError:
- case adVariant:
- nType = DataType::OTHER; break;
- default:
- OSL_FAIL("MapADOType2Jdbc: Unknown Type!");
- ;
- }
- return nType;
-}
-// -------------------------------------------------------------------------
-DataTypeEnum ADOS::MapJdbc2ADOType(sal_Int32 _nType,sal_Int32 _nJetEngine)
-{
- switch (_nType)
- {
- case DataType::SMALLINT: return adSmallInt; break;
- case DataType::INTEGER: return adInteger; break;
- case DataType::BIGINT: return adBigInt; break;
- case DataType::FLOAT: return adSingle; break;
- case DataType::DOUBLE: return adDouble; break;
- case DataType::NUMERIC: return adNumeric; break;
- case DataType::DECIMAL: return adDecimal; break;
- case DataType::DATE: return isJetEngine(_nJetEngine) ? adDate : adDBDate; break;
- case DataType::TIME: return adDBTime; break;
- case DataType::TIMESTAMP: return isJetEngine(_nJetEngine) ? adDate : adDBTimeStamp; break;
- case DataType::BOOLEAN:
- case DataType::BIT: return adBoolean; break;
- case DataType::BINARY: return adBinary; break;
- case DataType::VARCHAR: return adVarWChar; break;
- case DataType::CLOB:
- case DataType::LONGVARCHAR: return adLongVarWChar; break;
- case DataType::VARBINARY: return adVarBinary; break;
- case DataType::BLOB:
- case DataType::LONGVARBINARY: return adLongVarBinary; break;
- case DataType::CHAR: return adWChar; break;
- case DataType::TINYINT: return isJetEngine(_nJetEngine) ? adUnsignedTinyInt : adTinyInt;break;
- case DataType::OBJECT: return adGUID; break;
- default:
- OSL_FAIL("MapJdbc2ADOType: Unknown Type!");
- ;
- }
- return adEmpty;
-}
-// -----------------------------------------------------------------------------
-const int JET_ENGINETYPE_UNKNOWN = 0;
-const int JET_ENGINETYPE_JET10 = 1;
-const int JET_ENGINETYPE_JET11 = 2;
-const int JET_ENGINETYPE_JET20 = 3;
-const int JET_ENGINETYPE_JET3X = 4;
-const int JET_ENGINETYPE_JET4X = 5;
-const int JET_ENGINETYPE_DBASE3 = 10;
-const int JET_ENGINETYPE_DBASE4 = 11;
-const int JET_ENGINETYPE_DBASE5 = 12;
-const int JET_ENGINETYPE_EXCEL30 = 20;
-const int JET_ENGINETYPE_EXCEL40 = 21;
-const int JET_ENGINETYPE_EXCEL50 = 22;
-const int JET_ENGINETYPE_EXCEL80 = 23;
-const int JET_ENGINETYPE_EXCEL90 = 24;
-const int JET_ENGINETYPE_EXCHANGE4 = 30;
-const int JET_ENGINETYPE_LOTUSWK1 = 40;
-const int JET_ENGINETYPE_LOTUSWK3 = 41;
-const int JET_ENGINETYPE_LOTUSWK4 = 42;
-const int JET_ENGINETYPE_PARADOX3X = 50;
-const int JET_ENGINETYPE_PARADOX4X = 51;
-const int JET_ENGINETYPE_PARADOX5X = 52;
-const int JET_ENGINETYPE_PARADOX7X = 53;
-const int JET_ENGINETYPE_TEXT1X = 60;
-const int JET_ENGINETYPE_HTML1X = 70;
-
-sal_Bool ADOS::isJetEngine(sal_Int32 _nEngineType)
-{
- sal_Bool bRet = sal_False;
- switch(_nEngineType)
- {
- case JET_ENGINETYPE_UNKNOWN:
- case JET_ENGINETYPE_JET10:
- case JET_ENGINETYPE_JET11:
- case JET_ENGINETYPE_JET20:
- case JET_ENGINETYPE_JET3X:
- case JET_ENGINETYPE_JET4X:
- case JET_ENGINETYPE_DBASE3:
- case JET_ENGINETYPE_DBASE4:
- case JET_ENGINETYPE_DBASE5:
- case JET_ENGINETYPE_EXCEL30:
- case JET_ENGINETYPE_EXCEL40:
- case JET_ENGINETYPE_EXCEL50:
- case JET_ENGINETYPE_EXCEL80:
- case JET_ENGINETYPE_EXCEL90:
- case JET_ENGINETYPE_EXCHANGE4:
- case JET_ENGINETYPE_LOTUSWK1:
- case JET_ENGINETYPE_LOTUSWK3:
- case JET_ENGINETYPE_LOTUSWK4:
- case JET_ENGINETYPE_PARADOX3X:
- case JET_ENGINETYPE_PARADOX4X:
- case JET_ENGINETYPE_PARADOX5X:
- case JET_ENGINETYPE_PARADOX7X:
- case JET_ENGINETYPE_TEXT1X:
- case JET_ENGINETYPE_HTML1X:
- bRet = sal_True;
- break;
- }
- return bRet;
-}
-// -----------------------------------------------------------------------------
-ObjectTypeEnum ADOS::mapObjectType2Ado(sal_Int32 objType)
-{
- ObjectTypeEnum eType = adPermObjTable;
- switch(objType)
- {
- case PrivilegeObject::TABLE:
- eType = adPermObjTable;
- break;
- case PrivilegeObject::VIEW:
- eType = adPermObjView;
- break;
- case PrivilegeObject::COLUMN:
- eType = adPermObjColumn;
- break;
- }
- return eType;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 ADOS::mapAdoType2Object(ObjectTypeEnum objType)
-{
- sal_Int32 nType = PrivilegeObject::TABLE;
- switch(objType)
- {
- case adPermObjTable:
- nType = PrivilegeObject::TABLE;
- break;
- case adPermObjView:
- nType = PrivilegeObject::VIEW;
- break;
- case adPermObjColumn:
- nType = PrivilegeObject::COLUMN;
- break;
- default:
- OSL_FAIL( "ADOS::mapAdoType2Object: privilege type cannot be translated!" );
- break;
- }
- return nType;
-}
-#ifdef DELETE
-#undef DELETE
-#endif
-// -----------------------------------------------------------------------------
-sal_Int32 ADOS::mapAdoRights2Sdbc(RightsEnum eRights)
-{
- sal_Int32 nRights = 0;
- if((eRights & adRightInsert) == adRightInsert)
- nRights |= Privilege::INSERT;
- if((eRights & adRightDelete) == adRightDelete)
- nRights |= ::com::sun::star::sdbcx::Privilege::DELETE;
- if((eRights & adRightUpdate) == adRightUpdate)
- nRights |= Privilege::UPDATE;
- if((eRights & adRightWriteDesign) == adRightWriteDesign)
- nRights |= Privilege::ALTER;
- if((eRights & adRightRead) == adRightRead)
- nRights |= Privilege::SELECT;
- if((eRights & adRightReference) == adRightReference)
- nRights |= Privilege::REFERENCE;
- if((eRights & adRightDrop) == adRightDrop)
- nRights |= Privilege::DROP;
-
- return nRights;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 ADOS::mapRights2Ado(sal_Int32 nRights)
-{
- sal_Int32 eRights = adRightNone;
-
- if((nRights & Privilege::INSERT) == Privilege::INSERT)
- eRights |= adRightInsert;
- if((nRights & Privilege::DELETE) == Privilege::DELETE)
- eRights |= adRightDelete;
- if((nRights & Privilege::UPDATE) == Privilege::UPDATE)
- eRights |= adRightUpdate;
- if((nRights & Privilege::ALTER) == Privilege::ALTER)
- eRights |= adRightWriteDesign;
- if((nRights & Privilege::SELECT) == Privilege::SELECT)
- eRights |= adRightRead;
- if((nRights & Privilege::REFERENCE) == Privilege::REFERENCE)
- eRights |= adRightReference;
- if((nRights & Privilege::DROP) == Privilege::DROP)
- eRights |= adRightDrop;
-
- return eRights;
-}
-// -----------------------------------------------------------------------------
-WpADOField ADOS::getField(ADORecordset* _pRecordSet,sal_Int32 _nColumnIndex) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- if ( !_pRecordSet )
- return WpADOField();
-
- ADOFields* pFields = NULL;
- _pRecordSet->get_Fields(&pFields);
- WpOLEAppendCollection<ADOFields, ADOField, WpADOField> aFields(pFields);
- if(_nColumnIndex <= 0 || _nColumnIndex > aFields.GetItemCount())
- ::dbtools::throwInvalidIndexException(NULL);
- WpADOField aField(aFields.GetItem(_nColumnIndex-1));
- if(!aField.IsValid())
- ::dbtools::throwInvalidIndexException(NULL);
- return aField;
-}
-// -----------------------------------------------------------------------------
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/ado/exports.dxp b/connectivity/source/drivers/ado/exports.dxp
deleted file mode 100755
index f0e1c69934..0000000000
--- a/connectivity/source/drivers/ado/exports.dxp
+++ /dev/null
@@ -1,2 +0,0 @@
-component_getImplementationEnvironment
-component_getFactory
diff --git a/connectivity/source/drivers/ado/makefile.mk b/connectivity/source/drivers/ado/makefile.mk
deleted file mode 100755
index 20cd74f996..0000000000
--- a/connectivity/source/drivers/ado/makefile.mk
+++ /dev/null
@@ -1,124 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=ado
-VISIBILITY_HIDDEN=TRUE
-
-# --- Settings ----------------------------------
-
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : $(PRJ)$/version.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-.IF "$(GUI)"=="WNT"
-# --- Files -------------------------------------
-
-.IF "$(COM)" == "GCC"
-CFLAGS+=-fpermissive
-.ENDIF
-
-EXCEPTIONSFILES= \
- $(SLO)$/ADatabaseMetaDataImpl.obj \
- $(SLO)$/Aolevariant.obj \
- $(SLO)$/ADatabaseMetaData.obj \
- $(SLO)$/AColumn.obj \
- $(SLO)$/AColumns.obj \
- $(SLO)$/AIndex.obj \
- $(SLO)$/AIndexes.obj \
- $(SLO)$/AKey.obj \
- $(SLO)$/AKeys.obj \
- $(SLO)$/AUser.obj \
- $(SLO)$/AUsers.obj \
- $(SLO)$/AGroup.obj \
- $(SLO)$/AGroups.obj \
- $(SLO)$/ACatalog.obj \
- $(SLO)$/AView.obj \
- $(SLO)$/AViews.obj \
- $(SLO)$/ATable.obj \
- $(SLO)$/ATables.obj \
- $(SLO)$/ACallableStatement.obj \
- $(SLO)$/ADatabaseMetaDataResultSetMetaData.obj \
- $(SLO)$/ADatabaseMetaDataResultSet.obj \
- $(SLO)$/AResultSet.obj \
- $(SLO)$/AConnection.obj \
- $(SLO)$/AStatement.obj \
- $(SLO)$/APreparedStatement.obj \
- $(SLO)$/AResultSetMetaData.obj \
- $(SLO)$/ADriver.obj \
- $(SLO)$/Aservices.obj \
- $(SLO)$/Awrapado.obj \
- $(SLO)$/adoimp.obj
-
-SLOFILES=\
- $(EXCEPTIONSFILES)
-# --- Library -----------------------------------
-
-SHL1TARGET= $(ADO_TARGET)$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(OLE32LIB) \
- $(OLEAUT32LIB) \
- $(UUIDLIB) \
- $(DBTOOLSLIB) \
- $(COMPHELPERLIB)
-
-.IF "$(COMPHELPERLIB)" == ""
-SHL1STDLIBS+= icomphelp2.lib
-.ENDIF
-
-SHL1IMPLIB= i$(SHL1TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-.ELSE
-dummy:
- @echo "Nothing to build for GUI $(GUI)"
-.ENDIF # "$(GUI)"=="WNT"
-# --- Targets ----------------------------------
-.INCLUDE : $(PRJ)$/target.pmk
-
-
-ALLTAR : $(MISC)/ado.component
-
-$(MISC)/ado.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- ado.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt ado.component
diff --git a/connectivity/source/drivers/calc/CCatalog.cxx b/connectivity/source/drivers/calc/CCatalog.cxx
deleted file mode 100644
index 985a3b21df..0000000000
--- a/connectivity/source/drivers/calc/CCatalog.cxx
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include "calc/CCatalog.hxx"
-#include "calc/CConnection.hxx"
-#include "calc/CTables.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <rtl/logfile.hxx>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-// -------------------------------------------------------------------------
-using namespace connectivity::calc;
-// -------------------------------------------------------------------------
-OCalcCatalog::OCalcCatalog(OCalcConnection* _pCon) : file::OFileCatalog(_pCon)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcCatalog::OCalcCatalog" );
-}
-// -------------------------------------------------------------------------
-void OCalcCatalog::refreshTables()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcCatalog::refreshTables" );
- TStringVector aVector;
- Sequence< ::rtl::OUString > aTypes;
- OCalcConnection::ODocHolder aDocHodler(((OCalcConnection*)m_pConnection));
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),aTypes);
-
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- aVector.push_back(xRow->getString(3));
- }
- if(m_pTables)
- m_pTables->reFill(aVector);
- else
- m_pTables = new OCalcTables(m_xMetaData,*this,m_aMutex,aVector);
-
- // this avoids that the document will be loaded a 2nd time when one table will be accessed.
- //if ( m_pTables && m_pTables->hasElements() )
- // m_pTables->getByIndex(0);
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/calc/CColumns.cxx b/connectivity/source/drivers/calc/CColumns.cxx
deleted file mode 100644
index e3d7bcaa44..0000000000
--- a/connectivity/source/drivers/calc/CColumns.cxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "calc/CColumns.hxx"
-#include "calc/CTable.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-
-using namespace connectivity::calc;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-
-sdbcx::ObjectType OCalcColumns::createObject(const ::rtl::OUString& _rName)
-{
- OCalcTable* pTable = (OCalcTable*)m_pTable;
- ::rtl::Reference<OSQLColumns> aCols = pTable->getTableColumns();
-
- OSQLColumns::Vector::const_iterator aIter = find(aCols->get().begin(),aCols->get().end(),_rName,::comphelper::UStringMixEqual(isCaseSensitive()));
- sdbcx::ObjectType xRet;
- if(aIter != aCols->get().end())
- xRet = sdbcx::ObjectType(*aIter,UNO_QUERY);
- return xRet;
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx
deleted file mode 100644
index 44f6f89928..0000000000
--- a/connectivity/source/drivers/calc/CConnection.cxx
+++ /dev/null
@@ -1,293 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "calc/CConnection.hxx"
-#include "calc/CDatabaseMetaData.hxx"
-#include "calc/CCatalog.hxx"
-#include "calc/CDriver.hxx"
-#include "resource/calc_res.hrc"
-#include "resource/sharedresources.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/frame/XComponentLoader.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include <tools/urlobj.hxx>
-#include "calc/CPreparedStatement.hxx"
-#include "calc/CStatement.hxx"
-#include <unotools/pathoptions.hxx>
-#include <connectivity/dbexception.hxx>
-#include <cppuhelper/exc_hlp.hxx>
-#include <rtl/logfile.hxx>
-
-using namespace connectivity::calc;
-using namespace connectivity::file;
-
-typedef connectivity::file::OConnection OConnection_BASE;
-
-//------------------------------------------------------------------------------
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::sheet;
-
-// --------------------------------------------------------------------------------
-
-OCalcConnection::OCalcConnection(ODriver* _pDriver) : OConnection(_pDriver),m_nDocCount(0)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcConnection::OCalcConnection" );
- // m_aFilenameExtension is not used
-}
-
-OCalcConnection::~OCalcConnection()
-{
-}
-
-void OCalcConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyValue >& info)
- throw(SQLException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcConnection::construct" );
- // open file
-
- sal_Int32 nLen = url.indexOf(':');
- nLen = url.indexOf(':',nLen+1);
- ::rtl::OUString aDSN(url.copy(nLen+1));
-
- m_aFileName = aDSN;
- INetURLObject aURL;
- aURL.SetSmartProtocol(INET_PROT_FILE);
- {
- SvtPathOptions aPathOptions;
- m_aFileName = aPathOptions.SubstituteVariable(m_aFileName);
- }
- aURL.SetSmartURL(m_aFileName);
- if ( aURL.GetProtocol() == INET_PROT_NOT_VALID )
- {
- // don't pass invalid URL to loadComponentFromURL
- throw SQLException();
- }
- m_aFileName = aURL.GetMainURL(INetURLObject::NO_DECODE);
-
- m_sPassword = ::rtl::OUString();
- const char* pPwd = "password";
-
- const PropertyValue *pIter = info.getConstArray();
- const PropertyValue *pEnd = pIter + info.getLength();
- for(;pIter != pEnd;++pIter)
- {
- if(!pIter->Name.compareToAscii(pPwd))
- {
- pIter->Value >>= m_sPassword;
- break;
- }
- } // for(;pIter != pEnd;++pIter)
- ODocHolder aDocHodler(this); // just to test that the doc can be loaded
- acquireDoc();
-}
-// -----------------------------------------------------------------------------
-Reference< XSpreadsheetDocument> OCalcConnection::acquireDoc()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcConnection::acquireDoc" );
- if ( m_xDoc.is() )
- {
- osl_incrementInterlockedCount(&m_nDocCount);
- return m_xDoc;
- }
- // open read-only as long as updating isn't implemented
- Sequence<PropertyValue> aArgs(2);
- aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden"));
- aArgs[0].Value <<= (sal_Bool) sal_True;
- aArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
- aArgs[1].Value <<= (sal_Bool) sal_True;
-
- if ( m_sPassword.getLength() )
- {
- const sal_Int32 nPos = aArgs.getLength();
- aArgs.realloc(nPos+1);
- aArgs[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Password"));
- aArgs[nPos].Value <<= m_sPassword;
- }
-
- Reference< XComponentLoader > xDesktop( getDriver()->getFactory()->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), UNO_QUERY );
- if (!xDesktop.is())
- {
- OSL_FAIL("no desktop");
- throw SQLException();
- }
- Reference< XComponent > xComponent;
- Any aLoaderException;
- try
- {
- xComponent = xDesktop->loadComponentFromURL(
- m_aFileName, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), 0, aArgs );
- }
- catch( const Exception& )
- {
- aLoaderException = ::cppu::getCaughtException();
- }
-
- m_xDoc.set(xComponent, UNO_QUERY );
-
- // if the URL is not a spreadsheet document, throw the exception here
- // instead of at the first access to it
- if ( !m_xDoc.is() )
- {
- Any aErrorDetails;
- if ( aLoaderException.hasValue() )
- {
- Exception aLoaderError;
- OSL_VERIFY( aLoaderException >>= aLoaderError );
-
- SQLException aDetailException;
- aDetailException.Message = m_aResources.getResourceStringWithSubstitution(
- STR_LOAD_FILE_ERROR_MESSAGE,
- "$exception_type$", aLoaderException.getValueTypeName(),
- "$error_message$", aLoaderError.Message
- );
- aErrorDetails <<= aDetailException;
- }
-
- const ::rtl::OUString sError( m_aResources.getResourceStringWithSubstitution(
- STR_COULD_NOT_LOAD_FILE,
- "$filename$", m_aFileName
- ) );
- ::dbtools::throwGenericSQLException( sError, *this, aErrorDetails );
- }
- osl_incrementInterlockedCount(&m_nDocCount);
- return m_xDoc;
-}
-// -----------------------------------------------------------------------------
-void OCalcConnection::releaseDoc()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcConnection::releaseDoc" );
- if ( osl_decrementInterlockedCount(&m_nDocCount) == 0 )
- ::comphelper::disposeComponent( m_xDoc );
-}
-// -----------------------------------------------------------------------------
-void OCalcConnection::disposing()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcConnection::disposing" );
- ::osl::MutexGuard aGuard(m_aMutex);
-
- m_nDocCount = 0;
- ::comphelper::disposeComponent( m_xDoc );
-
- OConnection::disposing();
-}
-
-// XServiceInfo
-// --------------------------------------------------------------------------------
-
-IMPLEMENT_SERVICE_INFO(OCalcConnection, "com.sun.star.sdbc.drivers.calc.Connection", "com.sun.star.sdbc.Connection")
-
-// --------------------------------------------------------------------------------
-
-Reference< XDatabaseMetaData > SAL_CALL OCalcConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcConnection::getMetaData" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if(!xMetaData.is())
- {
- xMetaData = new OCalcDatabaseMetaData(this);
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-
-//------------------------------------------------------------------------------
-
-::com::sun::star::uno::Reference< XTablesSupplier > OCalcConnection::createCatalog()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcConnection::createCatalog" );
- ::osl::MutexGuard aGuard( m_aMutex );
- Reference< XTablesSupplier > xTab = m_xCatalog;
- if(!xTab.is())
- {
- OCalcCatalog *pCat = new OCalcCatalog(this);
- xTab = pCat;
- m_xCatalog = xTab;
- }
- return xTab;
-}
-
-// --------------------------------------------------------------------------------
-
-Reference< XStatement > SAL_CALL OCalcConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcConnection::createStatement" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- Reference< XStatement > xReturn = new OCalcStatement(this);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-
-// --------------------------------------------------------------------------------
-
-Reference< XPreparedStatement > SAL_CALL OCalcConnection::prepareStatement( const ::rtl::OUString& sql )
- throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcConnection::prepareStatement" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- OCalcPreparedStatement* pStmt = new OCalcPreparedStatement(this);
- Reference< XPreparedStatement > xHoldAlive = pStmt;
- pStmt->construct(sql);
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return pStmt;
-}
-
-// --------------------------------------------------------------------------------
-
-Reference< XPreparedStatement > SAL_CALL OCalcConnection::prepareCall( const ::rtl::OUString& /*sql*/ )
- throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcConnection::prepareCall" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- ::dbtools::throwFeatureNotImplementedException( "XConnection::prepareCall", *this );
- return NULL;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/calc/CDatabaseMetaData.cxx b/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
deleted file mode 100644
index c25d533d57..0000000000
--- a/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
+++ /dev/null
@@ -1,470 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include "calc/CDatabaseMetaData.hxx"
-#include "calc/CConnection.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include <com/sun/star/sheet/XSpreadsheet.hpp>
-#include <com/sun/star/sheet/XCellRangesQuery.hpp>
-#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
-#include <com/sun/star/sheet/XDatabaseRanges.hpp>
-#include <com/sun/star/sheet/XDatabaseRange.hpp>
-#include <tools/urlobj.hxx>
-#include "FDatabaseMetaDataResultSet.hxx"
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <comphelper/types.hxx>
-#include <rtl/logfile.hxx>
-
-using namespace connectivity::calc;
-using namespace connectivity::file;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::table;
-using namespace ::com::sun::star::sheet;
-
-// -------------------------------------------------------------------------
-
-OCalcDatabaseMetaData::OCalcDatabaseMetaData(OConnection* _pCon) :ODatabaseMetaData(_pCon)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcDatabaseMetaData::OCalcDatabaseMetaData" );
-}
-
-// -------------------------------------------------------------------------
-
-OCalcDatabaseMetaData::~OCalcDatabaseMetaData()
-{
-}
-
-// -------------------------------------------------------------------------
-Reference< XResultSet > OCalcDatabaseMetaData::impl_getTypeInfo_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcDatabaseMetaData::impl_getTypeInfo_throw" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
- Reference< XResultSet > xRef = pResult;
-
- static ODatabaseMetaDataResultSet::ORows aRows;
- if(aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow;
-
- aRows.reserve(6);
- aRow.reserve(18);
-
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"))));
- aRow.push_back(new ORowSetValueDecorator(DataType::VARCHAR));
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)65535));
- aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value()); // ORowSetValue((sal_Int32)ColumnValue::NULLABLE)
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnSearch::CHAR));
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)10));
-
-
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DECIMAL")));
- aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
- aRow[3] = ODatabaseMetaDataResultSet::get0Value();
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRow[15] = ODatabaseMetaDataResultSet::get0Value();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BOOL")));
- aRow[2] = new ORowSetValueDecorator(DataType::BIT);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRow[15] = new ORowSetValueDecorator((sal_Int32)15);
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATE")));
- aRow[2] = new ORowSetValueDecorator(DataType::DATE);
- aRow[3] = ODatabaseMetaDataResultSet::get0Value();
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRow[15] = ODatabaseMetaDataResultSet::get0Value();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIME")));
- aRow[2] = new ORowSetValueDecorator(DataType::TIME);
- aRow[3] = ODatabaseMetaDataResultSet::get0Value();
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRow[15] = ODatabaseMetaDataResultSet::get0Value();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP")));
- aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
- aRow[3] = ODatabaseMetaDataResultSet::get0Value();
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRow[15] = ODatabaseMetaDataResultSet::get0Value();
- aRows.push_back(aRow);
- }
-
- pResult->setRows(aRows);
- return xRef;
-}
-
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL OCalcDatabaseMetaData::getColumns(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& tableNamePattern,
- const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcDatabaseMetaData::getColumns" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- Reference< XTablesSupplier > xTables = m_pConnection->createCatalog();
- if(!xTables.is())
- throw SQLException();
-
- Reference< XNameAccess> xNames = xTables->getTables();
- if(!xNames.is())
- throw SQLException();
-
- ODatabaseMetaDataResultSet::ORows aRows;
- ODatabaseMetaDataResultSet::ORow aRow(19);
-
- aRow[10] = new ORowSetValueDecorator((sal_Int32)10);
-
- Sequence< ::rtl::OUString> aTabNames(xNames->getElementNames());
- const ::rtl::OUString* pTabIter = aTabNames.getConstArray();
- const ::rtl::OUString* pTabEnd = pTabIter + aTabNames.getLength();
- for(;pTabIter != pTabEnd;++pTabIter)
- {
- if(match(tableNamePattern,*pTabIter,'\0'))
- {
- const Reference< XColumnsSupplier> xTable(xNames->getByName(*pTabIter),UNO_QUERY_THROW);
- OSL_ENSURE(xTable.is(),"Table not found! Normallya exception had to be thrown here!");
- aRow[3] = new ORowSetValueDecorator(*pTabIter);
-
- const Reference< XNameAccess> xColumns = xTable->getColumns();
- if(!xColumns.is())
- throw SQLException();
-
- const Sequence< ::rtl::OUString> aColNames(xColumns->getElementNames());
-
- const ::rtl::OUString* pColumnIter = aColNames.getConstArray();
- const ::rtl::OUString* pEnd = pColumnIter + aColNames.getLength();
- Reference< XPropertySet> xColumn;
- for(sal_Int32 i=1;pColumnIter != pEnd;++pColumnIter,++i)
- {
- if(match(columnNamePattern,*pColumnIter,'\0'))
- {
- aRow[4] = new ORowSetValueDecorator( *pColumnIter);
-
- xColumns->getByName(*pColumnIter) >>= xColumn;
- OSL_ENSURE(xColumn.is(),"Columns contains a column who isn't a fastpropertyset!");
- aRow[5] = new ORowSetValueDecorator(::comphelper::getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))));
- aRow[6] = new ORowSetValueDecorator(::comphelper::getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME))));
- aRow[7] = new ORowSetValueDecorator(::comphelper::getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))));
- // aRow[8] = xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME));
- aRow[9] = new ORowSetValueDecorator(::comphelper::getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))));
- aRow[11] = new ORowSetValueDecorator(::comphelper::getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))));
- // aRow[12] = xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME));
- aRow[13] = new ORowSetValueDecorator(::comphelper::getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE))));
- // aRow[14] = xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME));
- // aRow[15] = xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME));
- switch(sal_Int32(aRow[5]->getValue()))
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- aRow[16] = new ORowSetValueDecorator((sal_Int32)254);
- break;
- case DataType::LONGVARCHAR:
- aRow[16] = new ORowSetValueDecorator((sal_Int32)65535);
- break;
- default:
- aRow[16] = new ORowSetValueDecorator((sal_Int32)0);
- }
- aRow[17] = new ORowSetValueDecorator(i);
- switch(sal_Int32(aRow[11]->getValue()))
- {
- case ColumnValue::NO_NULLS:
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NO")));
- break;
- case ColumnValue::NULLABLE:
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("YES")));
- break;
- default:
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString());
- }
- aRows.push_back(aRow);
- }
- }
- }
- }
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns);
- Reference< XResultSet > xRef = pResult;
- pResult->setRows(aRows);
-
- return xRef;
-}
-
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL OCalcDatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcDatabaseMetaData::getURL" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:calc:")) + m_pConnection->getURL();
-}
-
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OCalcDatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcDatabaseMetaData::getMaxBinaryLiteralLength" );
- return STRING_MAXLEN;
-}
-
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OCalcDatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcDatabaseMetaData::getMaxCharLiteralLength" );
- return STRING_MAXLEN;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OCalcDatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcDatabaseMetaData::getMaxColumnNameLength" );
- return STRING_MAXLEN;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OCalcDatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcDatabaseMetaData::getMaxColumnsInIndex" );
- return 1;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OCalcDatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcDatabaseMetaData::getMaxColumnsInTable" );
- return 256;
-}
-
-// -------------------------------------------------------------------------
-
-sal_Bool lcl_IsEmptyOrHidden( const Reference<XSpreadsheets>& xSheets, const ::rtl::OUString& rName )
-{
- Any aAny = xSheets->getByName( rName );
- Reference<XSpreadsheet> xSheet;
- if ( aAny >>= xSheet )
- {
- // test if sheet is hidden
-
- Reference<XPropertySet> xProp( xSheet, UNO_QUERY );
- if (xProp.is())
- {
- sal_Bool bVisible = sal_Bool();
- Any aVisAny = xProp->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsVisible")) );
- if ( aVisAny >>= bVisible )
- if (!bVisible)
- return sal_True; // hidden
- }
-
- // use the same data area as in OCalcTable to test for empty table
-
- Reference<XSheetCellCursor> xCursor = xSheet->createCursor();
- Reference<XCellRangeAddressable> xRange( xCursor, UNO_QUERY );
- if ( xRange.is() )
- {
- xCursor->collapseToSize( 1, 1 ); // single (first) cell
- xCursor->collapseToCurrentRegion(); // contiguous data area
-
- CellRangeAddress aRangeAddr = xRange->getRangeAddress();
- if ( aRangeAddr.StartColumn == aRangeAddr.EndColumn &&
- aRangeAddr.StartRow == aRangeAddr.EndRow )
- {
- // single cell -> check content
- Reference<XCell> xCell = xCursor->getCellByPosition( 0, 0 );
- if ( xCell.is() && xCell->getType() == CellContentType_EMPTY )
- return sal_True;
- }
- }
- }
-
- return sal_False;
-}
-
-sal_Bool lcl_IsUnnamed( const Reference<XDatabaseRanges>& xRanges, const ::rtl::OUString& rName )
-{
- sal_Bool bUnnamed = sal_False;
-
- Any aAny = xRanges->getByName( rName );
- Reference<XDatabaseRange> xRange;
- if ( aAny >>= xRange )
- {
- Reference<XPropertySet> xRangeProp( xRange, UNO_QUERY );
- if ( xRangeProp.is() )
- {
- try
- {
- Any aUserAny = xRangeProp->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsUserDefined")) );
- sal_Bool bUserDefined = sal_Bool();
- if ( aUserAny >>= bUserDefined )
- bUnnamed = !bUserDefined;
- }
- catch ( UnknownPropertyException& )
- {
- // optional property
- }
- }
- }
-
- return bUnnamed;
-}
-
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL OCalcDatabaseMetaData::getTables(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/,
- const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& types )
- throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcDatabaseMetaData::getTables" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTables);
- Reference< XResultSet > xRef = pResult;
-
- // check if ORowSetValue type is given
- // when no types are given then we have to return all tables e.g. TABLE
-
- ::rtl::OUString aTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
-
- sal_Bool bTableFound = sal_True;
- sal_Int32 nLength = types.getLength();
- if(nLength)
- {
- bTableFound = sal_False;
-
- const ::rtl::OUString* pIter = types.getConstArray();
- const ::rtl::OUString* pEnd = pIter + nLength;
- for(;pIter != pEnd;++pIter)
- {
- if(*pIter == aTable)
- {
- bTableFound = sal_True;
- break;
- }
- }
- }
- if(!bTableFound)
- return xRef;
-
- // get the sheet names from the document
-
- OCalcConnection::ODocHolder aDocHodler(((OCalcConnection*)m_pConnection));
- Reference<XSpreadsheetDocument> xDoc = aDocHodler.getDoc();
- if ( !xDoc.is() )
- throw SQLException();
- Reference<XSpreadsheets> xSheets = xDoc->getSheets();
- if ( !xSheets.is() )
- throw SQLException();
- Sequence< ::rtl::OUString > aSheetNames = xSheets->getElementNames();
-
- ODatabaseMetaDataResultSet::ORows aRows;
- sal_Int32 nSheetCount = aSheetNames.getLength();
- for (sal_Int32 nSheet=0; nSheet<nSheetCount; nSheet++)
- {
- ::rtl::OUString aName = aSheetNames[nSheet];
- if ( !lcl_IsEmptyOrHidden( xSheets, aName ) && match(tableNamePattern,aName,'\0') )
- {
- ODatabaseMetaDataResultSet::ORow aRow(3);
- aRow.reserve(6);
- aRow.push_back(new ORowSetValueDecorator(aName));
- aRow.push_back(new ORowSetValueDecorator(aTable));
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRows.push_back(aRow);
- }
- }
-
- // also use database ranges
-
- Reference<XPropertySet> xDocProp( xDoc, UNO_QUERY );
- if ( xDocProp.is() )
- {
- Any aRangesAny = xDocProp->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DatabaseRanges")) );
- Reference<XDatabaseRanges> xRanges;
- if ( aRangesAny >>= xRanges )
- {
- Sequence< ::rtl::OUString > aDBNames = xRanges->getElementNames();
- sal_Int32 nDBCount = aDBNames.getLength();
- for (sal_Int32 nRange=0; nRange<nDBCount; nRange++)
- {
- ::rtl::OUString aName = aDBNames[nRange];
- if ( !lcl_IsUnnamed( xRanges, aName ) && match(tableNamePattern,aName,'\0') )
- {
- ODatabaseMetaDataResultSet::ORow aRow(3);
- aRow.reserve(6);
- aRow.push_back(new ORowSetValueDecorator(aName));
- aRow.push_back(new ORowSetValueDecorator(aTable));
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRows.push_back(aRow);
- }
- }
- }
- }
-
- pResult->setRows(aRows);
-
- return xRef;
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/calc/CDriver.cxx b/connectivity/source/drivers/calc/CDriver.cxx
deleted file mode 100644
index 4317829cf9..0000000000
--- a/connectivity/source/drivers/calc/CDriver.cxx
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "calc/CDriver.hxx"
-#include "calc/CConnection.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/dbexception.hxx"
-#include "resource/sharedresources.hxx"
-#include "resource/calc_res.hrc"
-
-using namespace connectivity::calc;
-using namespace connectivity::file;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-
-
-//------------------------------------------------------------------------------
-// static ServiceInfo
-
-rtl::OUString ODriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdbc.calc.ODriver"));
-}
-
-::rtl::OUString SAL_CALL ODriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-
-// service names from file::OFileDriver
-
-//------------------------------------------------------------------
-
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
- connectivity::calc::ODriver_CreateInstance(const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
-{
- return *(new ODriver(_rxFactory));
-}
-
-Reference< XConnection > SAL_CALL ODriver::connect( const ::rtl::OUString& url,
- const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- if ( ! acceptsURL(url) )
- return NULL;
-
- OCalcConnection* pCon = new OCalcConnection(this);
- pCon->construct(url,info);
- Reference< XConnection > xCon = pCon;
- m_xConnections.push_back(WeakReferenceHelper(*pCon));
-
- return xCon;
-}
-
-sal_Bool SAL_CALL ODriver::acceptsURL( const ::rtl::OUString& url )
- throw(SQLException, RuntimeException)
-{
- return url.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:calc:")),10) == 0;
-}
-
-Sequence< DriverPropertyInfo > SAL_CALL ODriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException)
-{
- if ( !acceptsURL(url) )
- {
- SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- }
- return Sequence< DriverPropertyInfo >();
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/calc/CPreparedStatement.cxx b/connectivity/source/drivers/calc/CPreparedStatement.cxx
deleted file mode 100644
index 13487b5067..0000000000
--- a/connectivity/source/drivers/calc/CPreparedStatement.cxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "calc/CPreparedStatement.hxx"
-#include "calc/CResultSet.hxx"
-
-using namespace connectivity::calc;
-using namespace connectivity::file;
-using namespace com::sun::star::uno;
-// -------------------------------------------------------------------------
-OResultSet* OCalcPreparedStatement::createResultSet()
-{
- return new OCalcResultSet(this,m_aSQLIterator);
-}
-// -------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OCalcPreparedStatement,"com.sun.star.sdbc.driver.calc.PreparedStatement","com.sun.star.sdbc.PreparedStatement");
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/calc/CResultSet.cxx b/connectivity/source/drivers/calc/CResultSet.cxx
deleted file mode 100644
index 4429ec9950..0000000000
--- a/connectivity/source/drivers/calc/CResultSet.cxx
+++ /dev/null
@@ -1,192 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <com/sun/star/sdbcx/CompareBookmark.hpp>
-#include "calc/CResultSet.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/sequence.hxx>
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity::calc;
-using namespace connectivity::file;
-using namespace ::cppu;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-
-//------------------------------------------------------------------------------
-OCalcResultSet::OCalcResultSet( OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator)
- : file::OResultSet(pStmt,_aSQLIterator)
- ,m_bBookmarkable(sal_True)
-{
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISBOOKMARKABLE), PROPERTY_ID_ISBOOKMARKABLE, PropertyAttribute::READONLY,&m_bBookmarkable, ::getBooleanCppuType());
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OCalcResultSet::getImplementationName( ) throw ( RuntimeException)
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.calc.ResultSet"));
-}
-// -------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL OCalcResultSet::getSupportedServiceNames( ) throw( RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(2);
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.ResultSet"));
- aSupported[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.ResultSet"));
- return aSupported;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OCalcResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw( RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OCalcResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OResultSet::queryInterface(rType);
- return aRet.hasValue() ? aRet : OCalcResultSet_BASE::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
- Sequence< Type > SAL_CALL OCalcResultSet::getTypes( ) throw( RuntimeException)
-{
- return ::comphelper::concatSequences(OResultSet::getTypes(),OCalcResultSet_BASE::getTypes());
-}
-
-// -------------------------------------------------------------------------
-// XRowLocate
-Any SAL_CALL OCalcResultSet::getBookmark( ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return makeAny((sal_Int32)(m_aRow->get())[0]->getValue());
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OCalcResultSet::moveToBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False;
-
- return Move(IResultSetHelper::BOOKMARK,comphelper::getINT32(bookmark),sal_True);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OCalcResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False;
-
- Move(IResultSetHelper::BOOKMARK,comphelper::getINT32(bookmark),sal_False);
-
- return relative(rows);
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OCalcResultSet::compareBookmarks( const Any& lhs, const Any& rhs ) throw( SQLException, RuntimeException)
-{
- return (lhs == rhs) ? 0 : 2;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OCalcResultSet::hasOrderedBookmarks( ) throw( SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OCalcResultSet::hashBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return comphelper::getINT32(bookmark);
-}
-// -------------------------------------------------------------------------
-// XDeleteRows
-Sequence< sal_Int32 > SAL_CALL OCalcResultSet::deleteRows( const Sequence< Any >& /*rows*/ ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- ::dbtools::throwFeatureNotImplementedException( "XDeleteRows::deleteRows", *this );
- return Sequence< sal_Int32 >();
-}
-// -------------------------------------------------------------------------
-sal_Bool OCalcResultSet::fillIndexValues(const Reference< XColumnsSupplier> &/*_xIndex*/)
-{
- // Calc table has no index
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OCalcResultSet::getInfoHelper()
-{
- return *OCalcResultSet_BASE3::getArrayHelper();
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OCalcResultSet::createArrayHelper() const
-{
- Sequence< Property > aProps;
- describeProperties(aProps);
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-void SAL_CALL OCalcResultSet::acquire() throw()
-{
- OCalcResultSet_BASE2::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OCalcResultSet::release() throw()
-{
- OCalcResultSet_BASE2::release();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OCalcResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/calc/CStatement.cxx b/connectivity/source/drivers/calc/CStatement.cxx
deleted file mode 100644
index 9bdc780c82..0000000000
--- a/connectivity/source/drivers/calc/CStatement.cxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "calc/CStatement.hxx"
-#include "calc/CResultSet.hxx"
-
-using namespace connectivity::calc;
-using namespace connectivity::file;
-using namespace com::sun::star::uno;
-// -------------------------------------------------------------------------
-OResultSet* OCalcStatement::createResultSet()
-{
- return new OCalcResultSet(this,m_aSQLIterator);
-}
-// -------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OCalcStatement,"com.sun.star.sdbc.driver.calc.Statement","com.sun.star.sdbc.Statement");
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
deleted file mode 100644
index 64efd5f09e..0000000000
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ /dev/null
@@ -1,869 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "calc/CTable.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include <com/sun/star/sheet/XSpreadsheet.hpp>
-#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
-#include <com/sun/star/sheet/XCellRangesQuery.hpp>
-#include <com/sun/star/sheet/XDatabaseRanges.hpp>
-#include <com/sun/star/sheet/XDatabaseRange.hpp>
-#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
-#include <com/sun/star/sheet/XUsedAreaCursor.hpp>
-#include <com/sun/star/sheet/CellFlags.hpp>
-#include <com/sun/star/sheet/FormulaResult.hpp>
-#include <com/sun/star/util/NumberFormat.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include <com/sun/star/text/XText.hpp>
-#include <svl/converter.hxx>
-#include "calc/CConnection.hxx"
-#include "calc/CColumns.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <osl/thread.h>
-#include <tools/config.hxx>
-#include <comphelper/sequence.hxx>
-#include <svl/zforlist.hxx>
-#include <rtl/math.hxx>
-#include <comphelper/extract.hxx>
-#include <connectivity/dbexception.hxx>
-#include <connectivity/dbconversion.hxx>
-#include <comphelper/types.hxx>
-#include <rtl/logfile.hxx>
-
-using namespace connectivity;
-using namespace connectivity::calc;
-using namespace connectivity::file;
-using namespace ::cppu;
-using namespace ::dbtools;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sheet;
-using namespace ::com::sun::star::table;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::util;
-
-
-void lcl_UpdateArea( const Reference<XCellRange>& xUsedRange, sal_Int32& rEndCol, sal_Int32& rEndRow )
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::lcl_UpdateArea" );
- // update rEndCol, rEndRow if any non-empty cell in xUsedRange is right/below
-
- const Reference<XCellRangesQuery> xUsedQuery( xUsedRange, UNO_QUERY );
- if ( xUsedQuery.is() )
- {
- const sal_Int16 nContentFlags =
- CellFlags::STRING | CellFlags::VALUE | CellFlags::DATETIME | CellFlags::FORMULA | CellFlags::ANNOTATION;
-
- const Reference<XSheetCellRanges> xUsedRanges = xUsedQuery->queryContentCells( nContentFlags );
- const Sequence<CellRangeAddress> aAddresses = xUsedRanges->getRangeAddresses();
-
- const sal_Int32 nCount = aAddresses.getLength();
- const CellRangeAddress* pData = aAddresses.getConstArray();
- for ( sal_Int32 i=0; i<nCount; i++ )
- {
- rEndCol = pData[i].EndColumn > rEndCol ? pData[i].EndColumn : rEndCol;
- rEndRow = pData[i].EndRow > rEndRow ? pData[i].EndRow : rEndRow;
- }
- }
-}
-
-void lcl_GetDataArea( const Reference<XSpreadsheet>& xSheet, sal_Int32& rColumnCount, sal_Int32& rRowCount )
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::lcl_GetDataArea" );
- Reference<XSheetCellCursor> xCursor = xSheet->createCursor();
- Reference<XCellRangeAddressable> xRange( xCursor, UNO_QUERY );
- if ( !xRange.is() )
- {
- rColumnCount = rRowCount = 0;
- return;
- }
-
- // first find the contiguous cell area starting at A1
-
- xCursor->collapseToSize( 1, 1 ); // single (first) cell
- xCursor->collapseToCurrentRegion(); // contiguous data area
-
- CellRangeAddress aRegionAddr = xRange->getRangeAddress();
- sal_Int32 nEndCol = aRegionAddr.EndColumn;
- sal_Int32 nEndRow = aRegionAddr.EndRow;
-
- Reference<XUsedAreaCursor> xUsed( xCursor, UNO_QUERY );
- if ( xUsed.is() )
- {
- // The used area from XUsedAreaCursor includes visible attributes.
- // If the used area is larger than the contiguous cell area, find non-empty
- // cells in that area.
-
- xUsed->gotoEndOfUsedArea( sal_False );
- CellRangeAddress aUsedAddr = xRange->getRangeAddress();
-
- if ( aUsedAddr.EndColumn > aRegionAddr.EndColumn )
- {
- Reference<XCellRange> xUsedRange = xSheet->getCellRangeByPosition(
- aRegionAddr.EndColumn + 1, 0, aUsedAddr.EndColumn, aUsedAddr.EndRow );
- lcl_UpdateArea( xUsedRange, nEndCol, nEndRow );
- }
-
- if ( aUsedAddr.EndRow > aRegionAddr.EndRow )
- {
- // only up to the last column of aRegionAddr, the other columns are handled above
- Reference<XCellRange> xUsedRange = xSheet->getCellRangeByPosition(
- 0, aRegionAddr.EndRow + 1, aRegionAddr.EndColumn, aUsedAddr.EndRow );
- lcl_UpdateArea( xUsedRange, nEndCol, nEndRow );
- }
- }
-
- rColumnCount = nEndCol + 1; // number of columns
- rRowCount = nEndRow; // first row (headers) is not counted
-}
-
-CellContentType lcl_GetContentOrResultType( const Reference<XCell>& xCell )
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::lcl_GetContentOrResultType" );
- CellContentType eCellType = xCell->getType();
- if ( eCellType == CellContentType_FORMULA )
- {
- static const ::rtl::OUString s_sFormulaResultType(RTL_CONSTASCII_USTRINGPARAM("FormulaResultType"));
- Reference<XPropertySet> xProp( xCell, UNO_QUERY );
- try
- {
- xProp->getPropertyValue( s_sFormulaResultType ) >>= eCellType; // type of formula result
- }
- catch (UnknownPropertyException&)
- {
- eCellType = CellContentType_VALUE; // if FormulaResultType property not available
- }
- }
- return eCellType;
-}
-
-Reference<XCell> lcl_GetUsedCell( const Reference<XSpreadsheet>& xSheet, sal_Int32 nDocColumn, sal_Int32 nDocRow )
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::lcl_GetUsedCell" );
- Reference<XCell> xCell = xSheet->getCellByPosition( nDocColumn, nDocRow );
- if ( xCell.is() && xCell->getType() == CellContentType_EMPTY )
- {
- // get first non-empty cell
-
- Reference<XCellRangeAddressable> xAddr( xSheet, UNO_QUERY );
- if (xAddr.is())
- {
- CellRangeAddress aTotalRange = xAddr->getRangeAddress();
- sal_Int32 nLastRow = aTotalRange.EndRow;
- Reference<XCellRangesQuery> xQuery( xSheet->getCellRangeByPosition( nDocColumn, nDocRow, nDocColumn, nLastRow ), UNO_QUERY );
- if (xQuery.is())
- {
- // queryIntersection to get a ranges object
- Reference<XSheetCellRanges> xRanges = xQuery->queryIntersection( aTotalRange );
- if (xRanges.is())
- {
- Reference<XEnumerationAccess> xCells = xRanges->getCells();
- if (xCells.is())
- {
- Reference<XEnumeration> xEnum = xCells->createEnumeration();
- if ( xEnum.is() && xEnum->hasMoreElements() )
- {
- // get first non-empty cell from enumeration
- xCell.set(xEnum->nextElement(),UNO_QUERY);
- }
- // otherwise, keep empty cell
- }
- }
- }
- }
- }
- return xCell;
-}
-
-bool lcl_HasTextInColumn( const Reference<XSpreadsheet>& xSheet, sal_Int32 nDocColumn, sal_Int32 nDocRow )
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::lcl_HasTextInColumn" );
- // look for any text cell or text result in the column
-
- Reference<XCellRangeAddressable> xAddr( xSheet, UNO_QUERY );
- if (xAddr.is())
- {
- CellRangeAddress aTotalRange = xAddr->getRangeAddress();
- sal_Int32 nLastRow = aTotalRange.EndRow;
- Reference<XCellRangesQuery> xQuery( xSheet->getCellRangeByPosition( nDocColumn, nDocRow, nDocColumn, nLastRow ), UNO_QUERY );
- if (xQuery.is())
- {
- // are there text cells in the column?
- Reference<XSheetCellRanges> xTextContent = xQuery->queryContentCells( CellFlags::STRING );
- if ( xTextContent.is() && xTextContent->hasElements() )
- return true;
-
- // are there formulas with text results in the column?
- Reference<XSheetCellRanges> xTextFormula = xQuery->queryFormulaCells( FormulaResult::STRING );
- if ( xTextFormula.is() && xTextFormula->hasElements() )
- return true;
- }
- }
-
- return false;
-}
-
-void lcl_GetColumnInfo( const Reference<XSpreadsheet>& xSheet, const Reference<XNumberFormats>& xFormats,
- sal_Int32 nDocColumn, sal_Int32 nStartRow, sal_Bool bHasHeaders,
- ::rtl::OUString& rName, sal_Int32& rDataType, sal_Bool& rCurrency )
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::lcl_GetColumnInfo" );
- //! avoid duplicate field names
-
- // get column name from first row, if range contains headers
-
- if ( bHasHeaders )
- {
- Reference<XText> xHeaderText( xSheet->getCellByPosition( nDocColumn, nStartRow ), UNO_QUERY );
- if ( xHeaderText.is() )
- rName = xHeaderText->getString();
- }
-
- // get column type from first data row
-
- sal_Int32 nDataRow = nStartRow;
- if ( bHasHeaders )
- ++nDataRow;
- Reference<XCell> xDataCell = lcl_GetUsedCell( xSheet, nDocColumn, nDataRow );
-
- Reference<XPropertySet> xProp( xDataCell, UNO_QUERY );
- if ( xProp.is() )
- {
- rCurrency = sal_False; // set to true for currency below
-
- const CellContentType eCellType = lcl_GetContentOrResultType( xDataCell );
- // #i35178# use "text" type if there is any text cell in the column
- if ( eCellType == CellContentType_TEXT || lcl_HasTextInColumn( xSheet, nDocColumn, nDataRow ) )
- rDataType = DataType::VARCHAR;
- else if ( eCellType == CellContentType_VALUE )
- {
- // get number format to distinguish between different types
-
- sal_Int16 nNumType = NumberFormat::NUMBER;
- try
- {
- static ::rtl::OUString s_NumberFormat(RTL_CONSTASCII_USTRINGPARAM("NumberFormat"));
- sal_Int32 nKey = 0;
-
- if ( xProp->getPropertyValue( s_NumberFormat ) >>= nKey )
- {
- const Reference<XPropertySet> xFormat = xFormats->getByKey( nKey );
- if ( xFormat.is() )
- {
- xFormat->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE) ) >>= nNumType;
- }
- }
- }
- catch ( Exception& )
- {
- }
-
- if ( nNumType & NumberFormat::TEXT )
- rDataType = DataType::VARCHAR;
- else if ( nNumType & NumberFormat::NUMBER )
- rDataType = DataType::DECIMAL;
- else if ( nNumType & NumberFormat::CURRENCY )
- {
- rCurrency = sal_True;
- rDataType = DataType::DECIMAL;
- }
- else if ( ( nNumType & NumberFormat::DATETIME ) == NumberFormat::DATETIME )
- {
- // NumberFormat::DATETIME is DATE | TIME
- rDataType = DataType::TIMESTAMP;
- }
- else if ( nNumType & NumberFormat::DATE )
- rDataType = DataType::DATE;
- else if ( nNumType & NumberFormat::TIME )
- rDataType = DataType::TIME;
- else if ( nNumType & NumberFormat::LOGICAL )
- rDataType = DataType::BIT;
- else
- rDataType = DataType::DECIMAL;
- }
- else
- {
- // whole column empty
- rDataType = DataType::VARCHAR;
- }
- }
-}
-
-// -------------------------------------------------------------------------
-
-void lcl_SetValue( ORowSetValue& rValue, const Reference<XSpreadsheet>& xSheet,
- sal_Int32 nStartCol, sal_Int32 nStartRow, sal_Bool bHasHeaders,
- const ::Date& rNullDate,
- sal_Int32 nDBRow, sal_Int32 nDBColumn, sal_Int32 nType )
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::lcl_SetValue" );
- sal_Int32 nDocColumn = nStartCol + nDBColumn - 1; // database counts from 1
- sal_Int32 nDocRow = nStartRow + nDBRow - 1;
- if (bHasHeaders)
- ++nDocRow;
-
- const Reference<XCell> xCell = xSheet->getCellByPosition( nDocColumn, nDocRow );
- if ( xCell.is() )
- {
- CellContentType eCellType = lcl_GetContentOrResultType( xCell );
- switch (nType)
- {
- case DataType::VARCHAR:
- if ( eCellType == CellContentType_EMPTY )
- rValue.setNull();
- else
- {
- // #i25840# still let Calc convert numbers to text
- const Reference<XText> xText( xCell, UNO_QUERY );
- if ( xText.is() )
- rValue = xText->getString();
- }
- break;
- case DataType::DECIMAL:
- if ( eCellType == CellContentType_VALUE )
- rValue = xCell->getValue(); // double
- else
- rValue.setNull();
- break;
- case DataType::BIT:
- if ( eCellType == CellContentType_VALUE )
- rValue = (sal_Bool)( xCell->getValue() != 0.0 );
- else
- rValue.setNull();
- break;
- case DataType::DATE:
- if ( eCellType == CellContentType_VALUE )
- {
- ::Date aDate( rNullDate );
- aDate += (long)::rtl::math::approxFloor( xCell->getValue() );
- ::com::sun::star::util::Date aDateStruct( aDate.GetDay(), aDate.GetMonth(), aDate.GetYear() );
- rValue = aDateStruct;
- }
- else
- rValue.setNull();
- break;
- case DataType::TIME:
- if ( eCellType == CellContentType_VALUE )
- {
- double fCellVal = xCell->getValue();
- double fTime = fCellVal - rtl::math::approxFloor( fCellVal );
- long nIntTime = (long)rtl::math::round( fTime * 8640000.0 );
- if ( nIntTime == 8640000 )
- nIntTime = 0; // 23:59:59.995 and above is 00:00:00.00
- ::com::sun::star::util::Time aTime;
- aTime.HundredthSeconds = (sal_uInt16)( nIntTime % 100 );
- nIntTime /= 100;
- aTime.Seconds = (sal_uInt16)( nIntTime % 60 );
- nIntTime /= 60;
- aTime.Minutes = (sal_uInt16)( nIntTime % 60 );
- nIntTime /= 60;
- OSL_ENSURE( nIntTime < 24, "error in time calculation" );
- aTime.Hours = (sal_uInt16) nIntTime;
- rValue = aTime;
- }
- else
- rValue.setNull();
- break;
- case DataType::TIMESTAMP:
- if ( eCellType == CellContentType_VALUE )
- {
- double fCellVal = xCell->getValue();
- double fDays = ::rtl::math::approxFloor( fCellVal );
- double fTime = fCellVal - fDays;
- long nIntDays = (long)fDays;
- long nIntTime = (long)::rtl::math::round( fTime * 8640000.0 );
- if ( nIntTime == 8640000 )
- {
- nIntTime = 0; // 23:59:59.995 and above is 00:00:00.00
- ++nIntDays; // (next day)
- }
-
- ::com::sun::star::util::DateTime aDateTime;
-
- aDateTime.HundredthSeconds = (sal_uInt16)( nIntTime % 100 );
- nIntTime /= 100;
- aDateTime.Seconds = (sal_uInt16)( nIntTime % 60 );
- nIntTime /= 60;
- aDateTime.Minutes = (sal_uInt16)( nIntTime % 60 );
- nIntTime /= 60;
- OSL_ENSURE( nIntTime < 24, "error in time calculation" );
- aDateTime.Hours = (sal_uInt16) nIntTime;
-
- ::Date aDate( rNullDate );
- aDate += nIntDays;
- aDateTime.Day = aDate.GetDay();
- aDateTime.Month = aDate.GetMonth();
- aDateTime.Year = aDate.GetYear();
-
- rValue = aDateTime;
- }
- else
- rValue.setNull();
- break;
- } // switch (nType)
- }
-
-// rValue.setTypeKind(nType);
-}
-
-// -------------------------------------------------------------------------
-
-::rtl::OUString lcl_GetColumnStr( sal_Int32 nColumn )
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::lcl_GetColumnStr" );
- if ( nColumn < 26 )
- return ::rtl::OUString::valueOf( (sal_Unicode) ( 'A' + nColumn ) );
- else
- {
- ::rtl::OUStringBuffer aBuffer(2);
- aBuffer.setLength( 2 );
- aBuffer.setCharAt( 0, (sal_Unicode) ( 'A' + ( nColumn / 26 ) - 1 ) );
- aBuffer.setCharAt( 1, (sal_Unicode) ( 'A' + ( nColumn % 26 ) ) );
- return aBuffer.makeStringAndClear();
- }
-}
-
-void OCalcTable::fillColumns()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::fillColumns" );
- if ( !m_xSheet.is() )
- throw SQLException();
-
- String aStrFieldName;
- aStrFieldName.AssignAscii("Column");
- ::rtl::OUString aTypeName;
- ::comphelper::UStringMixEqual aCase(m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
- const sal_Bool bStoresMixedCaseQuotedIdentifiers = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers();
-
- for (sal_Int32 i = 0; i < m_nDataCols; i++)
- {
- ::rtl::OUString aColumnName;
- sal_Int32 eType = DataType::OTHER;
- sal_Bool bCurrency = sal_False;
-
- lcl_GetColumnInfo( m_xSheet, m_xFormats, m_nStartCol + i, m_nStartRow, m_bHasHeaders,
- aColumnName, eType, bCurrency );
-
- if ( !aColumnName.getLength() )
- aColumnName = lcl_GetColumnStr( i );
-
- sal_Int32 nPrecision = 0; //! ...
- sal_Int32 nDecimals = 0; //! ...
-
- switch ( eType )
- {
- case DataType::VARCHAR:
- {
- static const ::rtl::OUString s_sType(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
- aTypeName = s_sType;
- }
- break;
- case DataType::DECIMAL:
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DECIMAL"));
- break;
- case DataType::BIT:
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BOOL"));
- break;
- case DataType::DATE:
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATE"));
- break;
- case DataType::TIME:
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIME"));
- break;
- case DataType::TIMESTAMP:
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP"));
- break;
- default:
- OSL_FAIL("missing type name");
- aTypeName = ::rtl::OUString();
- }
-
- // check if the column name already exists
- ::rtl::OUString aAlias = aColumnName;
- OSQLColumns::Vector::const_iterator aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
- sal_Int32 nExprCnt = 0;
- while(aFind != m_aColumns->get().end())
- {
- (aAlias = aColumnName) += ::rtl::OUString::valueOf((sal_Int32)++nExprCnt);
- aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
- }
-
- sdbcx::OColumn* pColumn = new sdbcx::OColumn( aAlias, aTypeName, ::rtl::OUString(),::rtl::OUString(),
- ColumnValue::NULLABLE, nPrecision, nDecimals,
- eType, sal_False, sal_False, bCurrency,
- bStoresMixedCaseQuotedIdentifiers);
- Reference< XPropertySet> xCol = pColumn;
- m_aColumns->get().push_back(xCol);
- m_aTypes.push_back(eType);
- m_aPrecisions.push_back(nPrecision);
- m_aScales.push_back(nDecimals);
- }
-}
-
-// -------------------------------------------------------------------------
-OCalcTable::OCalcTable(sdbcx::OCollection* _pTables,OCalcConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description ,
- const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName
- ) : OCalcTable_BASE(_pTables,_pConnection,_Name,
- _Type,
- _Description,
- _SchemaName,
- _CatalogName)
- ,m_pConnection(_pConnection)
- ,m_nStartCol(0)
- ,m_nStartRow(0)
- ,m_nDataCols(0)
- ,m_nDataRows(0)
- ,m_bHasHeaders(sal_False)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::OCalcTable" );
-}
-// -----------------------------------------------------------------------------
-void OCalcTable::construct()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::construct" );
- // get sheet object
- Reference< XSpreadsheetDocument> xDoc = m_pConnection->acquireDoc();
- if (xDoc.is())
- {
- Reference<XSpreadsheets> xSheets = xDoc->getSheets();
- if ( xSheets.is() && xSheets->hasByName( m_Name ) )
- {
- m_xSheet.set(xSheets->getByName( m_Name ),UNO_QUERY);
- if ( m_xSheet.is() )
- {
- lcl_GetDataArea( m_xSheet, m_nDataCols, m_nDataRows );
- m_bHasHeaders = sal_True;
- // whole sheet is always assumed to include a header row
- }
- }
- else // no sheet -> try database range
- {
- Reference<XPropertySet> xDocProp( xDoc, UNO_QUERY );
- if ( xDocProp.is() )
- {
- Reference<XDatabaseRanges> xRanges(xDocProp->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DatabaseRanges")) ),UNO_QUERY);
-
- if ( xRanges.is() && xRanges->hasByName( m_Name ) )
- {
- Reference<XDatabaseRange> xDBRange(xRanges->getByName( m_Name ),UNO_QUERY);
- Reference<XCellRangeReferrer> xRefer( xDBRange, UNO_QUERY );
- if ( xRefer.is() )
- {
- // Header flag is always stored with database range
- // Get flag from FilterDescriptor
-
- sal_Bool bRangeHeader = sal_True;
- Reference<XPropertySet> xFiltProp( xDBRange->getFilterDescriptor(), UNO_QUERY );
- if ( xFiltProp.is() )
- xFiltProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ContainsHeader"))) >>= bRangeHeader;
-
- Reference<XSheetCellRange> xSheetRange( xRefer->getReferredCells(), UNO_QUERY );
- Reference<XCellRangeAddressable> xAddr( xSheetRange, UNO_QUERY );
- if ( xSheetRange.is() && xAddr.is() )
- {
- m_xSheet = xSheetRange->getSpreadsheet();
- CellRangeAddress aRangeAddr = xAddr->getRangeAddress();
- m_nStartCol = aRangeAddr.StartColumn;
- m_nStartRow = aRangeAddr.StartRow;
- m_nDataCols = aRangeAddr.EndColumn - m_nStartCol + 1;
- // m_nDataRows is excluding header row
- m_nDataRows = aRangeAddr.EndRow - m_nStartRow;
- if ( !bRangeHeader )
- {
- // m_nDataRows counts the whole range
- m_nDataRows += 1;
- }
-
- m_bHasHeaders = bRangeHeader;
- }
- }
- }
- }
- }
-
- Reference<XNumberFormatsSupplier> xSupp( xDoc, UNO_QUERY );
- if (xSupp.is())
- m_xFormats = xSupp->getNumberFormats();
-
- Reference<XPropertySet> xProp( xDoc, UNO_QUERY );
- if (xProp.is())
- {
- ::com::sun::star::util::Date aDateStruct;
- if ( xProp->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NullDate")) ) >>= aDateStruct )
- m_aNullDate = ::Date( aDateStruct.Day, aDateStruct.Month, aDateStruct.Year );
- }
- }
-
- //! default if no null date available?
-
- fillColumns();
-
- refreshColumns();
-}
-// -------------------------------------------------------------------------
-void OCalcTable::refreshColumns()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::refreshColumns" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- TStringVector aVector;
-
- OSQLColumns::Vector::const_iterator aEnd = m_aColumns->get().end();
- for(OSQLColumns::Vector::const_iterator aIter = m_aColumns->get().begin();aIter != aEnd;++aIter)
- aVector.push_back(Reference< XNamed>(*aIter,UNO_QUERY)->getName());
-
- if(m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new OCalcColumns(this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void OCalcTable::refreshIndexes()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::refreshIndexes" );
- // Calc table has no index
-}
-
-// -------------------------------------------------------------------------
-void SAL_CALL OCalcTable::disposing(void)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::disposing" );
- OFileTable::disposing();
- ::osl::MutexGuard aGuard(m_aMutex);
- m_aColumns = NULL;
- if ( m_pConnection )
- m_pConnection->releaseDoc();
- m_pConnection = NULL;
-
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OCalcTable::getTypes( ) throw(RuntimeException)
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::getTypes" );
- Sequence< Type > aTypes = OTable_TYPEDEF::getTypes();
- ::std::vector<Type> aOwnTypes;
- aOwnTypes.reserve(aTypes.getLength());
-
- const Type* pBegin = aTypes.getConstArray();
- const Type* pEnd = pBegin + aTypes.getLength();
- for(;pBegin != pEnd;++pBegin)
- {
- if(!( *pBegin == ::getCppuType((const Reference<XKeysSupplier>*)0) ||
- *pBegin == ::getCppuType((const Reference<XIndexesSupplier>*)0) ||
- *pBegin == ::getCppuType((const Reference<XRename>*)0) ||
- *pBegin == ::getCppuType((const Reference<XAlterTable>*)0) ||
- *pBegin == ::getCppuType((const Reference<XDataDescriptorFactory>*)0)))
- aOwnTypes.push_back(*pBegin);
- }
- aOwnTypes.push_back(::getCppuType( (const Reference< ::com::sun::star::lang::XUnoTunnel > *)0 ));
-
- const Type* pAttrs = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pAttrs, aOwnTypes.size());
-}
-
-// -------------------------------------------------------------------------
-Any SAL_CALL OCalcTable::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- if( rType == ::getCppuType((const Reference<XKeysSupplier>*)0) ||
- rType == ::getCppuType((const Reference<XIndexesSupplier>*)0) ||
- rType == ::getCppuType((const Reference<XRename>*)0) ||
- rType == ::getCppuType((const Reference<XAlterTable>*)0) ||
- rType == ::getCppuType((const Reference<XDataDescriptorFactory>*)0))
- return Any();
-
- const Any aRet = ::cppu::queryInterface(rType,static_cast< ::com::sun::star::lang::XUnoTunnel*> (this));
- return aRet.hasValue() ? aRet : OTable_TYPEDEF::queryInterface(rType);
-}
-
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > OCalcTable::getUnoTunnelImplementationId()
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::getUnoTunnelImplementationId" );
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OCalcTable::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::getSomething" );
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OCalcTable_BASE::getSomething(rId);
-}
-//------------------------------------------------------------------
-sal_Int32 OCalcTable::getCurrentLastPos() const
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::getCurrentLastPos" );
- return m_nDataRows;
-}
-//------------------------------------------------------------------
-sal_Bool OCalcTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::seekRow" );
- // ----------------------------------------------------------
- // Positionierung vorbereiten:
-
- sal_uInt32 nNumberOfRecords = m_nDataRows;
- sal_uInt32 nTempPos = m_nFilePos;
- m_nFilePos = nCurPos;
-
- switch(eCursorPosition)
- {
- case IResultSetHelper::NEXT:
- m_nFilePos++;
- break;
- case IResultSetHelper::PRIOR:
- if (m_nFilePos > 0)
- m_nFilePos--;
- break;
- case IResultSetHelper::FIRST:
- m_nFilePos = 1;
- break;
- case IResultSetHelper::LAST:
- m_nFilePos = nNumberOfRecords;
- break;
- case IResultSetHelper::RELATIVE:
- m_nFilePos = (((sal_Int32)m_nFilePos) + nOffset < 0) ? 0L
- : (sal_uInt32)(((sal_Int32)m_nFilePos) + nOffset);
- break;
- case IResultSetHelper::ABSOLUTE:
- case IResultSetHelper::BOOKMARK:
- m_nFilePos = (sal_uInt32)nOffset;
- break;
- }
-
- if (m_nFilePos > (sal_Int32)nNumberOfRecords)
- m_nFilePos = (sal_Int32)nNumberOfRecords + 1;
-
- if (m_nFilePos == 0 || m_nFilePos == (sal_Int32)nNumberOfRecords + 1)
- goto Error;
- else
- {
- //! read buffer / setup row object etc?
- }
- goto End;
-
-Error:
- switch(eCursorPosition)
- {
- case IResultSetHelper::PRIOR:
- case IResultSetHelper::FIRST:
- m_nFilePos = 0;
- break;
- case IResultSetHelper::LAST:
- case IResultSetHelper::NEXT:
- case IResultSetHelper::ABSOLUTE:
- case IResultSetHelper::RELATIVE:
- if (nOffset > 0)
- m_nFilePos = nNumberOfRecords + 1;
- else if (nOffset < 0)
- m_nFilePos = 0;
- break;
- case IResultSetHelper::BOOKMARK:
- m_nFilePos = nTempPos; // vorherige Position
- }
- // aStatus.Set(SDB_STAT_NO_DATA_FOUND);
- return sal_False;
-
-End:
- nCurPos = m_nFilePos;
- return sal_True;
-}
-//------------------------------------------------------------------
-sal_Bool OCalcTable::fetchRow( OValueRefRow& _rRow, const OSQLColumns & _rCols,
- sal_Bool _bUseTableDefs, sal_Bool bRetrieveData )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::fetchRow" );
- // read the bookmark
-
- sal_Bool bIsCurRecordDeleted = sal_False;
- _rRow->setDeleted(bIsCurRecordDeleted);
- *(_rRow->get())[0] = m_nFilePos;
-
- if (!bRetrieveData)
- return sal_True;
-
- // fields
-
- OSQLColumns::Vector::const_iterator aIter = _rCols.get().begin();
- OSQLColumns::Vector::const_iterator aEnd = _rCols.get().end();
- const OValueRefVector::Vector::size_type nCount = _rRow->get().size();
- for (OValueRefVector::Vector::size_type i = 1; aIter != aEnd && i < nCount;
- ++aIter, i++)
- {
- if ( (_rRow->get())[i]->isBound() )
- {
- sal_Int32 nType = 0;
- if ( _bUseTableDefs )
- nType = m_aTypes[i-1];
- else
- (*aIter)->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
-
-
- lcl_SetValue( (_rRow->get())[i]->get(), m_xSheet, m_nStartCol, m_nStartRow, m_bHasHeaders,
- m_aNullDate, m_nFilePos, i, nType );
- }
- }
- return sal_True;
-}
-// -------------------------------------------------------------------------
-void OCalcTable::FileClose()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTable::FileClose" );
- ::osl::MutexGuard aGuard(m_aMutex);
-
- OCalcTable_BASE::FileClose();
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/calc/CTables.cxx b/connectivity/source/drivers/calc/CTables.cxx
deleted file mode 100644
index 2cee66ace7..0000000000
--- a/connectivity/source/drivers/calc/CTables.cxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "calc/CTables.hxx"
-#include "calc/CTable.hxx"
-#include "file/FCatalog.hxx"
-#include "file/FConnection.hxx"
-#include "calc/CCatalog.hxx"
-#include <comphelper/types.hxx>
-#include <rtl/logfile.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::calc;
-using namespace connectivity::file;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-namespace starutil = ::com::sun::star::util;
-
-sdbcx::ObjectType OCalcTables::createObject(const ::rtl::OUString& _rName)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "calc", "Ocke.Janssen@sun.com", "OCalcTables::createObject" );
- OCalcTable* pTable = new OCalcTable(this,(OCalcConnection*)static_cast<OFileCatalog&>(m_rParent).getConnection(),
- _rName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE")));
- sdbcx::ObjectType xRet = pTable;
- pTable->construct();
- return xRet;
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/calc/CalcDriver.xml b/connectivity/source/drivers/calc/CalcDriver.xml
deleted file mode 100755
index 31a73e8bdd..0000000000
--- a/connectivity/source/drivers/calc/CalcDriver.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description>
- <module-name>file</module-name>
- <component-description>
- <author>Niklas Nebel</author>
- <name>com.sun.star.sdbc.driver.calc.ODriver</name>
- <description>This library implements the database driver for spreadsheet (Calc) file formats.
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service>com.sun.star.sdbc.Driver</supported-service>
- <supported-service>com.sun.star.sdbcx.Driver</supported-service>
- <service-dependency> ... </service-dependency>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>osl</runtime-module-dependency>
- <runtime-module-dependency>svtools-light1</runtime-module-dependency>
- <runtime-module-dependency>svtools</runtime-module-dependency>
- <runtime-module-dependency>ucbhelper</runtime-module-dependency>
- <runtime-module-dependency>dbtools</runtime-module-dependency>
- <runtime-module-dependency>unotools</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
diff --git a/connectivity/source/drivers/calc/Cservices.cxx b/connectivity/source/drivers/calc/Cservices.cxx
deleted file mode 100644
index 41ab7f6bae..0000000000
--- a/connectivity/source/drivers/calc/Cservices.cxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "calc/CDriver.hxx"
-#include <cppuhelper/factory.hxx>
-
-using namespace connectivity::calc;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pT
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- ODriver::getImplementationName_Static(),
- ODriver::getSupportedServiceNames_Static(),
- ODriver_CreateInstance, ::cppu::createSingleFactory)
- ;
-
- if(aReq.xRet.is())
- aReq.xRet->acquire();
-
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/calc/calc.component b/connectivity/source/drivers/calc/calc.component
deleted file mode 100755
index be949f70de..0000000000
--- a/connectivity/source/drivers/calc/calc.component
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.sdbc.calc.ODriver">
- <service name="com.sun.star.sdbc.Driver"/>
- <service name="com.sun.star.sdbcx.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/calc/calc.xcu b/connectivity/source/drivers/calc/calc.xcu
deleted file mode 100644
index ec71ed3caf..0000000000
--- a/connectivity/source/drivers/calc/calc.xcu
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:calc:*" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.calc.ODriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Spreadsheet</value>
- </prop>
- <node oor:name="Features">
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsBrowsing" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FileSystemBased" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="MediaType" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>application/vnd.oasis.opendocument.spreadsheet</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/calc/exports.dxp b/connectivity/source/drivers/calc/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/drivers/calc/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/drivers/calc/makefile.mk b/connectivity/source/drivers/calc/makefile.mk
deleted file mode 100755
index d36438a277..0000000000
--- a/connectivity/source/drivers/calc/makefile.mk
+++ /dev/null
@@ -1,99 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=calc
-
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-# --- Settings ----------------------------------
-
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/CResultSet.obj \
- $(SLO)$/CStatement.obj \
- $(SLO)$/CPreparedStatement.obj \
- $(SLO)$/CDatabaseMetaData.obj \
- $(SLO)$/CCatalog.obj \
- $(SLO)$/CColumns.obj \
- $(SLO)$/CTable.obj \
- $(SLO)$/CTables.obj \
- $(SLO)$/CConnection.obj \
- $(SLO)$/Cservices.obj \
- $(SLO)$/CDriver.obj
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-
-# --- Library -----------------------------------
-
-SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SVLLIB) \
- $(TOOLSLIB) \
- $(UNOTOOLSLIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(DBTOOLSLIB) \
- $(DBFILELIB) \
- $(COMPHELPERLIB)
-
-
-SHL1DEPN=
-SHL1IMPLIB= i$(TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-# --- Targets ----------------------------------
-
-.INCLUDE : $(PRJ)$/target.pmk
-
-
-
-ALLTAR : $(MISC)/calc.component
-
-$(MISC)/calc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- calc.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt calc.component
diff --git a/connectivity/source/drivers/dbase/DCatalog.cxx b/connectivity/source/drivers/dbase/DCatalog.cxx
deleted file mode 100644
index 3e5f2b8bde..0000000000
--- a/connectivity/source/drivers/dbase/DCatalog.cxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include "dbase/DCatalog.hxx"
-#include "dbase/DConnection.hxx"
-#include "dbase/DTables.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-// -------------------------------------------------------------------------
-using namespace connectivity::dbase;
-// -------------------------------------------------------------------------
-ODbaseCatalog::ODbaseCatalog(ODbaseConnection* _pCon) : file::OFileCatalog(_pCon)
-{
-}
-// -------------------------------------------------------------------------
-void ODbaseCatalog::refreshTables()
-{
- TStringVector aVector;
- Sequence< ::rtl::OUString > aTypes;
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),aTypes);
-
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- aVector.push_back(xRow->getString(3));
- }
- if(m_pTables)
- m_pTables->reFill(aVector);
- else
- m_pTables = new ODbaseTables(m_xMetaData,*this,m_aMutex,aVector);
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DCode.cxx b/connectivity/source/drivers/dbase/DCode.cxx
deleted file mode 100644
index 9a21d955ae..0000000000
--- a/connectivity/source/drivers/dbase/DCode.cxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DCode.hxx"
-#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include "dbase/DIndex.hxx"
-#include "dbase/DIndexIter.hxx"
-
-
-using namespace connectivity::dbase;
-using namespace connectivity::file;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-
-TYPEINIT1(OFILEOperandAttr, OOperandAttr);
-// -----------------------------------------------------------------------------
-OOperandAttr* OFILEAnalyzer::createOperandAttr(sal_Int32 _nPos,
- const Reference< XPropertySet>& _xCol,
- const Reference< XNameAccess>& _xIndexes)
-{
- return new OFILEOperandAttr((sal_uInt16)_nPos,_xCol,_xIndexes);
-}
-
-//------------------------------------------------------------------
-OFILEOperandAttr::OFILEOperandAttr(sal_uInt16 _nPos,
- const Reference< XPropertySet>& _xColumn,
- const Reference< XNameAccess>& _xIndexes)
- : OOperandAttr(_nPos,_xColumn)
-{
- if(_xIndexes.is())
- {
- ::rtl::OUString sName;
- Reference<XPropertySetInfo> xColInfo = _xColumn->getPropertySetInfo();
- Reference<XPropertySet> xIndex;
-
- Sequence< ::rtl::OUString> aSeq = _xIndexes->getElementNames();
- const ::rtl::OUString* pBegin = aSeq.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + aSeq.getLength();
- for(;pBegin != pEnd;++pBegin)
- {
- _xIndexes->getByName(*pBegin) >>= xIndex;
- if(xIndex.is())
- {
- Reference<XColumnsSupplier> xColsSup(xIndex,UNO_QUERY);
- Reference<XNameAccess> xNameAccess = xColsSup->getColumns();
- _xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sName;
- if(xNameAccess->hasByName(sName))
- {
- m_xIndex = xIndex;
- break;
- }
- else if(xColInfo->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME)))
- {
- _xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME)) >>= sName;
- if(xNameAccess->hasByName(sName))
- {
- m_xIndex = xIndex;
- break;
- }
- }
- }
- }
- }
-
-}
-// -------------------------------------------------------------------------
-sal_Bool OFILEOperandAttr::isIndexed() const
-{
- return m_xIndex.is();
-}
-//------------------------------------------------------------------
-OEvaluateSet* OFILEOperandAttr::preProcess(OBoolOperator* pOp, OOperand* pRight)
-{
- OEvaluateSet* pEvaluateSet = NULL;
- if (isIndexed())
- {
- Reference<XUnoTunnel> xTunnel(m_xIndex,UNO_QUERY);
- if(xTunnel.is())
- {
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
- if(pIndex)
- {
- OIndexIterator* pIter = pIndex->createIterator(pOp,pRight);
-
- if (pIter)
- {
- pEvaluateSet = new OEvaluateSet();
- sal_uIntPtr nRec = pIter->First();
- while (nRec != NODE_NOTFOUND)
- {
- (*pEvaluateSet)[nRec] = nRec;
- nRec = pIter->Next();
- }
- }
- delete pIter;
- }
- }
- }
- return pEvaluateSet;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DColumns.cxx b/connectivity/source/drivers/dbase/DColumns.cxx
deleted file mode 100644
index 6f2fb95d5b..0000000000
--- a/connectivity/source/drivers/dbase/DColumns.cxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DColumns.hxx"
-#include "dbase/DTable.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
-#include <comphelper/property.hxx>
-
-using namespace connectivity::dbase;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-typedef file::OColumns ODbaseColumns_BASE;
-sdbcx::ObjectType ODbaseColumns::createObject(const ::rtl::OUString& _rName)
-{
-
- ODbaseTable* pTable = (ODbaseTable*)m_pTable;
-
- ::rtl::Reference<OSQLColumns> aCols = pTable->getTableColumns();
- OSQLColumns::Vector::const_iterator aIter = find(aCols->get().begin(),aCols->get().end(),_rName,::comphelper::UStringMixEqual(isCaseSensitive()));
-
- sdbcx::ObjectType xRet;
- if(aIter != aCols->get().end())
- xRet = sdbcx::ObjectType(*aIter,UNO_QUERY);
- return xRet;
-}
-
-// -------------------------------------------------------------------------
-void ODbaseColumns::impl_refresh() throw(RuntimeException)
-{
- m_pTable->refreshColumns();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > ODbaseColumns::createDescriptor()
-{
- return new sdbcx::OColumn(isCaseSensitive());
-}
-// -----------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType ODbaseColumns::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- if ( m_pTable->isNew() )
- return cloneDescriptor( descriptor );
-
- m_pTable->addColumn( descriptor );
- return createObject( _rForName );
-}
-// -----------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-// XDrop
-void ODbaseColumns::dropObject(sal_Int32 _nPos,const ::rtl::OUString /*_sElementName*/)
-{
- if(!m_pTable->isNew())
- m_pTable->dropColumn(_nPos);
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DConnection.cxx b/connectivity/source/drivers/dbase/DConnection.cxx
deleted file mode 100644
index e2dc2e30b8..0000000000
--- a/connectivity/source/drivers/dbase/DConnection.cxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "dbase/DConnection.hxx"
-#include "dbase/DDatabaseMetaData.hxx"
-#include "dbase/DCatalog.hxx"
-#include "dbase/DDriver.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <tools/urlobj.hxx>
-#include "dbase/DPreparedStatement.hxx"
-#include "dbase/DStatement.hxx"
-#include <tools/debug.hxx>
-#include <connectivity/dbexception.hxx>
-
-using namespace connectivity::dbase;
-using namespace connectivity::file;
-
-typedef connectivity::file::OConnection OConnection_BASE;
-
-//------------------------------------------------------------------------------
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-
-DBG_NAME(ODbaseConnection)
-// --------------------------------------------------------------------------------
-ODbaseConnection::ODbaseConnection(ODriver* _pDriver) : OConnection(_pDriver)
-{
- DBG_CTOR(ODbaseConnection,NULL);
- m_aFilenameExtension = String::CreateFromAscii("dbf");
-}
-//-----------------------------------------------------------------------------
-ODbaseConnection::~ODbaseConnection()
-{
- DBG_DTOR(ODbaseConnection,NULL);
-}
-
-// XServiceInfo
-// --------------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(ODbaseConnection, "com.sun.star.sdbc.drivers.dbase.Connection", "com.sun.star.sdbc.Connection")
-
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL ODbaseConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if(!xMetaData.is())
- {
- xMetaData = new ODbaseDatabaseMetaData(this);
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-//------------------------------------------------------------------------------
-::com::sun::star::uno::Reference< XTablesSupplier > ODbaseConnection::createCatalog()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- Reference< XTablesSupplier > xTab = m_xCatalog;
- if(!xTab.is())
- {
- ODbaseCatalog *pCat = new ODbaseCatalog(this);
- xTab = pCat;
- m_xCatalog = xTab;
- }
- return xTab;
-}
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL ODbaseConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- Reference< XStatement > xReturn = new ODbaseStatement(this);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL ODbaseConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- ODbasePreparedStatement* pStmt = new ODbasePreparedStatement(this);
- Reference< XPreparedStatement > xHoldAlive = pStmt;
- pStmt->construct(sql);
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return pStmt;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL ODbaseConnection::prepareCall( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::prepareCall", *this );
- return NULL;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
deleted file mode 100644
index 004875c606..0000000000
--- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
+++ /dev/null
@@ -1,415 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include "dbase/DDatabaseMetaData.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
-#include <tools/urlobj.hxx>
-#include "FDatabaseMetaDataResultSet.hxx"
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include "dbase/DIndex.hxx"
-#include "connectivity/FValue.hxx"
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include <ucbhelper/content.hxx>
-#include <rtl/logfile.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity::dbase;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::lang;
-
-ODbaseDatabaseMetaData::ODbaseDatabaseMetaData(::connectivity::file::OConnection* _pCon) :ODatabaseMetaData(_pCon)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::ODbaseDatabaseMetaData" );
-}
-// -------------------------------------------------------------------------
-ODbaseDatabaseMetaData::~ODbaseDatabaseMetaData()
-{
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > ODbaseDatabaseMetaData::impl_getTypeInfo_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::impl_getTypeInfo_throw" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
- Reference< XResultSet > xRef = pResult;
-
- static ODatabaseMetaDataResultSet::ORows aRows;
- if(aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow;
- aRow.reserve(18);
-
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"))));
- aRow.push_back(new ORowSetValueDecorator(DataType::VARCHAR));
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)254));
- aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
- aRow.push_back(new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("length"))));
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnValue::NULLABLE));
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnSearch::FULL));
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("C"))));
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)10));
-
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LONGVARCHAR")));
- aRow[2] = new ORowSetValueDecorator(DataType::LONGVARCHAR);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)2147483647);
- aRow[6] = new ORowSetValueDecorator();
- aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("M")));
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATE")));
- aRow[2] = new ORowSetValueDecorator(DataType::DATE);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)10);
- aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("D")));
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BOOLEAN")));
- aRow[2] = new ORowSetValueDecorator(DataType::BIT);
- aRow[3] = ODatabaseMetaDataResultSet::get1Value();
- aRow[4] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[5] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[6] = new ORowSetValueDecorator(::rtl::OUString());
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L")));
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DOUBLE")));
- aRow[2] = new ORowSetValueDecorator(DataType::DOUBLE);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)8);
- aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("B")));
- aRows.push_back(aRow);
-
- aRow[11] = new ORowSetValueDecorator(sal_True);
- aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Y")));
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP")));
- aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
- aRow[11] = new ORowSetValueDecorator(sal_False);
- aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("T")));
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INTEGER")));
- aRow[2] = new ORowSetValueDecorator(DataType::INTEGER);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)10);
- aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("I")));
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DECIMAL")));
- aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
- aRow[6] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("length,scale")));
- aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("F")));
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NUMERIC")));
- aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)16);
- aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("N")));
- aRow[15] = new ORowSetValueDecorator((sal_Int32)16);
- aRows.push_back(aRow);
- }
-
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getColumns(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& tableNamePattern,
- const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::getColumns" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- Reference< XTablesSupplier > xTables = m_pConnection->createCatalog();
- if(!xTables.is())
- throw SQLException();
-
- Reference< XNameAccess> xNames = xTables->getTables();
- if(!xNames.is())
- throw SQLException();
-
- ODatabaseMetaDataResultSet::ORows aRows;
- ODatabaseMetaDataResultSet::ORow aRow(19);
-
- aRow[10] = new ORowSetValueDecorator((sal_Int32)10);
- Sequence< ::rtl::OUString> aTabNames(xNames->getElementNames());
- const ::rtl::OUString* pTabBegin = aTabNames.getConstArray();
- const ::rtl::OUString* pTabEnd = pTabBegin + aTabNames.getLength();
- for(;pTabBegin != pTabEnd;++pTabBegin)
- {
- if(match(tableNamePattern,*pTabBegin,'\0'))
- {
- Reference< XColumnsSupplier> xTable;
- ::cppu::extractInterface(xTable,xNames->getByName(*pTabBegin));
- OSL_ENSURE(xTable.is(),"Table not found! Normallya exception had to be thrown here!");
- aRow[3] = new ORowSetValueDecorator(*pTabBegin);
-
- Reference< XNameAccess> xColumns = xTable->getColumns();
- if(!xColumns.is())
- throw SQLException();
-
- Sequence< ::rtl::OUString> aColNames(xColumns->getElementNames());
-
- const ::rtl::OUString* pBegin = aColNames.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + aColNames.getLength();
- Reference< XPropertySet> xColumn;
- for(sal_Int32 i=1;pBegin != pEnd;++pBegin,++i)
- {
- if(match(columnNamePattern,*pBegin,'\0'))
- {
- aRow[4] = new ORowSetValueDecorator(*pBegin);
-
- ::cppu::extractInterface(xColumn,xColumns->getByName(*pBegin));
- OSL_ENSURE(xColumn.is(),"Columns contains a column who isn't a fastpropertyset!");
- aRow[5] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))));
- aRow[6] = new ORowSetValueDecorator(getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME))));
- aRow[7] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))));
- aRow[9] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))));
- aRow[11] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))));
- aRow[13] = new ORowSetValueDecorator(getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE))));
- switch((sal_Int32)aRow[5]->getValue())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- aRow[16] = new ORowSetValueDecorator((sal_Int32)254);
- break;
- case DataType::LONGVARCHAR:
- aRow[16] = new ORowSetValueDecorator((sal_Int32)65535);
- break;
- default:
- aRow[16] = new ORowSetValueDecorator((sal_Int32)0);
- }
- aRow[17] = new ORowSetValueDecorator(i);
- switch(sal_Int32(aRow[11]->getValue()))
- {
- case ColumnValue::NO_NULLS:
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NO")));
- break;
- case ColumnValue::NULLABLE:
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("YES")));
- break;
- default:
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString());
- }
- aRows.push_back(aRow);
- }
- }
- }
- }
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns);
- Reference< XResultSet > xRef = pResult;
- pResult->setRows(aRows);
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getIndexInfo(
- const Any& /*catalog*/, const ::rtl::OUString& /*schema*/, const ::rtl::OUString& table,
- sal_Bool unique, sal_Bool /*approximate*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::getIndexInfo" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- Reference< XTablesSupplier > xTables = m_pConnection->createCatalog();
- if(!xTables.is())
- throw SQLException();
-
- Reference< XNameAccess> xNames = xTables->getTables();
- if(!xNames.is())
- throw SQLException();
-
- ODatabaseMetaDataResultSet::ORows aRows;
- ODatabaseMetaDataResultSet::ORow aRow(14);
-
- aRow[5] = new ORowSetValueDecorator(::rtl::OUString());
- aRow[10] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("A")));
-
- Reference< XIndexesSupplier> xTable;
- ::cppu::extractInterface(xTable,xNames->getByName(table));
- aRow[3] = new ORowSetValueDecorator(table);
- aRow[7] = new ORowSetValueDecorator((sal_Int32)3);
-
- Reference< XNameAccess> xIndexes = xTable->getIndexes();
- if(!xIndexes.is())
- throw SQLException();
-
- Sequence< ::rtl::OUString> aIdxNames(xIndexes->getElementNames());
-
- const ::rtl::OUString* pBegin = aIdxNames.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + aIdxNames.getLength();
- Reference< XPropertySet> xIndex;
- for(;pBegin != pEnd;++pBegin)
- {
- ::cppu::extractInterface(xIndex,xIndexes->getByName(*pBegin));
- OSL_ENSURE(xIndex.is(),"Indexes contains a column who isn't a fastpropertyset!");
-
- if(unique && !getBOOL(xIndex->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE))))
- continue;
- aRow[4] = new ORowSetValueDecorator(getBOOL(xIndex->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE))));
- aRow[6] = new ORowSetValueDecorator(*pBegin);
-
- Reference< XUnoTunnel> xTunnel(xIndex,UNO_QUERY);
- if(xTunnel.is())
- {
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
- if(pIndex)
- {
- aRow[11] = new ORowSetValueDecorator((sal_Int32)pIndex->getHeader().db_maxkeys);
- aRow[12] = new ORowSetValueDecorator((sal_Int32)pIndex->getHeader().db_pagecount);
- }
- }
-
- Reference<XColumnsSupplier> xColumnsSup(xIndex,UNO_QUERY);
- Reference< XNameAccess> xColumns = xColumnsSup->getColumns();
- Sequence< ::rtl::OUString> aColNames(xColumns->getElementNames());
-
- const ::rtl::OUString* pColBegin = aColNames.getConstArray();
- const ::rtl::OUString* pColEnd = pColBegin + aColNames.getLength();
- Reference< XPropertySet> xColumn;
- for(sal_Int32 j=1;pColBegin != pColEnd;++pColBegin,++j)
- {
- aRow[8] = new ORowSetValueDecorator(j);
- aRow[9] = new ORowSetValueDecorator(*pColBegin);
- aRows.push_back(aRow);
- }
- }
-
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eIndexInfo);
- Reference< XResultSet > xRef = pResult;
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODbaseDatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::getURL" );
- ::osl::MutexGuard aGuard( m_aMutex );
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:dbase:")) + m_pConnection->getURL();
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODbaseDatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::getMaxBinaryLiteralLength" );
- return STRING_MAXLEN;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODbaseDatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::getMaxCharLiteralLength" );
- return 254;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODbaseDatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::getMaxColumnNameLength" );
- return 10;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODbaseDatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::getMaxColumnsInIndex" );
- return 1;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODbaseDatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::getMaxColumnsInTable" );
- return 128;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL ODbaseDatabaseMetaData::supportsAlterTableWithAddColumn( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::supportsAlterTableWithAddColumn" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODbaseDatabaseMetaData::supportsAlterTableWithDropColumn( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::supportsAlterTableWithDropColumn" );
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL ODbaseDatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::isReadOnly" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- sal_Bool bReadOnly = sal_False;
- static ::rtl::OUString sReadOnly( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ));
- ::ucbhelper::Content aFile(m_pConnection->getContent(),Reference< XCommandEnvironment >());
- aFile.getPropertyValue(sReadOnly) >>= bReadOnly;
-
- return bReadOnly;
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODbaseDatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw" );
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODbaseDatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseDatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw" );
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DDriver.cxx b/connectivity/source/drivers/dbase/DDriver.cxx
deleted file mode 100644
index 27b802c53f..0000000000
--- a/connectivity/source/drivers/dbase/DDriver.cxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DDriver.hxx"
-#include "dbase/DConnection.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/dbexception.hxx"
-#include "resource/dbase_res.hrc"
-
-using namespace connectivity::dbase;
-using namespace connectivity::file;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-
-
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString ODriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdbc.dbase.ODriver"));
-}
-
-//------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-
-//------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL connectivity::dbase::ODriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
-{
- return *(new ODriver(_rxFactory));
-}
-// --------------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL ODriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- if ( ! acceptsURL(url) )
- return NULL;
-
- ODbaseConnection* pCon = new ODbaseConnection(this);
- pCon->construct(url,info);
- Reference< XConnection > xCon = pCon;
- m_xConnections.push_back(WeakReferenceHelper(*pCon));
-
- return xCon;
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL ODriver::acceptsURL( const ::rtl::OUString& url ) throw(SQLException, RuntimeException)
-{
- return !url.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:dbase:")),11);
-}
-// -----------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL ODriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException)
-{
- if ( acceptsURL(url) )
- {
- ::std::vector< DriverPropertyInfo > aDriverInfo;
-
- Sequence< ::rtl::OUString > aBoolean(2);
- aBoolean[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"));
- aBoolean[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1"));
-
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet of the database."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowDeleted"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Display inactive records."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"))
- ,aBoolean)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EnableSQL92Check"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Use SQL92 naming constraints."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"))
- ,aBoolean)
- );
- return Sequence< DriverPropertyInfo >(&(aDriverInfo[0]),aDriverInfo.size());
- }
-
- SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- return Sequence< DriverPropertyInfo >();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
deleted file mode 100644
index 9dbae67acb..0000000000
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ /dev/null
@@ -1,645 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DIndex.hxx"
-#include "dbase/DIndexColumns.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/sdbcx/VColumn.hxx"
-#include <comphelper/sequence.hxx>
-#include "dbase/DTable.hxx"
-#include "dbase/DIndexIter.hxx"
-#include <tools/config.hxx>
-#include "connectivity/CommonTools.hxx"
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <comphelper/extract.hxx>
-#include <unotools/localfilehelper.hxx>
-#include <unotools/ucbhelper.hxx>
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-#include "dbase/DResultSet.hxx"
-#include "diagnose_ex.h"
-#include <comphelper/types.hxx>
-#include "resource/dbase_res.hrc"
-#include <unotools/sharedunocomponent.hxx>
-
-using namespace ::comphelper;
-// -------------------------------------------------------------------------
-using namespace connectivity;
-using namespace utl;
-using namespace ::cppu;
-using namespace connectivity::file;
-using namespace connectivity::sdbcx;
-using namespace connectivity::dbase;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::lang;
-
-IMPLEMENT_SERVICE_INFO(ODbaseIndex,"com.sun.star.sdbcx.driver.dbase.Index","com.sun.star.sdbcx.Index");
-// -------------------------------------------------------------------------
-ODbaseIndex::ODbaseIndex(ODbaseTable* _pTable) : OIndex(sal_True/*_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers()*/)
- ,m_pFileStream(NULL)
- ,m_nCurNode(NODE_NOTFOUND)
- ,m_pTable(_pTable)
-{
- m_aHeader.db_pagecount = m_aHeader.db_rootpage = m_aHeader.db_keytype = m_aHeader.db_maxkeys = m_aHeader.db_keylen = 0;
- m_aHeader.db_name[0] = '\0';
- construct();
-}
-// -------------------------------------------------------------------------
-ODbaseIndex::ODbaseIndex( ODbaseTable* _pTable,
- const NDXHeader& _rHeader,
- const ::rtl::OUString& _rName)
- :OIndex(_rName,::rtl::OUString(),_rHeader.db_unique,sal_False,sal_False,sal_True)
- ,m_pFileStream(NULL)
- ,m_aHeader(_rHeader)
- ,m_nCurNode(NODE_NOTFOUND)
- ,m_pTable(_pTable)
-{
- construct();
-}
-// -----------------------------------------------------------------------------
-ODbaseIndex::~ODbaseIndex()
-{
- closeImpl();
-}
-// -------------------------------------------------------------------------
-void ODbaseIndex::refreshColumns()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- TStringVector aVector;
- if(!isNew())
- {
- OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
- OSL_ENSURE(m_aHeader.db_name[0] != '\0',"Invalid name for the column!");
- aVector.push_back(::rtl::OUString::createFromAscii(m_aHeader.db_name));
- }
-
- if(m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new ODbaseIndexColumns(this,m_aMutex,aVector);
-}
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > ODbaseIndex::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 ODbaseIndex::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : ODbaseIndex_BASE::getSomething(rId);
-}
-//------------------------------------------------------------------
-ONDXPagePtr ODbaseIndex::getRoot()
-{
- openIndexFile();
- if (!m_aRoot.Is())
- {
- m_nRootPage = m_aHeader.db_rootpage;
- m_nPageCount = m_aHeader.db_pagecount;
- m_aRoot = CreatePage(m_nRootPage,NULL,sal_True);
- }
- return m_aRoot;
-}
-//------------------------------------------------------------------
-sal_Bool ODbaseIndex::openIndexFile()
-{
- if(!m_pFileStream)
- {
- ::rtl::OUString sFile = getCompletePath();
- if(UCBContentHelper::Exists(sFile))
- {
- m_pFileStream = OFileTable::createStream_simpleError(sFile, STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
- if (!m_pFileStream)
- m_pFileStream = OFileTable::createStream_simpleError(sFile,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE);
- if(m_pFileStream)
- {
- m_pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
- m_pFileStream->SetBufferSize(PAGE_SIZE);
- (*m_pFileStream) >> *this;
- }
- }
- if(!m_pFileStream)
- {
- const ::rtl::OUString sError( m_pTable->getConnection()->getResources().getResourceStringWithSubstitution(
- STR_COULD_NOT_LOAD_FILE,
- "$filename$", sFile
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
- }
- }
-
- return m_pFileStream != NULL;
-}
-//------------------------------------------------------------------
-OIndexIterator* ODbaseIndex::createIterator(OBoolOperator* pOp,
- const OOperand* pOperand)
-{
- openIndexFile();
- return new OIndexIterator(this, pOp, pOperand);
-}
-//------------------------------------------------------------------
-sal_Bool ODbaseIndex::ConvertToKey(ONDXKey* rKey, sal_uInt32 nRec, const ORowSetValue& rValue)
-{
- OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
- // Search a specific value in Index
- // If the Index is unique, the key doesn't matter
- try
- {
- if (m_aHeader.db_keytype == 0)
- {
- *rKey = ONDXKey(rValue.getString(), nRec );
- }
- else
- {
- if (rValue.isNull())
- *rKey = ONDXKey(rValue.getDouble(), DataType::DOUBLE, nRec );
- else
- *rKey = ONDXKey(rValue.getDouble(), nRec );
- }
- }
- catch (Exception&)
- {
- OSL_ASSERT(0);
- return sal_False;
- }
- return sal_True;
-}
-
-//------------------------------------------------------------------
-sal_Bool ODbaseIndex::Find(sal_uInt32 nRec, const ORowSetValue& rValue)
-{
- openIndexFile();
- OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
- // Search a specific value in Index
- // If the Index is unique, the key doesn't matter
- ONDXKey aKey;
- return ConvertToKey(&aKey, nRec, rValue) && getRoot()->Find(aKey);
-}
-
-//------------------------------------------------------------------
-sal_Bool ODbaseIndex::Insert(sal_uInt32 nRec, const ORowSetValue& rValue)
-{
- openIndexFile();
- OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
- ONDXKey aKey;
-
- // Does the value already exist
- // Use Find() always to determine the actual leaf
- if (!ConvertToKey(&aKey, nRec, rValue) || (getRoot()->Find(aKey) && isUnique()))
- return sal_False;
-
- ONDXNode aNewNode(aKey);
-
- // insert in the current leaf
- if (!m_aCurLeaf.Is())
- return sal_False;
-
- sal_Bool bResult = m_aCurLeaf->Insert(aNewNode);
- Release(bResult);
-
- return bResult;
-}
-
-//------------------------------------------------------------------
-sal_Bool ODbaseIndex::Update(sal_uInt32 nRec, const ORowSetValue& rOldValue,
- const ORowSetValue& rNewValue)
-{
- openIndexFile();
- OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
- ONDXKey aKey;
- if (!ConvertToKey(&aKey, nRec, rNewValue) || (isUnique() && getRoot()->Find(aKey)))
- return sal_False;
- else
- return Delete(nRec, rOldValue) && Insert(nRec,rNewValue);
-}
-
-//------------------------------------------------------------------
-sal_Bool ODbaseIndex::Delete(sal_uInt32 nRec, const ORowSetValue& rValue)
-{
- openIndexFile();
- OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
- // Does the value already exist
- // Always use Find() to determine the actual leaf
- ONDXKey aKey;
- if (!ConvertToKey(&aKey, nRec, rValue) || !getRoot()->Find(aKey))
- return sal_False;
-
- ONDXNode aNewNode(aKey);
-
- // insert in the current leaf
- if (!m_aCurLeaf.Is())
- return sal_False;
-#if OSL_DEBUG_LEVEL > 1
- m_aRoot->PrintPage();
-#endif
-
- return m_aCurLeaf->Delete(m_nCurNode);
-}
-//------------------------------------------------------------------
-void ODbaseIndex::Collect(ONDXPage* pPage)
-{
- if (pPage)
- m_aCollector.push_back(pPage);
-}
-//------------------------------------------------------------------
-void ODbaseIndex::Release(sal_Bool bSave)
-{
- // Release the Index-recources
- m_bUseCollector = sal_False;
-
- if (m_aCurLeaf.Is())
- {
- m_aCurLeaf->Release(bSave);
- m_aCurLeaf.Clear();
- }
-
- // Release the root
- if (m_aRoot.Is())
- {
- m_aRoot->Release(bSave);
- m_aRoot.Clear();
- }
- // Release all references, before the FileStream will be closed
- for (sal_uIntPtr i = 0; i < m_aCollector.size(); i++)
- m_aCollector[i]->QueryDelete();
-
- m_aCollector.clear();
-
- // Header modified?
- if (bSave && (m_aHeader.db_rootpage != m_nRootPage ||
- m_aHeader.db_pagecount != m_nPageCount))
- {
- m_aHeader.db_rootpage = m_nRootPage;
- m_aHeader.db_pagecount = m_nPageCount;
- (*m_pFileStream) << *this;
- }
- m_nRootPage = m_nPageCount = 0;
- m_nCurNode = NODE_NOTFOUND;
-
- closeImpl();
-}
-// -----------------------------------------------------------------------------
-void ODbaseIndex::closeImpl()
-{
- if(m_pFileStream)
- {
- delete m_pFileStream;
- m_pFileStream = NULL;
- }
-}
-//------------------------------------------------------------------
-ONDXPage* ODbaseIndex::CreatePage(sal_uInt32 nPagePos, ONDXPage* pParent, sal_Bool bLoad)
-{
- OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
-
- ONDXPage* pPage;
- if ( !m_aCollector.empty() )
- {
- pPage = *(m_aCollector.rbegin());
- m_aCollector.pop_back();
- pPage->SetPagePos(nPagePos);
- pPage->SetParent(pParent);
- }
- else
- pPage = new ONDXPage(*this, nPagePos, pParent);
-
- if (bLoad)
- (*m_pFileStream) >> *pPage;
-
- return pPage;
-}
-
-//------------------------------------------------------------------
-SvStream& connectivity::dbase::operator >> (SvStream &rStream, ODbaseIndex& rIndex)
-{
- rStream.Seek(0);
- rStream.Read(&rIndex.m_aHeader,PAGE_SIZE);
-
- rIndex.m_nRootPage = rIndex.m_aHeader.db_rootpage;
- rIndex.m_nPageCount = rIndex.m_aHeader.db_pagecount;
- return rStream;
-}
-//------------------------------------------------------------------
-SvStream& connectivity::dbase::operator << (SvStream &rStream, ODbaseIndex& rIndex)
-{
- rStream.Seek(0);
- OSL_VERIFY_EQUALS( rStream.Write(&rIndex.m_aHeader,PAGE_SIZE), PAGE_SIZE, "Write not successful: Wrong header size for dbase index!");
- return rStream;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString ODbaseIndex::getCompletePath()
-{
- ::rtl::OUString sDir = m_pTable->getConnection()->getURL();
- sDir += OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELIMITER);
- sDir += m_Name;
- sDir += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".ndx"));
- return sDir;
-}
-//------------------------------------------------------------------
-void ODbaseIndex::createINFEntry()
-{
- // synchronize inf-file
- String sEntry = m_Name;
- sEntry += String::CreateFromAscii(".ndx");
-
- ::rtl::OUString sCfgFile(m_pTable->getConnection()->getURL());
- sCfgFile += OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELIMITER);
- sCfgFile += m_pTable->getName();
- sCfgFile += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".inf"));
-
- String sPhysicalPath;
- LocalFileHelper::ConvertURLToPhysicalName(sCfgFile,sPhysicalPath);
-
- Config aInfFile(sPhysicalPath);
- aInfFile.SetGroup(dBASE_III_GROUP);
-
- sal_uInt16 nSuffix = aInfFile.GetKeyCount();
- rtl::OString aNewEntry,aKeyName;
- sal_Bool bCase = isCaseSensitive();
- while (aNewEntry.isEmpty())
- {
- aNewEntry = rtl::OString(RTL_CONSTASCII_STRINGPARAM("NDX"));
- aNewEntry += rtl::OString::valueOf(static_cast<sal_Int32>(++nSuffix));
- for (sal_uInt16 i = 0; i < aInfFile.GetKeyCount(); i++)
- {
- aKeyName = aInfFile.GetKeyName(i);
- if (bCase ? aKeyName.equals(aNewEntry) : aKeyName.equalsIgnoreAsciiCase(aNewEntry))
- {
- aNewEntry = rtl::OString();
- break;
- }
- }
- }
- aInfFile.WriteKey(aNewEntry,ByteString(sEntry,m_pTable->getConnection()->getTextEncoding()));
-}
-// -------------------------------------------------------------------------
-sal_Bool ODbaseIndex::DropImpl()
-{
- closeImpl();
-
- ::rtl::OUString sPath = getCompletePath();
- if(UCBContentHelper::Exists(sPath))
- {
- if(!UCBContentHelper::Kill(sPath))
- m_pTable->getConnection()->throwGenericSQLException(STR_COULD_NOT_DELETE_INDEX,*m_pTable);
- }
-
- // synchronize inf-file
- ::rtl::OUString sCfgFile(m_pTable->getConnection()->getURL());
- sCfgFile += OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELIMITER);
- sCfgFile += m_pTable->getName();
- sCfgFile += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".inf"));
-
- String sPhysicalPath;
- String sNDX(sCfgFile);
- OSL_VERIFY_RES( LocalFileHelper::ConvertURLToPhysicalName(sNDX,sPhysicalPath),"Can not convert Config Filename into Physical Name!");
-
- Config aInfFile(sPhysicalPath);
- aInfFile.SetGroup(dBASE_III_GROUP);
- sal_uInt16 nKeyCnt = aInfFile.GetKeyCount();
- ByteString aKeyName;
- String sEntry = m_Name;
- sEntry += String::CreateFromAscii(".ndx");
-
- // delete entries from the inf file
- for (sal_uInt16 nKey = 0; nKey < nKeyCnt; nKey++)
- {
- // References the Key to an Index-file?
- aKeyName = aInfFile.GetKeyName( nKey );
- if (aKeyName.Copy(0,3) == "NDX")
- {
- if(sEntry == String(aInfFile.ReadKey(aKeyName),m_pTable->getConnection()->getTextEncoding()))
- {
- aInfFile.DeleteKey(aKeyName);
- break;
- }
- }
- }
- return sal_True;
-}
-// -------------------------------------------------------------------------
-void ODbaseIndex::impl_killFileAndthrowError_throw(sal_uInt16 _nErrorId,const ::rtl::OUString& _sFile)
-{
- closeImpl();
- if(UCBContentHelper::Exists(_sFile))
- UCBContentHelper::Kill(_sFile);
- m_pTable->getConnection()->throwGenericSQLException(_nErrorId,*this);
-}
-//------------------------------------------------------------------
-sal_Bool ODbaseIndex::CreateImpl()
-{
- // Create the Index
- const ::rtl::OUString sFile = getCompletePath();
- if(UCBContentHelper::Exists(sFile))
- {
- const ::rtl::OUString sError( m_pTable->getConnection()->getResources().getResourceStringWithSubstitution(
- STR_COULD_NOT_CREATE_INDEX_NAME,
- "$filename$", sFile
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
- }
- // Index comprises only one column
- if (m_pColumns->getCount() > 1)
- m_pTable->getConnection()->throwGenericSQLException(STR_ONL_ONE_COLUMN_PER_INDEX,*this);
-
- Reference<XFastPropertySet> xCol(m_pColumns->getByIndex(0),UNO_QUERY);
-
- // Is the column already indexed?
- if ( !xCol.is() )
- ::dbtools::throwFunctionSequenceException(*this);
-
- // create the index file
- m_pFileStream = OFileTable::createStream_simpleError(sFile,STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC);
- if (!m_pFileStream)
- {
- const ::rtl::OUString sError( m_pTable->getConnection()->getResources().getResourceStringWithSubstitution(
- STR_COULD_NOT_LOAD_FILE,
- "$filename$", sFile
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
- }
-
- m_pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
- m_pFileStream->SetBufferSize(PAGE_SIZE);
-
- // firstly the result must be sorted
- utl::SharedUNOComponent<XStatement> xStmt;
- utl::SharedUNOComponent<XResultSet> xSet;
- String aName;
- try
- {
- xStmt.set( m_pTable->getConnection()->createStatement(), UNO_SET_THROW);
-
- aName = getString(xCol->getFastPropertyValue(PROPERTY_ID_NAME));
-
- const String aQuote(m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString());
- String aStatement;
- aStatement.AssignAscii("SELECT ");
- aStatement += aQuote;
- aStatement += aName;
- aStatement += aQuote;
- aStatement.AppendAscii(" FROM ");
- aStatement += aQuote;
- aStatement += m_pTable->getName().getStr();
- aStatement += aQuote;
- aStatement.AppendAscii(" ORDER BY ");
- aStatement += aQuote;
- aStatement += aName;
- aStatement += aQuote;
-
- xSet.set( xStmt->executeQuery(aStatement),UNO_SET_THROW );
- }
- catch(const Exception& )
- {
- impl_killFileAndthrowError_throw(STR_COULD_NOT_CREATE_INDEX,sFile);
- }
- if (!xSet.is())
- {
- impl_killFileAndthrowError_throw(STR_COULD_NOT_CREATE_INDEX,sFile);
- }
-
- // Set the header info
- memset(&m_aHeader,0,sizeof(m_aHeader));
- sal_Int32 nType = 0;
- ::rtl::Reference<OSQLColumns> aCols = m_pTable->getTableColumns();
- const Reference< XPropertySet > xTableCol(*find(aCols->get().begin(),aCols->get().end(),aName,::comphelper::UStringMixEqual(isCaseSensitive())));
-
- xTableCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
-
- m_aHeader.db_keytype = (nType == DataType::VARCHAR || nType == DataType::CHAR) ? 0 : 1;
- m_aHeader.db_keylen = (m_aHeader.db_keytype) ? 8 : (sal_uInt16)getINT32(xTableCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)));
- m_aHeader.db_keylen = (( m_aHeader.db_keylen - 1) / 4 + 1) * 4;
- m_aHeader.db_maxkeys = (PAGE_SIZE - 4) / (8 + m_aHeader.db_keylen);
- if ( m_aHeader.db_maxkeys < 3 )
- {
- impl_killFileAndthrowError_throw(STR_COULD_NOT_CREATE_INDEX_KEYSIZE,sFile);
- }
-
- m_pFileStream->SetStreamSize(PAGE_SIZE);
-
- ByteString aCol(aName,m_pTable->getConnection()->getTextEncoding());
- strncpy(m_aHeader.db_name,aCol.GetBuffer(),std::min((sal_uInt16)sizeof(m_aHeader.db_name), aCol.Len()));
- m_aHeader.db_unique = m_IsUnique ? 1: 0;
- m_aHeader.db_keyrec = m_aHeader.db_keylen + 8;
-
- // modifications of the header are detected by differences between
- // the HeaderInfo and nRootPage or nPageCount respectively
- m_nRootPage = 1;
- m_nPageCount = 2;
-
- m_aCurLeaf = m_aRoot = CreatePage(m_nRootPage);
- m_aRoot->SetModified(sal_True);
-
- m_bUseCollector = sal_True;
-
- sal_Int32 nRowsLeft = 0;
- Reference<XRow> xRow(xSet,UNO_QUERY);
-
- if(xSet->last())
- {
- Reference< XUnoTunnel> xTunnel(xSet,UNO_QUERY);
- ODbaseResultSet* pDbaseRes = NULL;
- if(xTunnel.is())
- pDbaseRes = reinterpret_cast< ODbaseResultSet* >( xTunnel->getSomething(ODbaseResultSet::getUnoTunnelImplementationId()) );
- OSL_ENSURE(pDbaseRes,"No dbase resultset found? What's going on here!");
- Reference<XRowLocate> xRowLocate(xSet,UNO_QUERY);
- nRowsLeft = xSet->getRow();
-
- xSet->beforeFirst();
- ORowSetValue atmpValue=ORowSetValue();
- ONDXKey aKey(atmpValue, nType, 0);
- ONDXKey aInsertKey(atmpValue, nType, 0);
- // Create the index structure
- while (xSet->next())
- {
- ORowSetValue aValue(m_aHeader.db_keytype ? ORowSetValue(xRow->getDouble(1)) : ORowSetValue(xRow->getString(1)));
- // checking for duplicate entries
- if (m_IsUnique && m_nCurNode != NODE_NOTFOUND)
- {
- aKey.setValue(aValue);
- if (aKey == (*m_aCurLeaf)[m_nCurNode].GetKey())
- {
- impl_killFileAndthrowError_throw(STR_COULD_NOT_CREATE_INDEX_NOT_UNIQUE,sFile);
- }
- }
- aInsertKey.setValue(aValue);
- aInsertKey.setRecord(pDbaseRes->getCurrentFilePos());
-
- ONDXNode aNewNode(aInsertKey);
- if (!m_aCurLeaf->Insert(aNewNode, --nRowsLeft))
- break;
- }
- }
-
- if(nRowsLeft)
- {
- impl_killFileAndthrowError_throw(STR_COULD_NOT_CREATE_INDEX,sFile);
- }
- Release();
- createINFEntry();
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-void SAL_CALL ODbaseIndex::acquire() throw()
-{
- ODbaseIndex_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODbaseIndex::release() throw()
-{
- ODbaseIndex_BASE::release();
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DIndexColumns.cxx b/connectivity/source/drivers/dbase/DIndexColumns.cxx
deleted file mode 100644
index b2f22c7e96..0000000000
--- a/connectivity/source/drivers/dbase/DIndexColumns.cxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DIndexColumns.hxx"
-#include "dbase/DTable.hxx"
-#include "connectivity/sdbcx/VIndexColumn.hxx"
-#include <comphelper/types.hxx>
-#include <comphelper/property.hxx>
-#include <connectivity/dbexception.hxx>
-
-using namespace ::comphelper;
-
-using namespace connectivity::dbase;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-
-sdbcx::ObjectType ODbaseIndexColumns::createObject(const ::rtl::OUString& _rName)
-{
- const ODbaseTable* pTable = m_pIndex->getTable();
-
- ::rtl::Reference<OSQLColumns> aCols = pTable->getTableColumns();
- OSQLColumns::Vector::const_iterator aIter = find(aCols->get().begin(),aCols->get().end(),_rName,::comphelper::UStringMixEqual(isCaseSensitive()));
-
- Reference< XPropertySet > xCol;
- if(aIter != aCols->get().end())
- xCol = *aIter;
-
- if(!xCol.is())
- return sdbcx::ObjectType();
-
- sdbcx::ObjectType xRet = new sdbcx::OIndexColumn(sal_True,_rName
- ,getString(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)))
- ,::rtl::OUString()
- ,getINT32(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)))
- ,getINT32(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)))
- ,getINT32(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)))
- ,getINT32(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)))
- ,sal_False
- ,sal_False
- ,sal_False
- ,pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers());
-
- return xRet;
-}
-
-// -------------------------------------------------------------------------
-void ODbaseIndexColumns::impl_refresh() throw(RuntimeException)
-{
- m_pIndex->refreshColumns();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > ODbaseIndexColumns::createDescriptor()
-{
- return new sdbcx::OIndexColumn(m_pIndex->getTable()->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers());
-}
-// -------------------------------------------------------------------------
-sdbcx::ObjectType ODbaseIndexColumns::appendObject( const ::rtl::OUString& /*_rForName*/, const Reference< XPropertySet >& descriptor )
-{
- return cloneDescriptor( descriptor );
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DIndexIter.cxx b/connectivity/source/drivers/dbase/DIndexIter.cxx
deleted file mode 100644
index ed3020ba12..0000000000
--- a/connectivity/source/drivers/dbase/DIndexIter.cxx
+++ /dev/null
@@ -1,306 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DIndexIter.hxx"
-#include <com/sun/star/sdb/SQLFilterOperator.hpp>
-
-using namespace ::com::sun::star::sdb;
-using namespace connectivity;
-using namespace connectivity::dbase;
-using namespace connectivity::file;
-using namespace ::com::sun::star::sdb;
-//==================================================================
-// OIndexIterator
-//==================================================================
-//------------------------------------------------------------------
-OIndexIterator::~OIndexIterator()
-{
- m_pIndex->release();
-}
-
-//------------------------------------------------------------------
-sal_uIntPtr OIndexIterator::First()
-{
- return Find(sal_True);
-}
-
-//------------------------------------------------------------------
-sal_uIntPtr OIndexIterator::Next()
-{
- return Find(sal_False);
-}
-//------------------------------------------------------------------
-sal_uIntPtr OIndexIterator::Find(sal_Bool bFirst)
-{
- sal_uIntPtr nRes = STRING_NOTFOUND;
-
- if (bFirst)
- {
- m_aRoot = m_pIndex->getRoot();
- m_aCurLeaf = NULL;
- }
-
- if (!m_pOperator)
- {
- // Preparation, position on the smallest element
- if (bFirst)
- {
- ONDXPage* pPage = m_aRoot;
- while (pPage && !pPage->IsLeaf())
- pPage = pPage->GetChild(m_pIndex);
-
- m_aCurLeaf = pPage;
- m_nCurNode = NODE_NOTFOUND;
- }
- ONDXKey* pKey = GetNextKey();
- nRes = pKey ? pKey->GetRecord() : STRING_NOTFOUND;
- }
- else if (m_pOperator->IsA(TYPE(OOp_ISNOTNULL)))
- nRes = GetNotNull(bFirst);
- else if (m_pOperator->IsA(TYPE(OOp_ISNULL)))
- nRes = GetNull(bFirst);
- else if (m_pOperator->IsA(TYPE(OOp_LIKE)))
- nRes = GetLike(bFirst);
- else if (m_pOperator->IsA(TYPE(OOp_COMPARE)))
- nRes = GetCompare(bFirst);
-
- return nRes;
-}
-
-//------------------------------------------------------------------
-ONDXKey* OIndexIterator::GetFirstKey(ONDXPage* pPage, const OOperand& rKey)
-{
- // searches a given key
- // Speciality: At the end of the algorithm
- // the actual page and the position of the node which fulfil the
- // '<='-condition are saved. this is considered for inserts.
- // ONDXIndex* m_pIndex = GetNDXIndex();
- OOp_COMPARE aTempOp(SQLFilterOperator::GREATER);
- sal_uInt16 i = 0;
-
- if (pPage->IsLeaf())
- {
- // in the leaf the actual operation is run, otherwise temp. (>)
- while (i < pPage->Count() && !m_pOperator->operate(&((*pPage)[i]).GetKey(),&rKey))
- i++;
- }
- else
- while (i < pPage->Count() && !aTempOp.operate(&((*pPage)[i]).GetKey(),&rKey))
- i++;
-
-
- ONDXKey* pFoundKey = NULL;
- if (!pPage->IsLeaf())
- {
- // descend further
- ONDXPagePtr aPage = (i==0) ? pPage->GetChild(m_pIndex)
- : ((*pPage)[i-1]).GetChild(m_pIndex, pPage);
- pFoundKey = aPage.Is() ? GetFirstKey(aPage, rKey) : NULL;
- }
- else if (i == pPage->Count())
- {
- pFoundKey = NULL;
- }
- else
- {
- pFoundKey = &(*pPage)[i].GetKey();
- if (!m_pOperator->operate(pFoundKey,&rKey))
- pFoundKey = NULL;
-
- m_aCurLeaf = pPage;
- m_nCurNode = pFoundKey ? i : i - 1;
- }
- return pFoundKey;
-}
-
-//------------------------------------------------------------------
-sal_uIntPtr OIndexIterator::GetCompare(sal_Bool bFirst)
-{
- ONDXKey* pKey = NULL;
- sal_Int32 ePredicateType = PTR_CAST(file::OOp_COMPARE,m_pOperator)->getPredicateType();
-
- if (bFirst)
- {
- // Preparation, position on the smallest element
- ONDXPage* pPage = m_aRoot;
- switch (ePredicateType)
- {
- case SQLFilterOperator::NOT_EQUAL:
- case SQLFilterOperator::LESS:
- case SQLFilterOperator::LESS_EQUAL:
- while (pPage && !pPage->IsLeaf())
- pPage = pPage->GetChild(m_pIndex);
-
- m_aCurLeaf = pPage;
- m_nCurNode = NODE_NOTFOUND;
- }
-
-
- switch (ePredicateType)
- {
- case SQLFilterOperator::NOT_EQUAL:
- while ( ( ( pKey = GetNextKey() ) != NULL ) && !m_pOperator->operate(pKey,m_pOperand)) ;
- break;
- case SQLFilterOperator::LESS:
- while ( ( ( pKey = GetNextKey() ) != NULL ) && pKey->getValue().isNull()) ;
- break;
- case SQLFilterOperator::LESS_EQUAL:
- while ( ( pKey = GetNextKey() ) != NULL ) ;
- break;
- case SQLFilterOperator::GREATER_EQUAL:
- case SQLFilterOperator::EQUAL:
- pKey = GetFirstKey(m_aRoot,*m_pOperand);
- break;
- case SQLFilterOperator::GREATER:
- pKey = GetFirstKey(m_aRoot,*m_pOperand);
- if ( !pKey )
- while ( ( ( pKey = GetNextKey() ) != NULL ) && !m_pOperator->operate(pKey,m_pOperand)) ;
- }
- }
- else
- {
- switch (ePredicateType)
- {
- case SQLFilterOperator::NOT_EQUAL:
- while ( ( ( pKey = GetNextKey() ) != NULL ) && !m_pOperator->operate(pKey,m_pOperand))
- ;
- break;
- case SQLFilterOperator::LESS:
- case SQLFilterOperator::LESS_EQUAL:
- case SQLFilterOperator::EQUAL:
- if ( ( ( pKey = GetNextKey() ) == NULL ) || !m_pOperator->operate(pKey,m_pOperand))
- {
- pKey = NULL;
- m_aCurLeaf = NULL;
- }
- break;
- case SQLFilterOperator::GREATER_EQUAL:
- case SQLFilterOperator::GREATER:
- pKey = GetNextKey();
- }
- }
-
- return pKey ? pKey->GetRecord() : STRING_NOTFOUND;
-}
-
-//------------------------------------------------------------------
-sal_uIntPtr OIndexIterator::GetLike(sal_Bool bFirst)
-{
- if (bFirst)
- {
- ONDXPage* pPage = m_aRoot;
-
- while (pPage && !pPage->IsLeaf())
- pPage = pPage->GetChild(m_pIndex);
-
- m_aCurLeaf = pPage;
- m_nCurNode = NODE_NOTFOUND;
- }
-
- ONDXKey* pKey;
- while ( ( ( pKey = GetNextKey() ) != NULL ) && !m_pOperator->operate(pKey,m_pOperand))
- ;
- return pKey ? pKey->GetRecord() : STRING_NOTFOUND;
-}
-
-//------------------------------------------------------------------
-sal_uIntPtr OIndexIterator::GetNull(sal_Bool bFirst)
-{
- if (bFirst)
- {
- ONDXPage* pPage = m_aRoot;
- while (pPage && !pPage->IsLeaf())
- pPage = pPage->GetChild(m_pIndex);
-
- m_aCurLeaf = pPage;
- m_nCurNode = NODE_NOTFOUND;
- }
-
- ONDXKey* pKey;
- if ( ( ( pKey = GetNextKey() ) == NULL ) || !pKey->getValue().isNull())
- {
- pKey = NULL;
- m_aCurLeaf = NULL;
- }
- return pKey ? pKey->GetRecord() : STRING_NOTFOUND;
-}
-
-//------------------------------------------------------------------
-sal_uIntPtr OIndexIterator::GetNotNull(sal_Bool bFirst)
-{
- ONDXKey* pKey;
- if (bFirst)
- {
- // erst alle NULL werte abklappern
- for (sal_uIntPtr nRec = GetNull(bFirst);
- nRec != STRING_NOTFOUND;
- nRec = GetNull(sal_False))
- ;
- pKey = m_aCurLeaf.Is() ? &(*m_aCurLeaf)[m_nCurNode].GetKey() : NULL;
- }
- else
- pKey = GetNextKey();
-
- return pKey ? pKey->GetRecord() : STRING_NOTFOUND;
-}
-
-//------------------------------------------------------------------
-ONDXKey* OIndexIterator::GetNextKey()
-{
- if (m_aCurLeaf.Is() && ((++m_nCurNode) >= m_aCurLeaf->Count()))
- {
- ONDXPage* pPage = m_aCurLeaf;
- // search next page
- while (pPage)
- {
- ONDXPage* pParentPage = pPage->GetParent();
- if (pParentPage)
- {
- sal_uInt16 nPos = pParentPage->Search(pPage);
- if (nPos != pParentPage->Count() - 1)
- { // page found
- pPage = (*pParentPage)[nPos+1].GetChild(m_pIndex,pParentPage);
- break;
- }
- }
- pPage = pParentPage;
- }
-
- // now go on with leaf
- while (pPage && !pPage->IsLeaf())
- pPage = pPage->GetChild(m_pIndex);
-
- m_aCurLeaf = pPage;
- m_nCurNode = 0;
- }
- return m_aCurLeaf.Is() ? &(*m_aCurLeaf)[m_nCurNode].GetKey() : NULL;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DIndexes.cxx b/connectivity/source/drivers/dbase/DIndexes.cxx
deleted file mode 100644
index b5be60ff22..0000000000
--- a/connectivity/source/drivers/dbase/DIndexes.cxx
+++ /dev/null
@@ -1,136 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DIndexes.hxx"
-#include "dbase/DIndex.hxx"
-#include <connectivity/dbexception.hxx>
-#include <unotools/ucbhelper.hxx>
-#include <comphelper/types.hxx>
-#include "resource/dbase_res.hrc"
-
-using namespace ::comphelper;
-
-using namespace utl;
-using namespace ::connectivity;
-using namespace ::dbtools;
-using namespace ::connectivity::dbase;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-namespace starutil = ::com::sun::star::util;
-
-sdbcx::ObjectType ODbaseIndexes::createObject(const ::rtl::OUString& _rName)
-{
- ::rtl::OUString sFile = m_pTable->getConnection()->getURL();
- sFile += OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELIMITER);
- sFile += _rName;
- sFile += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".ndx"));
- if ( !UCBContentHelper::Exists(sFile) )
- {
- const ::rtl::OUString sError( m_pTable->getConnection()->getResources().getResourceStringWithSubstitution(
- STR_COULD_NOT_LOAD_FILE,
- "$filename$", sFile
- ) );
- ::dbtools::throwGenericSQLException( sError, *m_pTable );
- }
-
- sdbcx::ObjectType xRet;
- SvStream* pFileStream = ::connectivity::file::OFileTable::createStream_simpleError(sFile,STREAM_READ | STREAM_NOCREATE| STREAM_SHARE_DENYWRITE);
- if(pFileStream)
- {
- pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
- pFileStream->SetBufferSize(PAGE_SIZE);
- ODbaseIndex::NDXHeader aHeader;
-
- pFileStream->Seek(0);
- pFileStream->Read(&aHeader,PAGE_SIZE);
- delete pFileStream;
-
- ODbaseIndex* pIndex = new ODbaseIndex(m_pTable,aHeader,_rName);
- xRet = pIndex;
- pIndex->openIndexFile();
- }
- else
- {
- const ::rtl::OUString sError( m_pTable->getConnection()->getResources().getResourceStringWithSubstitution(
- STR_COULD_NOT_LOAD_FILE,
- "$filename$", sFile
- ) );
- ::dbtools::throwGenericSQLException( sError, *m_pTable );
- }
- return xRet;
-}
-// -------------------------------------------------------------------------
-void ODbaseIndexes::impl_refresh( ) throw(RuntimeException)
-{
- if(m_pTable)
- m_pTable->refreshIndexes();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > ODbaseIndexes::createDescriptor()
-{
- return new ODbaseIndex(m_pTable);
-}
-typedef connectivity::sdbcx::OCollection ODbaseTables_BASE_BASE;
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType ODbaseIndexes::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- Reference<XUnoTunnel> xTunnel(descriptor,UNO_QUERY);
- if(xTunnel.is())
- {
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
- if(!pIndex || !pIndex->CreateImpl())
- throw SQLException();
- }
-
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void ODbaseIndexes::dropObject(sal_Int32 _nPos,const ::rtl::OUString /*_sElementName*/)
-{
- Reference< XUnoTunnel> xTunnel(getObject(_nPos),UNO_QUERY);
- if ( xTunnel.is() )
- {
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
- if ( pIndex )
- pIndex->DropImpl();
- }
-
-}
-// -------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DNoException.cxx b/connectivity/source/drivers/dbase/DNoException.cxx
deleted file mode 100644
index f1d027211c..0000000000
--- a/connectivity/source/drivers/dbase/DNoException.cxx
+++ /dev/null
@@ -1,623 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DTable.hxx"
-#include "dbase/DIndex.hxx"
-#include "dbase/dindexnode.hxx"
-#include <tools/debug.hxx>
-#include "diagnose_ex.h"
-
-#include <sal/types.h>
-#include <algorithm>
-#include <rtl/logfile.hxx>
-
-using namespace connectivity;
-using namespace connectivity::dbase;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::sdbc;
-//------------------------------------------------------------------
-sal_Bool ODbaseTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::seekRow" );
- // ----------------------------------------------------------
- // Prepare positioning:
- OSL_ENSURE(m_pFileStream,"ODbaseTable::seekRow: FileStream is NULL!");
-
- sal_uInt32 nNumberOfRecords = (sal_uInt32)m_aHeader.db_anz;
- sal_uInt32 nTempPos = m_nFilePos;
- m_nFilePos = nCurPos;
-
- switch(eCursorPosition)
- {
- case IResultSetHelper::NEXT:
- ++m_nFilePos;
- break;
- case IResultSetHelper::PRIOR:
- if (m_nFilePos > 0)
- --m_nFilePos;
- break;
- case IResultSetHelper::FIRST:
- m_nFilePos = 1;
- break;
- case IResultSetHelper::LAST:
- m_nFilePos = nNumberOfRecords;
- break;
- case IResultSetHelper::RELATIVE:
- m_nFilePos = (((sal_Int32)m_nFilePos) + nOffset < 0) ? 0L
- : (sal_uInt32)(((sal_Int32)m_nFilePos) + nOffset);
- break;
- case IResultSetHelper::ABSOLUTE:
- case IResultSetHelper::BOOKMARK:
- m_nFilePos = (sal_uInt32)nOffset;
- break;
- }
-
- if (m_nFilePos > (sal_Int32)nNumberOfRecords)
- m_nFilePos = (sal_Int32)nNumberOfRecords + 1;
-
- if (m_nFilePos == 0 || m_nFilePos == (sal_Int32)nNumberOfRecords + 1)
- goto Error;
- else
- {
- sal_uInt16 nEntryLen = m_aHeader.db_slng;
-
- OSL_ENSURE(m_nFilePos >= 1,"SdbDBFCursor::FileFetchRow: ungueltige Record-Position");
- sal_Int32 nPos = m_aHeader.db_kopf + (sal_Int32)(m_nFilePos-1) * nEntryLen;
-
- sal_uIntPtr nLen = m_pFileStream->Seek(nPos);
- if (m_pFileStream->GetError() != ERRCODE_NONE)
- goto Error;
-
- nLen = m_pFileStream->Read((char*)m_pBuffer, nEntryLen);
- if (m_pFileStream->GetError() != ERRCODE_NONE)
- goto Error;
- }
- goto End;
-
-Error:
- switch(eCursorPosition)
- {
- case IResultSetHelper::PRIOR:
- case IResultSetHelper::FIRST:
- m_nFilePos = 0;
- break;
- case IResultSetHelper::LAST:
- case IResultSetHelper::NEXT:
- case IResultSetHelper::ABSOLUTE:
- case IResultSetHelper::RELATIVE:
- if (nOffset > 0)
- m_nFilePos = nNumberOfRecords + 1;
- else if (nOffset < 0)
- m_nFilePos = 0;
- break;
- case IResultSetHelper::BOOKMARK:
- m_nFilePos = nTempPos; // last position
- }
- return sal_False;
-
-End:
- nCurPos = m_nFilePos;
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODbaseTable::ReadMemo(sal_uIntPtr nBlockNo, ORowSetValue& aVariable)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::ReadMemo" );
- bool bIsText = true;
-
- m_pMemoStream->Seek(nBlockNo * m_aMemoHeader.db_size);
- switch (m_aMemoHeader.db_typ)
- {
- case MemodBaseIII: // dBase III-Memofeld, ends with Ctrl-Z
- {
- const char cEOF = (char) 0x1a;
- ByteString aBStr;
- static char aBuf[514];
- aBuf[512] = 0; // to prevent a random value
- bool bReady = false;
-
- do
- {
- m_pMemoStream->Read(&aBuf,512);
-
- sal_uInt16 i = 0;
- while (aBuf[i] != cEOF && ++i < 512)
- ;
- bReady = aBuf[i] == cEOF;
-
- aBuf[i] = 0;
- aBStr += aBuf;
-
- } while (!bReady && !m_pMemoStream->IsEof() && aBStr.Len() < STRING_MAXLEN);
-
- ::rtl::OUString aStr(aBStr.GetBuffer(), aBStr.Len(),getConnection()->getTextEncoding());
- aVariable = aStr;
-
- } break;
- case MemoFoxPro:
- case MemodBaseIV: // dBase IV-Memofeld with the length specification
- {
- char sHeader[4];
- m_pMemoStream->Read(sHeader,4);
- // Foxpro stores text and binary data
- if (m_aMemoHeader.db_typ == MemoFoxPro)
- {
- if (((sal_uInt8)sHeader[0]) != 0 || ((sal_uInt8)sHeader[1]) != 0 || ((sal_uInt8)sHeader[2]) != 0)
- {
- return sal_False;
- }
-
- bIsText = sHeader[3] != 0;
- }
- else if (((sal_uInt8)sHeader[0]) != 0xFF || ((sal_uInt8)sHeader[1]) != 0xFF || ((sal_uInt8)sHeader[2]) != 0x08)
- {
- return sal_False;
- }
-
- sal_uInt32 nLength;
- (*m_pMemoStream) >> nLength;
-
- if (m_aMemoHeader.db_typ == MemodBaseIV)
- nLength -= 8;
-
- ::rtl::OUString aStr;
- while ( nLength > STRING_MAXLEN )
- {
- ByteString aBStr;
- aBStr.Expand(STRING_MAXLEN);
- m_pMemoStream->Read(aBStr.AllocBuffer(STRING_MAXLEN),STRING_MAXLEN);
- aStr += ::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), getConnection()->getTextEncoding());
- nLength -= STRING_MAXLEN;
- }
- if ( nLength > 0 )
- {
- ByteString aBStr;
- aBStr.Expand(static_cast<xub_StrLen>(nLength));
- m_pMemoStream->Read(aBStr.AllocBuffer(static_cast<xub_StrLen>(nLength)),nLength);
-
- aStr += ::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), getConnection()->getTextEncoding());
-
- }
- if ( aStr.getLength() )
- aVariable = aStr;
- }
- }
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-void ODbaseTable::AllocBuffer()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::AllocBuffer" );
- sal_uInt16 nSize = m_aHeader.db_slng;
- OSL_ENSURE(nSize > 0, "Size too small");
-
- if (m_nBufferSize != nSize)
- {
- delete[] m_pBuffer;
- m_pBuffer = NULL;
- }
-
- // If no buffer available: allocate
- if (m_pBuffer == NULL && nSize > 0)
- {
- m_nBufferSize = nSize;
- m_pBuffer = new sal_uInt8[m_nBufferSize+1];
- }
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODbaseTable::WriteBuffer()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::WriteBuffer" );
- OSL_ENSURE(m_nFilePos >= 1,"SdbDBFCursor::FileFetchRow: ungueltige Record-Position");
-
- // Position on the desired record:
- long nPos = m_aHeader.db_kopf + (long)(m_nFilePos-1) * m_aHeader.db_slng;
- m_pFileStream->Seek(nPos);
- return m_pFileStream->Write((char*) m_pBuffer, m_aHeader.db_slng) > 0;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 ODbaseTable::getCurrentLastPos() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::getCurrentLastPos" );
- return m_aHeader.db_anz;
-}
-// -----------------------------------------------------------------------------
-//==================================================================
-// ONDXNode
-//==================================================================
-
-//------------------------------------------------------------------
-void ONDXNode::Read(SvStream &rStream, ODbaseIndex& rIndex)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXNode::Read" );
- rStream >> aKey.nRecord; // key
-
- if (rIndex.getHeader().db_keytype)
- {
- double aDbl;
- rStream >> aDbl;
- aKey = ONDXKey(aDbl,aKey.nRecord);
- }
- else
- {
- ByteString aBuf;
- sal_uInt16 nLen = rIndex.getHeader().db_keylen;
- char* pStr = aBuf.AllocBuffer(nLen+1);
-
- rStream.Read(pStr,nLen);
- pStr[nLen] = 0;
- aBuf.ReleaseBufferAccess();
- aBuf.EraseTrailingChars();
-
- aKey = ONDXKey(::rtl::OUString(aBuf.GetBuffer(),aBuf.Len(),rIndex.m_pTable->getConnection()->getTextEncoding()) ,aKey.nRecord);
- }
- rStream >> aChild;
-}
-
-union
-{
- double aDbl;
- char aData[128];
-} aNodeData;
-//------------------------------------------------------------------
-void ONDXNode::Write(SvStream &rStream, const ONDXPage& rPage) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXNode::Write" );
- const ODbaseIndex& rIndex = rPage.GetIndex();
- if (!rIndex.isUnique() || rPage.IsLeaf())
- rStream << (sal_uInt32)aKey.nRecord; // key
- else
- rStream << (sal_uInt32)0; // key
-
- if (rIndex.getHeader().db_keytype) // double
- {
- if (aKey.getValue().isNull())
- {
- memset(aNodeData.aData,0,rIndex.getHeader().db_keylen);
- rStream.Write((sal_uInt8*)aNodeData.aData,rIndex.getHeader().db_keylen);
- }
- else
- rStream << (double) aKey.getValue();
- }
- else
- {
- memset(aNodeData.aData,0x20,rIndex.getHeader().db_keylen);
- if (!aKey.getValue().isNull())
- {
- ::rtl::OUString sValue = aKey.getValue();
- ByteString aText(sValue.getStr(), rIndex.m_pTable->getConnection()->getTextEncoding());
- strncpy(aNodeData.aData,aText.GetBuffer(),std::min(rIndex.getHeader().db_keylen, aText.Len()));
- }
- rStream.Write((sal_uInt8*)aNodeData.aData,rIndex.getHeader().db_keylen);
- }
- rStream << aChild;
-}
-
-
-//------------------------------------------------------------------
-ONDXPagePtr& ONDXNode::GetChild(ODbaseIndex* pIndex, ONDXPage* pParent)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXNode::GetChild" );
- if (!aChild.Is() && pIndex)
- {
- aChild = pIndex->CreatePage(aChild.GetPagePos(),pParent,aChild.HasPage());
- }
- return aChild;
-}
-
-//==================================================================
-// ONDXKey
-//==================================================================
-//------------------------------------------------------------------
-sal_Bool ONDXKey::IsText(sal_Int32 eType)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXKey::IsText" );
- return eType == DataType::VARCHAR || eType == DataType::CHAR;
-}
-
-//------------------------------------------------------------------
-StringCompare ONDXKey::Compare(const ONDXKey& rKey) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXKey::Compare" );
- StringCompare eResult;
-
- if (getValue().isNull())
- {
- if (rKey.getValue().isNull() || (rKey.IsText(getDBType()) && !rKey.getValue().getString().getLength()))
- eResult = COMPARE_EQUAL;
- else
- eResult = COMPARE_LESS;
- }
- else if (rKey.getValue().isNull())
- {
- if (getValue().isNull() || (IsText(getDBType()) && !getValue().getString().getLength()))
- eResult = COMPARE_EQUAL;
- else
- eResult = COMPARE_GREATER;
- }
- else if (IsText(getDBType()))
- {
- sal_Int32 nRes = getValue().getString().compareTo(rKey.getValue());
- eResult = (nRes > 0) ? COMPARE_GREATER : (nRes == 0) ? COMPARE_EQUAL : COMPARE_LESS;
- }
- else
- {
- double m = getValue(),n = rKey.getValue();
- eResult = (m > n) ? COMPARE_GREATER : (n == m) ? COMPARE_EQUAL : COMPARE_LESS;
- }
-
- // Record comparison, if index !Unique
- if (eResult == COMPARE_EQUAL && nRecord && rKey.nRecord)
- eResult = (nRecord > rKey.nRecord) ? COMPARE_GREATER :
- (nRecord == rKey.nRecord) ? COMPARE_EQUAL : COMPARE_LESS;
-
- return eResult;
-}
-// -----------------------------------------------------------------------------
-void ONDXKey::setValue(const ORowSetValue& _rVal)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXKey::setValue" );
- xValue = _rVal;
-}
-// -----------------------------------------------------------------------------
-const ORowSetValue& ONDXKey::getValue() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXKey::getValue" );
- return xValue;
-}
-// -----------------------------------------------------------------------------
-SvStream& connectivity::dbase::operator >> (SvStream &rStream, ONDXPagePtr& rPage)
-{
- rStream >> rPage.nPagePos;
- return rStream;
-}
-// -----------------------------------------------------------------------------
-SvStream& connectivity::dbase::operator << (SvStream &rStream, const ONDXPagePtr& rPage)
-{
- rStream << rPage.nPagePos;
- return rStream;
-}
-// -----------------------------------------------------------------------------
-//==================================================================
-// ONDXPagePtr
-//==================================================================
-//------------------------------------------------------------------
-ONDXPagePtr::ONDXPagePtr(const ONDXPagePtr& rRef)
- :ONDXPageRef(rRef)
- ,nPagePos(rRef.nPagePos)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXPagePtr::ONDXPagePtr" );
-}
-
-//------------------------------------------------------------------
-ONDXPagePtr::ONDXPagePtr(ONDXPage* pRefPage)
- :ONDXPageRef(pRefPage)
- ,nPagePos(0)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXPagePtr::ONDXPagePtr" );
- if (pRefPage)
- nPagePos = pRefPage->GetPagePos();
-}
-//------------------------------------------------------------------
-ONDXPagePtr& ONDXPagePtr::operator=(const ONDXPagePtr& rRef)
-{
- ONDXPageRef::operator=(rRef);
- nPagePos = rRef.nPagePos;
- return *this;
-}
-
-//------------------------------------------------------------------
-ONDXPagePtr& ONDXPagePtr::operator= (ONDXPage* pRef)
-{
- ONDXPageRef::operator=(pRef);
- nPagePos = (pRef) ? pRef->GetPagePos() : 0;
- return *this;
-}
-// -----------------------------------------------------------------------------
-static sal_uInt32 nValue;
-//------------------------------------------------------------------
-SvStream& connectivity::dbase::operator >> (SvStream &rStream, ONDXPage& rPage)
-{
- rStream.Seek(rPage.GetPagePos() * 512);
- rStream >> nValue >> rPage.aChild;
- rPage.nCount = sal_uInt16(nValue);
-
- for (sal_uInt16 i = 0; i < rPage.nCount; i++)
- rPage[i].Read(rStream, rPage.GetIndex());
- return rStream;
-}
-
-//------------------------------------------------------------------
-SvStream& connectivity::dbase::operator << (SvStream &rStream, const ONDXPage& rPage)
-{
- // Page does not yet exist
- sal_uIntPtr nSize = (rPage.GetPagePos() + 1) * 512;
- if (nSize > rStream.Seek(STREAM_SEEK_TO_END))
- {
- rStream.SetStreamSize(nSize);
- rStream.Seek(rPage.GetPagePos() * 512);
-
- char aEmptyData[512];
- memset(aEmptyData,0x00,512);
- rStream.Write((sal_uInt8*)aEmptyData,512);
- }
- sal_uIntPtr nCurrentPos = rStream.Seek(rPage.GetPagePos() * 512);
- OSL_UNUSED( nCurrentPos );
-
- nValue = rPage.nCount;
- rStream << nValue << rPage.aChild;
-
- sal_uInt16 i = 0;
- for (; i < rPage.nCount; i++)
- rPage[i].Write(rStream, rPage);
-
- // check if we have to fill the stream with '\0'
- if(i < rPage.rIndex.getHeader().db_maxkeys)
- {
- sal_uIntPtr nTell = rStream.Tell() % 512;
- sal_uInt16 nBufferSize = rStream.GetBufferSize();
- sal_uIntPtr nSize = nBufferSize - nTell;
- if ( nSize <= nBufferSize )
- {
- char* pEmptyData = new char[nSize];
- memset(pEmptyData,0x00,nSize);
- rStream.Write((sal_uInt8*)pEmptyData,nSize);
- rStream.Seek(nTell);
- delete [] pEmptyData;
- }
- }
- return rStream;
-}
-// -----------------------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 1
-//------------------------------------------------------------------
-void ONDXPage::PrintPage()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXPage::PrintPage" );
- OSL_TRACE("\nSDB: -----------Page: %d Parent: %d Count: %d Child: %d-----",
- nPagePos, HasParent() ? aParent->GetPagePos() : 0 ,nCount, aChild.GetPagePos());
-
- for (sal_uInt16 i = 0; i < nCount; i++)
- {
- ONDXNode rNode = (*this)[i];
- ONDXKey& rKey = rNode.GetKey();
- if (!IsLeaf())
- rNode.GetChild(&rIndex, this);
-
- if (rKey.getValue().isNull())
- {
- OSL_TRACE("SDB: [%d,NULL,%d]",rKey.GetRecord(), rNode.GetChild().GetPagePos());
- }
- else if (rIndex.getHeader().db_keytype)
- {
- OSL_TRACE("SDB: [%d,%f,%d]",rKey.GetRecord(), rKey.getValue().getDouble(),rNode.GetChild().GetPagePos());
- }
- else
- {
- OSL_TRACE("SDB: [%d,%s,%d]",rKey.GetRecord(), (const char* )ByteString(rKey.getValue().getString().getStr(), rIndex.m_pTable->getConnection()->getTextEncoding()).GetBuffer(),rNode.GetChild().GetPagePos());
- }
- }
- OSL_TRACE("SDB: -----------------------------------------------\n");
- if (!IsLeaf())
- {
-#if OSL_DEBUG_LEVEL > 1
- GetChild(&rIndex)->PrintPage();
- for (sal_uInt16 i = 0; i < nCount; i++)
- {
- ONDXNode rNode = (*this)[i];
- rNode.GetChild(&rIndex,this)->PrintPage();
- }
-#endif
- }
- OSL_TRACE("SDB: ===============================================\n");
-}
-#endif
-// -----------------------------------------------------------------------------
-sal_Bool ONDXPage::IsFull() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXPage::IsFull" );
- return Count() == rIndex.getHeader().db_maxkeys;
-}
-// -----------------------------------------------------------------------------
-//------------------------------------------------------------------
-sal_uInt16 ONDXPage::Search(const ONDXKey& rSearch)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXPage::Search" );
- // binary search afterwards
- sal_uInt16 i = 0xFFFF;
- while (++i < Count())
- if ((*this)[i].GetKey() == rSearch)
- break;
-
- return (i < Count()) ? i : NODE_NOTFOUND;
-}
-
-//------------------------------------------------------------------
-sal_uInt16 ONDXPage::Search(const ONDXPage* pPage)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXPage::Search" );
- sal_uInt16 i = 0xFFFF;
- while (++i < Count())
- if (((*this)[i]).GetChild() == pPage)
- break;
-
- // if not found, then we assume, that the page points to the page (???)
- return (i < Count()) ? i : NODE_NOTFOUND;
-}
-// -----------------------------------------------------------------------------
-// runs recursively
-void ONDXPage::SearchAndReplace(const ONDXKey& rSearch,
- ONDXKey& rReplace)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXPage::SearchAndReplace" );
- OSL_ENSURE(rSearch != rReplace,"Invalid here:rSearch == rReplace");
- if (rSearch != rReplace)
- {
- sal_uInt16 nPos = NODE_NOTFOUND;
- ONDXPage* pPage = this;
-
- while (pPage && (nPos = pPage->Search(rSearch)) == NODE_NOTFOUND)
- pPage = pPage->aParent;
-
- if (pPage)
- {
- (*pPage)[nPos].GetKey() = rReplace;
- pPage->SetModified(sal_True);
- }
- }
-}
-// -----------------------------------------------------------------------------
-ONDXNode& ONDXPage::operator[] (sal_uInt16 nPos)
-{
- DBG_ASSERT(nCount > nPos, "falscher Indexzugriff");
- return ppNodes[nPos];
-}
-
-//------------------------------------------------------------------
-const ONDXNode& ONDXPage::operator[] (sal_uInt16 nPos) const
-{
- DBG_ASSERT(nCount > nPos, "falscher Indexzugriff");
- return ppNodes[nPos];
-}
-// -----------------------------------------------------------------------------
-void ONDXPage::Remove(sal_uInt16 nPos)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXPage::Remove" );
- DBG_ASSERT(nCount > nPos, "falscher Indexzugriff");
-
- for (sal_uInt16 i = nPos; i < (nCount-1); i++)
- (*this)[i] = (*this)[i+1];
-
- nCount--;
- bModified = sal_True;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DPreparedStatement.cxx b/connectivity/source/drivers/dbase/DPreparedStatement.cxx
deleted file mode 100644
index 67f7c36941..0000000000
--- a/connectivity/source/drivers/dbase/DPreparedStatement.cxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DPreparedStatement.hxx"
-#include "dbase/DResultSet.hxx"
-
-using namespace connectivity::dbase;
-using namespace connectivity::file;
-using namespace com::sun::star::uno;
-// -------------------------------------------------------------------------
-OResultSet* ODbasePreparedStatement::createResultSet()
-{
- return new ODbaseResultSet(this,m_aSQLIterator);
-}
-// -------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(ODbasePreparedStatement,"com.sun.star.sdbc.driver.dbase.PreparedStatement","com.sun.star.sdbc.PreparedStatement");
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DResultSet.cxx b/connectivity/source/drivers/dbase/DResultSet.cxx
deleted file mode 100644
index d055bdb6b3..0000000000
--- a/connectivity/source/drivers/dbase/DResultSet.cxx
+++ /dev/null
@@ -1,247 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <com/sun/star/sdbcx/CompareBookmark.hpp>
-#include "dbase/DResultSet.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/sequence.hxx>
-#include "dbase/DIndex.hxx"
-#include "dbase/DIndexIter.hxx"
-#include "dbase/DCode.hxx"
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-#include "resource/dbase_res.hrc"
-
-using namespace ::comphelper;
-
-using namespace connectivity::dbase;
-using namespace connectivity::file;
-using namespace ::cppu;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-//------------------------------------------------------------------------------
-ODbaseResultSet::ODbaseResultSet( OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator)
- : file::OResultSet(pStmt,_aSQLIterator)
- ,m_bBookmarkable(sal_True)
-{
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISBOOKMARKABLE), PROPERTY_ID_ISBOOKMARKABLE, PropertyAttribute::READONLY,&m_bBookmarkable, ::getBooleanCppuType());
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODbaseResultSet::getImplementationName( ) throw ( RuntimeException)
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.dbase.ResultSet"));
-}
-// -------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL ODbaseResultSet::getSupportedServiceNames( ) throw( RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(2);
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.ResultSet"));
- aSupported[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.ResultSet"));
- return aSupported;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODbaseResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw( RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL ODbaseResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ODbaseResultSet_BASE::queryInterface(rType);
- return aRet.hasValue() ? aRet : OResultSet::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
- Sequence< Type > SAL_CALL ODbaseResultSet::getTypes( ) throw( RuntimeException)
-{
- return ::comphelper::concatSequences(OResultSet::getTypes(),ODbaseResultSet_BASE::getTypes());
-}
-
-// -------------------------------------------------------------------------
-// XRowLocate
-Any SAL_CALL ODbaseResultSet::getBookmark( ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- OSL_ENSURE((m_bShowDeleted || !m_aRow->isDeleted()),"getBookmark called for deleted row");
-
- return makeAny((sal_Int32)(m_aRow->get())[0]->getValue());
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODbaseResultSet::moveToBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False;
-
- return m_pTable ? Move(IResultSetHelper::BOOKMARK,comphelper::getINT32(bookmark),sal_True) : sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODbaseResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- if(!m_pTable)
- return sal_False;
-
-
- Move(IResultSetHelper::BOOKMARK,comphelper::getINT32(bookmark),sal_False);
-
- return relative(rows);
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODbaseResultSet::compareBookmarks( const Any& lhs, const Any& rhs ) throw( SQLException, RuntimeException)
-{
- sal_Int32 nFirst(0),nSecond(0),nResult(0);
- if ( !( lhs >>= nFirst ) || !( rhs >>= nSecond ) )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_INVALID_BOOKMARK);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- } // if ( !( lhs >>= nFirst ) || !( rhs >>= nSecond ) )
-
- // have a look at CompareBookmark
- // we can't use the names there because we already have defines with the same name from the parser
- if(nFirst < nSecond)
- nResult = -1;
- else if(nFirst > nSecond)
- nResult = 1;
- else
- nResult = 0;
-
- return nResult;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODbaseResultSet::hasOrderedBookmarks( ) throw( SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODbaseResultSet::hashBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return comphelper::getINT32(bookmark);
-}
-// -------------------------------------------------------------------------
-// XDeleteRows
-Sequence< sal_Int32 > SAL_CALL ODbaseResultSet::deleteRows( const Sequence< Any >& /*rows*/ ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- ::dbtools::throwFeatureNotImplementedException( "XDeleteRows::deleteRows", *this );
- return Sequence< sal_Int32 >();
-}
-// -------------------------------------------------------------------------
-sal_Bool ODbaseResultSet::fillIndexValues(const Reference< XColumnsSupplier> &_xIndex)
-{
- Reference<XUnoTunnel> xTunnel(_xIndex,UNO_QUERY);
- if(xTunnel.is())
- {
- dbase::ODbaseIndex* pIndex = reinterpret_cast< dbase::ODbaseIndex* >( xTunnel->getSomething(dbase::ODbaseIndex::getUnoTunnelImplementationId()) );
- if(pIndex)
- {
- dbase::OIndexIterator* pIter = pIndex->createIterator(NULL,NULL);
-
- if (pIter)
- {
- sal_uInt32 nRec = pIter->First();
- while (nRec != SQL_COLUMN_NOTFOUND)
- {
- if (m_aOrderbyAscending[0])
- m_pFileSet->get().push_back(nRec);
- else
- m_pFileSet->get().insert(m_pFileSet->get().begin(),nRec);
- nRec = pIter->Next();
- }
- m_pFileSet->setFrozen();
- delete pIter;
- return sal_True;
- }
- delete pIter;
- }
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & ODbaseResultSet::getInfoHelper()
-{
- return *ODbaseResultSet_BASE3::getArrayHelper();
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* ODbaseResultSet::createArrayHelper() const
-{
- Sequence< Property > aProps;
- describeProperties(aProps);
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODbaseResultSet::acquire() throw()
-{
- ODbaseResultSet_BASE2::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODbaseResultSet::release() throw()
-{
- ODbaseResultSet_BASE2::release();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL ODbaseResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-OSQLAnalyzer* ODbaseResultSet::createAnalyzer()
-{
- return new OFILEAnalyzer(m_pTable->getConnection());
-}
-// -----------------------------------------------------------------------------
-sal_Int32 ODbaseResultSet::getCurrentFilePos() const
-{
- return m_pTable->getFilePos();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DStatement.cxx b/connectivity/source/drivers/dbase/DStatement.cxx
deleted file mode 100644
index 9e0e5ddfc8..0000000000
--- a/connectivity/source/drivers/dbase/DStatement.cxx
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DStatement.hxx"
-#include "dbase/DResultSet.hxx"
-
-using namespace connectivity::dbase;
-using namespace connectivity::file;
-using namespace com::sun::star::uno;
-
-// -------------------------------------------------------------------------
-OResultSet* ODbaseStatement::createResultSet()
-{
- return new ODbaseResultSet(this,m_aSQLIterator);
-}
-// -------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(ODbaseStatement,"com.sun.star.sdbc.driver.dbase.Statement","com.sun.star.sdbc.Statement");
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
deleted file mode 100644
index a71e966b4b..0000000000
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ /dev/null
@@ -1,2798 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DTable.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/ucb/XContentAccess.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <svl/converter.hxx>
-#include "dbase/DConnection.hxx"
-#include "dbase/DColumns.hxx"
-#include <osl/thread.h>
-#include <tools/config.hxx>
-#include "dbase/DIndex.hxx"
-#include "dbase/DIndexes.hxx"
-#include <comphelper/sequence.hxx>
-#include <svl/zforlist.hxx>
-#include <unotools/syslocale.hxx>
-#include <rtl/math.hxx>
-#include <stdio.h> //sprintf
-#include <ucbhelper/content.hxx>
-#include <comphelper/extract.hxx>
-#include <connectivity/dbexception.hxx>
-#include <connectivity/dbconversion.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/property.hxx>
-#include <unotools/tempfile.hxx>
-#include <unotools/ucbhelper.hxx>
-#include <comphelper/types.hxx>
-#include <cppuhelper/exc_hlp.hxx>
-#include "connectivity/PColumn.hxx"
-#include "connectivity/dbtools.hxx"
-#include "connectivity/FValue.hxx"
-#include "connectivity/dbconversion.hxx"
-#include "resource/dbase_res.hrc"
-#include <rtl/logfile.hxx>
-
-#include <algorithm>
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::sdbcx;
-using namespace connectivity::dbase;
-using namespace connectivity::file;
-using namespace ::ucbhelper;
-using namespace ::utl;
-using namespace ::cppu;
-using namespace ::dbtools;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::i18n;
-
-// stored as the Field Descriptor terminator
-#define FIELD_DESCRIPTOR_TERMINATOR 0x0D
-#define DBF_EOL 0x1A
-
-namespace
-{
-sal_Int32 lcl_getFileSize(SvStream& _rStream)
-{
- sal_Int32 nFileSize = 0;
- _rStream.Seek(STREAM_SEEK_TO_END);
- _rStream.SeekRel(-1);
- char cEOL;
- _rStream >> cEOL;
- nFileSize = _rStream.Tell();
- if ( cEOL == DBF_EOL )
- nFileSize -= 1;
- return nFileSize;
-}
-/**
- calculates the Julian date
-*/
-void lcl_CalcJulDate(sal_Int32& _nJulianDate,sal_Int32& _nJulianTime,const com::sun::star::util::DateTime _aDateTime)
-{
- com::sun::star::util::DateTime aDateTime = _aDateTime;
- // weird: months fix
- if (aDateTime.Month > 12)
- {
- aDateTime.Month--;
- sal_uInt16 delta = _aDateTime.Month / 12;
- aDateTime.Year += delta;
- aDateTime.Month -= delta * 12;
- aDateTime.Month++;
- }
-
- _nJulianTime = ((aDateTime.Hours*3600000)+(aDateTime.Minutes*60000)+(aDateTime.Seconds*1000)+(aDateTime.HundredthSeconds*10));
- /* conversion factors */
- sal_uInt16 iy0;
- sal_uInt16 im0;
- if ( aDateTime.Month <= 2 )
- {
- iy0 = aDateTime.Year - 1;
- im0 = aDateTime.Month + 12;
- }
- else
- {
- iy0 = aDateTime.Year;
- im0 = aDateTime.Month;
- }
- sal_Int32 ia = iy0 / 100;
- sal_Int32 ib = 2 - ia + (ia >> 2);
- /* calculate julian date */
- if ( aDateTime.Year <= 0 )
- {
- _nJulianDate = (sal_Int32) ((365.25 * iy0) - 0.75)
- + (sal_Int32) (30.6001 * (im0 + 1) )
- + aDateTime.Day + 1720994;
- } // if ( _aDateTime.Year <= 0 )
- else
- {
- _nJulianDate = static_cast<sal_Int32>( ((365.25 * iy0)
- + (sal_Int32) (30.6001 * (im0 + 1))
- + aDateTime.Day + 1720994));
- }
- double JD = _nJulianDate + 0.5;
- _nJulianDate = (sal_Int32)( JD + 0.5);
- const double gyr = aDateTime.Year + (0.01 * aDateTime.Month) + (0.0001 * aDateTime.Day);
- if ( gyr >= 1582.1015 ) /* on or after 15 October 1582 */
- _nJulianDate += ib;
-}
-
-/**
- calculates date time from the Julian Date
-*/
-void lcl_CalDate(sal_Int32 _nJulianDate,sal_Int32 _nJulianTime,com::sun::star::util::DateTime& _rDateTime)
-{
- if ( _nJulianDate )
- {
- sal_Int32 ialp;
- sal_Int32 ka = _nJulianDate;
- if ( _nJulianDate >= 2299161 )
- {
- ialp = (sal_Int32)( ((double) _nJulianDate - 1867216.25 ) / ( 36524.25 ));
- ka = _nJulianDate + 1 + ialp - ( ialp >> 2 );
- }
- sal_Int32 kb = ka + 1524;
- sal_Int32 kc = (sal_Int32) ( ((double) kb - 122.1 ) / 365.25 );
- sal_Int32 kd = (sal_Int32) ((double) kc * 365.25);
- sal_Int32 ke = (sal_Int32) ((double) ( kb - kd ) / 30.6001 );
- _rDateTime.Day = static_cast<sal_uInt16>(kb - kd - ((sal_Int32) ( (double) ke * 30.6001 )));
- if ( ke > 13 )
- _rDateTime.Month = static_cast<sal_uInt16>(ke - 13);
- else
- _rDateTime.Month = static_cast<sal_uInt16>(ke - 1);
- if ( (_rDateTime.Month == 2) && (_rDateTime.Day > 28) )
- _rDateTime.Day = 29;
- if ( (_rDateTime.Month == 2) && (_rDateTime.Day == 29) && (ke == 3) )
- _rDateTime.Year = static_cast<sal_uInt16>(kc - 4716);
- else if ( _rDateTime.Month > 2 )
- _rDateTime.Year = static_cast<sal_uInt16>(kc - 4716);
- else
- _rDateTime.Year = static_cast<sal_uInt16>(kc - 4715);
- }
-
- if ( _nJulianTime )
- {
- double d_s = _nJulianTime / 1000;
- double d_m = d_s / 60;
- double d_h = d_m / 60;
- _rDateTime.Hours = (sal_uInt16) (d_h);
- _rDateTime.Minutes = (sal_uInt16) d_m;
- _rDateTime.Seconds = static_cast<sal_uInt16>(( d_m - (double) _rDateTime.Minutes ) * 60.0);
- }
-}
-
-}
-
-// -------------------------------------------------------------------------
-void ODbaseTable::readHeader()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::readHeader" );
- OSL_ENSURE(m_pFileStream,"No Stream available!");
- if(!m_pFileStream)
- return;
- m_pFileStream->RefreshBuffer(); // Make sure, that the header information actually is read again
- m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN);
-
- sal_uInt8 nType=0;
- (*m_pFileStream) >> nType;
- if(ERRCODE_NONE != m_pFileStream->GetErrorCode())
- throwInvalidDbaseFormat();
-
- m_pFileStream->Read((char*)(&m_aHeader.db_aedat), 3*sizeof(sal_uInt8));
- if(ERRCODE_NONE != m_pFileStream->GetErrorCode())
- throwInvalidDbaseFormat();
- (*m_pFileStream) >> m_aHeader.db_anz;
- if(ERRCODE_NONE != m_pFileStream->GetErrorCode())
- throwInvalidDbaseFormat();
- (*m_pFileStream) >> m_aHeader.db_kopf;
- if(ERRCODE_NONE != m_pFileStream->GetErrorCode())
- throwInvalidDbaseFormat();
- (*m_pFileStream) >> m_aHeader.db_slng;
- if(ERRCODE_NONE != m_pFileStream->GetErrorCode())
- throwInvalidDbaseFormat();
- m_pFileStream->Read((char*)(&m_aHeader.db_frei), 20*sizeof(sal_uInt8));
- if(ERRCODE_NONE != m_pFileStream->GetErrorCode())
- throwInvalidDbaseFormat();
-
- if ( ( ( m_aHeader.db_kopf - 1 ) / 32 - 1 ) <= 0 ) // number of fields
- {
- // no dbase file
- throwInvalidDbaseFormat();
- }
- else
- {
- // Consistency check of the header:
- m_aHeader.db_typ = (DBFType)nType;
- switch (m_aHeader.db_typ)
- {
- case dBaseIII:
- case dBaseIV:
- case dBaseV:
- case VisualFoxPro:
- case VisualFoxProAuto:
- case dBaseFS:
- case dBaseFSMemo:
- case dBaseIVMemoSQL:
- case dBaseIIIMemo:
- case FoxProMemo:
- m_pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
- if ( m_aHeader.db_frei[17] != 0x00
- && !m_aHeader.db_frei[18] && !m_aHeader.db_frei[19] && getConnection()->isTextEncodingDefaulted() )
- {
- switch(m_aHeader.db_frei[17])
- {
- case 0x01: m_eEncoding = RTL_TEXTENCODING_IBM_437; break; // DOS USA code page 437
- case 0x02: m_eEncoding = RTL_TEXTENCODING_IBM_850; break; // DOS Multilingual code page 850
- case 0x03: m_eEncoding = RTL_TEXTENCODING_MS_1252; break; // Windows ANSI code page 1252
- case 0x04: m_eEncoding = RTL_TEXTENCODING_APPLE_ROMAN; break; // Standard Macintosh
- case 0x64: m_eEncoding = RTL_TEXTENCODING_IBM_852; break; // EE MS-DOS code page 852
- case 0x65: m_eEncoding = RTL_TEXTENCODING_IBM_865; break; // Nordic MS-DOS code page 865
- case 0x66: m_eEncoding = RTL_TEXTENCODING_IBM_866; break; // Russian MS-DOS code page 866
- case 0x67: m_eEncoding = RTL_TEXTENCODING_IBM_861; break; // Icelandic MS-DOS
- //case 0x68: m_eEncoding = ; break; // Kamenicky (Czech) MS-DOS
- //case 0x69: m_eEncoding = ; break; // Mazovia (Polish) MS-DOS
- case 0x6A: m_eEncoding = RTL_TEXTENCODING_IBM_737; break; // Greek MS-DOS (437G)
- case 0x6B: m_eEncoding = RTL_TEXTENCODING_IBM_857; break; // Turkish MS-DOS
- case 0x96: m_eEncoding = RTL_TEXTENCODING_APPLE_CYRILLIC; break; // Russian Macintosh
- case 0x97: m_eEncoding = RTL_TEXTENCODING_APPLE_CENTEURO; break; // Eastern European Macintosh
- case 0x98: m_eEncoding = RTL_TEXTENCODING_APPLE_GREEK; break; // Greek Macintosh
- case 0xC8: m_eEncoding = RTL_TEXTENCODING_MS_1250; break; // Windows EE code page 1250
- case 0xC9: m_eEncoding = RTL_TEXTENCODING_MS_1251; break; // Russian Windows
- case 0xCA: m_eEncoding = RTL_TEXTENCODING_MS_1254; break; // Turkish Windows
- case 0xCB: m_eEncoding = RTL_TEXTENCODING_MS_1253; break; // Greek Windows
- default:
- break;
- }
- }
- break;
- case dBaseIVMemo:
- m_pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
- break;
- default:
- {
- throwInvalidDbaseFormat();
- }
- }
- }
-}
-// -------------------------------------------------------------------------
-void ODbaseTable::fillColumns()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::fillColumns" );
- m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN);
- m_pFileStream->Seek(32L);
-
- if(!m_aColumns.is())
- m_aColumns = new OSQLColumns();
- else
- m_aColumns->get().clear();
-
- m_aTypes.clear();
- m_aPrecisions.clear();
- m_aScales.clear();
-
- // Number of fields:
- const sal_Int32 nFieldCount = (m_aHeader.db_kopf - 1) / 32 - 1;
- OSL_ENSURE(nFieldCount,"No columns in table!");
-
- m_aColumns->get().reserve(nFieldCount);
- m_aTypes.reserve(nFieldCount);
- m_aPrecisions.reserve(nFieldCount);
- m_aScales.reserve(nFieldCount);
-
- String aStrFieldName;
- aStrFieldName.AssignAscii("Column");
- ::rtl::OUString aTypeName;
- static const ::rtl::OUString sVARCHAR(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
- const sal_Bool bCase = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers();
- const bool bFoxPro = m_aHeader.db_typ == VisualFoxPro || m_aHeader.db_typ == VisualFoxProAuto || m_aHeader.db_typ == FoxProMemo;
-
- sal_Int32 i = 0;
- for (; i < nFieldCount; i++)
- {
- DBFColumn aDBFColumn;
- m_pFileStream->Read((char*)&aDBFColumn, sizeof(aDBFColumn));
- if ( FIELD_DESCRIPTOR_TERMINATOR == aDBFColumn.db_fnm[0] ) // 0x0D stored as the Field Descriptor terminator.
- break;
-
- sal_Bool bIsRowVersion = bFoxPro && ( aDBFColumn.db_frei2[0] & 0x01 ) == 0x01;
- const String aColumnName((const char *)aDBFColumn.db_fnm,m_eEncoding);
-
- m_aRealFieldLengths.push_back(aDBFColumn.db_flng);
- sal_Int32 nPrecision = aDBFColumn.db_flng;
- sal_Int32 eType;
- sal_Bool bIsCurrency = sal_False;
-
- char cType[2];
- cType[0] = aDBFColumn.db_typ;
- cType[1] = 0;
- aTypeName = ::rtl::OUString::createFromAscii(cType);
-OSL_TRACE("column type: %c",aDBFColumn.db_typ);
-
- switch (aDBFColumn.db_typ)
- {
- case 'C':
- eType = DataType::VARCHAR;
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
- break;
- case 'F':
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DECIMAL"));
- case 'N':
- if ( aDBFColumn.db_typ == 'N' )
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NUMERIC"));
- eType = DataType::DECIMAL;
-
- // for numeric fields two characters more are written, than the precision of the column description predescribes,
- // to keep room for the possible sign and the comma. This has to be considered...
- nPrecision = SvDbaseConverter::ConvertPrecisionToOdbc(nPrecision,aDBFColumn.db_dez);
- // This is not true for older versions ....
- break;
- case 'L':
- eType = DataType::BIT;
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BOOLEAN"));
- break;
- case 'Y':
- bIsCurrency = sal_True;
- eType = DataType::DOUBLE;
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DOUBLE"));
- break;
- case 'D':
- eType = DataType::DATE;
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATE"));
- break;
- case 'T':
- eType = DataType::TIMESTAMP;
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP"));
- break;
- case 'I':
- eType = DataType::INTEGER;
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INTEGER"));
- break;
- case 'M':
- if ( bFoxPro && ( aDBFColumn.db_frei2[0] & 0x04 ) == 0x04 )
- {
- eType = DataType::LONGVARBINARY;
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LONGVARBINARY"));
- }
- else
- {
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LONGVARCHAR"));
- eType = DataType::LONGVARCHAR;
- }
- nPrecision = 2147483647;
- break;
- case 'P':
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LONGVARBINARY"));
- eType = DataType::LONGVARBINARY;
- nPrecision = 2147483647;
- break;
- case '0':
- case 'B':
- if ( m_aHeader.db_typ == VisualFoxPro || m_aHeader.db_typ == VisualFoxProAuto )
- {
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DOUBLE"));
- eType = DataType::DOUBLE;
- }
- else
- {
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LONGVARBINARY"));
- eType = DataType::LONGVARBINARY;
- nPrecision = 2147483647;
- }
- break;
- default:
- eType = DataType::OTHER;
- }
-
- m_aTypes.push_back(eType);
- m_aPrecisions.push_back(nPrecision);
- m_aScales.push_back(aDBFColumn.db_dez);
-
- Reference< XPropertySet> xCol = new sdbcx::OColumn(aColumnName,
- aTypeName,
- ::rtl::OUString(),
- ::rtl::OUString(),
- ColumnValue::NULLABLE,
- nPrecision,
- aDBFColumn.db_dez,
- eType,
- sal_False,
- bIsRowVersion,
- bIsCurrency,
- bCase);
- m_aColumns->get().push_back(xCol);
- } // for (; i < nFieldCount; i++)
- OSL_ENSURE(i,"No columns in table!");
-}
-// -------------------------------------------------------------------------
-ODbaseTable::ODbaseTable(sdbcx::OCollection* _pTables,ODbaseConnection* _pConnection)
- :ODbaseTable_BASE(_pTables,_pConnection)
- ,m_pMemoStream(NULL)
- ,m_bWriteableMemo(sal_False)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::ODbaseTable" );
- // initialize the header
- m_aHeader.db_typ = dBaseIII;
- m_aHeader.db_anz = 0;
- m_aHeader.db_kopf = 0;
- m_aHeader.db_slng = 0;
- m_eEncoding = getConnection()->getTextEncoding();
-}
-// -------------------------------------------------------------------------
-ODbaseTable::ODbaseTable(sdbcx::OCollection* _pTables,ODbaseConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description ,
- const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName
- ) : ODbaseTable_BASE(_pTables,_pConnection,_Name,
- _Type,
- _Description,
- _SchemaName,
- _CatalogName)
- ,m_pMemoStream(NULL)
- ,m_bWriteableMemo(sal_False)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::ODbaseTable" );
- m_eEncoding = getConnection()->getTextEncoding();
-}
-
-// -----------------------------------------------------------------------------
-void ODbaseTable::construct()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::construct" );
- // initialize the header
- m_aHeader.db_typ = dBaseIII;
- m_aHeader.db_anz = 0;
- m_aHeader.db_kopf = 0;
- m_aHeader.db_slng = 0;
- m_aMemoHeader.db_size = 0;
-
- String sFileName(getEntry(m_pConnection,m_Name));
-
- INetURLObject aURL;
- aURL.SetURL(sFileName);
-
- OSL_ENSURE( m_pConnection->matchesExtension( aURL.getExtension() ),
- "ODbaseTable::ODbaseTable: invalid extension!");
- // getEntry is expected to ensure the corect file name
-
- m_pFileStream = createStream_simpleError( sFileName, STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
- m_bWriteable = ( m_pFileStream != NULL );
-
- if ( !m_pFileStream )
- {
- m_bWriteable = sal_False;
- m_pFileStream = createStream_simpleError( sFileName, STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE);
- }
-
- if(m_pFileStream)
- {
- readHeader();
- if (HasMemoFields())
- {
- // Create Memo-Filename (.DBT):
- // nyi: Ugly for Unix and Mac!
-
- if ( m_aHeader.db_typ == FoxProMemo || VisualFoxPro == m_aHeader.db_typ || VisualFoxProAuto == m_aHeader.db_typ ) // foxpro uses another extension
- aURL.SetExtension(String::CreateFromAscii("fpt"));
- else
- aURL.SetExtension(String::CreateFromAscii("dbt"));
-
- // If the memo file isn't found, the data will be displayed anyhow.
- // However, updates can't be done
- // but the operation is executed
- m_pMemoStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
- if ( !m_pMemoStream )
- {
- m_bWriteableMemo = sal_False;
- m_pMemoStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE);
- }
- if (m_pMemoStream)
- ReadMemoHeader();
- }
- fillColumns();
-
- sal_uInt32 nFileSize = lcl_getFileSize(*m_pFileStream);
- m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN);
- if ( m_aHeader.db_anz == 0 && ((nFileSize-m_aHeader.db_kopf)/m_aHeader.db_slng) > 0) // seems to be empty or someone wrote bullshit into the dbase file
- m_aHeader.db_anz = ((nFileSize-m_aHeader.db_kopf)/m_aHeader.db_slng);
-
- // Buffersize dependent on the file size
- m_pFileStream->SetBufferSize(nFileSize > 1000000 ? 32768 :
- nFileSize > 100000 ? 16384 :
- nFileSize > 10000 ? 4096 : 1024);
-
- if (m_pMemoStream)
- {
- // set the buffer extactly to the length of a record
- m_pMemoStream->Seek(STREAM_SEEK_TO_END);
- nFileSize = m_pMemoStream->Tell();
- m_pMemoStream->Seek(STREAM_SEEK_TO_BEGIN);
-
- // Buffersize dependent on the file size
- m_pMemoStream->SetBufferSize(nFileSize > 1000000 ? 32768 :
- nFileSize > 100000 ? 16384 :
- nFileSize > 10000 ? 4096 :
- m_aMemoHeader.db_size);
- }
-
- AllocBuffer();
- }
-}
-//------------------------------------------------------------------
-sal_Bool ODbaseTable::ReadMemoHeader()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::ReadMemoHeader" );
- m_pMemoStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
- m_pMemoStream->RefreshBuffer(); // make sure that the header information is actually read again
- m_pMemoStream->Seek(0L);
-
- (*m_pMemoStream) >> m_aMemoHeader.db_next;
- switch (m_aHeader.db_typ)
- {
- case dBaseIIIMemo: // dBase III: fixed block size
- case dBaseIVMemo:
- // sometimes dBase3 is attached to dBase4 memo
- m_pMemoStream->Seek(20L);
- (*m_pMemoStream) >> m_aMemoHeader.db_size;
- if (m_aMemoHeader.db_size > 1 && m_aMemoHeader.db_size != 512) // 1 is also for dBase 3
- m_aMemoHeader.db_typ = MemodBaseIV;
- else if (m_aMemoHeader.db_size > 1 && m_aMemoHeader.db_size == 512)
- {
- // There are files using size specification, though they are dBase-files
- char sHeader[4];
- m_pMemoStream->Seek(m_aMemoHeader.db_size);
- m_pMemoStream->Read(sHeader,4);
-
- if ((m_pMemoStream->GetErrorCode() != ERRCODE_NONE) || ((sal_uInt8)sHeader[0]) != 0xFF || ((sal_uInt8)sHeader[1]) != 0xFF || ((sal_uInt8)sHeader[2]) != 0x08)
- m_aMemoHeader.db_typ = MemodBaseIII;
- else
- m_aMemoHeader.db_typ = MemodBaseIV;
- }
- else
- {
- m_aMemoHeader.db_typ = MemodBaseIII;
- m_aMemoHeader.db_size = 512;
- }
- break;
- case VisualFoxPro:
- case VisualFoxProAuto:
- case FoxProMemo:
- m_aMemoHeader.db_typ = MemoFoxPro;
- m_pMemoStream->Seek(6L);
- m_pMemoStream->SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN);
- (*m_pMemoStream) >> m_aMemoHeader.db_size;
- break;
- default:
- OSL_FAIL( "ODbaseTable::ReadMemoHeader: unsupported memo type!" );
- break;
- }
- return sal_True;
-}
-// -------------------------------------------------------------------------
-String ODbaseTable::getEntry(OConnection* _pConnection,const ::rtl::OUString& _sName )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::getEntry" );
- ::rtl::OUString sURL;
- try
- {
- Reference< XResultSet > xDir = _pConnection->getDir()->getStaticResultSet();
- Reference< XRow> xRow(xDir,UNO_QUERY);
- ::rtl::OUString sName;
- ::rtl::OUString sExt;
- INetURLObject aURL;
- static const ::rtl::OUString s_sSeparator(RTL_CONSTASCII_USTRINGPARAM("/"));
- xDir->beforeFirst();
- while(xDir->next())
- {
- sName = xRow->getString(1);
- aURL.SetSmartProtocol(INET_PROT_FILE);
- String sUrl = _pConnection->getURL() + s_sSeparator + sName;
- aURL.SetSmartURL( sUrl );
-
- // cut the extension
- sExt = aURL.getExtension();
-
- // name and extension have to coincide
- if ( _pConnection->matchesExtension( sExt ) )
- {
- sName = sName.replaceAt(sName.getLength()-(sExt.getLength()+1),sExt.getLength()+1,::rtl::OUString());
- if ( sName == _sName )
- {
- Reference< XContentAccess > xContentAccess( xDir, UNO_QUERY );
- sURL = xContentAccess->queryContentIdentifierString();
- break;
- }
- }
- }
- xDir->beforeFirst(); // move back to before first record
- }
- catch(const Exception&)
- {
- OSL_ASSERT(0);
- }
- return sURL;
-}
-// -------------------------------------------------------------------------
-void ODbaseTable::refreshColumns()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::refreshColumns" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- TStringVector aVector;
- aVector.reserve(m_aColumns->get().size());
-
- for(OSQLColumns::Vector::const_iterator aIter = m_aColumns->get().begin();aIter != m_aColumns->get().end();++aIter)
- aVector.push_back(Reference< XNamed>(*aIter,UNO_QUERY)->getName());
-
- if(m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new ODbaseColumns(this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void ODbaseTable::refreshIndexes()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::refreshIndexes" );
- TStringVector aVector;
- if(m_pFileStream && (!m_pIndexes || m_pIndexes->getCount() == 0))
- {
- INetURLObject aURL;
- aURL.SetURL(getEntry(m_pConnection,m_Name));
-
- aURL.setExtension(String::CreateFromAscii("inf"));
- Config aInfFile(aURL.getFSysPath(INetURLObject::FSYS_DETECT));
- aInfFile.SetGroup(dBASE_III_GROUP);
- sal_uInt16 nKeyCnt = aInfFile.GetKeyCount();
- ByteString aKeyName;
- ByteString aIndexName;
-
- for (sal_uInt16 nKey = 0; nKey < nKeyCnt; nKey++)
- {
- // Refences the key an index-file?
- aKeyName = aInfFile.GetKeyName( nKey );
- //...if yes, add the index list of the table
- if (aKeyName.Copy(0,3) == ByteString("NDX") )
- {
- aIndexName = aInfFile.ReadKey(aKeyName);
- aURL.setName(String(aIndexName,m_eEncoding));
- try
- {
- Content aCnt(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference<XCommandEnvironment>());
- if (aCnt.isDocument())
- {
- aVector.push_back(aURL.getBase());
- }
- }
- catch(const Exception&) // an exception is thrown when no file exists
- {
- }
- }
- }
- }
- if(m_pIndexes)
- m_pIndexes->reFill(aVector);
- else
- m_pIndexes = new ODbaseIndexes(this,m_aMutex,aVector);
-}
-
-// -------------------------------------------------------------------------
-void SAL_CALL ODbaseTable::disposing(void)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::disposing" );
- OFileTable::disposing();
- ::osl::MutexGuard aGuard(m_aMutex);
- m_aColumns = NULL;
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL ODbaseTable::getTypes( ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::getTypes" );
- Sequence< Type > aTypes = OTable_TYPEDEF::getTypes();
- ::std::vector<Type> aOwnTypes;
- aOwnTypes.reserve(aTypes.getLength());
-
- const Type* pBegin = aTypes.getConstArray();
- const Type* pEnd = pBegin + aTypes.getLength();
- for(;pBegin != pEnd;++pBegin)
- {
- if(!(*pBegin == ::getCppuType((const Reference<XKeysSupplier>*)0) ||
- *pBegin == ::getCppuType((const Reference<XDataDescriptorFactory>*)0)))
- {
- aOwnTypes.push_back(*pBegin);
- }
- }
- aOwnTypes.push_back(::getCppuType( (const Reference< ::com::sun::star::lang::XUnoTunnel > *)0 ));
- Type *pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
-}
-
-// -------------------------------------------------------------------------
-Any SAL_CALL ODbaseTable::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::queryInterface" );
- if( rType == ::getCppuType((const Reference<XKeysSupplier>*)0) ||
- rType == ::getCppuType((const Reference<XDataDescriptorFactory>*)0))
- return Any();
-
- Any aRet = OTable_TYPEDEF::queryInterface(rType);
- return aRet.hasValue() ? aRet : ::cppu::queryInterface(rType,static_cast< ::com::sun::star::lang::XUnoTunnel*> (this));
-}
-
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > ODbaseTable::getUnoTunnelImplementationId()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::getUnoTunnelImplementationId" );
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 ODbaseTable::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::getSomething" );
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : ODbaseTable_BASE::getSomething(rId);
-}
-//------------------------------------------------------------------
-sal_Bool ODbaseTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols, sal_Bool _bUseTableDefs,sal_Bool bRetrieveData)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::fetchRow" );
- // Read the data
- bool bIsCurRecordDeleted = (char)m_pBuffer[0] == '*';
-
- // only read the bookmark
-
- // Mark record as deleted
- _rRow->setDeleted(bIsCurRecordDeleted);
- *(_rRow->get())[0] = m_nFilePos;
-
- if (!bRetrieveData)
- return sal_True;
-
- sal_Size nByteOffset = 1;
- // Fields:
- OSQLColumns::Vector::const_iterator aIter = _rCols.get().begin();
- OSQLColumns::Vector::const_iterator aEnd = _rCols.get().end();
- const sal_Size nCount = _rRow->get().size();
- for (sal_Size i = 1; aIter != aEnd && nByteOffset <= m_nBufferSize && i < nCount;++aIter, i++)
- {
- // Lengths depending on data type:
- sal_Int32 nLen = 0;
- sal_Int32 nType = 0;
- if(_bUseTableDefs)
- {
- nLen = m_aPrecisions[i-1];
- nType = m_aTypes[i-1];
- }
- else
- {
- (*aIter)->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)) >>= nLen;
- (*aIter)->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
- }
- switch(nType)
- {
- case DataType::INTEGER:
- case DataType::DOUBLE:
- case DataType::TIMESTAMP:
- case DataType::DATE:
- case DataType::BIT:
- case DataType::LONGVARCHAR:
- case DataType::LONGVARBINARY:
- nLen = m_aRealFieldLengths[i-1];
- break;
- case DataType::DECIMAL:
- if(_bUseTableDefs)
- nLen = SvDbaseConverter::ConvertPrecisionToDbase(nLen,m_aScales[i-1]);
- else
- nLen = SvDbaseConverter::ConvertPrecisionToDbase(nLen,getINT32((*aIter)->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))));
- break; // the sign and the comma
-
- case DataType::BINARY:
- case DataType::OTHER:
- nByteOffset += nLen;
- continue;
- }
-
- // Is the variable bound?
- if ( !(_rRow->get())[i]->isBound() )
- {
- // No - next field.
- nByteOffset += nLen;
- OSL_ENSURE( nByteOffset <= m_nBufferSize ,"ByteOffset > m_nBufferSize!");
- continue;
- } // if ( !(_rRow->get())[i]->isBound() )
- if ( ( nByteOffset + nLen) > m_nBufferSize )
- break; // length doesn't match buffer size.
-
- char *pData = (char *) (m_pBuffer + nByteOffset);
-
- if (nType == DataType::CHAR || nType == DataType::VARCHAR)
- {
- sal_Int32 nLastPos = -1;
- for (sal_Int32 k = 0; k < nLen; ++k)
- {
- if (pData[k] != ' ')
- // Record last non-empty position.
- nLastPos = k;
- }
- if (nLastPos < 0)
- {
- // Empty string. Skip it.
- (_rRow->get())[i]->setNull();
- }
- else
- {
- // Commit the string. Use intern() to ref-count it.
- *(_rRow->get())[i] = ::rtl::OUString::intern(pData, static_cast<sal_Int32>(nLastPos+1), m_eEncoding);
- }
- } // if (nType == DataType::CHAR || nType == DataType::VARCHAR)
- else if ( DataType::TIMESTAMP == nType )
- {
- sal_Int32 nDate = 0,nTime = 0;
- memcpy(&nDate, pData, 4);
- memcpy(&nTime, pData+ 4, 4);
- if ( !nDate && !nTime )
- {
- (_rRow->get())[i]->setNull();
- }
- else
- {
- ::com::sun::star::util::DateTime aDateTime;
- lcl_CalDate(nDate,nTime,aDateTime);
- *(_rRow->get())[i] = aDateTime;
- }
- }
- else if ( DataType::INTEGER == nType )
- {
- sal_Int32 nValue = 0;
- memcpy(&nValue, pData, nLen);
- *(_rRow->get())[i] = nValue;
- }
- else if ( DataType::DOUBLE == nType )
- {
- double d = 0.0;
- if (getBOOL((*aIter)->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)))) // Currency is treated separately
- {
- sal_Int64 nValue = 0;
- memcpy(&nValue, pData, nLen);
-
- if ( m_aScales[i-1] )
- d = (double)(nValue / pow(10.0,(int)m_aScales[i-1]));
- else
- d = (double)(nValue);
- }
- else
- {
- memcpy(&d, pData, nLen);
- }
-
- *(_rRow->get())[i] = d;
- }
- else
- {
- sal_Int32 nPos1 = -1, nPos2 = -1;
- // If the string contains Nul-characters, then convert them to blanks!
- for (sal_Int32 k = 0; k < nLen; k++)
- {
- if (pData[k] == '\0')
- pData[k] = ' ';
-
- if (pData[k] != ' ')
- {
- if (nPos1 < 0)
- // first non-empty char position.
- nPos1 = k;
-
- // last non-empty char position.
- nPos2 = k;
- }
- }
-
- if (nPos1 < 0)
- {
- // Empty string. Skip it.
- nByteOffset += nLen;
- (_rRow->get())[i]->setNull(); // no values -> done
- continue;
- }
-
- ::rtl::OUString aStr = ::rtl::OUString::intern(pData+nPos1, nPos2-nPos1+1, m_eEncoding);
-
- switch (nType)
- {
- case DataType::DATE:
- {
- if (aStr.getLength() != nLen)
- {
- (_rRow->get())[i]->setNull();
- break;
- }
- const sal_uInt16 nYear = (sal_uInt16)aStr.copy( 0, 4 ).toInt32();
- const sal_uInt16 nMonth = (sal_uInt16)aStr.copy( 4, 2 ).toInt32();
- const sal_uInt16 nDay = (sal_uInt16)aStr.copy( 6, 2 ).toInt32();
-
- const ::com::sun::star::util::Date aDate(nDay,nMonth,nYear);
- *(_rRow->get())[i] = aDate;
- }
- break;
- case DataType::DECIMAL:
- *(_rRow->get())[i] = ORowSetValue(aStr);
- break;
- case DataType::BIT:
- {
- sal_Bool b;
- switch (* ((const char *)pData))
- {
- case 'T':
- case 'Y':
- case 'J': b = sal_True; break;
- default: b = sal_False; break;
- }
- *(_rRow->get())[i] = b;
- }
- break;
- case DataType::LONGVARBINARY:
- case DataType::BINARY:
- case DataType::LONGVARCHAR:
- {
- const long nBlockNo = aStr.toInt32(); // read blocknumber
- if (nBlockNo > 0 && m_pMemoStream) // Read data from memo-file, only if
- {
- if ( !ReadMemo(nBlockNo, (_rRow->get())[i]->get()) )
- break;
- }
- else
- (_rRow->get())[i]->setNull();
- } break;
- default:
- OSL_FAIL("Falscher Type");
- }
- (_rRow->get())[i]->setTypeKind(nType);
- }
-
- nByteOffset += nLen;
- OSL_ENSURE( nByteOffset <= m_nBufferSize ,"ByteOffset > m_nBufferSize!");
- }
- return sal_True;
-}
-//------------------------------------------------------------------
-// -------------------------------------------------------------------------
-void ODbaseTable::FileClose()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::FileClose" );
- ::osl::MutexGuard aGuard(m_aMutex);
- // if not everything has been written yet
- if (m_pMemoStream && m_pMemoStream->IsWritable())
- m_pMemoStream->Flush();
-
- delete m_pMemoStream;
- m_pMemoStream = NULL;
-
- ODbaseTable_BASE::FileClose();
-}
-// -------------------------------------------------------------------------
-sal_Bool ODbaseTable::CreateImpl()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::CreateImpl" );
- OSL_ENSURE(!m_pFileStream, "SequenceError");
-
- if ( m_pConnection->isCheckEnabled() && ::dbtools::convertName2SQLName(m_Name,::rtl::OUString()) != m_Name )
- {
- const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
- STR_SQL_NAME_ERROR,
- "$name$", m_Name
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
- }
-
- INetURLObject aURL;
- aURL.SetSmartProtocol(INET_PROT_FILE);
- String aName = getEntry(m_pConnection,m_Name);
- if(!aName.Len())
- {
- ::rtl::OUString aIdent = m_pConnection->getContent()->getIdentifier()->getContentIdentifier();
- if ( aIdent.lastIndexOf('/') != (aIdent.getLength()-1) )
- aIdent += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aIdent += m_Name;
- aName = aIdent.getStr();
- }
- aURL.SetURL(aName);
-
- if ( !m_pConnection->matchesExtension( aURL.getExtension() ) )
- aURL.setExtension(m_pConnection->getExtension());
-
- try
- {
- Content aContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference<XCommandEnvironment>());
- if (aContent.isDocument())
- {
- // Only if the file exists with length > 0 raise an error
- SvStream* pFileStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE),STREAM_READ);
-
- if (pFileStream && pFileStream->Seek(STREAM_SEEK_TO_END))
- {
- return sal_False;
- }
- delete pFileStream;
- }
- }
- catch(const Exception&) // an exception is thrown when no file exists
- {
- }
-
- sal_Bool bMemoFile = sal_False;
-
- sal_Bool bOk = CreateFile(aURL, bMemoFile);
-
- FileClose();
-
- if (!bOk)
- {
- try
- {
- Content aContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference<XCommandEnvironment>());
- aContent.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),bool2any( sal_True ) );
- }
- catch(const Exception&) // an exception is thrown when no file exists
- {
- }
- return sal_False;
- }
-
- if (bMemoFile)
- {
- String aExt = aURL.getExtension();
- aURL.setExtension(String::CreateFromAscii("dbt")); // extension for memo file
- Content aMemo1Content(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference<XCommandEnvironment>());
-
- sal_Bool bMemoAlreadyExists = sal_False;
- try
- {
- bMemoAlreadyExists = aMemo1Content.isDocument();
- }
- catch(const Exception&) // an exception is thrown when no file exists
- {
- }
- if (bMemoAlreadyExists)
- {
- aURL.setExtension(aExt); // kill dbf file
- try
- {
- Content aMemoContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference<XCommandEnvironment>());
- aMemoContent.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),bool2any( sal_True ) );
- }
- catch(const Exception&)
- {
-
- const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
- STR_COULD_NOT_DELETE_FILE,
- "$name$", aName
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
- }
- }
- if (!CreateMemoFile(aURL))
- {
- aURL.setExtension(aExt); // kill dbf file
- Content aMemoContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference<XCommandEnvironment>());
- aMemoContent.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),bool2any( sal_True ) );
- return sal_False;
- }
- m_aHeader.db_typ = dBaseIIIMemo;
- }
- else
- m_aHeader.db_typ = dBaseIII;
-
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-void ODbaseTable::throwInvalidColumnType(const sal_uInt16 _nErrorId,const ::rtl::OUString& _sColumnName)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::throwInvalidColumnType" );
- try
- {
- // we have to drop the file because it is corrupted now
- DropImpl();
- }
- catch(const Exception&)
- {
- }
-
- const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
- _nErrorId,
- "$columnname$", _sColumnName
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
-}
-//------------------------------------------------------------------
-// creates in principle dBase IV file format
-sal_Bool ODbaseTable::CreateFile(const INetURLObject& aFile, sal_Bool& bCreateMemo)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::CreateFile" );
- bCreateMemo = sal_False;
- Date aDate; // current date
-
- m_pFileStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC );
-
- if (!m_pFileStream)
- return sal_False;
-
- sal_uInt8 nDbaseType = dBaseIII;
- Reference<XIndexAccess> xColumns(getColumns(),UNO_QUERY);
- Reference<XPropertySet> xCol;
- const ::rtl::OUString sPropType = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE);
-
- try
- {
- const sal_Int32 nCount = xColumns->getCount();
- for(sal_Int32 i=0;i<nCount;++i)
- {
- xColumns->getByIndex(i) >>= xCol;
- OSL_ENSURE(xCol.is(),"This should be a column!");
-
- switch (getINT32(xCol->getPropertyValue(sPropType)))
- {
- case DataType::DOUBLE:
- case DataType::INTEGER:
- case DataType::TIMESTAMP:
- case DataType::LONGVARBINARY:
- nDbaseType = VisualFoxPro;
- i = nCount; // no more columns need to be checked
- break;
- } // switch (getINT32(xCol->getPropertyValue(sPropType)))
- }
- }
- catch ( const Exception& e )
- {
- (void)e;
-
- try
- {
- // we have to drop the file because it is corrupted now
- DropImpl();
- }
- catch(const Exception&) { }
- throw;
- }
-
- char aBuffer[21]; // write buffer
- memset(aBuffer,0,sizeof(aBuffer));
-
- m_pFileStream->Seek(0L);
- (*m_pFileStream) << (sal_uInt8) nDbaseType; // dBase format
- (*m_pFileStream) << (sal_uInt8) (aDate.GetYear() % 100); // current date
-
-
- (*m_pFileStream) << (sal_uInt8) aDate.GetMonth();
- (*m_pFileStream) << (sal_uInt8) aDate.GetDay();
- (*m_pFileStream) << 0L; // number of data records
- (*m_pFileStream) << (sal_uInt16)((m_pColumns->getCount()+1) * 32 + 1); // header information,
- // pColumns contains always an additional column
- (*m_pFileStream) << (sal_uInt16) 0; // record length will be determined later
- m_pFileStream->Write(aBuffer, 20);
-
- sal_uInt16 nRecLength = 1; // Length 1 for deleted flag
- sal_Int32 nMaxFieldLength = m_pConnection->getMetaData()->getMaxColumnNameLength();
- ::rtl::OUString aName;
- const ::rtl::OUString sPropName = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME);
- const ::rtl::OUString sPropPrec = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION);
- const ::rtl::OUString sPropScale = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE);
-
- try
- {
- const sal_Int32 nCount = xColumns->getCount();
- for(sal_Int32 i=0;i<nCount;++i)
- {
- xColumns->getByIndex(i) >>= xCol;
- OSL_ENSURE(xCol.is(),"This should be a column!");
-
- char cTyp( 'C' );
-
- xCol->getPropertyValue(sPropName) >>= aName;
-
- ::rtl::OString aCol;
- if ( DBTypeConversion::convertUnicodeString( aName, aCol, m_eEncoding ) > nMaxFieldLength)
- {
- throwInvalidColumnType( STR_INVALID_COLUMN_NAME_LENGTH, aName );
- }
-
- (*m_pFileStream) << aCol.getStr();
- m_pFileStream->Write(aBuffer, 11 - aCol.getLength());
-
- sal_Int32 nPrecision = 0;
- xCol->getPropertyValue(sPropPrec) >>= nPrecision;
- sal_Int32 nScale = 0;
- xCol->getPropertyValue(sPropScale) >>= nScale;
-
- bool bBinary = false;
-
- switch (getINT32(xCol->getPropertyValue(sPropType)))
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- cTyp = 'C';
- break;
- case DataType::DOUBLE:
- if (getBOOL(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)))) // Currency will be treated separately
- cTyp = 'Y';
- else
- cTyp = 'B';
- break;
- case DataType::INTEGER:
- cTyp = 'I';
- break;
- case DataType::TINYINT:
- case DataType::SMALLINT:
- case DataType::BIGINT:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::REAL:
- cTyp = 'N'; // only dBase 3 format
- break;
- case DataType::TIMESTAMP:
- cTyp = 'T';
- break;
- case DataType::DATE:
- cTyp = 'D';
- break;
- case DataType::BIT:
- cTyp = 'L';
- break;
- case DataType::LONGVARBINARY:
- bBinary = true;
- // run through
- case DataType::LONGVARCHAR:
- cTyp = 'M';
- break;
- default:
- {
- throwInvalidColumnType(STR_INVALID_COLUMN_TYPE, aName);
- }
- }
-
- (*m_pFileStream) << cTyp;
- if ( nDbaseType == VisualFoxPro )
- (*m_pFileStream) << (nRecLength-1);
- else
- m_pFileStream->Write(aBuffer, 4);
-
- switch(cTyp)
- {
- case 'C':
- OSL_ENSURE(nPrecision < 255, "ODbaseTable::Create: Column zu lang!");
- if (nPrecision > 254)
- {
- throwInvalidColumnType(STR_INVALID_COLUMN_PRECISION, aName);
- }
- (*m_pFileStream) << (sal_uInt8) Min((unsigned)nPrecision, 255U); // field length
- nRecLength = nRecLength + (sal_uInt16)::std::min((sal_uInt16)nPrecision, (sal_uInt16)255UL);
- (*m_pFileStream) << (sal_uInt8)0; // decimals
- break;
- case 'F':
- case 'N':
- OSL_ENSURE(nPrecision >= nScale,
- "ODbaseTable::Create: Feldlaenge muss groesser Nachkommastellen sein!");
- if (nPrecision < nScale)
- {
- throwInvalidColumnType(STR_INVALID_PRECISION_SCALE, aName);
- }
- if (getBOOL(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)))) // Currency will be treated separately
- {
- (*m_pFileStream) << (sal_uInt8)10; // standard length
- (*m_pFileStream) << (sal_uInt8)4;
- nRecLength += 10;
- }
- else
- {
- sal_Int32 nPrec = SvDbaseConverter::ConvertPrecisionToDbase(nPrecision,nScale);
-
- (*m_pFileStream) << (sal_uInt8)( nPrec);
- (*m_pFileStream) << (sal_uInt8)nScale;
- nRecLength += (sal_uInt16)nPrec;
- }
- break;
- case 'L':
- (*m_pFileStream) << (sal_uInt8)1;
- (*m_pFileStream) << (sal_uInt8)0;
- ++nRecLength;
- break;
- case 'I':
- (*m_pFileStream) << (sal_uInt8)4;
- (*m_pFileStream) << (sal_uInt8)0;
- nRecLength += 4;
- break;
- case 'Y':
- case 'B':
- case 'T':
- case 'D':
- (*m_pFileStream) << (sal_uInt8)8;
- (*m_pFileStream) << (sal_uInt8)0;
- nRecLength += 8;
- break;
- case 'M':
- bCreateMemo = sal_True;
- (*m_pFileStream) << (sal_uInt8)10;
- (*m_pFileStream) << (sal_uInt8)0;
- nRecLength += 10;
- if ( bBinary )
- aBuffer[0] = 0x06;
- break;
- default:
- throwInvalidColumnType(STR_INVALID_COLUMN_TYPE, aName);
- }
- m_pFileStream->Write(aBuffer, 14);
- aBuffer[0] = 0x00;
- }
-
- (*m_pFileStream) << (sal_uInt8)FIELD_DESCRIPTOR_TERMINATOR; // end of header
- (*m_pFileStream) << (char)DBF_EOL;
- m_pFileStream->Seek(10L);
- (*m_pFileStream) << nRecLength; // set record length afterwards
-
- if (bCreateMemo)
- {
- m_pFileStream->Seek(0L);
- if (nDbaseType == VisualFoxPro)
- (*m_pFileStream) << (sal_uInt8) FoxProMemo;
- else
- (*m_pFileStream) << (sal_uInt8) dBaseIIIMemo;
- } // if (bCreateMemo)
- }
- catch ( const Exception& e )
- {
- (void)e;
-
- try
- {
- // we have to drop the file because it is corrupted now
- DropImpl();
- }
- catch(const Exception&) { }
- throw;
- }
- return sal_True;
-}
-
-//------------------------------------------------------------------
-// creates in principle dBase III file format
-sal_Bool ODbaseTable::CreateMemoFile(const INetURLObject& aFile)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::CreateMemoFile" );
- // filehandling macro for table creation
- m_pMemoStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | STREAM_SHARE_DENYWRITE);
-
- if (!m_pMemoStream)
- return sal_False;
-
- m_pMemoStream->SetStreamSize(512);
-
- m_pMemoStream->Seek(0L);
- (*m_pMemoStream) << long(1); // pointer to the first free block
-
- m_pMemoStream->Flush();
- delete m_pMemoStream;
- m_pMemoStream = NULL;
- return sal_True;
-}
-//------------------------------------------------------------------
-sal_Bool ODbaseTable::Drop_Static(const ::rtl::OUString& _sUrl,sal_Bool _bHasMemoFields,OCollection* _pIndexes )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::Drop_Static" );
- INetURLObject aURL;
- aURL.SetURL(_sUrl);
-
- sal_Bool bDropped = ::utl::UCBContentHelper::Kill(aURL.GetMainURL(INetURLObject::NO_DECODE));
-
- if(bDropped)
- {
- if (_bHasMemoFields)
- { // delete the memo fields
- aURL.setExtension(String::CreateFromAscii("dbt"));
- bDropped = ::utl::UCBContentHelper::Kill(aURL.GetMainURL(INetURLObject::NO_DECODE));
- }
-
- if(bDropped)
- {
- if(_pIndexes)
- {
- try
- {
- sal_Int32 i = _pIndexes->getCount();
- while (i)
- {
- _pIndexes->dropByIndex(--i);
- }
- }
- catch(const SQLException&)
- {
- }
- }
- aURL.setExtension(String::CreateFromAscii("inf"));
-
- // as the inf file does not necessarily exist, we aren't allowed to use UCBContentHelper::Kill
- try
- {
- ::ucbhelper::Content aDeleteContent( aURL.GetMainURL( INetURLObject::NO_DECODE ), Reference< XCommandEnvironment > () );
- aDeleteContent.executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")), makeAny( sal_Bool( sal_True ) ) );
- }
- catch(const Exception&)
- {
- // silently ignore this ....
- }
- }
- }
- return bDropped;
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODbaseTable::DropImpl()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::DropImpl" );
- FileClose();
-
- if(!m_pIndexes)
- refreshIndexes(); // look for indexes which must be deleted as well
-
- sal_Bool bDropped = Drop_Static(getEntry(m_pConnection,m_Name),HasMemoFields(),m_pIndexes);
- if(!bDropped)
- {// we couldn't drop the table so we have to reopen it
- construct();
- if(m_pColumns)
- m_pColumns->refresh();
- }
- return bDropped;
-}
-
-//------------------------------------------------------------------
-sal_Bool ODbaseTable::InsertRow(OValueRefVector& rRow, sal_Bool bFlush,const Reference<XIndexAccess>& _xCols)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::InsertRow" );
- // fill buffer with blanks
- AllocBuffer();
- memset(m_pBuffer, 0, m_aHeader.db_slng);
- m_pBuffer[0] = ' ';
-
- // Copy new row completely:
- // ... and add at the end as new Record:
- sal_uInt32 nTempPos = m_nFilePos;
-
- m_nFilePos = (sal_uIntPtr)m_aHeader.db_anz + 1;
- sal_Bool bInsertRow = UpdateBuffer( rRow, NULL, _xCols );
- if ( bInsertRow )
- {
- sal_uInt32 nFileSize = 0, nMemoFileSize = 0;
-
- nFileSize = lcl_getFileSize(*m_pFileStream);
-
- if (HasMemoFields() && m_pMemoStream)
- {
- m_pMemoStream->Seek(STREAM_SEEK_TO_END);
- nMemoFileSize = m_pMemoStream->Tell();
- }
-
- if (!WriteBuffer())
- {
- m_pFileStream->SetStreamSize(nFileSize); // restore old size
-
- if (HasMemoFields() && m_pMemoStream)
- m_pMemoStream->SetStreamSize(nMemoFileSize); // restore old size
- m_nFilePos = nTempPos; // restore file position
- }
- else
- {
- (*m_pFileStream) << (char)DBF_EOL; // write EOL
- // raise number of datasets in the header:
- m_pFileStream->Seek( 4L );
- (*m_pFileStream) << (m_aHeader.db_anz + 1);
-
- // if AppendOnly no flush!
- if (bFlush)
- m_pFileStream->Flush();
-
- // raise number if successfully
- m_aHeader.db_anz++;
- *rRow.get()[0] = m_nFilePos; // set bookmark
- m_nFilePos = nTempPos;
- }
- }
- else
- m_nFilePos = nTempPos;
-
- return bInsertRow;
-}
-
-//------------------------------------------------------------------
-sal_Bool ODbaseTable::UpdateRow(OValueRefVector& rRow, OValueRefRow& pOrgRow,const Reference<XIndexAccess>& _xCols)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::UpdateRow" );
- // fill buffer with blanks
- AllocBuffer();
-
- // position on desired record:
- long nPos = m_aHeader.db_kopf + (long)(m_nFilePos-1) * m_aHeader.db_slng;
- m_pFileStream->Seek(nPos);
- m_pFileStream->Read((char*)m_pBuffer, m_aHeader.db_slng);
-
- sal_uInt32 nMemoFileSize( 0 );
- if (HasMemoFields() && m_pMemoStream)
- {
- m_pMemoStream->Seek(STREAM_SEEK_TO_END);
- nMemoFileSize = m_pMemoStream->Tell();
- }
- if (!UpdateBuffer(rRow, pOrgRow,_xCols) || !WriteBuffer())
- {
- if (HasMemoFields() && m_pMemoStream)
- m_pMemoStream->SetStreamSize(nMemoFileSize); // restore old size
- }
- else
- {
- m_pFileStream->Flush();
- }
- return sal_True;
-}
-
-//------------------------------------------------------------------
-sal_Bool ODbaseTable::DeleteRow(const OSQLColumns& _rCols)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::DeleteRow" );
- // Set the Delete-Flag (be it set or not):
- // Position on desired record:
- long nFilePos = m_aHeader.db_kopf + (long)(m_nFilePos-1) * m_aHeader.db_slng;
- m_pFileStream->Seek(nFilePos);
-
- OValueRefRow aRow = new OValueRefVector(_rCols.get().size());
-
- if (!fetchRow(aRow,_rCols,sal_True,sal_True))
- return sal_False;
-
- Reference<XPropertySet> xCol;
- ::rtl::OUString aColName;
- ::comphelper::UStringMixEqual aCase(isCaseSensitive());
- for (sal_uInt16 i = 0; i < m_pColumns->getCount(); i++)
- {
- Reference<XPropertySet> xIndex = isUniqueByColumnName(i);
- if (xIndex.is())
- {
- ::cppu::extractInterface(xCol,m_pColumns->getByIndex(i));
- OSL_ENSURE(xCol.is(),"ODbaseTable::DeleteRow column is null!");
- if(xCol.is())
- {
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName;
-
- Reference<XUnoTunnel> xTunnel(xIndex,UNO_QUERY);
- OSL_ENSURE(xTunnel.is(),"No TunnelImplementation!");
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
- OSL_ENSURE(pIndex,"ODbaseTable::DeleteRow: No Index returned!");
-
- OSQLColumns::Vector::const_iterator aIter = _rCols.get().begin();
- sal_Int32 nPos = 1;
- for(;aIter != _rCols.get().end();++aIter,++nPos)
- {
- if(aCase(getString((*aIter)->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME))),aColName))
- break;
- }
- if (aIter == _rCols.get().end())
- continue;
-
- pIndex->Delete(m_nFilePos,*(aRow->get())[nPos]);
- }
- }
- }
-
- m_pFileStream->Seek(nFilePos);
- (*m_pFileStream) << (sal_uInt8)'*'; // mark the row in the table as deleted
- m_pFileStream->Flush();
- return sal_True;
-}
-// -------------------------------------------------------------------------
-Reference<XPropertySet> ODbaseTable::isUniqueByColumnName(sal_Int32 _nColumnPos)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::isUniqueByColumnName" );
- if(!m_pIndexes)
- refreshIndexes();
- if(m_pIndexes->hasElements())
- {
- Reference<XPropertySet> xCol;
- m_pColumns->getByIndex(_nColumnPos) >>= xCol;
- OSL_ENSURE(xCol.is(),"ODbaseTable::isUniqueByColumnName column is null!");
- ::rtl::OUString sColName;
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sColName;
-
- Reference<XPropertySet> xIndex;
- for(sal_Int32 i=0;i<m_pIndexes->getCount();++i)
- {
- ::cppu::extractInterface(xIndex,m_pIndexes->getByIndex(i));
- if(xIndex.is() && getBOOL(xIndex->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE))))
- {
- Reference<XNameAccess> xCols(Reference<XColumnsSupplier>(xIndex,UNO_QUERY)->getColumns());
- if(xCols->hasByName(sColName))
- return xIndex;
-
- }
- }
- }
- return Reference<XPropertySet>();
-}
-//------------------------------------------------------------------
-double toDouble(const ByteString& rString)
-{
- return ::rtl::math::stringToDouble( rString, '.', ',', NULL, NULL );
-}
-
-//------------------------------------------------------------------
-sal_Bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const Reference<XIndexAccess>& _xCols)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::UpdateBuffer" );
- OSL_ENSURE(m_pBuffer,"Buffer is NULL!");
- if ( !m_pBuffer )
- return sal_False;
- sal_Int32 nByteOffset = 1;
-
- // Update fields:
- Reference<XPropertySet> xCol;
- Reference<XPropertySet> xIndex;
- sal_uInt16 i;
- ::rtl::OUString aColName;
- const sal_Int32 nColumnCount = m_pColumns->getCount();
- ::std::vector< Reference<XPropertySet> > aIndexedCols(nColumnCount);
-
- ::comphelper::UStringMixEqual aCase(isCaseSensitive());
-
- Reference<XIndexAccess> xColumns = m_pColumns;
- // first search a key that exist already in the table
- for (i = 0; i < nColumnCount; ++i)
- {
- sal_Int32 nPos = i;
- if(_xCols != xColumns)
- {
- m_pColumns->getByIndex(i) >>= xCol;
- OSL_ENSURE(xCol.is(),"ODbaseTable::UpdateBuffer column is null!");
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName;
-
- for(nPos = 0;nPos<_xCols->getCount();++nPos)
- {
- Reference<XPropertySet> xFindCol;
- ::cppu::extractInterface(xFindCol,_xCols->getByIndex(nPos));
- OSL_ENSURE(xFindCol.is(),"ODbaseTable::UpdateBuffer column is null!");
- if(aCase(getString(xFindCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))),aColName))
- break;
- }
- if (nPos >= _xCols->getCount())
- continue;
- }
-
- ++nPos;
- xIndex = isUniqueByColumnName(i);
- aIndexedCols[i] = xIndex;
- if (xIndex.is())
- {
- // first check if the value is different to the old one and when if it conform to the index
- if(pOrgRow.is() && (rRow.get()[nPos]->getValue().isNull() || rRow.get()[nPos] == (pOrgRow->get())[nPos]))
- continue;
- else
- {
- Reference<XUnoTunnel> xTunnel(xIndex,UNO_QUERY);
- OSL_ENSURE(xTunnel.is(),"No TunnelImplementation!");
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
- OSL_ENSURE(pIndex,"ODbaseTable::UpdateBuffer: No Index returned!");
-
- if (pIndex->Find(0,*rRow.get()[nPos]))
- {
- // There is no unique value
- if ( !aColName.getLength() )
- {
- m_pColumns->getByIndex(i) >>= xCol;
- OSL_ENSURE(xCol.is(),"ODbaseTable::UpdateBuffer column is null!");
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName;
- xCol.clear();
- } // if ( !aColName.getLength() )
- const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
- STR_DUPLICATE_VALUE_IN_COLUMN
- ,"$columnname$", aColName
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
- }
- }
- }
- }
-
- // when we are here there is no double key in the table
-
- for (i = 0; i < nColumnCount && nByteOffset <= m_nBufferSize ; ++i)
- {
- // Lengths for each data type:
- OSL_ENSURE(i < m_aPrecisions.size(),"Illegal index!");
- sal_Int32 nLen = 0;
- sal_Int32 nType = 0;
- sal_Int32 nScale = 0;
- if ( i < m_aPrecisions.size() )
- {
- nLen = m_aPrecisions[i];
- nType = m_aTypes[i];
- nScale = m_aScales[i];
- }
- else
- {
- m_pColumns->getByIndex(i) >>= xCol;
- if ( xCol.is() )
- {
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)) >>= nLen;
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)) >>= nScale;
- }
- }
-
- bool bSetZero = false;
- switch (nType)
- {
- case DataType::INTEGER:
- case DataType::DOUBLE:
- case DataType::TIMESTAMP:
- bSetZero = true;
- case DataType::LONGVARBINARY:
- case DataType::DATE:
- case DataType::BIT:
- case DataType::LONGVARCHAR:
- nLen = m_aRealFieldLengths[i];
- break;
- case DataType::DECIMAL:
- nLen = SvDbaseConverter::ConvertPrecisionToDbase(nLen,nScale);
- break; // The sign and the comma
- default:
- break;
-
- } // switch (nType)
-
- sal_Int32 nPos = i;
- if(_xCols != xColumns)
- {
- m_pColumns->getByIndex(i) >>= xCol;
- OSL_ENSURE(xCol.is(),"ODbaseTable::UpdateBuffer column is null!");
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName;
- for(nPos = 0;nPos<_xCols->getCount();++nPos)
- {
- Reference<XPropertySet> xFindCol;
- ::cppu::extractInterface(xFindCol,_xCols->getByIndex(nPos));
- if(aCase(getString(xFindCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))),aColName))
- break;
- }
- if (nPos >= _xCols->getCount())
- {
- nByteOffset += nLen;
- continue;
- }
- }
-
-
-
- ++nPos; // the row values start at 1
- // If the variable is bound at all?
- if ( !rRow.get()[nPos]->isBound() )
- {
- // No - the next field.
- nByteOffset += nLen;
- continue;
- }
- if (aIndexedCols[i].is())
- {
- Reference<XUnoTunnel> xTunnel(aIndexedCols[i],UNO_QUERY);
- OSL_ENSURE(xTunnel.is(),"No TunnelImplementation!");
- ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
- OSL_ENSURE(pIndex,"ODbaseTable::UpdateBuffer: No Index returned!");
- // Update !!
- if (pOrgRow.is() && !rRow.get()[nPos]->getValue().isNull() )
- pIndex->Update(m_nFilePos,*(pOrgRow->get())[nPos],*rRow.get()[nPos]);
- else
- pIndex->Insert(m_nFilePos,*rRow.get()[nPos]);
- }
-
- char* pData = (char *)(m_pBuffer + nByteOffset);
- if (rRow.get()[nPos]->getValue().isNull())
- {
- if ( bSetZero )
- memset(pData,0,nLen); // Clear to NULL
- else
- memset(pData,' ',nLen); // Clear to NULL
- nByteOffset += nLen;
- OSL_ENSURE( nByteOffset <= m_nBufferSize ,"ByteOffset > m_nBufferSize!");
- continue;
- }
-
- try
- {
- switch (nType)
- {
- case DataType::TIMESTAMP:
- {
- sal_Int32 nJulianDate = 0, nJulianTime = 0;
- lcl_CalcJulDate(nJulianDate,nJulianTime,rRow.get()[nPos]->getValue());
- // Exactly 8 bytes to copy:
- memcpy(pData,&nJulianDate,4);
- memcpy(pData+4,&nJulianTime,4);
- }
- break;
- case DataType::DATE:
- {
- ::com::sun::star::util::Date aDate;
- if(rRow.get()[nPos]->getValue().getTypeKind() == DataType::DOUBLE)
- aDate = ::dbtools::DBTypeConversion::toDate(rRow.get()[nPos]->getValue().getDouble());
- else
- aDate = rRow.get()[nPos]->getValue();
- char s[9];
- snprintf(s,
- sizeof(s),
- "%04d%02d%02d",
- (int)aDate.Year,
- (int)aDate.Month,
- (int)aDate.Day);
-
- // Exactly 8 bytes to copy:
- strncpy(pData,s,sizeof s - 1);
- } break;
- case DataType::INTEGER:
- {
- sal_Int32 nValue = rRow.get()[nPos]->getValue();
- memcpy(pData,&nValue,nLen);
- }
- break;
- case DataType::DOUBLE:
- {
- const double d = rRow.get()[nPos]->getValue();
- m_pColumns->getByIndex(i) >>= xCol;
-
- if (getBOOL(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)))) // Currency is treated separately
- {
- sal_Int64 nValue = 0;
- if ( m_aScales[i] )
- nValue = (sal_Int64)(d * pow(10.0,(int)m_aScales[i]));
- else
- nValue = (sal_Int64)(d);
- memcpy(pData,&nValue,nLen);
- } // if (getBOOL(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)))) // Currency is treated separately
- else
- memcpy(pData,&d,nLen);
- }
- break;
- case DataType::DECIMAL:
- {
- memset(pData,' ',nLen); // Clear to NULL
-
- const double n = rRow.get()[nPos]->getValue();
-
- // one, because const_cast GetFormatPrecision on SvNumberFormat is not constant,
- // even though it really could and should be
- const ByteString aDefaultValue( ::rtl::math::doubleToString( n, rtl_math_StringFormat_F, nScale, '.', NULL, 0));
- const sal_Int32 nValueLen = aDefaultValue.Len();
- if ( nValueLen <= nLen )
- {
- // Write value right-justified, padded with blanks to the left.
- memcpy(pData+nLen-nValueLen,aDefaultValue.GetBuffer(),nValueLen);
- // write the resulting double back
- *rRow.get()[nPos] = toDouble(aDefaultValue);
- }
- else
- {
- m_pColumns->getByIndex(i) >>= xCol;
- OSL_ENSURE(xCol.is(),"ODbaseTable::UpdateBuffer column is null!");
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName;
- ::std::list< ::std::pair<const sal_Char* , ::rtl::OUString > > aStringToSubstitutes;
- aStringToSubstitutes.push_back(::std::pair<const sal_Char* , ::rtl::OUString >("$columnname$", aColName));
- aStringToSubstitutes.push_back(::std::pair<const sal_Char* , ::rtl::OUString >("$precision$", String::CreateFromInt32(nLen)));
- aStringToSubstitutes.push_back(::std::pair<const sal_Char* , ::rtl::OUString >("$scale$", String::CreateFromInt32(nScale)));
- aStringToSubstitutes.push_back(::std::pair<const sal_Char* , ::rtl::OUString >("$value$", ::rtl::OStringToOUString(aDefaultValue,RTL_TEXTENCODING_UTF8)));
-
- const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
- STR_INVALID_COLUMN_DECIMAL_VALUE
- ,aStringToSubstitutes
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
- }
- } break;
- case DataType::BIT:
- *pData = rRow.get()[nPos]->getValue().getBool() ? 'T' : 'F';
- break;
- case DataType::LONGVARBINARY:
- case DataType::LONGVARCHAR:
- {
- char cNext = pData[nLen]; // Mark's scratch and replaced by 0
- pData[nLen] = '\0'; // This is because the buffer is always a sign of greater ...
-
- sal_uIntPtr nBlockNo = strtol((const char *)pData,NULL,10); // Block number read
-
- // Next initial character restore again:
- pData[nLen] = cNext;
- if (!m_pMemoStream || !WriteMemo(rRow.get()[nPos]->get(), nBlockNo))
- break;
-
- ByteString aStr;
- ByteString aBlock(rtl::OString::valueOf(static_cast<sal_Int32>(nBlockNo)));
- aStr.Expand(static_cast<sal_uInt16>(nLen - aBlock.Len()), '0' );
- aStr += aBlock;
- // Copy characters:
- memset(pData,' ',nLen); // Clear to NULL
- memcpy(pData, aStr.GetBuffer(), nLen);
- } break;
- default:
- {
- memset(pData,' ',nLen); // Clear to NULL
-
- ::rtl::OUString sStringToWrite( rRow.get()[nPos]->getValue().getString() );
-
- // convert the string, using the connection's encoding
- ::rtl::OString sEncoded;
-
- DBTypeConversion::convertUnicodeStringToLength( sStringToWrite, sEncoded, nLen, m_eEncoding );
- memcpy( pData, sEncoded.getStr(), sEncoded.getLength() );
-
- }
- break;
- }
- }
- catch( const SQLException& )
- {
- throw;
- }
- catch ( const Exception& )
- {
- m_pColumns->getByIndex(i) >>= xCol;
- OSL_ENSURE( xCol.is(), "ODbaseTable::UpdateBuffer column is null!" );
- if ( xCol.is() )
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName;
-
- const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
- STR_INVALID_COLUMN_VALUE,
- "$columnname$", aColName
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
- }
- // And more ...
- nByteOffset += nLen;
- OSL_ENSURE( nByteOffset <= m_nBufferSize ,"ByteOffset > m_nBufferSize!");
- }
- return sal_True;
-}
-
-// -----------------------------------------------------------------------------
-sal_Bool ODbaseTable::WriteMemo(ORowSetValue& aVariable, sal_uIntPtr& rBlockNr)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::WriteMemo" );
- // if the BlockNo 0 is given, the block will be appended at the end
- sal_uIntPtr nSize = 0;
- ::rtl::OString aStr;
- ::com::sun::star::uno::Sequence<sal_Int8> aValue;
- sal_uInt8 nHeader[4];
- const bool bBinary = aVariable.getTypeKind() == DataType::LONGVARBINARY && m_aMemoHeader.db_typ == MemoFoxPro;
- if ( bBinary )
- {
- aValue = aVariable.getSequence();
- nSize = aValue.getLength();
- }
- else
- {
- nSize = DBTypeConversion::convertUnicodeString( aVariable.getString(), aStr, m_eEncoding );
- }
-
- // append or overwrite
- sal_Bool bAppend = rBlockNr == 0;
-
- if (!bAppend)
- {
- switch (m_aMemoHeader.db_typ)
- {
- case MemodBaseIII: // dBase III-Memofield, ends with 2 * Ctrl-Z
- bAppend = nSize > (512 - 2);
- break;
- case MemoFoxPro:
- case MemodBaseIV: // dBase IV-Memofield with length
- {
- char sHeader[4];
- m_pMemoStream->Seek(rBlockNr * m_aMemoHeader.db_size);
- m_pMemoStream->SeekRel(4L);
- m_pMemoStream->Read(sHeader,4);
-
- sal_uIntPtr nOldSize;
- if (m_aMemoHeader.db_typ == MemoFoxPro)
- nOldSize = ((((unsigned char)sHeader[0]) * 256 +
- (unsigned char)sHeader[1]) * 256 +
- (unsigned char)sHeader[2]) * 256 +
- (unsigned char)sHeader[3];
- else
- nOldSize = ((((unsigned char)sHeader[3]) * 256 +
- (unsigned char)sHeader[2]) * 256 +
- (unsigned char)sHeader[1]) * 256 +
- (unsigned char)sHeader[0] - 8;
-
- // fits the new length in the used blocks
- sal_uIntPtr nUsedBlocks = ((nSize + 8) / m_aMemoHeader.db_size) + (((nSize + 8) % m_aMemoHeader.db_size > 0) ? 1 : 0),
- nOldUsedBlocks = ((nOldSize + 8) / m_aMemoHeader.db_size) + (((nOldSize + 8) % m_aMemoHeader.db_size > 0) ? 1 : 0);
- bAppend = nUsedBlocks > nOldUsedBlocks;
- }
- }
- }
-
- if (bAppend)
- {
- sal_uIntPtr nStreamSize = m_pMemoStream->Seek(STREAM_SEEK_TO_END);
- // fill last block
- rBlockNr = (nStreamSize / m_aMemoHeader.db_size) + ((nStreamSize % m_aMemoHeader.db_size) > 0 ? 1 : 0);
-
- m_pMemoStream->SetStreamSize(rBlockNr * m_aMemoHeader.db_size);
- m_pMemoStream->Seek(STREAM_SEEK_TO_END);
- }
- else
- {
- m_pMemoStream->Seek(rBlockNr * m_aMemoHeader.db_size);
- }
-
- switch (m_aMemoHeader.db_typ)
- {
- case MemodBaseIII: // dBase III-Memofield, ends with Ctrl-Z
- {
- const char cEOF = (char) DBF_EOL;
- nSize++;
- m_pMemoStream->Write( aStr.getStr(), aStr.getLength() );
- (*m_pMemoStream) << cEOF << cEOF;
- } break;
- case MemoFoxPro:
- case MemodBaseIV: // dBase IV-Memofeld with length
- {
- if ( MemodBaseIV == m_aMemoHeader.db_typ )
- (*m_pMemoStream) << (sal_uInt8)0xFF
- << (sal_uInt8)0xFF
- << (sal_uInt8)0x08;
- else
- (*m_pMemoStream) << (sal_uInt8)0x00
- << (sal_uInt8)0x00
- << (sal_uInt8)0x00;
-
- sal_uInt32 nWriteSize = nSize;
- if (m_aMemoHeader.db_typ == MemoFoxPro)
- {
- if ( bBinary )
- (*m_pMemoStream) << (sal_uInt8) 0x00; // Picture
- else
- (*m_pMemoStream) << (sal_uInt8) 0x01; // Memo
- for (int i = 4; i > 0; nWriteSize >>= 8)
- nHeader[--i] = (sal_uInt8) (nWriteSize % 256);
- }
- else
- {
- (*m_pMemoStream) << (sal_uInt8) 0x00;
- nWriteSize += 8;
- for (int i = 0; i < 4; nWriteSize >>= 8)
- nHeader[i++] = (sal_uInt8) (nWriteSize % 256);
- }
-
- m_pMemoStream->Write(nHeader,4);
- if ( bBinary )
- m_pMemoStream->Write( aValue.getConstArray(), aValue.getLength() );
- else
- m_pMemoStream->Write( aStr.getStr(), aStr.getLength() );
- m_pMemoStream->Flush();
- }
- }
-
-
- // Write the new block number
- if (bAppend)
- {
- sal_uIntPtr nStreamSize = m_pMemoStream->Seek(STREAM_SEEK_TO_END);
- m_aMemoHeader.db_next = (nStreamSize / m_aMemoHeader.db_size) + ((nStreamSize % m_aMemoHeader.db_size) > 0 ? 1 : 0);
-
- // Write the new block number
- m_pMemoStream->Seek(0L);
- (*m_pMemoStream) << m_aMemoHeader.db_next;
- m_pMemoStream->Flush();
- }
- return sal_True;
-}
-
-// -----------------------------------------------------------------------------
-// XAlterTable
-void SAL_CALL ODbaseTable::alterColumnByName( const ::rtl::OUString& colName, const Reference< XPropertySet >& descriptor ) throw(SQLException, NoSuchElementException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::alterColumnByName" );
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
-
-
- Reference<XDataDescriptorFactory> xOldColumn;
- m_pColumns->getByName(colName) >>= xOldColumn;
-
- alterColumn(m_pColumns->findColumn(colName)-1,descriptor,xOldColumn);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODbaseTable::alterColumnByIndex( sal_Int32 index, const Reference< XPropertySet >& descriptor ) throw(SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::alterColumnByIndex" );
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
-
- if(index < 0 || index >= m_pColumns->getCount())
- throw IndexOutOfBoundsException(::rtl::OUString::valueOf(index),*this);
-
- Reference<XDataDescriptorFactory> xOldColumn;
- m_pColumns->getByIndex(index) >>= xOldColumn;
- alterColumn(index,descriptor,xOldColumn);
-}
-// -----------------------------------------------------------------------------
-void ODbaseTable::alterColumn(sal_Int32 index,
- const Reference< XPropertySet >& descriptor ,
- const Reference< XDataDescriptorFactory >& xOldColumn )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::alterColumn" );
- if(index < 0 || index >= m_pColumns->getCount())
- throw IndexOutOfBoundsException(::rtl::OUString::valueOf(index),*this);
-
- ODbaseTable* pNewTable = NULL;
- try
- {
- OSL_ENSURE(descriptor.is(),"ODbaseTable::alterColumn: descriptor can not be null!");
- // creates a copy of the the original column and copy all properties from descriptor in xCopyColumn
- Reference<XPropertySet> xCopyColumn;
- if(xOldColumn.is())
- xCopyColumn = xOldColumn->createDataDescriptor();
- else
- xCopyColumn = new OColumn(getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers());
-
- ::comphelper::copyProperties(descriptor,xCopyColumn);
-
- // creates a temp file
-
- String sTempName = createTempFile();
-
- pNewTable = new ODbaseTable(m_pTables,static_cast<ODbaseConnection*>(m_pConnection));
- Reference<XPropertySet> xHoldTable = pNewTable;
- pNewTable->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME),makeAny(::rtl::OUString(sTempName)));
- Reference<XAppend> xAppend(pNewTable->getColumns(),UNO_QUERY);
- OSL_ENSURE(xAppend.is(),"ODbaseTable::alterColumn: No XAppend interface!");
-
- // copy the structure
- sal_Int32 i=0;
- for(;i < index;++i)
- {
- Reference<XPropertySet> xProp;
- m_pColumns->getByIndex(i) >>= xProp;
- Reference<XDataDescriptorFactory> xColumn(xProp,UNO_QUERY);
- Reference<XPropertySet> xCpy;
- if(xColumn.is())
- xCpy = xColumn->createDataDescriptor();
- else
- xCpy = new OColumn(getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers());
- ::comphelper::copyProperties(xProp,xCpy);
- xAppend->appendByDescriptor(xCpy);
- }
- ++i; // now insert our new column
- xAppend->appendByDescriptor(xCopyColumn);
-
- for(;i < m_pColumns->getCount();++i)
- {
- Reference<XPropertySet> xProp;
- m_pColumns->getByIndex(i) >>= xProp;
- Reference<XDataDescriptorFactory> xColumn(xProp,UNO_QUERY);
- Reference<XPropertySet> xCpy;
- if(xColumn.is())
- xCpy = xColumn->createDataDescriptor();
- else
- xCpy = new OColumn(getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers());
- ::comphelper::copyProperties(xProp,xCpy);
- xAppend->appendByDescriptor(xCpy);
- }
-
- // construct the new table
- if(!pNewTable->CreateImpl())
- {
- const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
- STR_COLUMN_NOT_ALTERABLE,
- "$columnname$", ::comphelper::getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)))
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
- }
-
- pNewTable->construct();
-
- // copy the data
- copyData(pNewTable,0);
-
- // now drop the old one
- if( DropImpl() ) // we don't want to delete the memo columns too
- {
- // rename the new one to the old one
- pNewTable->renameImpl(m_Name);
- // release the temp file
- pNewTable = NULL;
- ::comphelper::disposeComponent(xHoldTable);
- }
- else
- {
- pNewTable = NULL;
- }
- FileClose();
- construct();
- if(m_pColumns)
- m_pColumns->refresh();
-
- }
- catch(const SQLException&)
- {
- throw;
- }
- catch(const Exception&)
- {
- OSL_FAIL("ODbaseTable::alterColumn: Exception occurred!");
- throw;
- }
-}
-// -----------------------------------------------------------------------------
-Reference< XDatabaseMetaData> ODbaseTable::getMetaData() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::getMetaData" );
- return getConnection()->getMetaData();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODbaseTable::rename( const ::rtl::OUString& newName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::rename" );
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
- if(m_pTables && m_pTables->hasByName(newName))
- throw ElementExistException(newName,*this);
-
-
- renameImpl(newName);
-
- ODbaseTable_BASE::rename(newName);
-
- construct();
- if(m_pColumns)
- m_pColumns->refresh();
-}
-namespace
-{
- void renameFile(OConnection* _pConenction,const ::rtl::OUString& oldName,
- const ::rtl::OUString& newName,const String& _sExtension)
- {
- String aName = ODbaseTable::getEntry(_pConenction,oldName);
- if(!aName.Len())
- {
- ::rtl::OUString aIdent = _pConenction->getContent()->getIdentifier()->getContentIdentifier();
- if ( aIdent.lastIndexOf('/') != (aIdent.getLength()-1) )
- aIdent += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aIdent += oldName;
- aName = aIdent;
- }
- INetURLObject aURL;
- aURL.SetURL(aName);
-
- aURL.setExtension( _sExtension );
- String sNewName(newName);
- sNewName.AppendAscii(".");
- sNewName += _sExtension;
-
- try
- {
- Content aContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference<XCommandEnvironment>());
-
- Sequence< PropertyValue > aProps( 1 );
- aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title"));
- aProps[0].Handle = -1; // n/a
- aProps[0].Value = makeAny( ::rtl::OUString(sNewName) );
- Sequence< Any > aValues;
- aContent.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("setPropertyValues")),makeAny(aProps) ) >>= aValues;
- if(aValues.getLength() && aValues[0].hasValue())
- throw Exception();
- }
- catch(const Exception&)
- {
- throw ElementExistException(newName,NULL);
- }
- }
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODbaseTable::renameImpl( const ::rtl::OUString& newName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::getEntry" );
- ::osl::MutexGuard aGuard(m_aMutex);
-
- FileClose();
-
-
- renameFile(m_pConnection,m_Name,newName,m_pConnection->getExtension());
- if ( HasMemoFields() )
- { // delete the memo fields
- String sExt = String::CreateFromAscii("dbt");
- renameFile(m_pConnection,m_Name,newName,sExt);
- }
-}
-// -----------------------------------------------------------------------------
-void ODbaseTable::addColumn(const Reference< XPropertySet >& _xNewColumn)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::addColumn" );
- String sTempName = createTempFile();
-
- ODbaseTable* pNewTable = new ODbaseTable(m_pTables,static_cast<ODbaseConnection*>(m_pConnection));
- Reference< XPropertySet > xHold = pNewTable;
- pNewTable->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME),makeAny(::rtl::OUString(sTempName)));
- {
- Reference<XAppend> xAppend(pNewTable->getColumns(),UNO_QUERY);
- sal_Bool bCase = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers();
- // copy the structure
- for(sal_Int32 i=0;i < m_pColumns->getCount();++i)
- {
- Reference<XPropertySet> xProp;
- m_pColumns->getByIndex(i) >>= xProp;
- Reference<XDataDescriptorFactory> xColumn(xProp,UNO_QUERY);
- Reference<XPropertySet> xCpy;
- if(xColumn.is())
- xCpy = xColumn->createDataDescriptor();
- else
- {
- xCpy = new OColumn(bCase);
- ::comphelper::copyProperties(xProp,xCpy);
- }
-
- xAppend->appendByDescriptor(xCpy);
- }
- Reference<XPropertySet> xCpy = new OColumn(bCase);
- ::comphelper::copyProperties(_xNewColumn,xCpy);
- xAppend->appendByDescriptor(xCpy);
- }
-
- // construct the new table
- if(!pNewTable->CreateImpl())
- {
- const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
- STR_COLUMN_NOT_ADDABLE,
- "$columnname$", ::comphelper::getString(_xNewColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)))
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
- }
-
- sal_Bool bAlreadyDroped = sal_False;
- try
- {
- pNewTable->construct();
- // copy the data
- copyData(pNewTable,pNewTable->m_pColumns->getCount());
- // drop the old table
- if(DropImpl())
- {
- bAlreadyDroped = sal_True;
- pNewTable->renameImpl(m_Name);
- // release the temp file
- }
- xHold = pNewTable = NULL;
-
- FileClose();
- construct();
- if(m_pColumns)
- m_pColumns->refresh();
- }
- catch(const SQLException&)
- {
- // here we know that the old table wasn't droped before
- if(!bAlreadyDroped)
- xHold = pNewTable = NULL;
-
- throw;
- }
-}
-// -----------------------------------------------------------------------------
-void ODbaseTable::dropColumn(sal_Int32 _nPos)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::dropColumn" );
- String sTempName = createTempFile();
-
- ODbaseTable* pNewTable = new ODbaseTable(m_pTables,static_cast<ODbaseConnection*>(m_pConnection));
- Reference< XPropertySet > xHold = pNewTable;
- pNewTable->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME),makeAny(::rtl::OUString(sTempName)));
- {
- Reference<XAppend> xAppend(pNewTable->getColumns(),UNO_QUERY);
- sal_Bool bCase = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers();
- // copy the structure
- for(sal_Int32 i=0;i < m_pColumns->getCount();++i)
- {
- if(_nPos != i)
- {
- Reference<XPropertySet> xProp;
- m_pColumns->getByIndex(i) >>= xProp;
- Reference<XDataDescriptorFactory> xColumn(xProp,UNO_QUERY);
- Reference<XPropertySet> xCpy;
- if(xColumn.is())
- xCpy = xColumn->createDataDescriptor();
- else
- {
- xCpy = new OColumn(bCase);
- ::comphelper::copyProperties(xProp,xCpy);
- }
- xAppend->appendByDescriptor(xCpy);
- }
- }
- }
-
- // construct the new table
- if(!pNewTable->CreateImpl())
- {
- xHold = pNewTable = NULL;
- const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
- STR_COLUMN_NOT_DROP,
- "$position$", ::rtl::OUString::valueOf(_nPos)
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
- }
- pNewTable->construct();
- // copy the data
- copyData(pNewTable,_nPos);
- // drop the old table
- if(DropImpl())
- pNewTable->renameImpl(m_Name);
- // release the temp file
-
- xHold = pNewTable = NULL;
-
- FileClose();
- construct();
-}
-// -----------------------------------------------------------------------------
-String ODbaseTable::createTempFile()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::createTempFile" );
- ::rtl::OUString aIdent = m_pConnection->getContent()->getIdentifier()->getContentIdentifier();
- if ( aIdent.lastIndexOf('/') != (aIdent.getLength()-1) )
- aIdent += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- String sTempName(aIdent);
- String sExt;
- sExt.AssignAscii(".");
- sExt += m_pConnection->getExtension();
-
- String sName(m_Name);
- TempFile aTempFile(sName,&sExt,&sTempName);
- if(!aTempFile.IsValid())
- getConnection()->throwGenericSQLException(STR_COULD_NOT_ALTER_TABLE,*this);
-
- INetURLObject aURL;
- aURL.SetSmartProtocol(INET_PROT_FILE);
- aURL.SetURL(aTempFile.GetURL());
-
- String sNewName(aURL.getName());
- sNewName.Erase(sNewName.Len() - sExt.Len());
- return sNewName;
-}
-// -----------------------------------------------------------------------------
-void ODbaseTable::copyData(ODbaseTable* _pNewTable,sal_Int32 _nPos)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::copyData" );
- sal_Int32 nPos = _nPos + 1; // +1 because we always have the bookmark clumn as well
- OValueRefRow aRow = new OValueRefVector(m_pColumns->getCount());
- OValueRefRow aInsertRow;
- if(_nPos)
- {
- aInsertRow = new OValueRefVector(_pNewTable->m_pColumns->getCount());
- ::std::for_each(aInsertRow->get().begin(),aInsertRow->get().end(),TSetRefBound(sal_True));
- }
- else
- aInsertRow = aRow;
-
- // we only have to bind the values which we need to copy into the new table
- ::std::for_each(aRow->get().begin(),aRow->get().end(),TSetRefBound(sal_True));
- if(_nPos && (_nPos < (sal_Int32)aRow->get().size()))
- (aRow->get())[nPos]->setBound(sal_False);
-
-
- sal_Bool bOk = sal_True;
- sal_Int32 nCurPos;
- OValueRefVector::Vector::iterator aIter;
- for(sal_uInt32 nRowPos = 0; nRowPos < m_aHeader.db_anz;++nRowPos)
- {
- bOk = seekRow( IResultSetHelper::BOOKMARK, nRowPos+1, nCurPos );
- if ( bOk )
- {
- bOk = fetchRow( aRow, *m_aColumns, sal_True, sal_True);
- if ( bOk && !aRow->isDeleted() ) // copy only not deleted rows
- {
- // special handling when pos == 0 then we don't have to distinguish between the two rows
- if(_nPos)
- {
- aIter = aRow->get().begin()+1;
- sal_Int32 nCount = 1;
- for(OValueRefVector::Vector::iterator aInsertIter = aInsertRow->get().begin()+1; aIter != aRow->get().end() && aInsertIter != aInsertRow->get().end();++aIter,++nCount)
- {
- if(nPos != nCount)
- {
- (*aInsertIter)->setValue( (*aIter)->getValue() );
- ++aInsertIter;
- }
- }
- }
- bOk = _pNewTable->InsertRow(*aInsertRow,sal_True,_pNewTable->m_pColumns);
- OSL_ENSURE(bOk,"Row could not be inserted!");
- }
- else
- OSL_ENSURE(bOk,"Row could not be fetched!");
- }
- else
- {
- OSL_ASSERT(0);
- }
- } // for(sal_uInt32 nRowPos = 0; nRowPos < m_aHeader.db_anz;++nRowPos)
-}
-// -----------------------------------------------------------------------------
-void ODbaseTable::throwInvalidDbaseFormat()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::throwInvalidDbaseFormat" );
- FileClose();
- // no dbase file
-
- const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
- STR_INVALID_DBASE_FILE,
- "$filename$", getEntry(m_pConnection,m_Name)
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
-}
-// -----------------------------------------------------------------------------
-void ODbaseTable::refreshHeader()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::refreshHeader" );
- if ( m_aHeader.db_anz == 0 )
- readHeader();
-}
-//------------------------------------------------------------------
-sal_Bool ODbaseTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::seekRow" );
- // ----------------------------------------------------------
- // prepare positioning:
- OSL_ENSURE(m_pFileStream,"ODbaseTable::seekRow: FileStream is NULL!");
-
- sal_uInt32 nNumberOfRecords = (sal_uInt32)m_aHeader.db_anz;
- sal_uInt32 nTempPos = m_nFilePos;
- m_nFilePos = nCurPos;
-
- switch(eCursorPosition)
- {
- case IResultSetHelper::NEXT:
- ++m_nFilePos;
- break;
- case IResultSetHelper::PRIOR:
- if (m_nFilePos > 0)
- --m_nFilePos;
- break;
- case IResultSetHelper::FIRST:
- m_nFilePos = 1;
- break;
- case IResultSetHelper::LAST:
- m_nFilePos = nNumberOfRecords;
- break;
- case IResultSetHelper::RELATIVE:
- m_nFilePos = (((sal_Int32)m_nFilePos) + nOffset < 0) ? 0L
- : (sal_uInt32)(((sal_Int32)m_nFilePos) + nOffset);
- break;
- case IResultSetHelper::ABSOLUTE:
- case IResultSetHelper::BOOKMARK:
- m_nFilePos = (sal_uInt32)nOffset;
- break;
- }
-
- if (m_nFilePos > (sal_Int32)nNumberOfRecords)
- m_nFilePos = (sal_Int32)nNumberOfRecords + 1;
-
- if (m_nFilePos == 0 || m_nFilePos == (sal_Int32)nNumberOfRecords + 1)
- goto Error;
- else
- {
- sal_uInt16 nEntryLen = m_aHeader.db_slng;
-
- OSL_ENSURE(m_nFilePos >= 1,"SdbDBFCursor::FileFetchRow: ungueltige Record-Position");
- sal_Int32 nPos = m_aHeader.db_kopf + (sal_Int32)(m_nFilePos-1) * nEntryLen;
-
- m_pFileStream->Seek(nPos);
- if (m_pFileStream->GetError() != ERRCODE_NONE)
- goto Error;
-
- m_pFileStream->Read((char*)m_pBuffer, nEntryLen);
- if (m_pFileStream->GetError() != ERRCODE_NONE)
- goto Error;
- }
- goto End;
-
-Error:
- switch(eCursorPosition)
- {
- case IResultSetHelper::PRIOR:
- case IResultSetHelper::FIRST:
- m_nFilePos = 0;
- break;
- case IResultSetHelper::LAST:
- case IResultSetHelper::NEXT:
- case IResultSetHelper::ABSOLUTE:
- case IResultSetHelper::RELATIVE:
- if (nOffset > 0)
- m_nFilePos = nNumberOfRecords + 1;
- else if (nOffset < 0)
- m_nFilePos = 0;
- break;
- case IResultSetHelper::BOOKMARK:
- m_nFilePos = nTempPos; // last position
- }
- return sal_False;
-
-End:
- nCurPos = m_nFilePos;
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODbaseTable::ReadMemo(sal_uIntPtr nBlockNo, ORowSetValue& aVariable)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::ReadMemo" );
- bool bIsText = true;
-
- m_pMemoStream->Seek(nBlockNo * m_aMemoHeader.db_size);
- switch (m_aMemoHeader.db_typ)
- {
- case MemodBaseIII: // dBase III-Memofield, ends with Ctrl-Z
- {
- const char cEOF = (char) DBF_EOL;
- ByteString aBStr;
- static char aBuf[514];
- aBuf[512] = 0; // avoid random value
- sal_Bool bReady = sal_False;
-
- do
- {
- m_pMemoStream->Read(&aBuf,512);
-
- sal_uInt16 i = 0;
- while (aBuf[i] != cEOF && ++i < 512)
- ;
- bReady = aBuf[i] == cEOF;
-
- aBuf[i] = 0;
- aBStr += aBuf;
-
- } while (!bReady && !m_pMemoStream->IsEof() && aBStr.Len() < STRING_MAXLEN);
-
- ::rtl::OUString aStr(aBStr.GetBuffer(), aBStr.Len(),m_eEncoding);
- aVariable = aStr;
-
- } break;
- case MemoFoxPro:
- case MemodBaseIV: // dBase IV-Memofield with length
- {
- char sHeader[4];
- m_pMemoStream->Read(sHeader,4);
- // Foxpro stores text and binary data
- if (m_aMemoHeader.db_typ == MemoFoxPro)
- {
- bIsText = sHeader[3] != 0;
- }
- else if (((sal_uInt8)sHeader[0]) != 0xFF || ((sal_uInt8)sHeader[1]) != 0xFF || ((sal_uInt8)sHeader[2]) != 0x08)
- {
- return sal_False;
- }
-
- sal_uInt32 nLength(0);
- (*m_pMemoStream) >> nLength;
-
- if (m_aMemoHeader.db_typ == MemodBaseIV)
- nLength -= 8;
-
- if ( nLength )
- {
- if ( bIsText )
- {
- ::rtl::OUStringBuffer aStr;
- while ( nLength > STRING_MAXLEN )
- {
- ByteString aBStr;
- aBStr.Expand(STRING_MAXLEN);
- m_pMemoStream->Read(aBStr.AllocBuffer(STRING_MAXLEN),STRING_MAXLEN);
- aStr.append(::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), m_eEncoding));
- nLength -= STRING_MAXLEN;
- }
- if ( nLength > 0 )
- {
- ByteString aBStr;
- aBStr.Expand(static_cast<xub_StrLen>(nLength));
- m_pMemoStream->Read(aBStr.AllocBuffer(static_cast<xub_StrLen>(nLength)),nLength);
- aStr.append(::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), m_eEncoding));
- }
- if ( aStr.getLength() )
- aVariable = aStr.makeStringAndClear();
- } // if ( bIsText )
- else
- {
- ::com::sun::star::uno::Sequence< sal_Int8 > aData(nLength);
- m_pMemoStream->Read(aData.getArray(),nLength);
- aVariable = aData;
- }
- } // if ( nLength )
- }
- }
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-void ODbaseTable::AllocBuffer()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::AllocBuffer" );
- sal_uInt16 nSize = m_aHeader.db_slng;
- OSL_ENSURE(nSize > 0, "Size too small");
-
- if (m_nBufferSize != nSize)
- {
- delete m_pBuffer;
- m_pBuffer = NULL;
- }
-
- // if there is no buffer available: allocate:
- if (m_pBuffer == NULL && nSize > 0)
- {
- m_nBufferSize = nSize;
- m_pBuffer = new sal_uInt8[m_nBufferSize+1];
- }
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODbaseTable::WriteBuffer()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::WriteBuffer" );
- OSL_ENSURE(m_nFilePos >= 1,"SdbDBFCursor::FileFetchRow: ungueltige Record-Position");
-
- // postion on desired record:
- long nPos = m_aHeader.db_kopf + (long)(m_nFilePos-1) * m_aHeader.db_slng;
- m_pFileStream->Seek(nPos);
- return m_pFileStream->Write((char*) m_pBuffer, m_aHeader.db_slng) > 0;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 ODbaseTable::getCurrentLastPos() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::getCurrentLastPos" );
- return m_aHeader.db_anz;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/DTables.cxx b/connectivity/source/drivers/dbase/DTables.cxx
deleted file mode 100644
index 7c4b452e87..0000000000
--- a/connectivity/source/drivers/dbase/DTables.cxx
+++ /dev/null
@@ -1,146 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DTables.hxx"
-#include "dbase/DTable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include "file/FCatalog.hxx"
-#include "file/FConnection.hxx"
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include "dbase/DCatalog.hxx"
-#include <comphelper/types.hxx>
-#include "resource/dbase_res.hrc"
-#include "connectivity/dbexception.hxx"
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::dbase;
-using namespace connectivity::file;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-namespace starutil = ::com::sun::star::util;
-
-sdbcx::ObjectType ODbaseTables::createObject(const ::rtl::OUString& _rName)
-{
- ::rtl::OUString aName,aSchema;
- ODbaseTable* pRet = new ODbaseTable(this,(ODbaseConnection*)static_cast<OFileCatalog&>(m_rParent).getConnection(),
- _rName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE")));
-
- sdbcx::ObjectType xRet = pRet;
- pRet->construct();
- return xRet;
-}
-// -------------------------------------------------------------------------
-void ODbaseTables::impl_refresh( ) throw(RuntimeException)
-{
- static_cast<ODbaseCatalog*>(&m_rParent)->refreshTables();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > ODbaseTables::createDescriptor()
-{
- return new ODbaseTable(this,(ODbaseConnection*)static_cast<OFileCatalog&>(m_rParent).getConnection());
-}
-typedef connectivity::sdbcx::OCollection ODbaseTables_BASE_BASE;
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType ODbaseTables::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- Reference<XUnoTunnel> xTunnel(descriptor,UNO_QUERY);
- if(xTunnel.is())
- {
- ODbaseTable* pTable = reinterpret_cast< ODbaseTable* >( xTunnel->getSomething(ODbaseTable::getUnoTunnelImplementationId()) );
- if(pTable)
- {
- pTable->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME),makeAny(_rForName));
- try
- {
- if(!pTable->CreateImpl())
- throw SQLException();
- }
- catch(SQLException&)
- {
- throw;
- }
- catch(Exception&)
- {
- throw SQLException();
- }
- }
- }
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void ODbaseTables::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName)
-{
- Reference< XUnoTunnel> xTunnel;
- try
- {
- xTunnel.set(getObject(_nPos),UNO_QUERY);
- }
- catch(const Exception&)
- {
- if(ODbaseTable::Drop_Static(ODbaseTable::getEntry(static_cast<OFileCatalog&>(m_rParent).getConnection(),_sElementName),sal_False,NULL))
- return;
- }
-
- if ( xTunnel.is() )
- {
- ODbaseTable* pTable = reinterpret_cast< ODbaseTable* >( xTunnel->getSomething(ODbaseTable::getUnoTunnelImplementationId()) );
- if(pTable)
- pTable->DropImpl();
- }
- else
- {
- const ::rtl::OUString sError( static_cast<OFileCatalog&>(m_rParent).getConnection()->getResources().getResourceStringWithSubstitution(
- STR_TABLE_NOT_DROP,
- "$tablename$", _sElementName
- ) );
- ::dbtools::throwGenericSQLException( sError, NULL );
- }
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL ODbaseTables::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- typedef sdbcx::OCollection OTables_BASE;
- return OTables_BASE::queryInterface(rType);
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/Dservices.cxx b/connectivity/source/drivers/dbase/Dservices.cxx
deleted file mode 100644
index 7bcc49e87a..0000000000
--- a/connectivity/source/drivers/dbase/Dservices.cxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/DDriver.hxx"
-#include <cppuhelper/factory.hxx>
-
-using namespace connectivity::dbase;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pT
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- ODriver::getImplementationName_Static(),
- ODriver::getSupportedServiceNames_Static(),
- ODriver_CreateInstance, ::cppu::createSingleFactory)
- ;
-
- if(aReq.xRet.is())
- aReq.xRet->acquire();
-
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/dbase.component b/connectivity/source/drivers/dbase/dbase.component
deleted file mode 100755
index 7f913f0836..0000000000
--- a/connectivity/source/drivers/dbase/dbase.component
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.sdbc.dbase.ODriver">
- <service name="com.sun.star.sdbc.Driver"/>
- <service name="com.sun.star.sdbcx.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/dbase/dbase.mxp.map b/connectivity/source/drivers/dbase/dbase.mxp.map
deleted file mode 100755
index 57a91423a1..0000000000
--- a/connectivity/source/drivers/dbase/dbase.mxp.map
+++ /dev/null
@@ -1,171 +0,0 @@
-component_getFactory
-__mh_dylib_header
-___builtin_delete
-___builtin_vec_delete
-___builtin_vec_new
-___check_eh_spec
-___cp_pop_exception
-___cp_push_exception
-___eh_alloc
-___get_eh_context
-___pure_virtual
-___rtti_class
-___rtti_si
-___rtti_user
-___sjthrow
-___start_cp_handler
-___terminate
-_terminate__Fv
-dyld_stub_binding_helper
-rest_world
-save_world
-___builtin_new
-___eh_rtime_match
-___tf9bad_alloc
-__._10bad_typeid
-__._8bad_cast
-___get_eh_info
-___is_pointer__FPv
-___throw_type_match_rtti
-___vt_10bad_typeid
-___vt_8bad_cast
-__keymgr_get_per_thread_data
-__keymgr_set_per_thread_data
-___tf9exception
-___ti9exception
-___vt_9exception
-_what__C9exception
-__._9bad_alloc
-___vt_9bad_alloc
-__._9type_info
-___eq__C9type_infoRCB0
-___tf16__user_type_info
-___tf9type_info
-___ti9type_info
-___vt_9type_info
-_getPropertySetInfo__Q312connectivity5dbase15ODbaseResultSet
-_release__Q312connectivity5dbase15ODbaseResultSet
-_acquire__Q312connectivity5dbase15ODbaseResultSet
-__._Q312connectivity5dbase15ODbaseResultSet
-__._Q312connectivity5dbase15ODbaseStatement
-__._Q312connectivity5dbase23ODbasePreparedStatement
-_IsText__Q312connectivity5dbase7ONDXKeyl
-_Write__CQ312connectivity5dbase8ONDXNodeR8SvStreamRCQ312connectivity5dbase8ONDXPage
-_Read__Q312connectivity5dbase8ONDXNodeR8SvStreamRQ312connectivity5dbase11ODbaseIndex
-_Merge__Q312connectivity5dbase8ONDXPageUsGQ312connectivity5dbase11ONDXPagePtr
-_Remove__Q312connectivity5dbase8ONDXPageUs
-_SearchAndReplace__Q312connectivity5dbase8ONDXPageRCQ312connectivity5dbase7ONDXKeyRB1
-_Search__Q312connectivity5dbase8ONDXPageRCQ312connectivity5dbase7ONDXKey
-_FindPos__CQ312connectivity5dbase8ONDXPageRCQ312connectivity5dbase7ONDXKey
-_ReleaseFull__Q312connectivity5dbase8ONDXPageUc
-_Append__Q312connectivity5dbase8ONDXPageRQ312connectivity5dbase8ONDXNode
-_Split__Q312connectivity5dbase8ONDXPageRB0
-_Insert__Q312connectivity5dbase8ONDXPageUsRQ312connectivity5dbase8ONDXNode
-_IsFull__CQ312connectivity5dbase8ONDXPage
-___vc__CQ312connectivity5dbase8ONDXPageUs
-___ls__Q212connectivity5dbaseR8SvStreamRCQ312connectivity5dbase8ONDXPage
-__._Q312connectivity5dbase8ONDXPage
-_GetFirstKey__Q312connectivity5dbase14OIndexIteratorPQ312connectivity5dbase8ONDXPageRCQ312connectivity4file8OOperand
-_GetCompare__Q312connectivity5dbase14OIndexIteratorUc
-_GetLike__Q312connectivity5dbase14OIndexIteratorUc
-_GetNull__Q312connectivity5dbase14OIndexIteratorUc
-_GetNotNull__Q312connectivity5dbase14OIndexIteratorUc
-_GetNextKey__Q312connectivity5dbase14OIndexIterator
-_Find__Q312connectivity5dbase14OIndexIteratorUc
-_refreshTables__Q312connectivity5dbase13ODbaseCatalog
-__._Q312connectivity5dbase18UStringDescription
-___Q312connectivity5dbase18UStringDescriptionPFv_PCc
-__._Q312connectivity5dbase11ODbaseIndex
-_release__Q312connectivity5dbase11ODbaseIndex
-_acquire__Q312connectivity5dbase11ODbaseIndex
-_createINFEntry__Q312connectivity5dbase11ODbaseIndex
-_getEntry__Q312connectivity5dbase11ODbaseIndex
-___ls__Q212connectivity5dbaseR8SvStreamRQ312connectivity5dbase11ODbaseIndex
-_Release__Q312connectivity5dbase11ODbaseIndexUc
-_ConvertToKey__Q312connectivity5dbase11ODbaseIndexPQ312connectivity5dbase7ONDXKeyUlRCQ312connectivity4file12ORowSetValue
-_openIndexFile__Q312connectivity5dbase11ODbaseIndex
-__._Q312connectivity5dbase11ODbaseTable
-_WriteMemo__Q312connectivity5dbase11ODbaseTableRQ312connectivity4file12ORowSetValueRUl
-_isUniqueByColumnName__Q312connectivity5dbase11ODbaseTableRCQ23rtl8OUString
-_WriteBuffer__Q312connectivity5dbase11ODbaseTable
-_UpdateBuffer__Q312connectivity5dbase11ODbaseTableRQ312connectivity4file12OValueVectorGQ23vost4ORef1ZB1RCQ53com3sun4star3unot9Reference1ZQ53com3sun4star9container12XIndexAccess
-_CreateMemoFile__Q312connectivity5dbase11ODbaseTableRC13INetURLObject
-_CreateFile__Q312connectivity5dbase11ODbaseTableRC13INetURLObjectRUc
-_ReadMemo__Q312connectivity5dbase11ODbaseTableUlRQ312connectivity4file12ORowSetValue
-_refreshIndexes__Q312connectivity5dbase11ODbaseTable
-_refreshColumns__Q312connectivity5dbase11ODbaseTable
-_AllocBuffer__Q312connectivity5dbase11ODbaseTable
-_fillColumns__Q312connectivity5dbase11ODbaseTable
-_ReadMemoHeader__Q312connectivity5dbase11ODbaseTable
-_readHeader__Q312connectivity5dbase11ODbaseTable
-_getPropertySetInfo__Q312connectivity4file26ODatabaseMetaDataResultSet
-_release__Q312connectivity4file26ODatabaseMetaDataResultSet
-_acquire__Q312connectivity4file26ODatabaseMetaDataResultSet
-_getPropertySetInfo__Q312connectivity4file10OResultSet
-_release__Q312connectivity4file10OResultSet
-_acquire__Q312connectivity4file10OResultSet
-_scanParameter__Q312connectivity4file10OResultSetPQ212connectivity13OSQLParseNodeRQ24_STLt6vector2ZPB1ZQ24_STLt9allocator1ZPB1
-_AddParameter__Q312connectivity4file10OResultSetPQ212connectivity13OSQLParseNodeRCQ53com3sun4star3unot9Reference1ZQ53com3sun4star5beans12XPropertySet
-_SetAssignValue__Q312connectivity4file10OResultSetRC6Stringn1UcUl
-_ParseAssignValues__Q312connectivity4file10OResultSetRCQ24_STLt6vector2Z6StringZQ24_STLt9allocator1ZB2PQ212connectivity13OSQLParseNodeUs
-_getUnoTunnelImplementationId__Q312connectivity4file10OResultSet
-_setOrderbyColumn__Q312connectivity4file10OResultSetUsPQ212connectivity13OSQLParseNoden1
-_CreateKeySet__Q312connectivity4file14OFILESortIndex
-___Q312connectivity4file14OFILESortIndexPCQ312connectivity4file8OKeyTypePCUclUs
-_anylizeSQL__Q312connectivity4file10OResultSet
-_GetAssignValues__Q312connectivity4file10OResultSet
-_moveAbsolute__Q312connectivity4file10OResultSetlUc
-_ExecuteRow__Q312connectivity4file10OResultSetQ412connectivity4file10OFileTable12FilePositionlUcn2
-_AddKeyValue__Q312connectivity4file14OFILESortIndexPQ312connectivity4file13OFILEKeyValue
-_GetOrderbyKeyValue__Q312connectivity4file10OResultSetGQ23vost4ORef1ZQ312connectivity4file12OValueVector
-_evaluate__Q312connectivity4file10OResultSet
-_SkipDeleted__Q312connectivity4file10OResultSetQ412connectivity4file10OFileTable12FilePositionlUc
-__._Q312connectivity4file14OFILESortIndex
-_construct__Q312connectivity4file10OResultSet
-_isCount__CQ312connectivity4file10OResultSet
-__._Q312connectivity4file18UStringDescription
-___Q312connectivity4file18UStringDescriptionPFv_PCc
-_disposing__Q312connectivity4file15OStatement_Base
-_acquire__Q312connectivity4file15OStatement_Base
-__._Q312connectivity4file16OStatement_BASE2
-__._Q312connectivity4file10OStatement
-_disposeResultSet__Q312connectivity4file15OStatement_Base
-_getImplementationName_Static__Q312connectivity4file11OFileDriver
-_operate__CQ312connectivity4file8OOp_LIKEPCQ312connectivity4file8OOperandn1
-_operate__CQ312connectivity4file10OOp_ISNULLPCQ312connectivity4file8OOperandn1
-_IsOf__Q312connectivity4file12ONumOperatorPFv_Pv
-_StaticType__Q312connectivity4file12ONumOperator
-_IsOf__Q312connectivity4file11OOp_COMPAREPFv_Pv
-_IsOf__Q312connectivity4file11OOp_NOTLIKEPFv_Pv
-_StaticType__Q312connectivity4file11OOp_NOTLIKE
-_IsOf__Q312connectivity4file8OOp_LIKEPFv_Pv
-_IsOf__Q312connectivity4file13OOp_ISNOTNULLPFv_Pv
-_IsOf__Q312connectivity4file10OOp_ISNULLPFv_Pv
-_IsOf__Q312connectivity4file6OOp_ORPFv_Pv
-_StaticType__Q312connectivity4file6OOp_OR
-_IsOf__Q312connectivity4file7OOp_ANDPFv_Pv
-_StaticType__Q312connectivity4file7OOp_AND
-_IsOf__Q312connectivity4file13OBoolOperatorPFv_Pv
-_IsOf__Q312connectivity4file9OOperatorPFv_Pv
-_IsOf__Q312connectivity4file14OOperandResultPFv_Pv
-_IsOf__Q312connectivity4file13OOperandConstPFv_Pv
-_IsOf__Q312connectivity4file13OOperandValuePFv_Pv
-_StaticType__Q312connectivity4file13OOperandValue
-_IsOf__Q312connectivity4file13OOperandParamPFv_Pv
-_IsOf__Q312connectivity4file16OFILEOperandAttrPFv_Pv
-_StaticType__Q312connectivity4file16OFILEOperandAttr
-_IsOf__Q312connectivity4file12OOperandAttrPFv_Pv
-_IsOf__Q312connectivity4file11OOperandRowPFv_Pv
-_StaticType__Q312connectivity4file11OOperandRow
-_IsOf__Q312connectivity4file8OOperandPFv_Pv
-_IsOf__Q312connectivity4file5OCodePFv_Pv
-_StaticType__Q312connectivity4file5OCode
-_execute_Operand__Q312connectivity4file18OPredicateCompilerPQ212connectivity13OSQLParseNode
-_execute_ISNULL__Q312connectivity4file18OPredicateCompilerPQ212connectivity13OSQLParseNode
-_execute_LIKE__Q312connectivity4file18OPredicateCompilerPQ212connectivity13OSQLParseNode
-_execute_COMPARE__Q312connectivity4file18OPredicateCompilerPQ212connectivity13OSQLParseNode
-___tf13bad_exception
-___uncatch_exception
-___eh_free
-___tfv
-___dynamic_cast
diff --git a/connectivity/source/drivers/dbase/dbase.xcu b/connectivity/source/drivers/dbase/dbase.xcu
deleted file mode 100644
index 319b8d79a9..0000000000
--- a/connectivity/source/drivers/dbase/dbase.xcu
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:dbase:*" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.dbase.ODriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">dBASE</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="CharSet" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="ShowDeleted" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="EnableSQL92Check" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="AddIndexAppendix" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- </node>
- <node oor:name="Features">
- <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseDOSLineEnds" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsTableCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="SupportsBrowsing" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FileSystemBased" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="MediaType" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>application/dbase</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/dbase/dbase.xml b/connectivity/source/drivers/dbase/dbase.xml
deleted file mode 100755
index e378fcd5fd..0000000000
--- a/connectivity/source/drivers/dbase/dbase.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description>
- <module-name>file</module-name>
- <component-description>
- <author>Ocke Jannsen</author>
- <name>com.sun.star.comp.sdbc.dbase.ODriver</name>
- <description>This library implements the database driver for dBase file format.
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service>com.sun.star.sdbc.Driver</supported-service>
- <supported-service>com.sun.star.sdbcx.Driver</supported-service>
- <service-dependency> ... </service-dependency>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>file</runtime-module-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>osl</runtime-module-dependency>
- <runtime-module-dependency>svtools-light1</runtime-module-dependency>
- <runtime-module-dependency>svtools</runtime-module-dependency>
- <runtime-module-dependency>ucbhelper</runtime-module-dependency>
- <runtime-module-dependency>dbtools</runtime-module-dependency>
- <runtime-module-dependency>unotools</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
deleted file mode 100644
index 203086e16e..0000000000
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ /dev/null
@@ -1,1016 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "dbase/dindexnode.hxx"
-#include "connectivity/CommonTools.hxx"
-#include <osl/thread.h>
-#include "dbase/DIndex.hxx"
-#include <tools/debug.hxx>
-#include "diagnose_ex.h"
-
-#include <algorithm>
-
-
-using namespace connectivity;
-using namespace connectivity::dbase;
-using namespace connectivity::file;
-using namespace com::sun::star::sdbc;
-// -----------------------------------------------------------------------------
-ONDXKey::ONDXKey(sal_uInt32 nRec)
- :nRecord(nRec)
-{
-}
-// -----------------------------------------------------------------------------
-ONDXKey::ONDXKey(const ORowSetValue& rVal, sal_Int32 eType, sal_uInt32 nRec)
- : ONDXKey_BASE(eType)
- , nRecord(nRec)
- , xValue(rVal)
-{
-}
-// -----------------------------------------------------------------------------
-ONDXKey::ONDXKey(const rtl::OUString& aStr, sal_uInt32 nRec)
- : ONDXKey_BASE(::com::sun::star::sdbc::DataType::VARCHAR)
- ,nRecord(nRec)
-{
- if (aStr.getLength())
- {
- xValue = aStr;
- xValue.setBound(sal_True);
- }
-}
-// -----------------------------------------------------------------------------
-
-ONDXKey::ONDXKey(double aVal, sal_uInt32 nRec)
- : ONDXKey_BASE(::com::sun::star::sdbc::DataType::DOUBLE)
- ,nRecord(nRec)
- ,xValue(aVal)
-{
-}
-// -----------------------------------------------------------------------------
-
-//==================================================================
-// Index Seite
-//==================================================================
-ONDXPage::ONDXPage(ODbaseIndex& rInd, sal_uInt32 nPos, ONDXPage* pParent)
- :nPagePos(nPos)
- ,bModified(sal_False)
- ,nCount(0)
- ,aParent(pParent)
- ,rIndex(rInd)
- ,ppNodes(NULL)
-{
- sal_uInt16 nT = rIndex.getHeader().db_maxkeys;
- ppNodes = new ONDXNode[nT];
-}
-
-//------------------------------------------------------------------
-ONDXPage::~ONDXPage()
-{
- delete[] ppNodes;
-}
-//------------------------------------------------------------------
-void ONDXPage::QueryDelete()
-{
- // Store in GarbageCollector
- if (IsModified() && rIndex.m_pFileStream)
- (*rIndex.m_pFileStream) << *this;
-
- bModified = sal_False;
- if (rIndex.UseCollector())
- {
- if (aChild.Is())
- aChild->Release(sal_False);
-
- for (sal_uInt16 i = 0; i < rIndex.getHeader().db_maxkeys;i++)
- {
- if (ppNodes[i].GetChild().Is())
- ppNodes[i].GetChild()->Release(sal_False);
-
- ppNodes[i] = ONDXNode();
- }
- RestoreNoDelete();
-
- nCount = 0;
- aParent.Clear();
- rIndex.Collect(this);
- }
- else
- SvRefBase::QueryDelete();
-}
-//------------------------------------------------------------------
-ONDXPagePtr& ONDXPage::GetChild(ODbaseIndex* pIndex)
-{
- if (!aChild.Is() && pIndex)
- {
- aChild = rIndex.CreatePage(aChild.GetPagePos(),this,aChild.HasPage());
- }
- return aChild;
-}
-
-//------------------------------------------------------------------
-sal_uInt16 ONDXPage::FindPos(const ONDXKey& rKey) const
-{
- // searches the position for the given key in a page
- sal_uInt16 i = 0;
- while (i < nCount && rKey > ((*this)[i]).GetKey())
- i++;
-
- return i;
-}
-
-//------------------------------------------------------------------
-sal_Bool ONDXPage::Find(const ONDXKey& rKey)
-{
- // searches the given key
- // Speciality: At the end of the method
- // the actual page and the position of the node, fulfilling the '<=' condition, are saved
- // This is considered at insert.
- sal_uInt16 i = 0;
- while (i < nCount && rKey > ((*this)[i]).GetKey())
- i++;
-
- sal_Bool bResult = sal_False;
-
- if (!IsLeaf())
- {
- // descend further
- ONDXPagePtr aPage = (i==0) ? GetChild(&rIndex) : ((*this)[i-1]).GetChild(&rIndex, this);
- bResult = aPage.Is() && aPage->Find(rKey);
- }
- else if (i == nCount)
- {
- rIndex.m_aCurLeaf = this;
- rIndex.m_nCurNode = i - 1;
- bResult = sal_False;
- }
- else
- {
- bResult = rKey == ((*this)[i]).GetKey();
- rIndex.m_aCurLeaf = this;
- rIndex.m_nCurNode = bResult ? i : i - 1;
- }
- return bResult;
-}
-
-//------------------------------------------------------------------
-sal_Bool ONDXPage::Insert(ONDXNode& rNode, sal_uInt32 nRowsLeft)
-{
- // When creating an index there can be multiple nodes added,
- // these are sorted ascending
- sal_Bool bAppend = nRowsLeft > 0;
- if (IsFull())
- {
- sal_Bool bResult = sal_True;
- ONDXNode aSplitNode;
- if (bAppend)
- aSplitNode = rNode;
- else
- {
- // Save the last node
- aSplitNode = (*this)[nCount-1];
- if(rNode.GetKey() <= aSplitNode.GetKey())
- {
-
- // this practically reduces the number of nodes by 1
- if (IsLeaf() && this == &rIndex.m_aCurLeaf)
- {
- // assumes, that the node, for which the condition (<=) holds, is stored in m_nCurNode
- --nCount; // (otherwise we might get Assertions and GPFs - 60593)
- bResult = Insert(rIndex.m_nCurNode + 1, rNode);
- }
- else // Position unbekannt
- {
- sal_uInt16 nPos = NODE_NOTFOUND;
- while (++nPos < nCount && rNode.GetKey() > ((*this)[nPos]).GetKey()) ;
-
- --nCount; // (otherwise we might get Assertions and GPFs - 60593)
- bResult = Insert(nPos, rNode);
- }
-
- // can the new node be inserted
- if (!bResult)
- {
- nCount++;
- aSplitNode = rNode;
- }
- }
- else
- aSplitNode = rNode;
- }
-
- sal_uInt32 nNewPagePos = rIndex.GetPageCount();
- sal_uInt32 nNewPageCount = nNewPagePos + 1;
-
- // insert extracted node into parent node
- if (!HasParent())
- {
- // No parent, then new root
- ONDXPagePtr aNewRoot = rIndex.CreatePage(nNewPagePos + 1);
- aNewRoot->SetChild(this);
-
- rIndex.m_aRoot = aNewRoot;
- rIndex.SetRootPos(nNewPagePos + 1);
- rIndex.SetPageCount(++nNewPageCount);
- }
-
- // create new leaf and divide page
- ONDXPagePtr aNewPage = rIndex.CreatePage(nNewPagePos,aParent);
- rIndex.SetPageCount(nNewPageCount);
-
- // How many nodes are being inserted?
- // Enough, then we can fill the page to the brim
- ONDXNode aInnerNode;
- if (!IsLeaf() || nRowsLeft < (sal_uInt32)(rIndex.GetMaxNodes() / 2))
- aInnerNode = Split(*aNewPage);
- else
- {
- aInnerNode = (*this)[nCount - 1];
-
- // Node points to the new page
- aInnerNode.SetChild(aNewPage);
-
- // Inner nodes have no record number
- if (rIndex.isUnique())
- aInnerNode.GetKey().ResetRecord();
-
- // new page points to the page of the extracted node
- if (!IsLeaf())
- aNewPage->SetChild(aInnerNode.GetChild());
- }
-
- aNewPage->Append(aSplitNode);
- ONDXPagePtr aTempParent = aParent;
- if (IsLeaf())
- {
- rIndex.m_aCurLeaf = aNewPage;
- rIndex.m_nCurNode = rIndex.m_aCurLeaf->Count() - 1;
-
- // free not needed pages, there are no references to those on the page
- // afterwards 'this' can't be valid anymore!!!
- ReleaseFull();
- }
-
- // Insert extracted node
- return aTempParent->Insert(aInnerNode);
- }
- else // Fill the page up
- {
- if (bAppend)
- {
- if (IsLeaf())
- rIndex.m_nCurNode = nCount - 1;
- return Append(rNode);
- }
- else
- {
- sal_uInt16 nNodePos = FindPos(rNode.GetKey());
- if (IsLeaf())
- rIndex.m_nCurNode = nNodePos;
-
- return Insert(nNodePos, rNode);
- }
- }
-}
-
-//------------------------------------------------------------------
-sal_Bool ONDXPage::Insert(sal_uInt16 nPos, ONDXNode& rNode)
-{
- sal_uInt16 nMaxCount = rIndex.getHeader().db_maxkeys;
- if (nPos >= nMaxCount)
- return sal_False;
-
- if (nCount)
- {
- ++nCount;
- // shift right
- for (sal_uInt16 i = std::min((sal_uInt16)(nMaxCount-1), (sal_uInt16)(nCount-1)); nPos < i; --i)
- (*this)[i] = (*this)[i-1];
- }
- else
- if (nCount < nMaxCount)
- nCount++;
-
- // insert at the position
- ONDXNode& rInsertNode = (*this)[nPos];
- rInsertNode = rNode;
- if (rInsertNode.GetChild().Is())
- {
- rInsertNode.GetChild()->SetParent(this);
- rNode.GetChild()->SetParent(this);
- }
-
- bModified = sal_True;
-
- return sal_True;
-}
-
-//------------------------------------------------------------------
-sal_Bool ONDXPage::Append(ONDXNode& rNode)
-{
- DBG_ASSERT(!IsFull(), "kein Append moeglich");
- return Insert(nCount, rNode);
-}
-//------------------------------------------------------------------
-void ONDXPage::Release(sal_Bool bSave)
-{
- // free pages
- if (aChild.Is())
- aChild->Release(bSave);
-
- // free pointer
- aChild.Clear();
-
- for (sal_uInt16 i = 0; i < rIndex.getHeader().db_maxkeys;i++)
- {
- if (ppNodes[i].GetChild())
- ppNodes[i].GetChild()->Release(bSave);
-
- ppNodes[i].GetChild().Clear();
- }
- aParent = NULL;
-}
-//------------------------------------------------------------------
-void ONDXPage::ReleaseFull(sal_Bool bSave)
-{
- ONDXPagePtr aTempParent = aParent;
- Release(bSave);
-
- if (aTempParent.Is())
- {
- // Free pages not needed, there will be no reference anymore to the pages
- // afterwards 'this' can't be valid anymore!!!
- sal_uInt16 nParentPos = aTempParent->Search(this);
- if (nParentPos != NODE_NOTFOUND)
- (*aTempParent)[nParentPos].GetChild().Clear();
- else
- aTempParent->GetChild().Clear();
- }
-}
-//------------------------------------------------------------------
-sal_Bool ONDXPage::Delete(sal_uInt16 nNodePos)
-{
- if (IsLeaf())
- {
- // The last element will not be deleted
- if (nNodePos == (nCount - 1))
- {
- ONDXNode aNode = (*this)[nNodePos];
-
- // parent's KeyValue has to be replaced
- if (HasParent())
- aParent->SearchAndReplace(aNode.GetKey(),
- (*this)[nNodePos-1].GetKey());
- }
- }
-
- // Delete the node
- Remove(nNodePos);
-
- // Underflow
- if (HasParent() && nCount < (rIndex.GetMaxNodes() / 2))
- {
- // determine, which node points to the page
- sal_uInt16 nParentNodePos = aParent->Search(this);
- // last element on parent-page -> merge with secondlast page
- if (nParentNodePos == (aParent->Count() - 1))
- {
- if (!nParentNodePos)
- // merge with left neighbour
- Merge(nParentNodePos,aParent->GetChild(&rIndex));
- else
- Merge(nParentNodePos,(*aParent)[nParentNodePos-1].GetChild(&rIndex,aParent));
- }
- // otherwise merge page with next page
- else
- {
- // merge with right neighbour
- Merge(nParentNodePos + 1,((*aParent)[nParentNodePos + 1].GetChild(&rIndex,aParent)));
- nParentNodePos++;
- }
- if (HasParent() && !(*aParent)[nParentNodePos].HasChild())
- aParent->Delete(nParentNodePos);
- }
- else if (IsRoot())
- // make sure that the position of the root is kept
- rIndex.SetRootPos(nPagePos);
- return sal_True;
-}
-
-
-//------------------------------------------------------------------
-ONDXNode ONDXPage::Split(ONDXPage& rPage)
-{
- DBG_ASSERT(IsFull(), "Falsches Splitting");
- /* devide one page into two
- leaf:
- Page 1 is (n - (n/2))
- Page 2 is (n/2)
- Node n/2 will be duplicated
- inner node:
- Page 1 is (n+1)/2
- Page 2 is (n/2-1)
- Node ((n+1)/2 + 1) : will be taken out
- */
- ONDXNode aResultNode;
- if (IsLeaf())
- {
- for (sal_uInt16 i = (nCount - (nCount / 2)), j = 0 ; i < nCount; i++)
- rPage.Insert(j++,(*this)[i]);
-
- // this node contains a key that already exists in the tree and must be replaced
- ONDXNode aLastNode = (*this)[nCount - 1];
- nCount = nCount - (nCount / 2);
- aResultNode = (*this)[nCount - 1];
-
- if (HasParent())
- aParent->SearchAndReplace(aLastNode.GetKey(),
- aResultNode.GetKey());
- }
- else
- {
- for (sal_uInt16 i = (nCount + 1) / 2 + 1, j = 0 ; i < nCount; i++)
- rPage.Insert(j++,(*this)[i]);
-
- aResultNode = (*this)[(nCount + 1) / 2];
- nCount = (nCount + 1) / 2;
-
- // new page points to page with extraced node
- rPage.SetChild(aResultNode.GetChild());
- }
- // node points to new page
- aResultNode.SetChild(&rPage);
-
- // inner nodes have no record number
- if (rIndex.isUnique())
- aResultNode.GetKey().ResetRecord();
- bModified = sal_True;
- return aResultNode;
-}
-
-//------------------------------------------------------------------
-void ONDXPage::Merge(sal_uInt16 nParentNodePos, ONDXPagePtr xPage)
-{
- DBG_ASSERT(HasParent(), "kein Vater vorhanden");
- DBG_ASSERT(nParentNodePos != NODE_NOTFOUND, "Falscher Indexaufbau");
-
- /* Merge 2 pages */
- ONDXNode aResultNode;
- sal_uInt16 nMaxNodes = rIndex.GetMaxNodes(),
- nMaxNodes_2 = nMaxNodes / 2;
-
- // Determine if page is right or left neighbour
- sal_Bool bRight = ((*xPage)[0].GetKey() > (*this)[0].GetKey()); // sal_True, whenn xPage the right side is
- sal_uInt16 nNewCount = (*xPage).Count() + Count();
-
- if (IsLeaf())
- {
- // Condition for merge
- if (nNewCount < (nMaxNodes_2 * 2))
- {
- sal_uInt16 nLastNode = bRight ? Count() - 1 : xPage->Count() - 1;
- if (bRight)
- {
- DBG_ASSERT(&xPage != this,"xPage und THIS duerfen nicht gleich sein: Endlosschleife");
- // shift all nodes from xPage to the left node (append)
- while (xPage->Count())
- {
- Append((*xPage)[0]);
- xPage->Remove(0);
- }
- }
- else
- {
- DBG_ASSERT(&xPage != this,"xPage und THIS duerfen nicht gleich sein: Endlosschleife");
- // xPage is the left page and THIS the right one
- while (xPage->Count())
- {
- Insert(0,(*xPage)[xPage->Count()-1]);
- xPage->Remove(xPage->Count()-1);
- }
- // replace old position of xPage in parent with this
- if (nParentNodePos)
- (*aParent)[nParentNodePos-1].SetChild(this,aParent);
- else // or set as right node
- aParent->SetChild(this);
- aParent->SetModified(sal_True);
-
- }
-
- // cancel Child-relationship at parent node
- (*aParent)[nParentNodePos].SetChild();
- // replace the Node-value, only if changed page is the left one, otherwise become
- if(aParent->IsRoot() && aParent->Count() == 1)
- {
- (*aParent)[0].SetChild();
- aParent->ReleaseFull();
- aParent = NULL;
- rIndex.SetRootPos(nPagePos);
- rIndex.m_aRoot = this;
- SetModified(sal_True);
- }
- else
- aParent->SearchAndReplace((*this)[nLastNode].GetKey(),(*this)[nCount-1].GetKey());
-
- xPage->SetModified(sal_False);
- xPage->ReleaseFull(); // is not needed anymore
- }
- // balance the elements nNewCount >= (nMaxNodes_2 * 2)
- else
- {
- if (bRight)
- {
- // shift all nodes from xPage to the left node (append)
- ONDXNode aReplaceNode = (*this)[nCount - 1];
- while (nCount < nMaxNodes_2)
- {
- Append((*xPage)[0]);
- xPage->Remove(0);
- }
- // Replace the node values: replace old last value by the last of xPage
- aParent->SearchAndReplace(aReplaceNode.GetKey(),(*this)[nCount-1].GetKey());
- }
- else
- {
- // insert all nodes from this in front of the xPage nodes
- ONDXNode aReplaceNode = (*this)[nCount - 1];
- while (xPage->Count() < nMaxNodes_2)
- {
- xPage->Insert(0,(*this)[nCount-1]);
- Remove(nCount-1);
- }
- // Replace the node value
- aParent->SearchAndReplace(aReplaceNode.GetKey(),(*this)[Count()-1].GetKey());
- }
- }
- }
- else // !IsLeaf()
- {
- // Condition for merge
- if (nNewCount < nMaxNodes_2 * 2)
- {
- if (bRight)
- {
- DBG_ASSERT(&xPage != this,"xPage und THIS duerfen nicht gleich sein: Endlosschleife");
- // Parent node will be integrated; is initialized with Child from xPage
- (*aParent)[nParentNodePos].SetChild(xPage->GetChild(),aParent);
- Append((*aParent)[nParentNodePos]);
- for (sal_uInt16 i = 0 ; i < xPage->Count(); i++)
- Append((*xPage)[i]);
- }
- else
- {
- DBG_ASSERT(&xPage != this,"xPage und THIS duerfen nicht gleich sein: Endlosschleife");
- // Parent-node will be integrated; is initialized with child
- (*aParent)[nParentNodePos].SetChild(GetChild(),aParent); // Parent memorizes my child
- Insert(0,(*aParent)[nParentNodePos]); // insert parent node into myself
- while (xPage->Count())
- {
- Insert(0,(*xPage)[xPage->Count()-1]);
- xPage->Remove(xPage->Count()-1);
- }
- SetChild(xPage->GetChild());
-
- if (nParentNodePos)
- (*aParent)[nParentNodePos-1].SetChild(this,aParent);
- else
- aParent->SetChild(this);
- }
-
- // afterwards parent node will be reset
- (*aParent)[nParentNodePos].SetChild();
- aParent->SetModified(sal_True);
-
- if(aParent->IsRoot() && aParent->Count() == 1)
- {
- (*aParent).SetChild();
- aParent->ReleaseFull();
- aParent = NULL;
- rIndex.SetRootPos(nPagePos);
- rIndex.m_aRoot = this;
- SetModified(sal_True);
- }
- else if(nParentNodePos)
- // replace the node value
- // for Append the range will be enlarged, for Insert the old node from xPage will reference to this
- // thats why the node must be updated here
- aParent->SearchAndReplace((*aParent)[nParentNodePos-1].GetKey(),(*aParent)[nParentNodePos].GetKey());
-
- xPage->SetModified(sal_False);
- xPage->ReleaseFull();
- }
- // balance the elements
- else
- {
- if (bRight)
- {
- while (nCount < nMaxNodes_2)
- {
- (*aParent)[nParentNodePos].SetChild(xPage->GetChild(),aParent);
- Append((*aParent)[nParentNodePos]);
- (*aParent)[nParentNodePos] = (*xPage)[0];
- xPage->Remove(0);
- }
- xPage->SetChild((*aParent)[nParentNodePos].GetChild());
- (*aParent)[nParentNodePos].SetChild(xPage,aParent);
- }
- else
- {
- while (nCount < nMaxNodes_2)
- {
- (*aParent)[nParentNodePos].SetChild(GetChild(),aParent);
- Insert(0,(*aParent)[nParentNodePos]);
- (*aParent)[nParentNodePos] = (*xPage)[xPage->Count()-1];
- xPage->Remove(xPage->Count()-1);
- }
- SetChild((*aParent)[nParentNodePos].GetChild());
- (*aParent)[nParentNodePos].SetChild(this,aParent);
-
- }
- aParent->SetModified(sal_True);
- }
- }
-}
-//==================================================================
-// ONDXNode
-//==================================================================
-
-//------------------------------------------------------------------
-void ONDXNode::Read(SvStream &rStream, ODbaseIndex& rIndex)
-{
- rStream >> aKey.nRecord; // key
-
- if (rIndex.getHeader().db_keytype)
- {
- double aDbl;
- rStream >> aDbl;
- aKey = ONDXKey(aDbl,aKey.nRecord);
- }
- else
- {
- ByteString aBuf;
- sal_uInt16 nLen = rIndex.getHeader().db_keylen;
- char* pStr = aBuf.AllocBuffer(nLen+1);
-
- rStream.Read(pStr,nLen);
- pStr[nLen] = 0;
- aBuf.ReleaseBufferAccess();
- aBuf.EraseTrailingChars();
-
- aKey = ONDXKey(::rtl::OUString(aBuf.GetBuffer(),aBuf.Len(),rIndex.m_pTable->getConnection()->getTextEncoding()) ,aKey.nRecord);
- }
- rStream >> aChild;
-}
-
-union NodeData
-{
- double aDbl;
- char aData[128];
-} aNodeData;
-//------------------------------------------------------------------
-void ONDXNode::Write(SvStream &rStream, const ONDXPage& rPage) const
-{
- const ODbaseIndex& rIndex = rPage.GetIndex();
- if (!rIndex.isUnique() || rPage.IsLeaf())
- rStream << (sal_uInt32)aKey.nRecord; // key
- else
- rStream << (sal_uInt32)0; // key
-
- if (rIndex.getHeader().db_keytype) // double
- {
- if (aKey.getValue().isNull())
- {
- memset(aNodeData.aData,0,rIndex.getHeader().db_keylen);
- rStream.Write((sal_uInt8*)aNodeData.aData,rIndex.getHeader().db_keylen);
- }
- else
- rStream << (double) aKey.getValue();
- }
- else
- {
- memset(aNodeData.aData,0x20,rIndex.getHeader().db_keylen);
- if (!aKey.getValue().isNull())
- {
- ::rtl::OUString sValue = aKey.getValue();
- ByteString aText(sValue.getStr(), rIndex.m_pTable->getConnection()->getTextEncoding());
- strncpy(aNodeData.aData,aText.GetBuffer(),std::min(rIndex.getHeader().db_keylen, aText.Len()));
- }
- rStream.Write((sal_uInt8*)aNodeData.aData,rIndex.getHeader().db_keylen);
- }
- rStream << aChild;
-}
-
-
-//------------------------------------------------------------------
-ONDXPagePtr& ONDXNode::GetChild(ODbaseIndex* pIndex, ONDXPage* pParent)
-{
- if (!aChild.Is() && pIndex)
- {
- aChild = pIndex->CreatePage(aChild.GetPagePos(),pParent,aChild.HasPage());
- }
- return aChild;
-}
-
-//==================================================================
-// ONDXKey
-//==================================================================
-//------------------------------------------------------------------
-sal_Bool ONDXKey::IsText(sal_Int32 eType)
-{
- return eType == DataType::VARCHAR || eType == DataType::CHAR;
-}
-
-//------------------------------------------------------------------
-StringCompare ONDXKey::Compare(const ONDXKey& rKey) const
-{
- StringCompare eResult;
-
- if (getValue().isNull())
- {
- if (rKey.getValue().isNull() || (rKey.IsText(getDBType()) && !rKey.getValue().getString().getLength()))
- eResult = COMPARE_EQUAL;
- else
- eResult = COMPARE_LESS;
- }
- else if (rKey.getValue().isNull())
- {
- if (getValue().isNull() || (IsText(getDBType()) && !getValue().getString().getLength()))
- eResult = COMPARE_EQUAL;
- else
- eResult = COMPARE_GREATER;
- }
- else if (IsText(getDBType()))
- {
- sal_Int32 nRes = getValue().getString().compareTo(rKey.getValue());
- eResult = (nRes > 0) ? COMPARE_GREATER : (nRes == 0) ? COMPARE_EQUAL : COMPARE_LESS;
- }
- else
- {
- double m = getValue(),n = rKey.getValue();
- eResult = (m > n) ? COMPARE_GREATER : (n == m) ? COMPARE_EQUAL : COMPARE_LESS;
- }
-
- // compare record, if index !Unique
- if (eResult == COMPARE_EQUAL && nRecord && rKey.nRecord)
- eResult = (nRecord > rKey.nRecord) ? COMPARE_GREATER :
- (nRecord == rKey.nRecord) ? COMPARE_EQUAL : COMPARE_LESS;
-
- return eResult;
-}
-// -----------------------------------------------------------------------------
-void ONDXKey::setValue(const ORowSetValue& _rVal)
-{
- xValue = _rVal;
-}
-// -----------------------------------------------------------------------------
-const ORowSetValue& ONDXKey::getValue() const
-{
- return xValue;
-}
-// -----------------------------------------------------------------------------
-SvStream& connectivity::dbase::operator >> (SvStream &rStream, ONDXPagePtr& rPage)
-{
- rStream >> rPage.nPagePos;
- return rStream;
-}
-// -----------------------------------------------------------------------------
-SvStream& connectivity::dbase::operator << (SvStream &rStream, const ONDXPagePtr& rPage)
-{
- rStream << rPage.nPagePos;
- return rStream;
-}
-// -----------------------------------------------------------------------------
-//==================================================================
-// ONDXPagePtr
-//==================================================================
-//------------------------------------------------------------------
-ONDXPagePtr::ONDXPagePtr(const ONDXPagePtr& rRef)
- :ONDXPageRef(rRef)
- ,nPagePos(rRef.nPagePos)
-{
-}
-
-//------------------------------------------------------------------
-ONDXPagePtr::ONDXPagePtr(ONDXPage* pRefPage)
- :ONDXPageRef(pRefPage)
- ,nPagePos(0)
-{
- if (pRefPage)
- nPagePos = pRefPage->GetPagePos();
-}
-//------------------------------------------------------------------
-ONDXPagePtr& ONDXPagePtr::operator=(const ONDXPagePtr& rRef)
-{
- ONDXPageRef::operator=(rRef);
- nPagePos = rRef.nPagePos;
- return *this;
-}
-
-//------------------------------------------------------------------
-ONDXPagePtr& ONDXPagePtr::operator= (ONDXPage* pRef)
-{
- ONDXPageRef::operator=(pRef);
- nPagePos = (pRef) ? pRef->GetPagePos() : 0;
- return *this;
-}
-// -----------------------------------------------------------------------------
-static sal_uInt32 nValue;
-//------------------------------------------------------------------
-SvStream& connectivity::dbase::operator >> (SvStream &rStream, ONDXPage& rPage)
-{
- rStream.Seek(rPage.GetPagePos() * PAGE_SIZE);
- rStream >> nValue >> rPage.aChild;
- rPage.nCount = sal_uInt16(nValue);
-
- for (sal_uInt16 i = 0; i < rPage.nCount; i++)
- rPage[i].Read(rStream, rPage.GetIndex());
- return rStream;
-}
-
-//------------------------------------------------------------------
-SvStream& connectivity::dbase::operator << (SvStream &rStream, const ONDXPage& rPage)
-{
- // Page doesn't exist yet
- sal_uIntPtr nSize = (rPage.GetPagePos() + 1) * PAGE_SIZE;
- if (nSize > rStream.Seek(STREAM_SEEK_TO_END))
- {
- rStream.SetStreamSize(nSize);
- rStream.Seek(rPage.GetPagePos() * PAGE_SIZE);
-
- char aEmptyData[PAGE_SIZE];
- memset(aEmptyData,0x00,PAGE_SIZE);
- rStream.Write((sal_uInt8*)aEmptyData,PAGE_SIZE);
- }
- sal_uIntPtr nCurrentPos = rStream.Seek(rPage.GetPagePos() * PAGE_SIZE);
- OSL_UNUSED( nCurrentPos );
-
- nValue = rPage.nCount;
- rStream << nValue << rPage.aChild;
-
- sal_uInt16 i = 0;
- for (; i < rPage.nCount; i++)
- rPage[i].Write(rStream, rPage);
-
- // check if we have to fill the stream with '\0'
- if(i < rPage.rIndex.getHeader().db_maxkeys)
- {
- sal_uIntPtr nTell = rStream.Tell() % PAGE_SIZE;
- sal_uInt16 nBufferSize = rStream.GetBufferSize();
- sal_uIntPtr nRemainSize = nBufferSize - nTell;
- if ( nRemainSize <= nBufferSize )
- {
- char* pEmptyData = new char[nRemainSize];
- memset(pEmptyData,0x00,nRemainSize);
- rStream.Write((sal_uInt8*)pEmptyData,nRemainSize);
- rStream.Seek(nTell);
- delete [] pEmptyData;
- }
- }
- return rStream;
-}
-// -----------------------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 1
-//------------------------------------------------------------------
-void ONDXPage::PrintPage()
-{
- OSL_TRACE("\nSDB: -----------Page: %d Parent: %d Count: %d Child: %d-----",
- nPagePos, HasParent() ? aParent->GetPagePos() : 0 ,nCount, aChild.GetPagePos());
-
- for (sal_uInt16 i = 0; i < nCount; i++)
- {
- ONDXNode rNode = (*this)[i];
- ONDXKey& rKey = rNode.GetKey();
- if (!IsLeaf())
- rNode.GetChild(&rIndex, this);
-
- if (rKey.getValue().isNull())
- {
- OSL_TRACE("SDB: [%d,NULL,%d]",rKey.GetRecord(), rNode.GetChild().GetPagePos());
- }
- else if (rIndex.getHeader().db_keytype)
- {
- OSL_TRACE("SDB: [%d,%f,%d]",rKey.GetRecord(), rKey.getValue().getDouble(),rNode.GetChild().GetPagePos());
- }
- else
- {
- OSL_TRACE("SDB: [%d,%s,%d]",rKey.GetRecord(), (const char* )ByteString(rKey.getValue().getString().getStr(), rIndex.m_pTable->getConnection()->getTextEncoding()).GetBuffer(),rNode.GetChild().GetPagePos());
- }
- }
- OSL_TRACE("SDB: -----------------------------------------------\n");
- if (!IsLeaf())
- {
-#if OSL_DEBUG_LEVEL > 1
- GetChild(&rIndex)->PrintPage();
- for (sal_uInt16 i = 0; i < nCount; i++)
- {
- ONDXNode rNode = (*this)[i];
- rNode.GetChild(&rIndex,this)->PrintPage();
- }
-#endif
- }
- OSL_TRACE("SDB: ===============================================\n");
-}
-#endif
-// -----------------------------------------------------------------------------
-sal_Bool ONDXPage::IsFull() const
-{
- return Count() == rIndex.getHeader().db_maxkeys;
-}
-// -----------------------------------------------------------------------------
-//------------------------------------------------------------------
-sal_uInt16 ONDXPage::Search(const ONDXKey& rSearch)
-{
- // binary search later
- sal_uInt16 i = NODE_NOTFOUND;
- while (++i < Count())
- if ((*this)[i].GetKey() == rSearch)
- break;
-
- return (i < Count()) ? i : NODE_NOTFOUND;
-}
-
-//------------------------------------------------------------------
-sal_uInt16 ONDXPage::Search(const ONDXPage* pPage)
-{
- sal_uInt16 i = NODE_NOTFOUND;
- while (++i < Count())
- if (((*this)[i]).GetChild() == pPage)
- break;
-
- // if not found, then we assume, that the page itself points to the page
- return (i < Count()) ? i : NODE_NOTFOUND;
-}
-// -----------------------------------------------------------------------------
-// runs recursively
-void ONDXPage::SearchAndReplace(const ONDXKey& rSearch,
- ONDXKey& rReplace)
-{
- OSL_ENSURE(rSearch != rReplace,"Invalid here:rSearch == rReplace");
- if (rSearch != rReplace)
- {
- sal_uInt16 nPos = NODE_NOTFOUND;
- ONDXPage* pPage = this;
-
- while (pPage && (nPos = pPage->Search(rSearch)) == NODE_NOTFOUND)
- pPage = pPage->aParent;
-
- if (pPage)
- {
- (*pPage)[nPos].GetKey() = rReplace;
- pPage->SetModified(sal_True);
- }
- }
-}
-// -----------------------------------------------------------------------------
-ONDXNode& ONDXPage::operator[] (sal_uInt16 nPos)
-{
- DBG_ASSERT(nCount > nPos, "falscher Indexzugriff");
- return ppNodes[nPos];
-}
-
-//------------------------------------------------------------------
-const ONDXNode& ONDXPage::operator[] (sal_uInt16 nPos) const
-{
- DBG_ASSERT(nCount > nPos, "falscher Indexzugriff");
- return ppNodes[nPos];
-}
-// -----------------------------------------------------------------------------
-void ONDXPage::Remove(sal_uInt16 nPos)
-{
- DBG_ASSERT(nCount > nPos, "falscher Indexzugriff");
-
- for (sal_uInt16 i = nPos; i < (nCount-1); i++)
- (*this)[i] = (*this)[i+1];
-
- nCount--;
- bModified = sal_True;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/dbase/exports.dxp b/connectivity/source/drivers/dbase/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/drivers/dbase/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/drivers/dbase/makefile.mk b/connectivity/source/drivers/dbase/makefile.mk
deleted file mode 100755
index 5c3344b1da..0000000000
--- a/connectivity/source/drivers/dbase/makefile.mk
+++ /dev/null
@@ -1,137 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=dbase
-
-VISIBILITY_HIDDEN=TRUE
-
-# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/DCode.obj \
- $(SLO)$/DResultSet.obj \
- $(SLO)$/DStatement.obj \
- $(SLO)$/DPreparedStatement.obj \
- $(SLO)$/dindexnode.obj \
- $(SLO)$/DIndexIter.obj \
- $(SLO)$/DDatabaseMetaData.obj \
- $(SLO)$/DCatalog.obj \
- $(SLO)$/DColumns.obj \
- $(SLO)$/DIndexColumns.obj \
- $(SLO)$/DIndex.obj \
- $(SLO)$/DIndexes.obj \
- $(SLO)$/DTable.obj \
- $(SLO)$/DTables.obj \
- $(SLO)$/DConnection.obj \
- $(SLO)$/Dservices.obj \
- $(SLO)$/DDriver.obj
-
-EXCEPTIONSFILES=\
- $(SLO)$/DCode.obj \
- $(SLO)$/DResultSet.obj \
- $(SLO)$/DStatement.obj \
- $(SLO)$/DPreparedStatement.obj \
- $(SLO)$/dindexnode.obj \
- $(SLO)$/DIndexIter.obj \
- $(SLO)$/DDatabaseMetaData.obj \
- $(SLO)$/DCatalog.obj \
- $(SLO)$/DColumns.obj \
- $(SLO)$/DIndexColumns.obj \
- $(SLO)$/DIndex.obj \
- $(SLO)$/DIndexes.obj \
- $(SLO)$/DTables.obj \
- $(SLO)$/DConnection.obj \
- $(SLO)$/Dservices.obj \
- $(SLO)$/DDriver.obj
-
-# [kh] ppc linux gcc compiler problem
-.IF "$(OS)$(COM)$(CPUNAME)"=="LINUXGCCPOWERPC"
-EXCEPTIONSNOOPTFILES= \
- $(SLO)$/DTable.obj
-.ELSE
-EXCEPTIONSFILES +=\
- $(SLO)$/DTable.obj
-.ENDIF
-
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-
-# --- Library -----------------------------------
-
-SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SVLLIB) \
- $(TOOLSLIB) \
- $(UCBHELPERLIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(DBTOOLSLIB) \
- $(DBFILELIB) \
- $(UNOTOOLSLIB) \
- $(COMPHELPERLIB)
-
-.IF "$(DBFILELIB)" == ""
-SHL1STDLIBS+= ifile.lib
-.ENDIF
-
-SHL1DEPN=
-SHL1IMPLIB= i$(DBASE_TARGET)
-
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-
-# --- Targets ----------------------------------
-
-.INCLUDE : $(PRJ)$/target.pmk
-
-
-
-ALLTAR : $(MISC)/dbase.component
-
-$(MISC)/dbase.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- dbase.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt dbase.component
diff --git a/connectivity/source/drivers/evoab/LServices.cxx b/connectivity/source/drivers/evoab/LServices.cxx
deleted file mode 100644
index 00c41fee75..0000000000
--- a/connectivity/source/drivers/evoab/LServices.cxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "LDriver.hxx"
-#include <cppuhelper/factory.hxx>
-
-using namespace connectivity::evoab;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pT
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- OEvoabDriver::getImplementationName_Static(),
- OEvoabDriver::getSupportedServiceNames_Static(),
- OEvoabDriver_CreateInstance, ::cppu::createSingleFactory)
- ;
-
- if(aReq.xRet.is())
- aReq.xRet->acquire();
-
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab/exports.dxp b/connectivity/source/drivers/evoab/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/drivers/evoab/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/drivers/evoab2/EApi.cxx b/connectivity/source/drivers/evoab2/EApi.cxx
deleted file mode 100644
index 1767ec1bcf..0000000000
--- a/connectivity/source/drivers/evoab2/EApi.cxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <rtl/ustring.hxx>
-#include <osl/module.h>
-#include <stdio.h>
-#define DECLARE_FN_POINTERS 1
-#include "EApi.h"
-static const char *eBookLibNames[] = {
- "libebook-1.2.so.10", // bumped again
- "libebook-1.2.so.9", // evolution-2.8
- "libebook-1.2.so.5", // evolution-2.4 and 2.6+
- "libebook-1.2.so.3", // evolution-2.2
- "libebook.so.8" // evolution-2.0
-};
-
-typedef void (*SymbolFunc) (void);
-
-#define SYM_MAP(a) { #a, (SymbolFunc *)&a }
- static struct {
- const char *sym_name;
- SymbolFunc *ref_value;
- } aApiMap[] = {
- SYM_MAP( e_contact_field_name ),
- SYM_MAP( e_contact_get ),
- SYM_MAP( e_contact_get_type ),
- SYM_MAP( e_contact_field_id ),
- SYM_MAP( e_source_peek_name ),
- SYM_MAP( e_source_get_property ),
- SYM_MAP( e_source_list_peek_groups ),
- SYM_MAP( e_source_group_peek_sources ),
- SYM_MAP( e_book_new ),
- SYM_MAP( e_book_open ),
- SYM_MAP( e_book_get_uri ),
- SYM_MAP( e_book_get_source ),
- SYM_MAP( e_book_get_addressbooks ),
- SYM_MAP( e_book_get_contacts ),
- SYM_MAP( e_book_authenticate_user ),
- SYM_MAP( e_book_query_field_test ),
- SYM_MAP( e_book_query_and ),
- SYM_MAP( e_book_query_or ),
- SYM_MAP( e_book_query_not ),
- SYM_MAP( e_book_query_ref ),
- SYM_MAP( e_book_query_unref ),
- SYM_MAP( e_book_query_from_string ),
- SYM_MAP( e_book_query_to_string ),
- SYM_MAP( e_book_query_field_exists ),
- SYM_MAP( e_source_group_peek_base_uri)
- };
-#undef SYM_MAP
-
-static bool
-tryLink( oslModule &aModule, const char *pName )
-{
- for( guint i = 0; i < G_N_ELEMENTS( aApiMap ); i++ )
- {
- SymbolFunc aMethod;
- aMethod = (SymbolFunc) osl_getFunctionSymbol
- ( aModule, rtl::OUString::createFromAscii ( aApiMap[ i ].sym_name ).pData );
- if( !aMethod )
- {
- fprintf( stderr, "Warning: missing symbol '%s' in '%s'",
- aApiMap[ i ].sym_name, pName );
- return false;
- }
- * aApiMap[ i ].ref_value = aMethod;
- }
- return true;
-}
-
-bool EApiInit()
-{
- oslModule aModule;
-
- for( guint j = 0; j < G_N_ELEMENTS( eBookLibNames ); j++ )
- {
- aModule = osl_loadModule( rtl::OUString::createFromAscii
- ( eBookLibNames[ j ] ).pData,
- SAL_LOADMODULE_DEFAULT );
- if( aModule)
- {
- if ( tryLink( aModule, eBookLibNames[ j ] ) )
- return true;
- osl_unloadModule( aModule );
- }
- }
- fprintf( stderr, "Can find no compliant libebook client libraries\n" );
- return false;
-}
-
-#if 0
-// hjs: SOLARDEF does no longer exist please lookup the required
-// defines in a regular compile line
-/*
- * Test code - enable &
- *
- * Compile with ( after source LinuxIntelEnv.Set.sh )
- gcc $SOLARDEF -I $SOLARVER/$UPD/$INPATH/inc \
- -I. `pkg-config --cflags --libs gobject-2.0` \
- -L $SOLARVER/$UPD/$INPATH/lib -luno_sal -lstdc++ EApi.cxx
- */
-
-int main( int argc, char **argv)
-{
- return EApiInit();
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/EApi.h b/connectivity/source/drivers/evoab2/EApi.h
deleted file mode 100755
index c089fda927..0000000000
--- a/connectivity/source/drivers/evoab2/EApi.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_EVOLUTION_API_HXX_
-#define _CONNECTIVITY_EVOAB_EVOLUTION_API_HXX_
-#include <glib-object.h>
-
-// Initializes the API below, returns false if not available
-bool EApiInit();
-
-G_BEGIN_DECLS
-
-// This header defined all the API methods as
-// function pointers instead of real functions
-// this will all evaporate as it is compiled generating
-// no symbol lookups or relocations, but giving code
-// clarity.
-
-// We attempt to define a minimum API that we use:
-
-// e-contact.h
-#ifdef DECLARE_FN_POINTERS
-#define EAPI_EXTERN
-#else
-#define EAPI_EXTERN extern
-#endif
-
-
-typedef void EContact;
-#define E_CONTACT(a) ((EContact *)(a))
-#define E_TYPE_CONTACT (e_contact_get_type())
-typedef int EContactField;
-
-EAPI_EXTERN const char *(*e_contact_field_name) ( EContactField field_id);
-EAPI_EXTERN gpointer (*e_contact_get) (EContact *contact, EContactField field_id);
-EAPI_EXTERN gconstpointer (*e_contact_get_const) (EContact *contact, EContactField field_id);
-// e-source.h
-typedef void ESource;
-#define E_SOURCE(a) ((ESource *)(a))
-EAPI_EXTERN const char *(*e_source_peek_name) (ESource *source);
-EAPI_EXTERN const gchar *(*e_source_get_property) (ESource *source,
- const gchar *property);
-
-EAPI_EXTERN GType (*e_contact_get_type) (void);
-EAPI_EXTERN EContactField (*e_contact_field_id) (const char *field_name);
-
-// e-source-list.h
-typedef void ESourceList;
-EAPI_EXTERN GSList *(*e_source_list_peek_groups) (ESourceList *list);
-
-// e-source-group.h
-typedef void ESourceGroup;
-#define E_SOURCE_GROUP(a) ((ESourceGroup *)(a))
-
-EAPI_EXTERN GSList *(*e_source_group_peek_sources) (ESourceGroup *group);
-EAPI_EXTERN const char *(*e_source_group_peek_base_uri) (ESourceGroup *group);
-// e-book.h
-typedef enum {
- E_BOOK_QUERY_IS,
- E_BOOK_QUERY_CONTAINS,
- E_BOOK_QUERY_BEGINS_WITH,
- E_BOOK_QUERY_ENDS_WITH,
-} EBookQueryTest;
-
-typedef void EBook;
-typedef void EBookQuery;
-
-EAPI_EXTERN EBook *(*e_book_new) (ESource *source,
- GError **error);
-
-EAPI_EXTERN gboolean (*e_book_open) (EBook *book,
- gboolean only_if_exists,
- GError **error);
-
-EAPI_EXTERN const char *(*e_book_get_uri) (EBook *book);
-EAPI_EXTERN ESource *(*e_book_get_source)(EBook *book);
-
-EAPI_EXTERN gboolean (*e_book_get_addressbooks) (ESourceList **addressbook_sources,
- GError **error);
-
-EAPI_EXTERN gboolean (*e_book_get_contacts) (EBook *book,
- EBookQuery *query,
- GList **contacts,
- GError **error);
-
-EAPI_EXTERN gboolean (*e_book_authenticate_user) (EBook *book,
- const char *user,
- const char *passwd,
- const char *auth_method,
- GError **error);
-
-// e-book-query.h
-EAPI_EXTERN EBookQuery* (*e_book_query_field_exists) (EContactField field);
-EAPI_EXTERN EBookQuery* (*e_book_query_field_test) (EContactField field,
- EBookQueryTest test,
- const char *value);
-EAPI_EXTERN EBookQuery* (*e_book_query_and) (int nqs, EBookQuery **qs, gboolean unref);
-EAPI_EXTERN EBookQuery* (*e_book_query_or) (int nqs, EBookQuery **qs, gboolean unref);
-EAPI_EXTERN EBookQuery* (*e_book_query_not) (EBookQuery *q, gboolean unref);
-EAPI_EXTERN EBookQuery* (*e_book_query_ref) (EBookQuery *q);
-EAPI_EXTERN void (*e_book_query_unref) (EBookQuery *q);
-EAPI_EXTERN char* (*e_book_query_to_string) (EBookQuery *q);
-EAPI_EXTERN EBookQuery* (*e_book_query_from_string) (const char *query_string);
-
-typedef struct {
- char *address_format; /* the two letter country code that
- determines the format/meaning of the
- following fields */
- char *po;
- char *ext;
- char *street;
- char *locality;
- char *region;
- char *code;
- char *country;
-} EContactAddress;
-G_END_DECLS
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NCatalog.cxx b/connectivity/source/drivers/evoab2/NCatalog.cxx
deleted file mode 100644
index d1cc91b842..0000000000
--- a/connectivity/source/drivers/evoab2/NCatalog.cxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "NCatalog.hxx"
-#include "NConnection.hxx"
-#include "NTables.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "NDebug.hxx"
-
-
-// -------------------------------------------------------------------------
-using namespace connectivity::evoab;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -------------------------------------------------------------------------
-OEvoabCatalog::OEvoabCatalog(OEvoabConnection* _pCon) :
- connectivity::sdbcx::OCatalog(_pCon)
- ,m_pConnection(_pCon)
- ,m_xMetaData(m_pConnection->getMetaData())
-{
-}
-void OEvoabCatalog::refreshTables()
-{
- TStringVector aVector;
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),aTypes);
-
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- ::rtl::OUString aName;
-
- while(xResult->next())
- {
- aName = xRow->getString(3);
- aVector.push_back(aName);
- }
- }
- if(m_pTables)
- m_pTables->reFill(aVector);
- else
- m_pTables = new OEvoabTables(m_xMetaData,*this,m_aMutex,aVector);
-}
-// XTablesSupplier
-Reference< XNameAccess > SAL_CALL OEvoabCatalog::getTables( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- try
- {
- if (!m_pTables) {
- refreshTables();
- }
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return m_pTables;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NCatalog.hxx b/connectivity/source/drivers/evoab2/NCatalog.hxx
deleted file mode 100644
index b08b4e46a1..0000000000
--- a/connectivity/source/drivers/evoab2/NCatalog.hxx
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_CATALOG_HXX_
-#define _CONNECTIVITY_EVOAB_CATALOG_HXX_
-
-#include "connectivity/sdbcx/VCatalog.hxx"
-
-namespace connectivity
-{
- namespace evoab
- {
- class OEvoabConnection;
- class OEvoabCatalog : public connectivity::sdbcx::OCatalog
- {
- OEvoabConnection *m_pConnection;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- public:
- OEvoabCatalog(OEvoabConnection *_pCon);
- inline OEvoabConnection* getConnection() const { return m_pConnection; }
- virtual void refreshTables();
- virtual void refreshViews() {}
- virtual void refreshGroups() {}
- virtual void refreshUsers() {}
- // XTablesSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTables(
- ) throw(::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_MOZAB_CATALOG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NColumns.cxx b/connectivity/source/drivers/evoab2/NColumns.cxx
deleted file mode 100644
index 53818b7507..0000000000
--- a/connectivity/source/drivers/evoab2/NColumns.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "NColumns.hxx"
-#include "NTable.hxx"
-#include "NTables.hxx"
-#include "NCatalog.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-
-using namespace connectivity::sdbcx;
-using namespace connectivity;
-using namespace ::comphelper;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace connectivity::evoab;
-
-// -------------------------------------------------------------------------
-sdbcx::ObjectType OEvoabColumns::createObject(const ::rtl::OUString& _rName)
-{
- Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns(
- Any(),
- m_pTable->getSchema(),
- m_pTable->getTableName(),
- _rName);
-
- sdbcx::ObjectType xRet = NULL;
- if (xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
-
- while (xResult->next())
- {
- if (xRow->getString(4) == _rName)
- {
- OColumn* pRet = new OColumn(
- _rName,
- xRow->getString(6),
- xRow->getString(13),
- xRow->getString(12),
- xRow->getInt(11),
- xRow->getInt(7),
- xRow->getInt(9),
- xRow->getInt(5),
- sal_False,
- sal_False,
- sal_False,
- sal_True);
- xRet = pRet;
- break;
- }
- }
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void OEvoabColumns::impl_refresh() throw(RuntimeException)
-{
- m_pTable->refreshColumns();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NColumns.hxx b/connectivity/source/drivers/evoab2/NColumns.hxx
deleted file mode 100644
index 34c01e911f..0000000000
--- a/connectivity/source/drivers/evoab2/NColumns.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_COLUMNS_HXX_
-#define _CONNECTIVITY_EVOAB_COLUMNS_HXX_
-
-#include "NTable.hxx"
-#include "connectivity/sdbcx/VCollection.hxx"
-
-namespace connectivity
-{
- namespace evoab
- {
- class OEvoabColumns : public sdbcx::OCollection
- {
- protected:
- OEvoabTable* m_pTable;
-
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
-
- public:
- OEvoabColumns( OEvoabTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector
- ) : sdbcx::OCollection(*_pTable,sal_True,_rMutex,_rVector),
- m_pTable(_pTable)
- { }
- };
- }
-}
-
-#endif // _CONNECTIVITY_EVOAB_COLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NConnection.cxx b/connectivity/source/drivers/evoab2/NConnection.cxx
deleted file mode 100644
index f056f61719..0000000000
--- a/connectivity/source/drivers/evoab2/NConnection.cxx
+++ /dev/null
@@ -1,293 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "NConnection.hxx"
-#include "NDatabaseMetaData.hxx"
-#include "NCatalog.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/TransactionIsolation.hpp>
-#include <tools/urlobj.hxx>
-#include "NPreparedStatement.hxx"
-#include "NStatement.hxx"
-#include <comphelper/extract.hxx>
-#include <connectivity/dbexception.hxx>
-#include <comphelper/processfactory.hxx>
-#include <tools/debug.hxx>
-#include "NDebug.hxx"
-#include <comphelper/sequence.hxx>
-
-using namespace connectivity::evoab;
-using namespace dbtools;
-
-//------------------------------------------------------------------------------
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-
-::rtl::OUString implGetExceptionMsg( Exception& e, const ::rtl::OUString& aExceptionType_ )
-{
- ::rtl::OUString aExceptionType = aExceptionType_;
- if( aExceptionType.getLength() == 0 )
- aExceptionType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown")) ;
-
- ::rtl::OUString aTypeLine( RTL_CONSTASCII_USTRINGPARAM("\nType: " ) );
- aTypeLine += aExceptionType;
-
- ::rtl::OUString aMessageLine( RTL_CONSTASCII_USTRINGPARAM("\nMessage: " ) );
- aMessageLine += ::rtl::OUString( e.Message );
-
- ::rtl::OUString aMsg(aTypeLine);
- aMsg += aMessageLine;
- return aMsg;
-}
-
- // Exception type unknown
-::rtl::OUString implGetExceptionMsg( Exception& e )
-{
- ::rtl::OUString aMsg = implGetExceptionMsg( e, ::rtl::OUString() );
- return aMsg;
-}
-
-// --------------------------------------------------------------------------------
-OEvoabConnection::OEvoabConnection( OEvoabDriver& _rDriver )
- :OSubComponent<OEvoabConnection, OConnection_BASE>( (::cppu::OWeakObject*)(&_rDriver), this )
- ,m_rDriver(_rDriver)
- ,m_xCatalog(NULL)
-{
-}
-//-----------------------------------------------------------------------------
-OEvoabConnection::~OEvoabConnection()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if(!isClosed()) {
- acquire();
- close();
- }
-}
-
-//-----------------------------------------------------------------------------
-void SAL_CALL OEvoabConnection::release() throw()
-{
- relase_ChildImpl();
-}
-
-// XServiceInfo
-// --------------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OEvoabConnection, "com.sun.star.sdbc.drivers.evoab.Connection", "com.sun.star.sdbc.Connection")
-
-//-----------------------------------------------------------------------------
-void OEvoabConnection::construct(const ::rtl::OUString& url, const Sequence< PropertyValue >& info) throw(SQLException)
-{
- osl_incrementInterlockedCount( &m_refCount );
- EVO_TRACE_STRING("OEvoabConnection::construct()::url = %s\n", url );
-
- ::rtl::OUString sPassword;
- const char* pPwd = "password";
-
- const PropertyValue *pIter = info.getConstArray();
- const PropertyValue *pEnd = pIter + info.getLength();
- for(;pIter != pEnd;++pIter)
- {
- if(!pIter->Name.compareToAscii(pPwd))
- {
- pIter->Value >>= sPassword;
- break;
- }
- }
-
- if (url.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sdbc:address:evolution:groupwise")))
- setSDBCAddressType(SDBCAddress::EVO_GWISE);
- else if (url.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sdbc:address:evolution:ldap")))
- setSDBCAddressType(SDBCAddress::EVO_LDAP);
- else
- setSDBCAddressType(SDBCAddress::EVO_LOCAL);
- setURL(url);
- setPassword(::rtl::OUStringToOString(sPassword,RTL_TEXTENCODING_UTF8));
- osl_decrementInterlockedCount( &m_refCount );
-}
-
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabConnection::nativeSQL( const ::rtl::OUString& _sSql ) throw(SQLException, RuntimeException)
-{
- // when you need to transform SQL92 to you driver specific you can do it here
- return _sSql;
-}
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL OEvoabConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if(!xMetaData.is())
- {
- xMetaData = new OEvoabDatabaseMetaData(this);
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-//------------------------------------------------------------------------------
-::com::sun::star::uno::Reference< XTablesSupplier > OEvoabConnection::createCatalog()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- Reference< XTablesSupplier > xTab = m_xCatalog;
- if(!xTab.is())
- {
- OEvoabCatalog *pCat = new OEvoabCatalog(this);
- xTab = pCat;
- m_xCatalog = xTab;
- }
- return xTab;
-}
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL OEvoabConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- OStatement* pStmt = new OStatement(this);
-
- Reference< XStatement > xStmt = pStmt;
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return xStmt;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OEvoabConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- OEvoabPreparedStatement* pStmt = new OEvoabPreparedStatement( this );
- Reference< XPreparedStatement > xStmt = pStmt;
- pStmt->construct( sql );
-
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return xStmt;
-}
-
-Reference< XPreparedStatement > SAL_CALL OEvoabConnection::prepareCall( const ::rtl::OUString& /*sql*/ ) throw( SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::prepareCall", *this );
- return NULL;
-}
-sal_Bool SAL_CALL OEvoabConnection::isClosed( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- return OConnection_BASE::rBHelper.bDisposed;
-}
-
-// --------------------------------------------------------------------------------
-// XCloseable
-void SAL_CALL OEvoabConnection::close( ) throw(SQLException, RuntimeException)
-{
- { // we just dispose us
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- }
- dispose();
-}
-
-// --------------------------------------------------------------------------------
-// XWarningsSupplier
-Any SAL_CALL OEvoabConnection::getWarnings( ) throw(SQLException, RuntimeException)
-{
- return m_aWarnings.getWarnings();
-}
-void SAL_CALL OEvoabConnection::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- m_aWarnings.clearWarnings();
-}
-//------------------------------------------------------------------------------
-
-void OEvoabConnection::disposing()
-{
- // we noticed that we should be destroyed in near future so we have to dispose our statements
- ::osl::MutexGuard aGuard(m_aMutex);
- OConnection_BASE::disposing();
- dispose_ChildImpl();
-}
-
-// -------------------------------- stubbed methods ------------------------------------------------
-void SAL_CALL OEvoabConnection::setAutoCommit( sal_Bool /*autoCommit*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setAutoCommit", *this );
-}
-sal_Bool SAL_CALL OEvoabConnection::getAutoCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-void SAL_CALL OEvoabConnection::commit( ) throw(SQLException, RuntimeException)
-{
-}
-void SAL_CALL OEvoabConnection::rollback( ) throw(SQLException, RuntimeException)
-{
-}
-void SAL_CALL OEvoabConnection::setReadOnly( sal_Bool /*readOnly*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setReadOnly", *this );
-}
-sal_Bool SAL_CALL OEvoabConnection::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-void SAL_CALL OEvoabConnection::setCatalog( const ::rtl::OUString& /*catalog*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setCatalog", *this );
-}
-
-::rtl::OUString SAL_CALL OEvoabConnection::getCatalog( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-void SAL_CALL OEvoabConnection::setTransactionIsolation( sal_Int32 /*level*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setTransactionIsolation", *this );
-}
-
-sal_Int32 SAL_CALL OEvoabConnection::getTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- return TransactionIsolation::NONE;
-}
-
-Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OEvoabConnection::getTypeMap( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::getTypeMap", *this );
- return NULL;
-}
-void SAL_CALL OEvoabConnection::setTypeMap( const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setTypeMap", *this );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NConnection.hxx b/connectivity/source/drivers/evoab2/NConnection.hxx
deleted file mode 100644
index 2b25b76013..0000000000
--- a/connectivity/source/drivers/evoab2/NConnection.hxx
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_CONNECTION_HXX_
-#define _CONNECTIVITY_EVOAB_CONNECTION_HXX_
-
-#include "NDriver.hxx"
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include "OSubComponent.hxx"
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#include "connectivity/CommonTools.hxx"
-#include "connectivity/warningscontainer.hxx"
-#include "TConnection.hxx"
-#include <cppuhelper/weakref.hxx>
-#include <osl/module.h>
-#include "EApi.h"
-
-namespace connectivity
-{
- namespace evoab
- {
-
- namespace SDBCAddress {
- typedef enum {
- Unknown = 0,
- EVO_LOCAL = 1,
- EVO_LDAP = 2,
- EVO_GWISE = 3
- } sdbc_address_type;
- }
-
- typedef connectivity::OMetaConnection OConnection_BASE; // implements basics and text encoding
-
- class OEvoabConnection :public OConnection_BASE
- ,public connectivity::OSubComponent<OEvoabConnection, OConnection_BASE>
- {
- friend class connectivity::OSubComponent<OEvoabConnection, OConnection_BASE>;
-
- private:
- const OEvoabDriver& m_rDriver;
- SDBCAddress::sdbc_address_type m_eSDBCAddressType;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier >
- m_xCatalog;
- ::rtl::OString m_aPassword;
- ::dbtools::WarningsContainer m_aWarnings;
-
- virtual ~OEvoabConnection();
-
- public:
- OEvoabConnection( OEvoabDriver& _rDriver );
- virtual void construct(const ::rtl::OUString& _rUrl,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo ) throw( ::com::sun::star::sdbc::SQLException);
-
- inline rtl::OString getPassword() { return m_aPassword; }
- inline void setPassword( rtl::OString aStr ) { m_aPassword = aStr; }
- // own methods
- inline const OEvoabDriver& getDriver() const { return m_rDriver; }
-
- SDBCAddress::sdbc_address_type getSDBCAddressType() const { return m_eSDBCAddressType;}
- void setSDBCAddressType(SDBCAddress::sdbc_address_type _eSDBCAddressType) {m_eSDBCAddressType = _eSDBCAddressType;}
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL release() throw();
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
-
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL nativeSQL( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getAutoCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL commit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL rollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isClosed( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCatalog( const ::rtl::OUString& catalog ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalog( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_EVOAB_CONNECTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
deleted file mode 100644
index 5af4a68551..0000000000
--- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
+++ /dev/null
@@ -1,1196 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "NDatabaseMetaData.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/TransactionIsolation.hpp>
-#include <connectivity/dbexception.hxx>
-#include <connectivity/FValue.hxx>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/ColumnSearch.hpp>
-
-#include <vector>
-#include <string.h>
-#include "EApi.h"
-
-#if OSL_DEBUG_LEVEL > 0
-# define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr())
-#else /* OSL_DEBUG_LEVEL */
-# define OUtoCStr( x ) ("dummy")
-#endif /* OSL_DEBUG_LEVEL */
-
-using namespace connectivity::evoab;
-using namespace connectivity;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-
-
-namespace connectivity
-{
- namespace evoab
- {
- static sal_Int32 const s_nCOLUMN_SIZE = 256;
- static sal_Int32 const s_nDECIMAL_DIGITS = 0;
- static sal_Int32 const s_nNULLABLE = 1;
- static sal_Int32 const s_nCHAR_OCTET_LENGTH = 65535;
-
- static ColumnProperty **pFields=NULL;
- static guint nFields = 0;
-
- static const char *pBlackList[] =
- {
- "id",
- "list-show-addresses",
- "address-label-home",
- "address-label-work",
- "address-label-other"
- };
-
- const SplitEvoColumns* get_evo_addr()
- {
- static const SplitEvoColumns evo_addr[] = {
- {"addr-line1",DEFAULT_ADDR_LINE1},{"addr-line2",DEFAULT_ADDR_LINE2},{"city",DEFAULT_CITY},{"state",DEFAULT_STATE},{"country",DEFAULT_COUNTRY},{"zip",DEFAULT_ZIP},
- {"work-addr-line1",WORK_ADDR_LINE1},{"work-addr-line2",WORK_ADDR_LINE2},{"work-city",WORK_CITY},{"work-state",WORK_STATE},{"work-country",WORK_COUNTRY},{"work-zip",WORK_ZIP},
- {"home-addr-line1",HOME_ADDR_LINE1},{"home-addr-line2",HOME_ADDR_LINE2},{"home-addr-City",HOME_CITY},{"home-state",HOME_STATE},{"home-country",HOME_COUNTRY},{"home-zip",HOME_ZIP},
- {"other-addr-line1",OTHER_ADDR_LINE1},{"other-addr-line2",OTHER_ADDR_LINE2},{"other-addr-city",OTHER_CITY},{"other-addr-state",OTHER_STATE},{"other-addr-country",OTHER_COUNTRY},{"other-addr-zip",OTHER_ZIP}
- };
- return evo_addr;
- }
-
- static void
- splitColumn (ColumnProperty **pToBeFields)
- {
- const SplitEvoColumns* evo_addr( get_evo_addr() );
- for (int i = 0; i < OTHER_ZIP; i++)
- {
- pToBeFields[nFields] = g_new0(ColumnProperty,1);
- pToBeFields[nFields]->bIsSplittedValue = true;
- pToBeFields[nFields]->pField = g_param_spec_ref(g_param_spec_string (evo_addr[i].pColumnName,evo_addr[i].pColumnName,"",NULL,G_PARAM_WRITABLE));
- nFields++;
- }
- }
-
- static void
- initFields()
- {
- if( !pFields )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !pFields )
- {
- guint nProps;
- ColumnProperty **pToBeFields;
- GParamSpec **pProps;
- nFields = 0;
- pProps = g_object_class_list_properties
- ( (GObjectClass *) g_type_class_ref( E_TYPE_CONTACT ),
- &nProps );
- pToBeFields = g_new0(ColumnProperty *, (nProps + OTHER_ZIP)/* new column(s)*/ );
- for ( guint i = 0; i < nProps; i++ )
- {
- switch (pProps[i]->value_type)
- {
- case G_TYPE_STRING:
- case G_TYPE_BOOLEAN:
- {
- bool bAdd = true;
- const char *pName = g_param_spec_get_name( pProps[i] );
- for (unsigned int j = 0; j < G_N_ELEMENTS( pBlackList ); j++ )
- {
- if( !strcmp( pBlackList[j], pName ) )
- {
- bAdd = false;
- break;
- }
- }
- if( bAdd )
- {
- pToBeFields[nFields]= g_new0(ColumnProperty,1);
- pToBeFields[nFields]->bIsSplittedValue=false;
- pToBeFields[ nFields++ ]->pField = g_param_spec_ref( pProps[i] );
- }
- break;
- }
- default:
- break;
- }
- }
-
- splitColumn(pToBeFields);
- pFields = pToBeFields;
- }
- }
- }
-
-
- guint
- getFieldCount()
- {
- initFields();
- return nFields;
- }
-
- const ColumnProperty *
- getField(guint n)
- {
- initFields();
- if( n < nFields )
- return pFields[n];
- else
- return NULL;
- }
-
- GType
- getGFieldType( guint nCol )
- {
- initFields();
-
- sal_Int32 nType = G_TYPE_STRING;
- if ( nCol < nFields )
- return ((GParamSpec *)pFields[nCol]->pField)->value_type;
- return nType;
- }
-
- sal_Int32
- getFieldType( guint nCol )
- {
- sal_Int32 nType = getGFieldType( nCol );
- return nType == G_TYPE_STRING ? DataType::VARCHAR : DataType::BIT;
- }
-
- guint findEvoabField(const rtl::OUString& aColName)
- {
- guint nRet = (guint)-1;
- sal_Bool bFound = sal_False;
- initFields();
- for (guint i=0;(i < nFields) && !bFound;i++)
- {
- rtl::OUString aName = getFieldName(i);
- if (aName == aColName)
- {
- nRet = i;
- bFound = sal_True;
- }
- }
- return nRet;
- }
-
- rtl::OUString
- getFieldTypeName( guint nCol )
- {
- switch( getFieldType( nCol ) )
- {
- case DataType::BIT:
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BIT"));
- case DataType::VARCHAR:
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
- default:
- break;
- }
- return ::rtl::OUString();
- }
-
- rtl::OUString
- getFieldName( guint nCol )
- {
- const GParamSpec *pSpec = getField( nCol )->pField;
- rtl::OUString aName;
- initFields();
-
- if( pSpec )
- aName = rtl::OStringToOUString( g_param_spec_get_name( ( GParamSpec * )pSpec ),
- RTL_TEXTENCODING_UTF8 );
- aName = aName.replace( '-', '_' );
- return aName;
- }
-
- void
- free_column_resources()
- {
- for (int i=nFields-1;i > 0;i--)
- {
- if (pFields && pFields[i] )
- {
- if (pFields[i]->pField)
- g_param_spec_unref(pFields[i]->pField);
- g_free(pFields[i]);
- }
- }
- if(pFields)
- {
- g_free(pFields);
- pFields=NULL;
- }
-
- }
-
-
- }
-}
-
-
-OEvoabDatabaseMetaData::OEvoabDatabaseMetaData(OEvoabConnection* _pCon)
- : ::connectivity::ODatabaseMetaDataBase(_pCon, _pCon->getConnectionInfo())
- ,m_pConnection(_pCon)
-{
- OSL_ENSURE(m_pConnection,"OEvoabDatabaseMetaData::OEvoabDatabaseMetaData: No connection set!");
-}
-OEvoabDatabaseMetaData::~OEvoabDatabaseMetaData()
-{
-}
-
-// -------------------------------------------------------------------------
-ODatabaseMetaDataResultSet::ORows& OEvoabDatabaseMetaData::getColumnRows( const ::rtl::OUString& columnNamePattern )
-{
- static ODatabaseMetaDataResultSet::ORows aRows;
- ODatabaseMetaDataResultSet::ORow aRow(19);
- aRows.clear();
-
- // ****************************************************
- // Some entries in a row never change, so set them now
- // ****************************************************
-
- // Catalog
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")));
- // Schema
- aRow[2] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")));
- // COLUMN_SIZE
- aRow[7] = new ORowSetValueDecorator(s_nCOLUMN_SIZE);
- // BUFFER_LENGTH, not used
- aRow[8] = ODatabaseMetaDataResultSet::getEmptyValue();
- // DECIMAL_DIGITS.
- aRow[9] = new ORowSetValueDecorator(s_nDECIMAL_DIGITS);
- // NUM_PREC_RADIX
- aRow[10] = new ORowSetValueDecorator((sal_Int32)10);
- // NULLABLE
- aRow[11] = new ORowSetValueDecorator(s_nNULLABLE);
- // REMARKS
- aRow[12] = ODatabaseMetaDataResultSet::getEmptyValue();
- // COULUMN_DEF, not used
- aRow[13] = ODatabaseMetaDataResultSet::getEmptyValue();
- // SQL_DATA_TYPE, not used
- aRow[14] = ODatabaseMetaDataResultSet::getEmptyValue();
- // SQL_DATETIME_SUB, not used
- aRow[15] = ODatabaseMetaDataResultSet::getEmptyValue();
- // CHAR_OCTET_LENGTH, refer to [5]
- aRow[16] = new ORowSetValueDecorator(s_nCHAR_OCTET_LENGTH);
- // IS_NULLABLE
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("YES")));
-
-
- aRow[3] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE")));
- ::osl::MutexGuard aGuard( m_aMutex );
-
- initFields();
- for (sal_Int32 i = 0; i < (sal_Int32) nFields; i++)
- {
- if( match( columnNamePattern, getFieldName( i ), '\0' ) )
- {
- aRow[5] = new ORowSetValueDecorator( static_cast<sal_Int16>( getFieldType( i ) ) );
- aRow[6] = new ORowSetValueDecorator( getFieldTypeName( i ) );
-
- OSL_TRACE( "ColumnName = '%s'", g_param_spec_get_name( pFields[i]->pField ) );
- // COLUMN_NAME
- aRow[4] = new ORowSetValueDecorator( getFieldName( i ) );
- // ORDINAL_POSITION
- aRow[17] = new ORowSetValueDecorator( i );
- aRows.push_back( aRow );
- }
- }
-
- return aRows ;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString OEvoabDatabaseMetaData::impl_getCatalogSeparator_throw( )
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 OEvoabDatabaseMetaData::impl_getMaxStatements_throw( )
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 OEvoabDatabaseMetaData::impl_getMaxTablesInSelect_throw( )
-{
- // We only support a single table
- return 1;
-}
-// -------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool OEvoabDatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool OEvoabDatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool OEvoabDatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- return aVal;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString OEvoabDatabaseMetaData::impl_getIdentifierQuoteString_throw( )
-{
- // normally this is "
- ::rtl::OUString aVal(RTL_CONSTASCII_USTRINGPARAM("\""));
- return aVal;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- return aVal;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool OEvoabDatabaseMetaData::impl_isCatalogAtStart_throw( )
-{
- sal_Bool bValue = sal_False;
- return bValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 /*level*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool OEvoabDatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException)
-{
- return sal_True; // should be supported at least
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool OEvoabDatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool OEvoabDatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool OEvoabDatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException)
-{
- // We allow you to select from any table.
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- // For now definately read-only, no support for update/delete
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException)
-{
- // todo add Support for this.
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsConvert( sal_Int32 /*fromType*/, sal_Int32 /*toType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool OEvoabDatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
-{
- // Any case may be used
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- return m_pConnection->getURL();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getDriverVersion() throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue = ::rtl::OUString::valueOf((sal_Int32)1);
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue = ::rtl::OUString::valueOf((sal_Int32)0);
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException)
-{
- return 1;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- return TransactionIsolation::NONE;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsResultSetType( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsResultSetConcurrency( sal_Int32 /*setType*/, sal_Int32 /*concurrency*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::ownUpdatesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::ownDeletesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::ownInsertsAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::othersUpdatesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::othersDeletesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::othersInsertsAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::updatesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::deletesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::insertsAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-// here follow all methods which return a resultset
-// the first methods is an example implementation how to use this resultset
-// of course you could implement it on your and you should do this because
-// the general way is more memory expensive
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException)
-{
- /* Dont need to change as evoab driver supports only table */
-
- // there exists no possibility to get table types so we have to check
- static ::rtl::OUString sTableTypes[] =
- {
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE")),
- // Currently we only support a 'TABLE' nothing more complex
- };
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTableTypes);
- Reference< XResultSet > xRef = pResult;
-
- // here we fill the rows which should be visible when ask for data from the resultset returned here
- sal_Int32 nSize = sizeof(sTableTypes) / sizeof(::rtl::OUString);
- ODatabaseMetaDataResultSet::ORows aRows;
- for(sal_Int32 i=0;i < nSize;++i)
- {
- ODatabaseMetaDataResultSet::ORow aRow;
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator(sTableTypes[i]));
-
- // bound row
- aRows.push_back(aRow);
- }
- // here we set the rows at the resultset
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > OEvoabDatabaseMetaData::impl_getTypeInfo_throw( )
-{
- /*
- * Return the proper type information required by evo driver
- */
-
- ODatabaseMetaDataResultSet* pResultSet = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTypeInfo);
-
- Reference< XResultSet > xResultSet = pResultSet;
- static ODatabaseMetaDataResultSet::ORows aRows;
-
- if(aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow;
- aRow.reserve(19);
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"))));
- aRow.push_back(new ORowSetValueDecorator(DataType::VARCHAR));
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)s_nCHAR_OCTET_LENGTH));
- aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- // aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnValue::NULLABLE));
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnSearch::FULL));
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)10));
-
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR")));
- aRow[2] = new ORowSetValueDecorator(DataType::VARCHAR);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)65535);
- aRows.push_back(aRow);
- }
- pResultSet->setRows(aRows);
- return xResultSet;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getColumns(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& /*tableNamePattern*/,
- const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- // this returns an empty resultset where the column-names are already set
- // in special the metadata of the resultset already returns the right columns
- ODatabaseMetaDataResultSet* pResultSet = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eColumns );
- Reference< XResultSet > xResultSet = pResultSet;
- pResultSet->setRows( getColumnRows( columnNamePattern ) );
- return xResultSet;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTables(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/,
- const ::rtl::OUString& /*tableNamePattern*/, const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTableTypes);
- Reference< XResultSet > xRef = pResult;
-
- // check if any type is given
- // when no types are given then we have to return all tables e.g. TABLE
-
- const ::rtl::OUString aTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
-
- sal_Bool bTableFound = sal_True;
- sal_Int32 nLength = types.getLength();
- if(nLength)
- {
- bTableFound = sal_False;
-
- const ::rtl::OUString* pBegin = types.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + nLength;
- for(;pBegin != pEnd;++pBegin)
- {
- if(*pBegin == aTable)
- {
- bTableFound = sal_True;
- break;
- }
- }
- }
- if(!bTableFound)
- return xRef;
-
- ODatabaseMetaDataResultSet::ORows aRows;
-
- ESourceList *pSourceList;
- if( !e_book_get_addressbooks (&pSourceList, NULL) )
- pSourceList = NULL;
-
- GSList *g;
- for( g = e_source_list_peek_groups( pSourceList ); g; g = g->next)
- {
- GSList *s;
- const char *p = e_source_group_peek_base_uri(E_SOURCE_GROUP(g->data));
-
- switch (m_pConnection->getSDBCAddressType()) {
- case SDBCAddress::EVO_GWISE:
- if ( !strncmp( "groupwise://", p, 11 ))
- break;
- else
- continue;
- case SDBCAddress::EVO_LOCAL:
- if ( !strncmp( "file://", p, 6 ) ||
- !strncmp( "local://", p, 6 ) )
- break;
- else
- continue;
- case SDBCAddress::EVO_LDAP:
- if ( !strncmp( "ldap://", p, 6 ))
- break;
- else
- continue;
- case SDBCAddress::Unknown:
- break;
- }
- for (s = e_source_group_peek_sources (E_SOURCE_GROUP (g->data)); s; s = s->next)
- {
- ESource *pSource = E_SOURCE (s->data);
-
- rtl::OUString aName = rtl::OStringToOUString( e_source_peek_name( pSource ),
- RTL_TEXTENCODING_UTF8 );
-
- ODatabaseMetaDataResultSet::ORow aRow(3);
- aRow.reserve(6);
- aRow.push_back(new ORowSetValueDecorator(aName));
- aRow.push_back(new ORowSetValueDecorator(aTable));
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRows.push_back(aRow);
- }
- }
-
- pResult->setRows(aRows);
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getUDTs( const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& /*typeNamePattern*/, const Sequence< sal_Int32 >& /*types*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XDatabaseMetaDaza::getUDTs", *this );
- return NULL;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.hxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.hxx
deleted file mode 100644
index a0fe1788e2..0000000000
--- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.hxx
+++ /dev/null
@@ -1,237 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_DATABASEMETADATA_HXX_
-#define _CONNECTIVITY_EVOAB_DATABASEMETADATA_HXX_
-
-#include "NDebug.hxx"
-#include "NConnection.hxx"
-#include "TDatabaseMetaDataBase.hxx"
-#include "FDatabaseMetaDataResultSet.hxx"
-
-
-namespace connectivity
-{
- namespace evoab
- {
- class EvoContacts;
-
-
- //**************************************************************
- //************ Class: OEvoabDatabaseMetaData
- //**************************************************************
- typedef struct{
- gboolean bIsSplittedValue;
- GParamSpec *pField;
- }ColumnProperty;
-
- typedef enum {
- DEFAULT_ADDR_LINE1=1,DEFAULT_ADDR_LINE2,DEFAULT_CITY,DEFAULT_STATE,DEFAULT_COUNTRY,DEFAULT_ZIP,
- WORK_ADDR_LINE1,WORK_ADDR_LINE2,WORK_CITY,WORK_STATE,WORK_COUNTRY,WORK_ZIP,
- HOME_ADDR_LINE1,HOME_ADDR_LINE2,HOME_CITY,HOME_STATE,HOME_COUNTRY,HOME_ZIP,
- OTHER_ADDR_LINE1,OTHER_ADDR_LINE2,OTHER_CITY,OTHER_STATE,OTHER_COUNTRY,OTHER_ZIP
- }ColumnNumber;
-
- typedef struct {
- const gchar *pColumnName;
- ColumnNumber value;
- }SplitEvoColumns;
-
- const SplitEvoColumns* get_evo_addr();
-
- const ColumnProperty *getField(guint n);
- guint getFieldCount() ;
- GType getGFieldType(guint nCol) ;
- sal_Int32 getFieldType(guint nCol) ;
- rtl::OUString getFieldTypeName(guint nCol) ;
- rtl::OUString getFieldName(guint nCol) ;
- guint findEvoabField(const rtl::OUString& aColName);
-
- void free_column_resources();
-
- class OEvoabDatabaseMetaData : public ODatabaseMetaDataBase
- {
- OEvoabConnection* m_pConnection;
-
- ODatabaseMetaDataResultSet::ORows& getColumnRows( const ::rtl::OUString& columnNamePattern );
-
- protected:
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw();
- // cached database information
- virtual ::rtl::OUString impl_getIdentifierQuoteString_throw( );
- virtual sal_Bool impl_isCatalogAtStart_throw( );
- virtual ::rtl::OUString impl_getCatalogSeparator_throw( );
- virtual sal_Bool impl_supportsCatalogsInTableDefinitions_throw( );
- virtual sal_Bool impl_supportsSchemasInTableDefinitions_throw( ) ;
- virtual sal_Bool impl_supportsCatalogsInDataManipulation_throw( );
- virtual sal_Bool impl_supportsSchemasInDataManipulation_throw( ) ;
- virtual sal_Bool impl_supportsMixedCaseQuotedIdentifiers_throw( ) ;
- virtual sal_Bool impl_supportsAlterTableWithAddColumn_throw( );
- virtual sal_Bool impl_supportsAlterTableWithDropColumn_throw( );
- virtual sal_Int32 impl_getMaxStatements_throw( );
- virtual sal_Int32 impl_getMaxTablesInSelect_throw( );
- virtual sal_Bool impl_storesMixedCaseQuotedIdentifiers_throw( );
-
- virtual ~OEvoabDatabaseMetaData();
- public:
- inline OEvoabConnection* getOwnConnection() const { return m_pConnection; }
-
- OEvoabDatabaseMetaData(OEvoabConnection* _pCon);
-
- // as I mentioned before this interface is really BIG
- // XDatabaseMetaData
- virtual sal_Bool SAL_CALL allProceduresAreCallable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL allTablesAreSelectable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getUserName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedLow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFiles( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::rtl::OUString SAL_CALL getSQLKeywords( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getNumericFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getStringFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSystemFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTimeDateFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSearchStringEscape( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getExtraNameCharacters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsColumnAliasing( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTypeConversion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getProcedureTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedDelete( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsStoredProcedures( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnionAll( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxConnections( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxIndexLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxRowSize( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxStatementLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTables( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTableTypes( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsBatchUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getUDTs( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern, const ::com::sun::star::uno::Sequence< sal_Int32 >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // _CONNECTIVITY_EVOAB_DATABASEMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NDebug.cxx b/connectivity/source/drivers/evoab2/NDebug.cxx
deleted file mode 100644
index 92e360425b..0000000000
--- a/connectivity/source/drivers/evoab2/NDebug.cxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "NDebug.hxx"
-#include <osl/diagnose.h>
-#ifdef DEBUG
-void evo_traceStringMessage( const sal_Char *pFormat,
- const ::rtl::OUString& rString )
-{
- rtl::OString aStr;
- aStr = ::rtl::OUStringToOString (rString, RTL_TEXTENCODING_UTF8);
- OSL_TRACE(pFormat, (const sal_Char *) aStr );
-}
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NDebug.hxx b/connectivity/source/drivers/evoab2/NDebug.hxx
deleted file mode 100644
index 77f7269c82..0000000000
--- a/connectivity/source/drivers/evoab2/NDebug.hxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
-#define CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
-
-#include <stdio.h>
-#include <rtl/ustring.hxx>
-#include <com/sun/star/beans/PropertyValue.hpp>
-
-#ifdef DEBUG
- void evo_traceStringMessage( const sal_Char* pFormat, const ::rtl::OUString& rString );
-# define EVO_TRACE_STRING( pFormat, rString ) evo_traceStringMessage( pFormat, rString )
-#else
-# define EVO_TRACE_STRING( pFormat, rString ) ((void)0)
-#endif
-
-#endif // CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NDriver.cxx b/connectivity/source/drivers/evoab2/NDriver.cxx
deleted file mode 100644
index ddb8d78b54..0000000000
--- a/connectivity/source/drivers/evoab2/NDriver.cxx
+++ /dev/null
@@ -1,192 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "NDriver.hxx"
-#include "NConnection.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/dbexception.hxx"
-#include <osl/file.hxx>
-#include "osl/security.hxx"
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/ucb/XContentAccess.hpp>
-#include <com/sun/star/ucb/XCommandEnvironment.hpp>
-#include <ucbhelper/content.hxx>
-#include <tools/debug.hxx>
-#include "NDebug.hxx"
-#include <signal.h>
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-
-using namespace osl;
-using namespace connectivity::evoab;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::ucb;
-
-// --------------------------------------------------------------------------------
-OEvoabDriver::OEvoabDriver(const Reference< XMultiServiceFactory >& _rxFactory) :
- ODriver_BASE( m_aMutex ), m_xFactory( _rxFactory )
-{
-}
-// -----------------------------------------------------------------------------
-OEvoabDriver::~OEvoabDriver()
-{
-}
-// -----------------------------------------------------------------------------
-void OEvoabDriver::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- // when driver will be destroied so all our connections have to be destroied as well
- for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
- {
- Reference< XComponent > xComp(i->get(), UNO_QUERY);
- if (xComp.is())
- {
- try
- {
- xComp->dispose();
- }
- catch (const com::sun::star::lang::DisposedException&)
- {
- xComp.clear();
- }
- }
- }
- m_xConnections.clear();
- connectivity::OWeakRefArray().swap(m_xConnections); // this really clears
-
- ODriver_BASE::disposing();
-}
-
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString OEvoabDriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(EVOAB_DRIVER_IMPL_NAME));
- // this name is referenced in the configuration and in the evoab.xml
- // Please take care when changing it.
-}
-
-//------------------------------------------------------------------
-Sequence< ::rtl::OUString > OEvoabDriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
-{
- // which service is supported
- // for more information @see com.sun.star.sdbc.Driver
- Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"));
- return aSNS;
-}
-//------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-//------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDriver::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-//------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL OEvoabDriver::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-
-//------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL connectivity::evoab::OEvoabDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
-{
- return *(new OEvoabDriver(_rxFactory));
-}
-// --------------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL OEvoabDriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- if ( ! acceptsURL(url) )
- return NULL;
-
- OEvoabConnection* pCon = new OEvoabConnection( *this );
- pCon->construct(url,info);
- Reference< XConnection > xCon = pCon;
- m_xConnections.push_back(WeakReferenceHelper(*pCon));
-
- return xCon;
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDriver::acceptsURL( const ::rtl::OUString& url )
- throw(SQLException, RuntimeException)
-{
- return acceptsURL_Stat(url);
-}
-
-// --------------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL OEvoabDriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException)
-{
- if ( ! acceptsURL(url) )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- } // if ( ! acceptsURL(url) )
-
- // if you have somthing special to say return it here :-)
- return Sequence< DriverPropertyInfo >();
-}
-
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDriver::getMajorVersion( ) throw(RuntimeException)
-{
- return 1;
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabDriver::getMinorVersion( ) throw(RuntimeException)
-{
- return 0;
-}
-// --------------------------------------------------------------------------------
-sal_Bool OEvoabDriver::acceptsURL_Stat( const ::rtl::OUString& url )
-{
- return (url.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sdbc:address:evolution:local")) || url.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sdbc:address:evolution:groupwise"))||url.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sdbc:address:evolution:ldap")))&& EApiInit();
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NDriver.hxx b/connectivity/source/drivers/evoab2/NDriver.hxx
deleted file mode 100644
index c8917bffa6..0000000000
--- a/connectivity/source/drivers/evoab2/NDriver.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_DRIVER_HXX_
-#define _CONNECTIVITY_EVOAB_DRIVER_HXX_
-
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/compbase2.hxx>
-#include "connectivity/CommonTools.hxx"
-#include <osl/module.h>
-
-#define EVOAB_EVOLUTION_SCHEMA "evolution"
-/*In Future, when seperate schema is required for ldap, groupwise*/
-#define EVOAB_LDAP_SCHEMA "ldap"
-#define EVOAB_GWISE_SCHEMA "groupwise"
-
-#define EVOAB_DRIVER_IMPL_NAME "com.sun.star.comp.sdbc.evoab.OEvoabDriver"
-
-namespace connectivity
-{
- namespace evoab
- {
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL OEvoabDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
-
-
- typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::sdbc::XDriver,
- ::com::sun::star::lang::XServiceInfo > ODriver_BASE;
-
-
- class OEvoabDriver : public ODriver_BASE
- {
-
- protected:
- ::osl::Mutex m_aMutex;
- connectivity::OWeakRefArray m_xConnections;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
-
- public:
- OEvoabDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
- virtual ~OEvoabDriver();
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- // XInterface
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
-
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
-
- public:
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- & getMSFactory(void) const { return m_xFactory; }
-
- // static methods
- static sal_Bool acceptsURL_Stat( const ::rtl::OUString& url );
- };
- }
-
-}
-#endif //_CONNECTIVITY_EVOAB_DRIVER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NPreparedStatement.cxx b/connectivity/source/drivers/evoab2/NPreparedStatement.cxx
deleted file mode 100644
index 1aadfbf031..0000000000
--- a/connectivity/source/drivers/evoab2/NPreparedStatement.cxx
+++ /dev/null
@@ -1,338 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include <osl/diagnose.h>
-#include "NPreparedStatement.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "propertyids.hxx"
-#include <connectivity/dbexception.hxx>
-#include <connectivity/dbtools.hxx>
-#include <tools/diagnose_ex.h>
-
-#include "resource/common_res.hrc"
-
-using namespace connectivity::evoab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-
-IMPLEMENT_SERVICE_INFO(OEvoabPreparedStatement,"com.sun.star.sdbcx.evoab.PreparedStatement","com.sun.star.sdbc.PreparedStatement");
-
-
-OEvoabPreparedStatement::OEvoabPreparedStatement( OEvoabConnection* _pConnection )
- :OCommonStatement(_pConnection)
- ,m_sSqlStatement()
- ,m_xMetaData()
-{
-}
-
-// -----------------------------------------------------------------------------
-void OEvoabPreparedStatement::construct( const ::rtl::OUString& _sql )
-{
- m_sSqlStatement = _sql;
-
- m_aQueryData = impl_getEBookQuery_throw( m_sSqlStatement );
- ENSURE_OR_THROW( m_aQueryData.getQuery(), "no EBookQuery" );
- ENSURE_OR_THROW( m_aQueryData.xSelectColumns.is(), "no SelectColumn" );
-
- // create our meta data
- OEvoabResultSetMetaData* pMeta = new OEvoabResultSetMetaData( m_aQueryData.sTable );
- m_xMetaData = pMeta;
- pMeta->setEvoabFields( m_aQueryData.xSelectColumns );
-}
-
-// -----------------------------------------------------------------------------
-OEvoabPreparedStatement::~OEvoabPreparedStatement()
-{
-}
-
-// -----------------------------------------------------------------------------
-void SAL_CALL OEvoabPreparedStatement::acquire() throw()
-{
- OCommonStatement::acquire();
-}
-
-// -----------------------------------------------------------------------------
-void SAL_CALL OEvoabPreparedStatement::release() throw()
-{
- OCommonStatement::release();
-}
-
-// -----------------------------------------------------------------------------
-Any SAL_CALL OEvoabPreparedStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OCommonStatement::queryInterface(rType);
- if(!aRet.hasValue())
- aRet = OPreparedStatement_BASE::queryInterface(rType);
- return aRet;
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OEvoabPreparedStatement::getTypes( ) throw(RuntimeException)
-{
- return ::comphelper::concatSequences(OPreparedStatement_BASE::getTypes(),OCommonStatement::getTypes());
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSetMetaData > SAL_CALL OEvoabPreparedStatement::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
- // the meta data should have been created at construction time
- ENSURE_OR_THROW( m_xMetaData.is(), "internal error: no meta data" );
- return m_xMetaData;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::close( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
- free_column_resources();
- // Reset last warning message
- try {
- clearWarnings ();
- OCommonStatement::close();
- }
- catch (SQLException &) {
- // If we get an error, ignore
- }
-
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OEvoabPreparedStatement::execute( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
- Reference< XResultSet> xRS = impl_executeQuery_throw( m_aQueryData );
- return xRS.is();
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OEvoabPreparedStatement::executeUpdate( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedException( "XStatement::executeUpdate", *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setString( sal_Int32 /*parameterIndex*/, const ::rtl::OUString& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setString", *this );
-}
-// -------------------------------------------------------------------------
-
-Reference< XConnection > SAL_CALL OEvoabPreparedStatement::getConnection( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
- return impl_getConnection();
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL OEvoabPreparedStatement::executeQuery( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
- return impl_executeQuery_throw( m_aQueryData );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setBoolean( sal_Int32 /*parameterIndex*/, sal_Bool /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setBoolean", *this );
-
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OEvoabPreparedStatement::setByte( sal_Int32 /*parameterIndex*/, sal_Int8 /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setByte", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setDate( sal_Int32 /*parameterIndex*/, const Date& /*aData*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setDate", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setTime( sal_Int32 /*parameterIndex*/, const Time& /*aVal*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setTime", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setTimestamp( sal_Int32 /*parameterIndex*/, const DateTime& /*aVal*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setTimestamp", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setDouble( sal_Int32 /*parameterIndex*/, double /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setDouble", *this );
-}
-
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setFloat( sal_Int32 /*parameterIndex*/, float /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setFloat", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setInt( sal_Int32 /*parameterIndex*/, sal_Int32 /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setInt", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setLong( sal_Int32 /*parameterIndex*/, sal_Int64 /*aVal*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setLong", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setNull( sal_Int32 /*parameterIndex*/, sal_Int32 /*sqlType*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setNull", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setClob( sal_Int32 /*parameterIndex*/, const Reference< XClob >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setClob", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setBlob( sal_Int32 /*parameterIndex*/, const Reference< XBlob >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setBlob", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setArray( sal_Int32 /*parameterIndex*/, const Reference< XArray >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setArray", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setRef( sal_Int32 /*parameterIndex*/, const Reference< XRef >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setRef", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setObjectWithInfo( sal_Int32 /*parameterIndex*/, const Any& /*x*/, sal_Int32 /*sqlType*/, sal_Int32 /*scale*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setObjectWithInfo", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setObjectNull( sal_Int32 /*parameterIndex*/, sal_Int32 /*sqlType*/, const ::rtl::OUString& /*typeName*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setObjectNull", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x ) throw(SQLException, RuntimeException)
-{
- if(!::dbtools::implSetObject(this,parameterIndex,x))
- {
- const ::rtl::OUString sError( getOwnConnection()->getResources().getResourceStringWithSubstitution(
- STR_UNKNOWN_PARA_TYPE,
- "$position$", ::rtl::OUString::valueOf(parameterIndex)
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setShort( sal_Int32 /*parameterIndex*/, sal_Int16 /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setShort", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setBytes( sal_Int32 /*parameterIndex*/, const Sequence< sal_Int8 >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setBytes", *this );
-}
-// -------------------------------------------------------------------------
-
-
-void SAL_CALL OEvoabPreparedStatement::setCharacterStream( sal_Int32 /*parameterIndex*/, const Reference< XInputStream >& /*x*/, sal_Int32 /*length*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setCharacterStream", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::setBinaryStream( sal_Int32 /*parameterIndex*/, const Reference< XInputStream >& /*x*/, sal_Int32 /*length*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setBinaryStream", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OEvoabPreparedStatement::clearParameters( ) throw(SQLException, RuntimeException)
-{
-}
-// -----------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL OEvoabPreparedStatement::getResultSet( ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabPreparedStatement::getUpdateCount( ) throw(SQLException, RuntimeException)
-{
- return 0;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabPreparedStatement::getMoreResults( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NPreparedStatement.hxx b/connectivity/source/drivers/evoab2/NPreparedStatement.hxx
deleted file mode 100644
index af0e56729f..0000000000
--- a/connectivity/source/drivers/evoab2/NPreparedStatement.hxx
+++ /dev/null
@@ -1,141 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_PREPAREDSTATEMENT_HXX_
-#define _CONNECTIVITY_EVOAB_PREPAREDSTATEMENT_HXX_
-
-#include "NStatement.hxx"
-#include "NConnection.hxx"
-#include "NDatabaseMetaData.hxx"
-#include "NResultSet.hxx"
-#include <com/sun/star/sdbc/XPreparedStatement.hpp>
-#include <com/sun/star/sdbc/XParameters.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XPreparedBatchExecution.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-
-namespace connectivity
-{
- namespace evoab
- {
-
- class OBoundParam;
- typedef ::cppu::ImplHelper5< ::com::sun::star::sdbc::XPreparedStatement,
- ::com::sun::star::sdbc::XParameters,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::sdbc::XMultipleResults,
- ::com::sun::star::lang::XServiceInfo> OPreparedStatement_BASE;
-
- class OEvoabPreparedStatement :public OCommonStatement
- ,public OPreparedStatement_BASE
- {
- protected:
- struct Parameter
- {
- ::com::sun::star::uno::Any aValue;
- sal_Int32 nDataType;
-
- Parameter(const ::com::sun::star::uno::Any& rValue,
- sal_Int32 rDataType) : aValue(rValue),nDataType(rDataType)
- {
- }
-
- };
-
- ::std::vector< Parameter> m_aParameters;
- //====================================================================
- // Data attributes
- //====================================================================
-
- // our SQL statement
- ::rtl::OUString m_sSqlStatement;
- // the EBookQuery we're working with
- QueryData m_aQueryData;
- // our meta data
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData;
-
- protected:
- virtual ~OEvoabPreparedStatement();
-
- public:
- OEvoabPreparedStatement( OEvoabConnection* _pConnection );
-
- void construct( const ::rtl::OUString& _sql );
-
- protected:
- DECLARE_SERVICE_INFO();
- //XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPreparedStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL executeUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XParameters
- virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearParameters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XMultipleResults
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getResultSet( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getUpdateCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getMoreResults( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // CONNECTIVITY_SPREPAREDSTATEMENT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
deleted file mode 100644
index ce0713537c..0000000000
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ /dev/null
@@ -1,1024 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "NDatabaseMetaData.hxx"
-#include "NConnection.hxx"
-#include "NResultSet.hxx"
-#include "propertyids.hxx"
-#include "resource/evoab2_res.hrc"
-#include "TSortIndex.hxx"
-#include <algorithm>
-
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdb/ErrorCondition.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-
-#include <comphelper/componentcontext.hxx>
-#include <comphelper/extract.hxx>
-#include <comphelper/property.hxx>
-#include <comphelper/sequence.hxx>
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-#include <connectivity/sqlerror.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <rtl/string.hxx>
-#include <tools/diagnose_ex.h>
-#include <unotools/syslocale.hxx>
-#include <unotools/intlwrapper.hxx>
-
-#include <cstring>
-#include <vector>
-
-namespace connectivity { namespace evoab {
-
-using namespace ::comphelper;
-using namespace com::sun::star;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-namespace ErrorCondition = ::com::sun::star::sdb::ErrorCondition;
-
-//------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabResultSet::getImplementationName( ) throw ( RuntimeException) \
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.evoab.ResultSet"));
-}
-// -------------------------------------------------------------------------
- Sequence< ::rtl::OUString > SAL_CALL OEvoabResultSet::getSupportedServiceNames( ) throw( RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(1);
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.ResultSet"));
- return aSupported;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw( RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-
-// -------------------------------------------------------------------------
-OEvoabResultSet::OEvoabResultSet( OCommonStatement* pStmt, OEvoabConnection *pConnection )
- :OResultSet_BASE(m_aMutex)
- ,::comphelper::OPropertyContainer( OResultSet_BASE::rBHelper )
- ,m_pStatement(pStmt)
- ,m_pConnection(pConnection)
- ,m_xMetaData(NULL)
- ,m_bWasNull(sal_True)
- ,m_nFetchSize(0)
- ,m_nResultSetType(ResultSetType::SCROLL_INSENSITIVE)
- ,m_nFetchDirection(FetchDirection::FORWARD)
- ,m_nResultSetConcurrency(ResultSetConcurrency::READ_ONLY)
- ,m_pContacts(NULL)
- ,m_nIndex(-1)
- ,m_nLength(0)
-{
- #define REGISTER_PROP( id, member ) \
- registerProperty( \
- OMetaConnection::getPropMap().getNameByIndex( id ), \
- id, \
- PropertyAttribute::READONLY, \
- &member, \
- ::getCppuType( &member ) \
- );
-
- REGISTER_PROP( PROPERTY_ID_FETCHSIZE, m_nFetchSize );
- REGISTER_PROP( PROPERTY_ID_RESULTSETTYPE, m_nResultSetType );
- REGISTER_PROP( PROPERTY_ID_FETCHDIRECTION, m_nFetchDirection );
- REGISTER_PROP( PROPERTY_ID_RESULTSETCONCURRENCY, m_nResultSetConcurrency );
-}
-
-// -------------------------------------------------------------------------
-OEvoabResultSet::~OEvoabResultSet()
-{
-}
-
-// -------------------------------------------------------------------------
-
-static ESource *
-findSource( const char *name )
-{
- ESourceList *pSourceList = NULL;
-
- g_return_val_if_fail (name != NULL, NULL);
-
- if (!e_book_get_addressbooks (&pSourceList, NULL))
- pSourceList = NULL;
-
- for ( GSList *g = e_source_list_peek_groups (pSourceList); g; g = g->next)
- {
- for (GSList *s = e_source_group_peek_sources (E_SOURCE_GROUP (g->data)); s; s = s->next)
- {
- ESource *pSource = E_SOURCE (s->data);
- if (!strcmp (e_source_peek_name (pSource), name))
- return pSource;
- }
- }
- return NULL;
-}
-
-static EBook *
-openBook( const char *abname )
-{
- ESource *pSource = findSource (abname);
- EBook *pBook = NULL;
- if (pSource)
- pBook = e_book_new (pSource, NULL);
-
- if (pBook && !e_book_open (pBook, TRUE, NULL))
- {
- g_object_unref (G_OBJECT (pBook));
- pBook = NULL;
- }
-
- return pBook;
-}
-
-static bool isLDAP( EBook *pBook )
-{
- return pBook && !strncmp( "ldap://", e_book_get_uri( pBook ), 6 );
-}
-
-static bool isLocal( EBook *pBook )
-{
- return pBook && ( !strncmp( "file://", e_book_get_uri( pBook ), 6 ) ||
- !strncmp( "local:", e_book_get_uri( pBook ), 6 ) );
-}
-
-static bool isAuthRequired( EBook *pBook )
-{
- return e_source_get_property( e_book_get_source( pBook ),
- "auth" ) != NULL;
-}
-
-static rtl::OString getUserName( EBook *pBook )
-{
- rtl::OString aName;
- if( isLDAP( pBook ) )
- aName = e_source_get_property( e_book_get_source( pBook ), "binddn" );
- else
- aName = e_source_get_property( e_book_get_source( pBook ), "user" );
- return aName;
-}
-
-static ::rtl::OUString
-valueToOUString( GValue& _rValue )
-{
- const char *pStr = g_value_get_string( &_rValue );
- rtl::OString aStr( pStr ? pStr : "" );
- ::rtl::OUString sResult( ::rtl::OStringToOUString( aStr, RTL_TEXTENCODING_UTF8 ) );
- g_value_unset( &_rValue );
- return sResult;
-}
-
-static bool
-valueToBool( GValue& _rValue )
-{
- bool bResult = g_value_get_boolean( &_rValue );
- g_value_unset( &_rValue );
- return bResult;
-}
-
-static bool
-executeQuery (EBook* pBook, EBookQuery* pQuery, GList **ppList,
- rtl::OString &rPassword, GError **pError)
-{
- ESource *pSource = e_book_get_source( pBook );
- bool bSuccess = false;
- bool bAuthSuccess = true;
-
- *ppList = NULL;
-
- if( isAuthRequired( pBook ) )
- {
- rtl::OString aUser( getUserName( pBook ) );
- const char *pAuth = e_source_get_property( pSource, "auth" );
- bAuthSuccess = e_book_authenticate_user( pBook, aUser.getStr(), rPassword.getStr(), pAuth, pError );
- }
-
- if (bAuthSuccess)
- bSuccess = e_book_get_contacts( pBook, pQuery, ppList, pError );
-
- return bSuccess;
-}
-
-static int
-whichAddress(int value)
-{
- int fieldEnum;
- switch (value)
- {
- case HOME_ADDR_LINE1:
- case HOME_ADDR_LINE2:
- case HOME_CITY:
- case HOME_STATE:
- case HOME_COUNTRY:
- case HOME_ZIP:
- fieldEnum = e_contact_field_id("address_home");
- break;
-
- case WORK_ADDR_LINE1:
- case WORK_ADDR_LINE2:
- case WORK_CITY:
- case WORK_STATE:
- case WORK_COUNTRY:
- case WORK_ZIP:
- fieldEnum = e_contact_field_id("address_work");
- break;
-
- case OTHER_ADDR_LINE1:
- case OTHER_ADDR_LINE2:
- case OTHER_CITY:
- case OTHER_STATE:
- case OTHER_COUNTRY:
- case OTHER_ZIP:
- fieldEnum = e_contact_field_id("address_other");
- break;
-
- default: fieldEnum = e_contact_field_id("address_home");
- }
- return fieldEnum;
-}
-
-/*
-* This function decides the default column values based on the first field of EContactAddress.
-* The search order is Work->Home->other(defaults).
-*/
-static EContactAddress *
-getDefaultContactAddress( EContact *pContact,int *value )
-{
- EContactAddress *ec = (EContactAddress *)e_contact_get(pContact,whichAddress(WORK_ADDR_LINE1));
- if ( ec && (strlen(ec->street)>0) )
- {
- *value= *value +WORK_ADDR_LINE1 -1;
- return ec;
- }
- else
- {
- ec = (EContactAddress *)e_contact_get(pContact,whichAddress(HOME_ADDR_LINE1));
- if ( ec && (strlen(ec->street)>0) )
- {
- *value=*value+HOME_ADDR_LINE1-1;
- return ec;
- }
- }
-
- *value=*value+OTHER_ADDR_LINE1-1;
- return (EContactAddress *)e_contact_get(pContact,whichAddress(OTHER_ADDR_LINE1));
-}
-
-static EContactAddress*
-getContactAddress( EContact *pContact, int * address_enum )
-{
- EContactAddress *ec = NULL;
- switch (*address_enum) {
-
- case DEFAULT_ADDR_LINE1:
- case DEFAULT_ADDR_LINE2:
- case DEFAULT_CITY:
- case DEFAULT_STATE:
- case DEFAULT_COUNTRY:
- case DEFAULT_ZIP:
- ec = getDefaultContactAddress(pContact,address_enum);break;
- default:
- ec = (EContactAddress *)e_contact_get(pContact,whichAddress(*address_enum));
- }
- return ec;
-}
-
-static bool
-handleSplitAddress( EContact *pContact,GValue *pStackValue, int value )
-{
- EContactAddress *ec = getContactAddress(pContact,&value) ;
-
- if (ec==NULL)
- return true;
-
- switch (value) {
- case WORK_ADDR_LINE1:
- g_value_set_string(pStackValue,ec->street ); break;
- case WORK_ADDR_LINE2:
- g_value_set_string(pStackValue,ec->po ); break;
- case WORK_CITY:
- g_value_set_string(pStackValue,ec->locality ); break;
- case WORK_STATE:
- g_value_set_string(pStackValue,ec->region ); break;
- case WORK_COUNTRY:
- g_value_set_string(pStackValue,ec->country ); break;
- case WORK_ZIP:
- g_value_set_string(pStackValue,ec->code ); break;
-
- case HOME_ADDR_LINE1:
- g_value_set_string(pStackValue,ec->street ); break;
- case HOME_ADDR_LINE2:
- g_value_set_string(pStackValue,ec->po ); break;
- case HOME_CITY:
- g_value_set_string(pStackValue,ec->locality ); break;
- case HOME_STATE:
- g_value_set_string(pStackValue,ec->region ); break;
- case HOME_COUNTRY:
- g_value_set_string(pStackValue,ec->country ); break;
- case HOME_ZIP:
- g_value_set_string(pStackValue,ec->code ); break;
-
- case OTHER_ADDR_LINE1:
- g_value_set_string(pStackValue,ec->street ); break;
- case OTHER_ADDR_LINE2:
- g_value_set_string(pStackValue,ec->po ); break;
- case OTHER_CITY:
- g_value_set_string(pStackValue,ec->locality ); break;
- case OTHER_STATE:
- g_value_set_string(pStackValue,ec->region ); break;
- case OTHER_COUNTRY:
- g_value_set_string(pStackValue,ec->country ); break;
- case OTHER_ZIP:
- g_value_set_string(pStackValue,ec->code ); break;
-
- }
-
- return false;
-}
-static bool
-getValue( EContact* pContact, sal_Int32 nColumnNum, GType nType, GValue* pStackValue, bool& _out_rWasNull )
-{
- const ColumnProperty * pSpecs = evoab::getField( nColumnNum );
- if ( !pSpecs )
- return false;
-
- GParamSpec* pSpec = pSpecs->pField;
- gboolean bIsSplittedColumn = pSpecs->bIsSplittedValue;
-
- _out_rWasNull = true;
- if ( !pSpec || !pContact)
- return false;
-
- if ( G_PARAM_SPEC_VALUE_TYPE (pSpec) != nType )
- {
-
- OSL_TRACE( "Wrong type (0x%x) (0x%x) '%s'",
- (int)G_PARAM_SPEC_VALUE_TYPE (pSpec), (int) nType,
- pSpec->name ? pSpec->name : "<noname>");
- return false;
- }
-
- g_value_init( pStackValue, nType );
- if ( bIsSplittedColumn )
- {
- const SplitEvoColumns* evo_addr( get_evo_addr() );
- for (int i=0;i<OTHER_ZIP;i++)
- {
- if (0 == strcmp (g_param_spec_get_name ((GParamSpec *)pSpec), evo_addr[i].pColumnName))
- {
- _out_rWasNull = handleSplitAddress( pContact, pStackValue, evo_addr[i].value );
- return true;
- }
- }
- }
- else
- {
- g_object_get_property( G_OBJECT (pContact),
- g_param_spec_get_name ((GParamSpec *) pSpec),
- pStackValue );
- if ( G_VALUE_TYPE( pStackValue ) != nType )
- {
- OSL_TRACE( "Fetched type mismatch" );
- g_value_unset( pStackValue );
- return false;
- }
- }
- _out_rWasNull = false;
- return true;
-}
-
-namespace
-{
- struct ComparisonData
- {
- const SortDescriptor& rSortOrder;
- IntlWrapper aIntlWrapper;
-
- ComparisonData( const SortDescriptor& _rSortOrder, const Reference< XMultiServiceFactory >& _rxFactory )
- :rSortOrder( _rSortOrder )
- ,aIntlWrapper( _rxFactory, SvtSysLocale().GetLocaleData().getLocale() )
- {
- }
- };
-}
-
-extern "C"
-int CompareContacts( gconstpointer _lhs, gconstpointer _rhs, gpointer _userData )
-{
- EContact* lhs = static_cast< EContact* >( const_cast< gpointer >( _lhs ) );
- EContact* rhs = static_cast< EContact* >( const_cast< gpointer >( _rhs ) );
-
- GValue aLhsValue = { 0, { { 0 } } };
- GValue aRhsValue = { 0, { { 0 } } };
- bool bLhsNull = true;
- bool bRhsNull = true;
-
- ::rtl::OUString sLhs, sRhs;
- bool bLhs(false), bRhs(false);
-
- const ComparisonData& rCompData = *static_cast< const ComparisonData* >( _userData );
- for ( SortDescriptor::const_iterator sortCol = rCompData.rSortOrder.begin();
- sortCol != rCompData.rSortOrder.end();
- ++sortCol
- )
- {
- sal_Int32 nField = sortCol->nField;
- GType eFieldType = evoab::getGFieldType( nField );
-
- bool success = getValue( lhs, nField, eFieldType, &aLhsValue, bLhsNull )
- && getValue( rhs, nField, eFieldType, &aRhsValue, bRhsNull );
- OSL_ENSURE( success, "CompareContacts: could not retrieve both values!" );
- if ( !success )
- return 0;
-
- if ( bLhsNull && !bRhsNull )
- return -1;
- if ( !bLhsNull && bRhsNull )
- return 1;
- if ( bLhsNull && bRhsNull )
- continue;
-
- if ( eFieldType == G_TYPE_STRING )
- {
- sLhs = valueToOUString( aLhsValue );
- sRhs = valueToOUString( aRhsValue );
- sal_Int32 nCompResult = rCompData.aIntlWrapper.getCaseCollator()->compareString( sLhs, sRhs );
- if ( nCompResult != 0 )
- return nCompResult;
- continue;
- }
-
- bLhs = valueToBool( aLhsValue );
- bRhs = valueToBool( aRhsValue );
- if ( bLhs && !bRhs )
- return -1;
- if ( !bLhs && bRhs )
- return 1;
- continue;
- }
-
- return 0;
-}
-
-static GList*
-sortContacts( GList* _pContactList, const ComparisonData& _rCompData )
-{
- OSL_ENSURE( !_rCompData.rSortOrder.empty(), "sortContacts: no need to call this without any sort order!" );
- ENSURE_OR_THROW( _rCompData.aIntlWrapper.getCaseCollator(), "no collator for comparing strings" );
-
- return g_list_sort_with_data( _pContactList, &CompareContacts, const_cast< gpointer >( static_cast< gconstpointer >( &_rCompData ) ) );
-}
-
-// -------------------------------------------------------------------------
-void OEvoabResultSet::construct( const QueryData& _rData )
-{
- ENSURE_OR_THROW( _rData.getQuery(), "internal error: no EBookQuery" );
-
- EBook *pBook = openBook(::rtl::OUStringToOString(_rData.sTable, RTL_TEXTENCODING_UTF8).getStr());
- if ( !pBook )
- m_pConnection->throwGenericSQLException( STR_CANNOT_OPEN_BOOK, *this );
-
- g_list_free(m_pContacts);
- m_pContacts = NULL;
- bool bExecuteQuery = true;
- switch ( _rData.eFilterType )
- {
- case eFilterNone:
- if ( !isLocal( pBook ) )
- {
- SQLError aErrorFactory( m_pConnection->getDriver().getMSFactory() );
- SQLException aAsException = aErrorFactory.getSQLException( ErrorCondition::DATA_CANNOT_SELECT_UNFILTERED, *this );
- m_aWarnings.appendWarning( SQLWarning(
- aAsException.Message,
- aAsException.Context,
- aAsException.SQLState,
- aAsException.ErrorCode,
- aAsException.NextException
- ) );
- bExecuteQuery = false;
- }
- break;
- case eFilterAlwaysFalse:
- bExecuteQuery = false;
- break;
- case eFilterOther:
- bExecuteQuery = true;
- break;
- }
- if ( bExecuteQuery )
- {
- rtl::OString aPassword = m_pConnection->getPassword();
- executeQuery( pBook, _rData.getQuery(), &m_pContacts, aPassword, NULL );
- m_pConnection->setPassword( aPassword );
-
- if ( m_pContacts && !_rData.aSortOrder.empty() )
- {
- ComparisonData aCompData( _rData.aSortOrder, getConnection()->getDriver().getMSFactory() );
- m_pContacts = sortContacts( m_pContacts, aCompData );
- }
- }
- m_nLength = g_list_length( m_pContacts );
- OSL_TRACE( "Query return %d records", m_nLength );
- m_nIndex = -1;
-
- // create our meta data (need the EBookQuery for this)
- OEvoabResultSetMetaData* pMeta = new OEvoabResultSetMetaData( _rData.sTable );
- m_xMetaData = pMeta;
-
- pMeta->setEvoabFields( _rData.xSelectColumns );
-}
-
-// -------------------------------------------------------------------------
-void OEvoabResultSet::disposing(void)
-{
- ::comphelper::OPropertyContainer::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
- g_list_free(m_pContacts);
- m_pContacts = NULL;
- m_pStatement = NULL;
-m_xMetaData.clear();
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OEvoabResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ::comphelper::OPropertyContainer::queryInterface(rType);
- if(!aRet.hasValue())
- aRet = OResultSet_BASE::queryInterface(rType);
- return aRet;
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OEvoabResultSet::getTypes( ) throw( RuntimeException)
-{
- return ::comphelper::concatSequences(
- OResultSet_BASE::getTypes(),
- ::comphelper::OPropertyContainer::getTypes()
- );
-}
-
-// -------------------------------------------------------------------------
-// XRow Interface
-
-/**
- * getString:
- * @nColumnNum: The column index from the table.
- *
- * If the equivalent NResultSetMetaData.cxx marks the columntype of
- * nColumnNum as DataType::VARCHAR this accessor is used.
- */
-::rtl::OUString SAL_CALL OEvoabResultSet::getString( sal_Int32 nColumnNum ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- rtl::OUString aResult;
- if ( m_xMetaData.is())
- {
- OEvoabResultSetMetaData *pMeta = (OEvoabResultSetMetaData *) m_xMetaData.get();
- sal_Int32 nFieldNumber = pMeta->fieldAtColumn(nColumnNum);
- GValue aValue = { 0, { { 0 } } };
- if ( getValue( getCur(), nFieldNumber, G_TYPE_STRING, &aValue, m_bWasNull ) )
- aResult = valueToOUString( aValue );
- }
- return aResult;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSet::getBoolean( sal_Int32 nColumnNum ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- sal_Bool bResult = sal_False;
-
- if ( m_xMetaData.is())
- {
- OEvoabResultSetMetaData *pMeta = (OEvoabResultSetMetaData *) m_xMetaData.get();
- sal_Int32 nFieldNumber = pMeta->fieldAtColumn(nColumnNum);
- GValue aValue = { 0, { { 0 } } };
- if ( getValue( getCur(), nFieldNumber, G_TYPE_BOOLEAN, &aValue, m_bWasNull ) )
- bResult = valueToBool( aValue );
- }
- return bResult ? sal_True : sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int64 SAL_CALL OEvoabResultSet::getLong( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getLong", *this );
- return sal_Int64();
-}
-// -------------------------------------------------------------------------
-Reference< XArray > SAL_CALL OEvoabResultSet::getArray( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getArray", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XClob > SAL_CALL OEvoabResultSet::getClob( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getClob", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XBlob > SAL_CALL OEvoabResultSet::getBlob( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getBlob", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XRef > SAL_CALL OEvoabResultSet::getRef( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getRef", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OEvoabResultSet::getObject( sal_Int32 /*nColumnNum*/, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getObject", *this );
- return Any();
-}
-// -------------------------------------------------------------------------
-sal_Int16 SAL_CALL OEvoabResultSet::getShort( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getShort", *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-::com::sun::star::util::Time SAL_CALL OEvoabResultSet::getTime( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getTime", *this );
- return ::com::sun::star::util::Time();
-}
-// -------------------------------------------------------------------------
-util::DateTime SAL_CALL OEvoabResultSet::getTimestamp( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getTimestamp", *this );
- return ::com::sun::star::util::DateTime();
-}
-// -------------------------------------------------------------------------
-Reference< XInputStream > SAL_CALL OEvoabResultSet::getBinaryStream( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getBinaryStream", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XInputStream > SAL_CALL OEvoabResultSet::getCharacterStream( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getCharacterStream", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-sal_Int8 SAL_CALL OEvoabResultSet::getByte( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getByte", *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-Sequence< sal_Int8 > SAL_CALL OEvoabResultSet::getBytes( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getBytes", *this );
- return Sequence< sal_Int8 >();
-}
-// -------------------------------------------------------------------------
-::com::sun::star::util::Date SAL_CALL OEvoabResultSet::getDate( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getDate", *this );
- return ::com::sun::star::util::Date();
-}
-// -------------------------------------------------------------------------
-double SAL_CALL OEvoabResultSet::getDouble( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getDouble", *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-float SAL_CALL OEvoabResultSet::getFloat( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getFloat", *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabResultSet::getInt( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getInt", *this );
- return 0;
-}
-// XRow Interface Ends
-// -------------------------------------------------------------------------
-
-// XResultSetMetaDataSupplier Interface
-Reference< XResultSetMetaData > SAL_CALL OEvoabResultSet::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- // the meta data should have been created at construction time
- ENSURE_OR_THROW( m_xMetaData.is(), "internal error: no meta data" );
- return m_xMetaData;
-}
-// XResultSetMetaDataSupplier Interface Ends
-// -------------------------------------------------------------------------
-
-// XResultSet Interface
-sal_Bool SAL_CALL OEvoabResultSet::next( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- if (m_nIndex+1 < m_nLength) {
- ++m_nIndex ;
- return true;
- }
- else
- return false;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSet::wasNull( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return m_bWasNull;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return m_nIndex < 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabResultSet::getRow( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return m_nIndex;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSet::isAfterLast( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return m_nIndex >= m_nLength;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSet::isFirst( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return m_nIndex == 0;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSet::isLast( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return m_nIndex == m_nLength - 1;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OEvoabResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- m_nIndex = -1;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OEvoabResultSet::afterLast( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- m_nIndex = m_nLength;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OEvoabResultSet::first( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- m_nIndex = 0;
- return true;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OEvoabResultSet::last( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- m_nIndex = m_nLength - 1;
- return true;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- if (row < m_nLength) {
- m_nIndex = row;
- return true;
- }
- else
- return false;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- if ((m_nIndex+row) < m_nLength) {
- m_nIndex += row;
- return true;
- }
- else
- return false;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSet::previous( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- if(m_nIndex > 0) {
- m_nIndex--;
- return true;
- }
- else
- return false;
-}
-// -------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL OEvoabResultSet::getStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-::com::sun::star::uno::WeakReferenceHelper aStatement((OWeakObject*)m_pStatement);
- return aStatement.get();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OEvoabResultSet::rowDeleted( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSet::rowInserted( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OEvoabResultSet::refreshRow( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-}
-//XResult Interface ends
-// -------------------------------------------------------------------------
-// XCancellable
-
-void SAL_CALL OEvoabResultSet::cancel( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- OSL_TRACE("In/Out: OEvoabResultSet::cancel" );
-
-}
-
-//XCloseable
-void SAL_CALL OEvoabResultSet::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- }
- OSL_TRACE("In/Out: OEvoabResultSet::close" );
- dispose();
-}
-
-// XWarningsSupplier
-// -------------------------------------------------------------------------
-void SAL_CALL OEvoabResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("In/Out: OEvoabResultSet::clearWarnings" );
- m_aWarnings.clearWarnings();
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OEvoabResultSet::getWarnings( ) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("In/Out: OEvoabResultSet::getWarnings" );
- return m_aWarnings.getWarnings();
-}
-// -------------------------------------------------------------------------
-//XColumnLocate Interface
-sal_Int32 SAL_CALL OEvoabResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- // find the first column with the name columnName
- Reference< XResultSetMetaData > xMeta = getMetaData();
- sal_Int32 nLen = xMeta->getColumnCount();
- sal_Int32 i = 1;
- for(;i<=nLen;++i)
- if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
- columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
- break;
- return i;
-}
-// -------------------------------------------------------------------------
-//XColumnLocate interface ends
-
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OEvoabResultSet::createArrayHelper( ) const
-{
- Sequence< Property > aProps;
- describeProperties( aProps );
- return new ::cppu::OPropertyArrayHelper( aProps );
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OEvoabResultSet::getInfoHelper()
-{
- return *const_cast<OEvoabResultSet*>(this)->getArrayHelper();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OEvoabResultSet::acquire() throw()
-{
- OResultSet_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OEvoabResultSet::release() throw()
-{
- OResultSet_BASE::release();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
-OEvoabResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-
-} } // connectivity::evoab
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NResultSet.hxx b/connectivity/source/drivers/evoab2/NResultSet.hxx
deleted file mode 100644
index 0ffe5a7e5b..0000000000
--- a/connectivity/source/drivers/evoab2/NResultSet.hxx
+++ /dev/null
@@ -1,186 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_RESULTSET_HXX_
-#define _CONNECTIVITY_EVOAB_RESULTSET_HXX_
-
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
-#include <com/sun/star/sdbcx/XDeleteRows.hpp>
-#include <cppuhelper/compbase8.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include <comphelper/propertycontainer.hxx>
-#include "connectivity/CommonTools.hxx"
-#include "connectivity/FValue.hxx"
-#include "connectivity/warningscontainer.hxx"
-#include "NStatement.hxx"
-#include "OSubComponent.hxx"
-#include "NResultSetMetaData.hxx"
-
-namespace connectivity
-{
- namespace evoab
- {
- typedef ::cppu::WeakComponentImplHelper8 < ::com::sun::star::sdbc::XResultSet
- , ::com::sun::star::sdbc::XRow
- , ::com::sun::star::sdbc::XResultSetMetaDataSupplier
- , ::com::sun::star::util::XCancellable
- , ::com::sun::star::sdbc::XWarningsSupplier
- , ::com::sun::star::sdbc::XCloseable
- , ::com::sun::star::sdbc::XColumnLocate
- , ::com::sun::star::lang::XServiceInfo
- > OResultSet_BASE;
-
-
- class OEvoabResultSet :public comphelper::OBaseMutex
- ,public OResultSet_BASE
- ,public ::comphelper::OPropertyContainer
- ,public ::comphelper::OPropertyArrayUsageHelper<OEvoabResultSet>
- {
-
- protected:
-
- OCommonStatement* m_pStatement;
- OEvoabConnection* m_pConnection;
- ::com::sun::star::uno::WeakReferenceHelper m_aStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData;
- ::dbtools::WarningsContainer m_aWarnings;
-
- bool m_bWasNull;
- // <properties>
- sal_Int32 m_nFetchSize;
- sal_Int32 m_nResultSetType;
- sal_Int32 m_nFetchDirection;
- sal_Int32 m_nResultSetConcurrency;
- // </properties>
-
- // Data & iteration
- GList *m_pContacts;
- sal_Int32 m_nIndex;
- sal_Int32 m_nLength;
- EContact *getCur()
- {
- gpointer pData = g_list_nth_data (m_pContacts, m_nIndex);
- return pData ? E_CONTACT (pData) : NULL;
- }
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- // you can't delete objects of this type
- virtual ~OEvoabResultSet();
- public:
- DECLARE_SERVICE_INFO();
-
- OEvoabResultSet( OCommonStatement *pStmt, OEvoabConnection *pConnection );
- void construct( const QueryData& _rData );
-
- OEvoabConnection * getConnection() { return m_pConnection; }
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
- {
- return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(*(OResultSet_BASE*)this);
- }
-
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XResultSet
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XColumnLocate
- virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // CONNECTIVITY_SRESULTSET_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx
deleted file mode 100644
index 335b44418c..0000000000
--- a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx
+++ /dev/null
@@ -1,197 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "NResultSetMetaData.hxx"
-#include "NDatabaseMetaData.hxx"
-#include "connectivity/dbexception.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include "NDebug.hxx"
-#include "resource/evoab2_res.hrc"
-
-using namespace connectivity::evoab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::sdbc;
-
-OEvoabResultSetMetaData::OEvoabResultSetMetaData(const ::rtl::OUString& _aTableName)
- : m_aTableName(_aTableName),
- m_aEvoabFields()
-{
-
-}
-// -------------------------------------------------------------------------
-OEvoabResultSetMetaData::~OEvoabResultSetMetaData()
-{
-}
-// -------------------------------------------------------------------------
-void OEvoabResultSetMetaData::setEvoabFields(const ::rtl::Reference<connectivity::OSQLColumns> &xColumns) throw(SQLException)
-{
- OSQLColumns::Vector::const_iterator aIter;
- static const ::rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("Name"));
-
- for (aIter = xColumns->get().begin(); aIter != xColumns->get().end(); ++aIter)
- {
- ::rtl::OUString aFieldName;
-
- (*aIter)->getPropertyValue(aName) >>= aFieldName;
- guint nFieldNumber = findEvoabField(aFieldName);
- if (nFieldNumber == (guint)-1)
- {
- connectivity::SharedResources aResource;
- const ::rtl::OUString sError( aResource.getResourceStringWithSubstitution(
- STR_INVALID_COLUMNNAME,
- "$columnname$", aFieldName
- ) );
- ::dbtools::throwGenericSQLException( sError, *this );
- }
- m_aEvoabFields.push_back(nFieldNumber);
- }
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabResultSetMetaData::getColumnDisplaySize( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return 50;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabResultSetMetaData::getColumnType( sal_Int32 nColumnNum ) throw(SQLException, RuntimeException)
-{
- sal_uInt32 nField = m_aEvoabFields[nColumnNum - 1];
- return evoab::getFieldType (nField);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabResultSetMetaData::getColumnCount( ) throw(SQLException, RuntimeException)
-{
- return m_aEvoabFields.size();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSetMetaData::isCaseSensitive( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabResultSetMetaData::getSchemaName( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabResultSetMetaData::getColumnName( sal_Int32 nColumnNum ) throw(SQLException, RuntimeException)
-{
- sal_uInt32 nField = m_aEvoabFields[nColumnNum - 1];
- return evoab::getFieldName( nField );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabResultSetMetaData::getColumnTypeName( sal_Int32 nColumnNum ) throw(SQLException, RuntimeException)
-{
- sal_uInt32 nField = m_aEvoabFields[nColumnNum - 1];
- return evoab::getFieldTypeName( nField );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabResultSetMetaData::getColumnLabel( sal_Int32 nColumnNum ) throw(SQLException, RuntimeException)
-{
- sal_uInt32 nField = m_aEvoabFields[nColumnNum - 1];
- const ColumnProperty *pSpecs = getField(nField);
- GParamSpec *pSpec = pSpecs->pField;
- rtl::OUString aLabel;
-
- if( pSpec )
- aLabel = rtl::OStringToOUString( g_param_spec_get_nick( (GParamSpec *) pSpec ),
- RTL_TEXTENCODING_UTF8 );
- return aLabel;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabResultSetMetaData::getColumnServiceName( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabResultSetMetaData::getTableName( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return m_aTableName;//::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabResultSetMetaData::getCatalogName( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OEvoabResultSetMetaData::isCurrency( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSetMetaData::isAutoIncrement( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSetMetaData::isSigned( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabResultSetMetaData::getPrecision( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return 0;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabResultSetMetaData::getScale( sal_Int32 /*nColumnNum*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OEvoabResultSetMetaData::isNullable( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSetMetaData::isSearchable( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSetMetaData::isReadOnly( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSetMetaData::isDefinitelyWritable( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabResultSetMetaData::isWritable( sal_Int32 /*nColumnNum*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NResultSetMetaData.hxx b/connectivity/source/drivers/evoab2/NResultSetMetaData.hxx
deleted file mode 100644
index 6906549dec..0000000000
--- a/connectivity/source/drivers/evoab2/NResultSetMetaData.hxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_RESULTSETMETADATA_HXX_
-#define _CONNECTIVITY_EVOAB_RESULTSETMETADATA_HXX_
-
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include "NConnection.hxx"
-#include <rtl/ref.hxx>
-#include <com/sun/star/connection/XConnection.hpp>
-namespace connectivity
-{
- namespace evoab
- {
- //**************************************************************
- //************ Class: ResultSetMetaData
- //**************************************************************
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> OResultSetMetaData_BASE;
-
- class OEvoabResultSetMetaData : public OResultSetMetaData_BASE
- {
- ::rtl::OUString m_aTableName;
- ::std::vector<sal_Int32> m_aEvoabFields;
-
- protected:
- virtual ~OEvoabResultSetMetaData();
- public:
- OEvoabResultSetMetaData(const ::rtl::OUString& _aTableName);
- void setEvoabFields(const ::rtl::Reference<connectivity::OSQLColumns> &xColumns) throw(::com::sun::star::sdbc::SQLException);
- inline sal_uInt32 fieldAtColumn(sal_Int32 columnIndex) const
- { return m_aEvoabFields[columnIndex - 1]; }
- inline sal_Int32 getFieldSize() const
- {return m_aEvoabFields.size();}
- /// Avoid ambigous cast error from the compiler.
- inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
- { return this; }
-
- virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // CONNECTIVITY_SRESULSETMETADATA_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NServices.cxx b/connectivity/source/drivers/evoab2/NServices.cxx
deleted file mode 100644
index 9dda360afc..0000000000
--- a/connectivity/source/drivers/evoab2/NServices.cxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "NDriver.hxx"
-#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
-
-using namespace connectivity::evoab;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pT
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(const ::com::sun::star::uno::Exception&)
- {
- OSL_FAIL("Service Creation Exception");
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- OEvoabDriver::getImplementationName_Static(),
- OEvoabDriver::getSupportedServiceNames_Static(),
- OEvoabDriver_CreateInstance, ::cppu::createSingleFactory)
- ;
-
- if(aReq.xRet.is())
- aReq.xRet->acquire();
-
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx
deleted file mode 100644
index 30cec213e0..0000000000
--- a/connectivity/source/drivers/evoab2/NStatement.cxx
+++ /dev/null
@@ -1,685 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include <osl/diagnose.h>
-#include <osl/thread.h>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include "propertyids.hxx"
-#include "NStatement.hxx"
-#include "NConnection.hxx"
-#include "NDatabaseMetaData.hxx"
-#include "NResultSet.hxx"
-#include "NDebug.hxx"
-#include "resource/evoab2_res.hrc"
-#include <resource/common_res.hrc>
-#include <connectivity/dbexception.hxx>
-#include <tools/diagnose_ex.h>
-
-namespace connectivity { namespace evoab {
-
-//------------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-//------------------------------------------------------------------------------
-OCommonStatement::OCommonStatement(OEvoabConnection* _pConnection)
- : OCommonStatement_IBase(m_aMutex)
- , ::comphelper::OPropertyContainer(OCommonStatement_IBase::rBHelper)
- , OStatement_CBase( (::cppu::OWeakObject*)_pConnection, this )
- , m_xResultSet(NULL)
- , m_pResultSet(NULL)
- , m_pConnection(_pConnection)
- , m_aParser(_pConnection->getDriver().getMSFactory())
- , m_aSQLIterator( _pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL )
- , m_pParseTree(NULL)
- , m_nMaxFieldSize(0)
- , m_nMaxRows(0)
- , m_nQueryTimeOut(0)
- , m_nFetchSize(0)
- , m_nResultSetType(ResultSetType::FORWARD_ONLY)
- , m_nFetchDirection(FetchDirection::FORWARD)
- , m_nResultSetConcurrency(ResultSetConcurrency::UPDATABLE)
- , m_bEscapeProcessing(sal_True)
- , rBHelper(OCommonStatement_IBase::rBHelper)
-{
- m_pConnection->acquire();
-
-#define REGISTER_PROP( id, member ) \
- registerProperty( \
- OMetaConnection::getPropMap().getNameByIndex( id ), \
- id, \
- 0, \
- &member, \
- ::getCppuType( &member ) \
- );
-
- REGISTER_PROP( PROPERTY_ID_CURSORNAME, m_aCursorName );
- REGISTER_PROP( PROPERTY_ID_MAXFIELDSIZE, m_nMaxFieldSize );
- REGISTER_PROP( PROPERTY_ID_MAXROWS, m_nMaxRows );
- REGISTER_PROP( PROPERTY_ID_QUERYTIMEOUT, m_nQueryTimeOut );
- REGISTER_PROP( PROPERTY_ID_FETCHSIZE, m_nFetchSize );
- REGISTER_PROP( PROPERTY_ID_RESULTSETTYPE, m_nResultSetType );
- REGISTER_PROP( PROPERTY_ID_FETCHDIRECTION, m_nFetchDirection );
- REGISTER_PROP( PROPERTY_ID_ESCAPEPROCESSING, m_bEscapeProcessing );
- REGISTER_PROP( PROPERTY_ID_RESULTSETCONCURRENCY, m_nResultSetConcurrency );
-}
-// -----------------------------------------------------------------------------
-OCommonStatement::~OCommonStatement()
-{
-}
-//------------------------------------------------------------------------------
-void OCommonStatement::disposeResultSet()
-{
- // free the cursor if alive
- Reference< XComponent > xComp(m_xResultSet.get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- m_xResultSet = Reference< XResultSet>();
-}
-//------------------------------------------------------------------------------
-void OCommonStatement::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- disposeResultSet();
-
- if (m_pConnection)
- m_pConnection->release();
- m_pConnection = NULL;
-
- dispose_ChildImpl();
- OCommonStatement_IBase::disposing();
-}
-//-----------------------------------------------------------------------------
-Any SAL_CALL OCommonStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OCommonStatement_IBase::queryInterface(rType);
- if(!aRet.hasValue())
- aRet = ::comphelper::OPropertyContainer::queryInterface(rType);
- return aRet;
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OCommonStatement::getTypes( ) throw(RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const Reference< XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< XFastPropertySet > *)0 ),
- ::getCppuType( (const Reference< XPropertySet > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),OCommonStatement_IBase::getTypes());
-}
-// -------------------------------------------------------------------------
-
-//void SAL_CALL OCommonStatement::cancel( ) throw(RuntimeException)
-//{
-//::osl::MutexGuard aGuard( m_aMutex );
-//checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-//// cancel the current sql statement
-//}
-
-// -------------------------------------------------------------------------
-void SAL_CALL OCommonStatement::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-
-void OCommonStatement::reset() throw (SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
-
- clearWarnings ();
-
- if (m_xResultSet.get().is())
- clearMyResultSet();
-}
-
-void OCommonStatement::clearMyResultSet () throw (SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
- try
- {
- Reference<XCloseable> xCloseable;
- if ( ::comphelper::query_interface( m_xResultSet.get(), xCloseable ) )
- xCloseable->close();
- }
- catch( const DisposedException& ) { }
-
- m_xResultSet = Reference< XResultSet >();
-}
-
-EBookQuery *
-OCommonStatement::createTrue()
-{ // Not the world's most efficient unconditional true but ...
- return e_book_query_from_string("(exists \"full_name\")");
-}
-
-EBookQuery *
-OCommonStatement::createTest( const ::rtl::OUString &aColumnName,
- EBookQueryTest eTest,
- const ::rtl::OUString &aMatch )
-{
- ::rtl::OString sMatch = rtl::OUStringToOString( aMatch, RTL_TEXTENCODING_UTF8 );
- ::rtl::OString sColumnName = rtl::OUStringToOString( aColumnName, RTL_TEXTENCODING_UTF8 );
-
- return e_book_query_field_test( e_contact_field_id( sColumnName.getStr() ),
- eTest, sMatch.getStr() );
-}
-
-// -------------------------------------------------------------------------
-
-::rtl::OUString OCommonStatement::impl_getColumnRefColumnName_throw( const OSQLParseNode& _rColumnRef )
-{
- ENSURE_OR_THROW( SQL_ISRULE( &_rColumnRef, column_ref ), "internal error: only column_refs supported as LHS" );
-
- ::rtl::OUString sColumnName;
- switch ( _rColumnRef.count() )
- {
- case 3: // SQL_TOKEN_NAME '.' column_val
- {
- const OSQLParseNode* pPunct = _rColumnRef.getChild( 1 );
- const OSQLParseNode* pColVal = _rColumnRef.getChild( 2 );
- if ( SQL_ISPUNCTUATION( pPunct, "." )
- && ( pColVal->count() == 1 )
- )
- {
- sColumnName = pColVal->getChild( 0 )->getTokenValue();
- }
- }
- break;
-
- case 1: // column
- {
- sColumnName = _rColumnRef.getChild( 0 )->getTokenValue();
- }
- break;
- }
-
- if ( !sColumnName.getLength() )
- m_pConnection->throwGenericSQLException( STR_QUERY_TOO_COMPLEX, *this );
-
- return sColumnName;
-}
-
-// -------------------------------------------------------------------------
-void OCommonStatement::orderByAnalysis( const OSQLParseNode* _pOrderByClause, SortDescriptor& _out_rSort )
-{
- ENSURE_OR_THROW( _pOrderByClause, "NULL node" );
- ENSURE_OR_THROW( SQL_ISRULE( _pOrderByClause, opt_order_by_clause ), "wrong node type" );
-
- _out_rSort.clear();
-
- const OSQLParseNode* pOrderList = _pOrderByClause->getByRule( OSQLParseNode::ordering_spec_commalist );
- ENSURE_OR_THROW( pOrderList, "unexpected parse tree structure" );
-
- for ( sal_uInt32 i=0; i<pOrderList->count(); ++i )
- {
- const OSQLParseNode* pOrderBy = pOrderList->getChild(i);
- if ( !pOrderBy || !SQL_ISRULE( pOrderBy, ordering_spec ) )
- continue;
- const OSQLParseNode* pColumnRef = pOrderBy->count() == 2 ? pOrderBy->getChild(0) : NULL;
- const OSQLParseNode* pAscDesc = pOrderBy->count() == 2 ? pOrderBy->getChild(1) : NULL;
- ENSURE_OR_THROW(
- ( pColumnRef != NULL )
- && ( pAscDesc != NULL )
- && SQL_ISRULE( pAscDesc, opt_asc_desc )
- && ( pAscDesc->count() < 2 ),
- "ordering_spec structure error" );
-
- // column name -> column field
- if ( !SQL_ISRULE( pColumnRef, column_ref ) )
- m_pConnection->throwGenericSQLException( STR_SORT_BY_COL_ONLY, *this );
- const ::rtl::OUString sColumnName( impl_getColumnRefColumnName_throw( *pColumnRef ) );
- guint nField = evoab::findEvoabField( sColumnName );
- // ascending/descending?
- bool bAscending = true;
- if ( ( pAscDesc->count() == 1 )
- && SQL_ISTOKEN( pAscDesc->getChild( 0 ), DESC )
- )
- bAscending = false;
-
- _out_rSort.push_back( FieldSort( nField, bAscending ) );
- }
-}
-
-// -------------------------------------------------------------------------
-EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
-{
- EBookQuery *pResult = NULL;
-
- ENSURE_OR_THROW( parseTree, "invalid parse tree" );
-
- // Nested brackets
- if( parseTree->count() == 3 &&
- SQL_ISPUNCTUATION( parseTree->getChild( 0 ), "(" ) &&
- SQL_ISPUNCTUATION( parseTree->getChild( 2 ), ")" ) )
- {
- pResult = whereAnalysis( parseTree->getChild( 1 ) );
- }
-
- // SQL AND, OR
- else if( ( SQL_ISRULE( parseTree, search_condition ) ||
- SQL_ISRULE( parseTree, boolean_term ) ) &&
- parseTree->count() == 3 )
- {
- ENSURE_OR_THROW( SQL_ISTOKEN( parseTree->getChild( 1 ), OR )
- || SQL_ISTOKEN( parseTree->getChild( 1 ), AND ),
- "unexpected search_condition structure" );
-
- EBookQuery *pArgs[2];
- pArgs[0] = whereAnalysis( parseTree->getChild( 0 ) );
- pArgs[1] = whereAnalysis( parseTree->getChild( 2 ) );
-
- if( SQL_ISTOKEN( parseTree->getChild( 1 ), OR ) )
- pResult = e_book_query_or( 2, pArgs, TRUE );
- else
- pResult = e_book_query_and( 2, pArgs, TRUE );
- }
- // SQL =, !=
- else if( SQL_ISRULE( parseTree, comparison_predicate ) )
- {
- OSQLParseNode *pPrec = parseTree->getChild( 1 );
-
- ENSURE_OR_THROW( parseTree->count() == 3, "unexpected comparison_predicate structure" );
-
- OSQLParseNode* pLHS = parseTree->getChild( 0 );
- OSQLParseNode* pRHS = parseTree->getChild( 2 );
-
- if ( ( !( SQL_ISRULE( pLHS, column_ref ) ) // on the LHS, we accept a column or a constant int value
- && ( pLHS->getNodeType() != SQL_NODE_INTNUM )
- )
- || ( ( pRHS->getNodeType() != SQL_NODE_STRING ) // on the RHS, certain literals are acceptable
- && ( pRHS->getNodeType() != SQL_NODE_INTNUM )
- && ( pRHS->getNodeType() != SQL_NODE_APPROXNUM )
- && !( SQL_ISTOKEN( pRHS, TRUE ) )
- && !( SQL_ISTOKEN( pRHS, FALSE ) )
- )
- || ( ( pLHS->getNodeType() == SQL_NODE_INTNUM ) // an int on LHS requires an int on RHS
- && ( pRHS->getNodeType() != SQL_NODE_INTNUM )
- )
- )
- {
- m_pConnection->throwGenericSQLException( STR_QUERY_TOO_COMPLEX, *this );
- }
-
- if ( ( pPrec->getNodeType() != SQL_NODE_EQUAL )
- && ( pPrec->getNodeType() != SQL_NODE_NOTEQUAL )
- )
- {
- m_pConnection->throwGenericSQLException( STR_OPERATOR_TOO_COMPLEX, *this );
- }
-
- // recognize the special "0 = 1" condition
- if ( ( pLHS->getNodeType() == SQL_NODE_INTNUM )
- && ( pRHS->getNodeType() == SQL_NODE_INTNUM )
- && ( pPrec->getNodeType() == SQL_NODE_EQUAL )
- )
- {
- const sal_Int32 nLHS = pLHS->getTokenValue().toInt64();
- const sal_Int32 nRHS = pRHS->getTokenValue().toInt64();
- return ( nLHS == nRHS ) ? createTrue() : NULL;
- }
-
- ::rtl::OUString aColumnName( impl_getColumnRefColumnName_throw( *pLHS ) );
-
- ::rtl::OUString aMatchString;
- if ( pRHS->isToken() )
- aMatchString = pRHS->getTokenValue();
- else
- aMatchString = pRHS->getChild( 0 )->getTokenValue();
-
- pResult = createTest( aColumnName, E_BOOK_QUERY_IS, aMatchString );
-
- if ( pResult && ( pPrec->getNodeType() == SQL_NODE_NOTEQUAL ) )
- pResult = e_book_query_not( pResult, TRUE );
- }
- // SQL like
- else if( SQL_ISRULE( parseTree, like_predicate ) )
- {
- ENSURE_OR_THROW( parseTree->count() == 2, "unexpected like_predicate structure" );
- const OSQLParseNode* pPart2 = parseTree->getChild(1);
-
- if( ! SQL_ISRULE( parseTree->getChild( 0 ), column_ref) )
- m_pConnection->throwGenericSQLException(STR_QUERY_INVALID_LIKE_COLUMN,*this);
-
- ::rtl::OUString aColumnName( impl_getColumnRefColumnName_throw( *parseTree->getChild( 0 ) ) );
-
- OSQLParseNode *pAtom = pPart2->getChild( pPart2->count() - 2 ); // Match String
- bool bNotLike = pPart2->getChild(0)->isToken();
-
- if( !( pAtom->getNodeType() == SQL_NODE_STRING ||
- pAtom->getNodeType() == SQL_NODE_NAME ||
- SQL_ISRULE( pAtom,parameter ) ||
- ( pAtom->getChild( 0 ) && pAtom->getChild( 0 )->getNodeType() == SQL_NODE_NAME ) ||
- ( pAtom->getChild( 0 ) && pAtom->getChild( 0 )->getNodeType() == SQL_NODE_STRING ) ) )
- {
- OSL_TRACE( "analyseSQL : pAtom->count() = %d\n", pAtom->count() );
- m_pConnection->throwGenericSQLException(STR_QUERY_INVALID_LIKE_STRING,*this);
- }
-
- const sal_Unicode WILDCARD = '%';
-
- rtl::OUString aMatchString;
- aMatchString = pAtom->getTokenValue();
-
- // Determine where '%' character is...
- if( aMatchString.equals( ::rtl::OUString::valueOf( WILDCARD ) ) )
- {
- // String containing only a '%' and nothing else matches everything
- pResult = createTest( aColumnName, E_BOOK_QUERY_CONTAINS,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")) );
- }
- else if( aMatchString.indexOf( WILDCARD ) == -1 )
- { // Simple string , eg. "to match" "contains in evo"
- EVO_TRACE_STRING( "Plain contains '%s'", aMatchString );
- pResult = createTest( aColumnName, E_BOOK_QUERY_CONTAINS, aMatchString );
- if( pResult && bNotLike )
- pResult = e_book_query_not( pResult, TRUE );
- }
- else if( bNotLike )
- {
- // We currently can't handle a 'NOT LIKE' when there are '%'
- m_pConnection->throwGenericSQLException(STR_QUERY_NOT_LIKE_TOO_COMPLEX,*this);
- }
- else if( (aMatchString.indexOf ( WILDCARD ) == aMatchString.lastIndexOf ( WILDCARD ) ) )
- { // One occurrence of '%' matches...
- if ( aMatchString.indexOf ( WILDCARD ) == 0 )
- pResult = createTest( aColumnName, E_BOOK_QUERY_ENDS_WITH, aMatchString.copy( 1 ) );
- else if ( aMatchString.indexOf ( WILDCARD ) == aMatchString.getLength() - 1 )
- pResult = createTest( aColumnName, E_BOOK_QUERY_BEGINS_WITH, aMatchString.copy( 0, aMatchString.getLength() - 1 ) );
- else
- m_pConnection->throwGenericSQLException(STR_QUERY_LIKE_WILDCARD,*this);
-
- if( pResult && bNotLike )
- pResult = e_book_query_not( pResult, TRUE );
- }
- else if( aMatchString.getLength() >= 3 &&
- aMatchString.indexOf ( WILDCARD ) == 0 &&
- aMatchString.indexOf ( WILDCARD, 1) == aMatchString.getLength() - 1 ) {
- // one '%' at the start and another at the end
- pResult = createTest( aColumnName, E_BOOK_QUERY_CONTAINS, aMatchString.copy (1, aMatchString.getLength() - 2) );
- }
- else
- m_pConnection->throwGenericSQLException(STR_QUERY_LIKE_WILDCARD_MANY,*this);
- }
-
- return pResult;
-}
-
-rtl::OUString OCommonStatement::getTableName()
-{
- ::rtl::OUString aTableName;
-
- if( m_pParseTree && m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT )
- {
- Any aCatalog;
- ::rtl::OUString aSchema, aComposedName;
- const OSQLParseNode *pSelectStmnt = m_aSQLIterator.getParseTree();
- const OSQLParseNode *pAllTableNames = pSelectStmnt->getChild( 3 )->getChild( 0 )->getChild( 1 );
-
- if( m_aSQLIterator.isTableNode( pAllTableNames->getChild( 0 ) ) )
- OSQLParseNode::getTableComponents( pAllTableNames->getChild( 0 ),
- aCatalog,aSchema, aTableName,NULL );
-
- else if( SQL_ISRULE( pAllTableNames->getChild( 0 ), table_ref ) )
- {
- OSQLParseNode *pNodeForTableName = pAllTableNames->getChild( 0 )->getChild( 0 );
- if( m_aSQLIterator.isTableNode( pNodeForTableName ) )
- {
- aTableName = OSQLParseNode::getTableRange(pAllTableNames->getChild( 0 ));
- if( !aTableName.getLength() )
- OSQLParseNode::getTableComponents( pNodeForTableName, aCatalog, aSchema, aTableName,NULL);
- }
- else
- OSL_FAIL( "odd table layout" );
- }
- else
- OSL_FAIL( "unusual table layout" );
- }
- return aTableName;
-}
-
-void OCommonStatement::parseSql( const rtl::OUString& sql, QueryData& _out_rQueryData )
-{
- EVO_TRACE_STRING( "parsing %s", sql );
-
- _out_rQueryData.eFilterType = eFilterOther;
-
- ::rtl::OUString aErr;
- m_pParseTree = m_aParser.parseTree( aErr, sql );
- m_aSQLIterator.setParseTree( m_pParseTree );
- m_aSQLIterator.traverseAll();
-
- _out_rQueryData.sTable = getTableName();
-
- // to be sorted?
- const OSQLParseNode* pOrderByClause = m_aSQLIterator.getOrderTree();
- if ( pOrderByClause )
- {
- #if OSL_DEBUG_LEVEL > 0
- ::rtl::OUString sTreeDebug;
- pOrderByClause->showParseTree( sTreeDebug );
- EVO_TRACE_STRING( "found order-by tree:\n%s", sTreeDebug );
- #endif
- orderByAnalysis( pOrderByClause, _out_rQueryData.aSortOrder );
- }
-
- const OSQLParseNode* pWhereClause = m_aSQLIterator.getWhereTree();
- if ( pWhereClause && SQL_ISRULE( pWhereClause, where_clause ) )
- {
- #if OSL_DEBUG_LEVEL > 0
- ::rtl::OUString sTreeDebug;
- pWhereClause->showParseTree( sTreeDebug );
- EVO_TRACE_STRING( "found where tree:\n%s", sTreeDebug );
- #endif
- EBookQuery* pQuery = whereAnalysis( pWhereClause->getChild( 1 ) );
- if ( !pQuery )
- {
- _out_rQueryData.eFilterType = eFilterAlwaysFalse;
- pQuery = createTrue();
- }
- _out_rQueryData.setQuery( pQuery );
- }
- else
- {
- _out_rQueryData.eFilterType = eFilterNone;
- _out_rQueryData.setQuery( createTrue() );
- }
-}
-
-// -------------------------------------------------------------------------
-
-Reference< XConnection > SAL_CALL OStatement::getConnection( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
- // just return our connection here
- return impl_getConnection();
-}
-
-// -------------------------------------------------------------------------
-Any SAL_CALL OCommonStatement::getWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
-
- return makeAny(SQLWarning());
-}
-
-// -------------------------------------------------------------------------
-void SAL_CALL OCommonStatement::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OCommonStatement::createArrayHelper( ) const
-{
- Sequence< Property > aProps;
- describeProperties( aProps );
- return new ::cppu::OPropertyArrayHelper( aProps );
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OCommonStatement::getInfoHelper()
-{
- return *const_cast< OCommonStatement* >( this )->getArrayHelper();
-}
-
-// -----------------------------------------------------------------------------
-void SAL_CALL OCommonStatement::acquire() throw()
-{
- OCommonStatement_IBase::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OCommonStatement::release() throw()
-{
- relase_ChildImpl();
-}
-
-// -------------------------------------------------------------------------
-QueryData OCommonStatement::impl_getEBookQuery_throw( const ::rtl::OUString& _rSql )
-{
- QueryData aData;
- parseSql( _rSql, aData );
-
-#ifdef DEBUG
- char *pSexpr = aData.getQuery() ? e_book_query_to_string( aData.getQuery() ) : g_strdup( "<map failed>" );
- g_message( "Parsed SQL to sexpr '%s'\n", pSexpr );
- g_free( pSexpr );
-#endif
-
- if ( !aData.getQuery() )
- m_pConnection->throwGenericSQLException( STR_QUERY_TOO_COMPLEX, *this );
-
- // a postcondition of this method is that we properly determined the SELECT columns
- aData.xSelectColumns = m_aSQLIterator.getSelectColumns();
- if ( !aData.xSelectColumns.is() )
- m_pConnection->throwGenericSQLException( STR_QUERY_TOO_COMPLEX, *this );
-
- return aData;
-}
-
-// -------------------------------------------------------------------------
-Reference< XResultSet > OCommonStatement::impl_executeQuery_throw( const QueryData& _rQueryData )
-{
- // create result set
- OEvoabResultSet* pResult = new OEvoabResultSet( this, m_pConnection );
- Reference< XResultSet > xRS = pResult;
- pResult->construct( _rQueryData );
-
- // done
- m_xResultSet = xRS;
- return xRS;
-}
-
-// -------------------------------------------------------------------------
-Reference< XResultSet > OCommonStatement::impl_executeQuery_throw( const ::rtl::OUString& _rSql )
-{
- EVO_TRACE_STRING( "OCommonStatement::impl_executeQuery_throw(%s)\n", _rSql );
-
-#ifdef DEBUG
- g_message( "Parse SQL '%s'\n",
- (const sal_Char *)OUStringToOString( _rSql, RTL_TEXTENCODING_UTF8 ) );
-#endif
-
- return impl_executeQuery_throw( impl_getEBookQuery_throw( _rSql ) );
-}
-
-// -----------------------------------------------------------------------------
-Reference< XPropertySetInfo > SAL_CALL OCommonStatement::getPropertySetInfo( ) throw(RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() );
-}
-
-// =============================================================================
-// = OStatement
-// =============================================================================
-// -----------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO( OStatement, "com.sun.star.comp.sdbcx.evoab.OStatement", "com.sun.star.sdbc.Statement" );
-
-// -----------------------------------------------------------------------------
-IMPLEMENT_FORWARD_XINTERFACE2( OStatement, OCommonStatement, OStatement_IBase )
-
-// -----------------------------------------------------------------------------
-IMPLEMENT_FORWARD_XTYPEPROVIDER2( OStatement, OCommonStatement, OStatement_IBase )
-
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OStatement::execute( const ::rtl::OUString& _sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
- Reference< XResultSet > xRS = impl_executeQuery_throw( _sql );
- return xRS.is();
-}
-
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL OStatement::executeQuery( const ::rtl::OUString& _sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
-
- return impl_executeQuery_throw( _sql );
-}
-
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OStatement::executeUpdate( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBase::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedException( "XStatement::executeUpdate", *this );
- return 0;
-}
-
-} } // namespace ::connectivity::evoab
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NStatement.hxx b/connectivity/source/drivers/evoab2/NStatement.hxx
deleted file mode 100644
index b5adfeb0a7..0000000000
--- a/connectivity/source/drivers/evoab2/NStatement.hxx
+++ /dev/null
@@ -1,291 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_STATEMENT_HXX_
-#define _CONNECTIVITY_EVOAB_STATEMENT_HXX_
-
-#include <com/sun/star/sdbc/XStatement.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XMultipleResults.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <comphelper/proparrhlp.hxx>
-#include <cppuhelper/compbase2.hxx>
-#include <comphelper/uno3.hxx>
-#include "connectivity/CommonTools.hxx"
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <comphelper/broadcasthelper.hxx>
-#include "connectivity/sqliterator.hxx"
-#include "connectivity/sqlparse.hxx"
-#include <connectivity/FValue.hxx>
-#include "OSubComponent.hxx"
-#include <com/sun/star/util/XCancellable.hpp>
-#include <cppuhelper/compbase5.hxx>
-#include <comphelper/propertycontainer.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-#include "EApi.h"
-
-#include <list>
-
-namespace connectivity
-{
- namespace evoab
- {
- class OEvoabResultSet;
- class OEvoabConnection;
- typedef ::cppu::WeakComponentImplHelper2 < ::com::sun::star::sdbc::XWarningsSupplier
- , ::com::sun::star::sdbc::XCloseable
- > OCommonStatement_IBase;
-
- struct FieldSort
- {
- sal_Int32 nField;
- bool bAscending;
-
- FieldSort() : nField(0), bAscending( true ) { }
- FieldSort( const sal_Int32 _nField, const bool _bAscending ) : nField( _nField ), bAscending( _bAscending ) { }
- };
- typedef ::std::vector< FieldSort > SortDescriptor;
-
- enum QueryFilterType
- {
- eFilterAlwaysFalse,
- eFilterNone,
- eFilterOther
- };
-
- struct QueryData
- {
- private:
- EBookQuery* pQuery;
-
- public:
- ::rtl::OUString sTable;
- QueryFilterType eFilterType;
- ::rtl::Reference< ::connectivity::OSQLColumns > xSelectColumns;
- SortDescriptor aSortOrder;
-
- QueryData()
- :pQuery( NULL )
- ,sTable()
- ,eFilterType( eFilterOther )
- ,xSelectColumns()
- ,aSortOrder()
- {
- }
-
- QueryData( const QueryData& _rhs )
- :pQuery( NULL )
- ,sTable()
- ,eFilterType( eFilterType )
- ,xSelectColumns()
- ,aSortOrder()
- {
- *this = _rhs;
- }
-
- QueryData& operator=( const QueryData& _rhs )
- {
- if ( this == &_rhs )
- return *this;
-
- setQuery( _rhs.pQuery );
- sTable = _rhs.sTable;
- eFilterType = _rhs.eFilterType;
- xSelectColumns = _rhs.xSelectColumns;
- aSortOrder = _rhs.aSortOrder;
-
- return *this;
- }
-
- ~QueryData()
- {
- setQuery( NULL );
- }
-
- EBookQuery* getQuery() const { return pQuery; }
-
- void setQuery( EBookQuery* _pQuery )
- {
- if ( pQuery )
- e_book_query_unref( pQuery );
- pQuery = _pQuery;
- if ( pQuery )
- e_book_query_ref( pQuery );
- }
- };
-
- //**************************************************************
- //************ Class: OCommonStatement
- // is a base class for the normal statement and for the prepared statement
- //**************************************************************
- class OCommonStatement;
- typedef OSubComponent< OCommonStatement, OCommonStatement_IBase > OStatement_CBase;
-
- class OCommonStatement :public comphelper::OBaseMutex
- ,public OCommonStatement_IBase
- ,public ::comphelper::OPropertyContainer
- ,public ::comphelper::OPropertyArrayUsageHelper< OCommonStatement >
- ,public OStatement_CBase
- {
- friend class OSubComponent< OCommonStatement, OCommonStatement_IBase >;
-
- private:
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet> m_xResultSet; // The last ResultSet created
- OEvoabResultSet *m_pResultSet;
- OEvoabConnection *m_pConnection;
- connectivity::OSQLParser m_aParser;
- connectivity::OSQLParseTreeIterator m_aSQLIterator;
- connectivity::OSQLParseNode *m_pParseTree;
-
- // <properties>
- ::rtl::OUString m_aCursorName;
- sal_Int32 m_nMaxFieldSize;
- sal_Int32 m_nMaxRows;
- sal_Int32 m_nQueryTimeOut;
- sal_Int32 m_nFetchSize;
- sal_Int32 m_nResultSetType;
- sal_Int32 m_nFetchDirection;
- sal_Int32 m_nResultSetConcurrency;
- sal_Bool m_bEscapeProcessing;
- // </properties>
-
- ::cppu::OBroadcastHelper& rBHelper;
-
- protected:
-
- void disposeResultSet();
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- virtual ~OCommonStatement();
-
- protected:
- void reset () throw( ::com::sun::star::sdbc::SQLException);
- void clearMyResultSet () throw( ::com::sun::star::sdbc::SQLException);
- void parseSql( const ::rtl::OUString& sql, QueryData& _out_rQueryData );
- EBookQuery *whereAnalysis( const OSQLParseNode* parseTree );
- void orderByAnalysis( const OSQLParseNode* _pOrderByClause, SortDescriptor& _out_rSort );
- rtl::OUString getTableName();
- EBookQuery *createTrue();
- EBookQuery *createTest( const ::rtl::OUString &aColumnName,
- EBookQueryTest eTest,
- const ::rtl::OUString &aMatch );
-
- public:
-
- // other methods
- OEvoabConnection* getOwnConnection() const { return m_pConnection;}
-
- using OCommonStatement_IBase::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
-
- protected:
- OCommonStatement( OEvoabConnection* _pConnection );
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL release() throw();
- virtual void SAL_CALL acquire() throw();
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- protected:
- /** will return the EBookQuery representing the stamement's WHERE condition, or throw
-
- Also, all statement dependent members (such as the parser/iterator) will be inited afterwards.
- */
- QueryData
- impl_getEBookQuery_throw( const ::rtl::OUString& _rSql );
-
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
- impl_executeQuery_throw( const ::rtl::OUString& _rSql );
-
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
- impl_executeQuery_throw( const QueryData& _rData );
-
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >
- impl_getConnection() { return ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >( (::com::sun::star::sdbc::XConnection*)m_pConnection ); }
-
- ::rtl::OUString
- impl_getColumnRefColumnName_throw( const ::connectivity::OSQLParseNode& _rColumnRef );
- };
-
- typedef ::cppu::ImplHelper2 < ::com::sun::star::lang::XServiceInfo
- , ::com::sun::star::sdbc::XStatement
- > OStatement_IBase;
- class OStatement :public OCommonStatement
- ,public OStatement_IBase
- {
- protected:
- virtual ~OStatement(){}
-
- public:
- OStatement( OEvoabConnection* _pConnection)
- :OCommonStatement( _pConnection)
- {
- }
-
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XTypeProvider
- DECLARE_XTYPEPROVIDER()
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
-
- // XStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Int32 SAL_CALL executeUpdate( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL execute( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- };
- }
-}
-#endif // CONNECTIVITY_SSTATEMENT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NTable.cxx b/connectivity/source/drivers/evoab2/NTable.cxx
deleted file mode 100644
index 30807ab4f5..0000000000
--- a/connectivity/source/drivers/evoab2/NTable.cxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "NTable.hxx"
-#include "NTables.hxx"
-#include "NColumns.hxx"
-#include "NCatalog.hxx"
-
-using namespace connectivity;
-using namespace ::comphelper;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace connectivity::evoab;
-// -------------------------------------------------------------------------
-OEvoabTable::OEvoabTable( sdbcx::OCollection* _pTables,
- OEvoabConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description ,
- const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName
- ) : OEvoabTable_TYPEDEF(_pTables,sal_True,
- _Name,
- _Type,
- _Description,
- _SchemaName,
- _CatalogName),
- m_pConnection(_pConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-void OEvoabTable::refreshColumns()
-{
- TStringVector aVector;
-
- if (!isNew())
- {
- Reference< XResultSet > xResult = m_pConnection->getMetaData()->getColumns(
- Any(),
- m_SchemaName,
- m_Name,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")));
-
- if (xResult.is())
- {
- Reference< XRow > xRow(xResult, UNO_QUERY);
- while (xResult->next())
- aVector.push_back(xRow->getString(4));
- }
- }
- if (m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new OEvoabColumns(this,m_aMutex,aVector);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NTable.hxx b/connectivity/source/drivers/evoab2/NTable.hxx
deleted file mode 100644
index 169191d630..0000000000
--- a/connectivity/source/drivers/evoab2/NTable.hxx
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_TABLE_HXX_
-#define _CONNECTIVITY_EVOAB_TABLE_HXX_
-
-#include "NConnection.hxx"
-#include "connectivity/sdbcx/VTable.hxx"
-
-namespace connectivity
-{
- namespace evoab
- {
- typedef connectivity::sdbcx::OTable OEvoabTable_TYPEDEF;
-
- ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xColProp);
-
- class OEvoabTable : public OEvoabTable_TYPEDEF
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- OEvoabConnection* m_pConnection;
-
- public:
- OEvoabTable( sdbcx::OCollection* _pTables,
- OEvoabConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description = ::rtl::OUString(),
- const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
- const ::rtl::OUString& _CatalogName = ::rtl::OUString()
- );
-
- OEvoabConnection* getConnection() { return m_pConnection;}
-
- virtual void refreshColumns();
-
- ::rtl::OUString getTableName() const { return m_Name; }
- ::rtl::OUString getSchema() const { return m_SchemaName; }
- };
- }
-}
-
-#endif // _CONNECTIVITY_EVOAB_TABLE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NTables.cxx b/connectivity/source/drivers/evoab2/NTables.cxx
deleted file mode 100644
index a883d823a8..0000000000
--- a/connectivity/source/drivers/evoab2/NTables.cxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "NTables.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <connectivity/sdbcx/VTable.hxx>
-#include "NCatalog.hxx"
-#include "NConnection.hxx"
-#include <comphelper/extract.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include <cppuhelper/interfacecontainer.h>
-#include <comphelper/types.hxx>
-#include "NDebug.hxx"
-#include "NTable.hxx"
-using namespace ::comphelper;
-
-using namespace ::cppu;
-using namespace connectivity::evoab;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace dbtools;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-ObjectType OEvoabTables::createObject(const ::rtl::OUString& aName)
-{
- ::rtl::OUString aSchema( RTL_CONSTASCII_USTRINGPARAM( "%" ));
-
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
- ::rtl::OUString sEmpty;
-
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),aSchema,aName,aTypes);
-
- ObjectType xRet = NULL;
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- if(xResult->next()) // there can be only one table with this name
- {
- OEvoabTable* pRet = new OEvoabTable(
- this,
- (OEvoabConnection *)static_cast<OEvoabCatalog&>(m_rParent).getConnection(),
- aName,
- xRow->getString(4),
- xRow->getString(5),
- sEmpty);
- xRet = pRet;
- }
- }
-
- ::comphelper::disposeComponent(xResult);
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void OEvoabTables::impl_refresh( ) throw(RuntimeException)
-{
- static_cast<OEvoabCatalog&>(m_rParent).refreshTables();
-}
-// -------------------------------------------------------------------------
-void OEvoabTables::disposing(void)
-{
-m_xMetaData.clear();
- OCollection::disposing();
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/NTables.hxx b/connectivity/source/drivers/evoab2/NTables.hxx
deleted file mode 100644
index 001454a18d..0000000000
--- a/connectivity/source/drivers/evoab2/NTables.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_EVOAB_TABLES_HXX_
-#define _CONNECTIVITY_EVOAB_TABLES_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-namespace connectivity
-{
- namespace evoab
- {
- class OEvoabTables : public sdbcx::OCollection
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- public:
- OEvoabTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,
- ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) :
- sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector),
- m_xMetaData(_rMetaData)
- {}
- virtual void SAL_CALL disposing(void);
- };
- }
-}
-#endif // _CONNECTIVITY_EVOAB_TABLES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/evoab2/evoab.component b/connectivity/source/drivers/evoab2/evoab.component
deleted file mode 100755
index a99719388d..0000000000
--- a/connectivity/source/drivers/evoab2/evoab.component
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.sdbc.evoab.OEvoabDriver">
- <service name="com.sun.star.sdbc.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/evoab2/evoab.xml b/connectivity/source/drivers/evoab2/evoab.xml
deleted file mode 100755
index fbf309cbf0..0000000000
--- a/connectivity/source/drivers/evoab2/evoab.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description>
- <module-name>evoab</module-name>
- <component-description>
- <author>Jayant Madavi</author>
- <name>com.sun.star.comp.sdbc.evoab.OEvoabDriver</name>
- <description>This library implements the database driver for evolution address book formats.
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service>com.sun.star.sdbc.Driver</supported-service>
- <service-dependency> ... </service-dependency>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>osl</runtime-module-dependency>
- <runtime-module-dependency>svtools-light1</runtime-module-dependency>
- <runtime-module-dependency>svtools</runtime-module-dependency>
- <runtime-module-dependency>ucbhelper</runtime-module-dependency>
- <runtime-module-dependency>unotools</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
diff --git a/connectivity/source/drivers/evoab2/evoab2.xcu b/connectivity/source/drivers/evoab2/evoab2.xcu
deleted file mode 100644
index bda1fb8648..0000000000
--- a/connectivity/source/drivers/evoab2/evoab2.xcu
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:address:evolution:local" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.evoab.OEvoabDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Evolution Local</value>
- </prop>
- <node oor:name="Features">
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="sdbc:address:evolution:ldap" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.evoab.OEvoabDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Evolution LDAP</value>
- </prop>
- <node oor:name="Features">
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="sdbc:address:evolution:groupwise" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.evoab.OEvoabDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Groupwise</value>
- </prop>
- <node oor:name="Features">
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/evoab2/makefile.mk b/connectivity/source/drivers/evoab2/makefile.mk
deleted file mode 100755
index 6f61762a0c..0000000000
--- a/connectivity/source/drivers/evoab2/makefile.mk
+++ /dev/null
@@ -1,121 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=evoab2
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-.IF "$(ENABLE_EVOAB2)"!="TRUE"
-dummy:
- @echo "Evolution 2.x Addressbook build disabled"
-.ELSE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-PKGCONFIG_MODULES=gtk+-2.0
-.INCLUDE : pkg_config.mk
-
-CFLAGS+=$(GOBJECT_CFLAGS)
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/NDriver.obj \
- $(SLO)$/NTable.obj \
- $(SLO)$/NColumns.obj \
- $(SLO)$/NTables.obj \
- $(SLO)$/NCatalog.obj \
- $(SLO)$/NConnection.obj \
- $(SLO)$/NDatabaseMetaData.obj \
- $(SLO)$/NStatement.obj \
- $(SLO)$/NPreparedStatement.obj \
- $(SLO)$/NServices.obj \
- $(SLO)$/NResultSet.obj \
- $(SLO)$/NResultSetMetaData.obj \
- $(SLO)$/EApi.obj \
- $(SLO)$/NDebug.obj
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-
-
-# --- Library -----------------------------------
-
-SHL1TARGET= $(EVOAB_TARGET)$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SVLLIB) \
- $(TOOLSLIB) \
- $(UNOTOOLSLIB) \
- $(UCBHELPERLIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(DBTOOLSLIB) \
- $(DBFILELIB) \
- $(COMPHELPERLIB)
-
-.IF "$(DBFILELIB)" == ""
-SHL1STDLIBS+= ifile.lib
-.ENDIF
-SHL1STDLIBS+=$(GOBJECT_LIBS)
-
-
-SHL1STDLIBS+=$(PKGCONFIG_LIBS:s/ -lpangoxft-1.0//)
-# hack for faked SO environment
-.IF "$(PKGCONFIG_ROOT)"!=""
-SHL1SONAME+=-z nodefs
-SHL1NOCHECK=TRUE
-.ENDIF # "$(PKGCONFIG_ROOT)"!=""
-
-
-SHL1DEPN=
-SHL1IMPLIB= i$(TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-
-.ENDIF
-
-# --- Targets ----------------------------------
-
-.INCLUDE : $(PRJ)$/target.pmk
-
-ALLTAR : $(MISC)/evoab.component
-
-$(MISC)/evoab.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- evoab.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt evoab.component
diff --git a/connectivity/source/drivers/file/FCatalog.cxx b/connectivity/source/drivers/file/FCatalog.cxx
deleted file mode 100644
index ad4430cb88..0000000000
--- a/connectivity/source/drivers/file/FCatalog.cxx
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "file/FCatalog.hxx"
-#include "file/FConnection.hxx"
-#include "file/FTables.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <rtl/logfile.hxx>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-// -------------------------------------------------------------------------
-using namespace connectivity::file;
-// -------------------------------------------------------------------------
-OFileCatalog::OFileCatalog(OConnection* _pCon) : connectivity::sdbcx::OCatalog(_pCon)
- ,m_pConnection(_pCon)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileCatalog::OFileCatalog" );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OFileCatalog::disposing()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileCatalog::disposing" );
- ::osl::MutexGuard aGuard(m_aMutex);
-
- typedef connectivity::sdbcx::OCatalog OFileCatalog_BASE;
-m_xMetaData.clear();
- OFileCatalog_BASE::disposing();
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OFileCatalog::buildName(const Reference< XRow >& _xRow)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileCatalog::buildName" );
- return _xRow->getString(3);
-}
-// -------------------------------------------------------------------------
-void OFileCatalog::refreshTables()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileCatalog::refreshTables" );
- TStringVector aVector;
- Sequence< ::rtl::OUString > aTypes;
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),aTypes);
- fillNames(xResult,aVector);
-
- if(m_pTables)
- m_pTables->reFill(aVector);
- else
- m_pTables = new OTables(m_xMetaData,*this,m_aMutex,aVector);
-}
-
-// -------------------------------------------------------------------------
-Any SAL_CALL OFileCatalog::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileCatalog::queryInterface" );
- if( rType == ::getCppuType((const Reference<XGroupsSupplier>*)0) ||
- rType == ::getCppuType((const Reference<XUsersSupplier>*)0) ||
- rType == ::getCppuType((const Reference<XViewsSupplier>*)0))
- return Any();
-
-
- typedef sdbcx::OCatalog OFileCatalog_BASE;
- return OFileCatalog_BASE::queryInterface(rType);
-}
-// -----------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OFileCatalog::getTypes( ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileCatalog::getTypes" );
- typedef sdbcx::OCatalog OFileCatalog_BASE;
-
- Sequence< Type > aTypes = OFileCatalog_BASE::getTypes();
- ::std::vector<Type> aOwnTypes;
- aOwnTypes.reserve(aTypes.getLength());
- const Type* pBegin = aTypes.getConstArray();
- const Type* pEnd = pBegin + aTypes.getLength();
- for(;pBegin != pEnd;++pBegin)
- {
- if(!(*pBegin == ::getCppuType((const Reference<XGroupsSupplier>*)0) ||
- *pBegin == ::getCppuType((const Reference<XUsersSupplier>*)0) ||
- *pBegin == ::getCppuType((const Reference<XViewsSupplier>*)0)))
- {
- aOwnTypes.push_back(*pBegin);
- }
- }
- const Type *pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FColumns.cxx b/connectivity/source/drivers/file/FColumns.cxx
deleted file mode 100644
index ae1d119011..0000000000
--- a/connectivity/source/drivers/file/FColumns.cxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "file/FColumns.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include "file/FTable.hxx"
-#include <comphelper/property.hxx>
-
-using namespace connectivity::file;
-using namespace connectivity;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
-{
-
- Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns(Any(),
- m_pTable->getSchema(),m_pTable->getName(),_rName);
-
- sdbcx::ObjectType xRet = NULL;
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- {
- if(xRow->getString(4) == _rName)
- {
- sdbcx::OColumn* pRet = new sdbcx::OColumn(_rName,
- xRow->getString(6),
- xRow->getString(13),
- xRow->getString(12),
- xRow->getInt(11),
- xRow->getInt(7),
- xRow->getInt(9),
- xRow->getInt(5),
- sal_False,
- sal_False,
- sal_False,
- m_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers());
- xRet = pRet;
- break;
- }
- }
- }
-
- return xRet;
-}
-// -----------------------------------------------------------------------------
-void OColumns::impl_refresh() throw(RuntimeException)
-{
- m_pTable->refreshColumns();
-}
-// -----------------------------------------------------------------------------
-
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx
deleted file mode 100644
index a24de50729..0000000000
--- a/connectivity/source/drivers/file/FConnection.cxx
+++ /dev/null
@@ -1,463 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include "file/FConnection.hxx"
-#include "file/FDatabaseMetaData.hxx"
-#include "file/FDriver.hxx"
-#include "file/FStatement.hxx"
-#include "file/FPreparedStatement.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/ucb/XContent.hpp>
-#include <com/sun/star/ucb/XContentIdentifier.hpp>
-#include <tools/urlobj.hxx>
-#include "file/FCatalog.hxx"
-#include <unotools/pathoptions.hxx>
-#include <ucbhelper/content.hxx>
-#include <connectivity/dbcharset.hxx>
-#include <connectivity/dbexception.hxx>
-#include <osl/thread.h>
-#include <osl/nlsupport.h>
-#include "resource/file_res.hrc"
-
-using namespace connectivity::file;
-using namespace dbtools;
-//------------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::ucb;
-using namespace ::ucbhelper;
-using rtl::OUString;
-typedef connectivity::OMetaConnection OConnection_BASE;
-// --------------------------------------------------------------------------------
-OConnection::OConnection(OFileDriver* _pDriver)
- : OSubComponent<OConnection, OConnection_BASE>((::cppu::OWeakObject*)_pDriver, this)
- ,m_pDriver(_pDriver)
- ,m_bClosed(sal_False)
- ,m_bShowDeleted(sal_False)
- ,m_bCaseSensitiveExtension( sal_True )
- ,m_bCheckSQL92(sal_False)
- ,m_bDefaultTextEncoding(false)
-{
- m_nTextEncoding = RTL_TEXTENCODING_DONTKNOW;
-}
-//-----------------------------------------------------------------------------
-OConnection::~OConnection()
-{
- if(!isClosed( ))
- close();
-}
-//-----------------------------------------------------------------------------
-void SAL_CALL OConnection::release() throw()
-{
- relase_ChildImpl();
-}
-
-//-----------------------------------------------------------------------------
-sal_Bool OConnection::matchesExtension( const String& _rExt ) const
-{
- if ( isCaseSensitveExtension() )
- return ( getExtension() == _rExt );
-
- String sMyExtension( getExtension() );
- sMyExtension.ToLowerAscii();
- String sExt( _rExt );
- sExt.ToLowerAscii();
-
- return sMyExtension == sExt;
-}
-
-//-----------------------------------------------------------------------------
-void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyValue >& info) throw(SQLException)
-{
- osl_incrementInterlockedCount( &m_refCount );
-
- ::rtl::OUString aExt;
- const PropertyValue *pIter = info.getConstArray();
- const PropertyValue *pEnd = pIter + info.getLength();
- for(;pIter != pEnd;++pIter)
- {
- if(0 == pIter->Name.compareToAscii("Extension"))
- OSL_VERIFY( pIter->Value >>= aExt );
- else if(0 == pIter->Name.compareToAscii("CharSet"))
- {
- ::rtl::OUString sIanaName;
- OSL_VERIFY( pIter->Value >>= sIanaName );
-
- ::dbtools::OCharsetMap aLookupIanaName;
- ::dbtools::OCharsetMap::const_iterator aLookup = aLookupIanaName.find(sIanaName, ::dbtools::OCharsetMap::IANA());
- if (aLookup != aLookupIanaName.end())
- m_nTextEncoding = (*aLookup).getEncoding();
- else
- m_nTextEncoding = RTL_TEXTENCODING_DONTKNOW;
- }
- else if (0 == pIter->Name.compareToAscii("ShowDeleted"))
- {
- OSL_VERIFY( pIter->Value >>= m_bShowDeleted );
- }
- else if (0 == pIter->Name.compareToAscii("EnableSQL92Check"))
- {
- pIter->Value >>= m_bCheckSQL92;
- }
- } // for(;pIter != pEnd;++pIter)
-
- {
- sal_Int32 nLen = url.indexOf(':');
- nLen = url.indexOf(':',nLen+1);
- ::rtl::OUString aDSN(url.copy(nLen+1)),aUID,aPWD;
-
- String aFileName = aDSN;
- INetURLObject aURL;
- aURL.SetSmartProtocol(INET_PROT_FILE);
- {
- SvtPathOptions aPathOptions;
- aFileName = aPathOptions.SubstituteVariable(aFileName);
- }
-
- aURL.SetSmartURL(aFileName);
-
- setURL(aURL.GetMainURL(INetURLObject::NO_DECODE));
- }
-
- if ( m_nTextEncoding == RTL_TEXTENCODING_DONTKNOW )
- {
- //m_nTextEncoding = osl_getTextEncodingFromLocale(NULL);
- m_nTextEncoding = osl_getThreadTextEncoding();
- m_bDefaultTextEncoding = true;
- }
-
- if ( aExt.getLength() )
- m_aFilenameExtension = aExt;
-
- try
- {
- ::ucbhelper::Content aFile;
- try
- {
- aFile = ::ucbhelper::Content(getURL(),Reference< XCommandEnvironment >());
- }
- catch(ContentCreationException& e)
- {
- throwUrlNotValid(getURL(),e.Message);
- }
-
- // set fields to fetch
- Sequence< OUString > aProps(1);
- OUString* pProps = aProps.getArray();
- pProps[ 0 ] = OUString(RTL_CONSTASCII_USTRINGPARAM("Title"));
-
- try
- {
- if (aFile.isFolder())
- {
- m_xDir = aFile.createDynamicCursor(aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY );
- m_xContent = aFile.get();
- }
- else if (aFile.isDocument())
- {
- Reference<XContent> xParent(Reference<XChild>(aFile.get(),UNO_QUERY)->getParent(),UNO_QUERY);
- Reference<XContentIdentifier> xIdent = xParent->getIdentifier();
- m_xContent = xParent;
-
- ::ucbhelper::Content aParent(xIdent->getContentIdentifier(),Reference< XCommandEnvironment >());
- m_xDir = aParent.createDynamicCursor(aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY );
- }
- else
- {
- OSL_FAIL("OConnection::construct: ::ucbhelper::Content isn't a folde nor a document! How that?!");
- throw SQLException();
- }
- }
- catch(Exception& e) // a execption is thrown when no file exists
- {
- throwUrlNotValid(getURL(),e.Message);
- }
- if(!m_xDir.is() || !m_xContent.is())
- throwUrlNotValid(getURL(),::rtl::OUString());
-
- if (m_aFilenameExtension.Search('*') != STRING_NOTFOUND || m_aFilenameExtension.Search('?') != STRING_NOTFOUND)
- throw SQLException();
- }
- catch(const Exception&)
- {
- osl_decrementInterlockedCount( &m_refCount );
- throw;
- }
-
- osl_decrementInterlockedCount( &m_refCount );
-}
-// XServiceInfo
-// --------------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OConnection, "com.sun.star.sdbc.drivers.file.Connection", "com.sun.star.sdbc.Connection")
-
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL OConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- Reference< XStatement > xReturn = new OStatement(this);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- OPreparedStatement* pStmt = new OPreparedStatement(this);
- Reference< XPreparedStatement > xHoldAlive = pStmt;
- pStmt->construct(sql);
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return pStmt;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
-{
- throwFeatureNotImplementedException( "XConnection::prepareCall", *this );
- return NULL;
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConnection::nativeSQL( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- return sql;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setAutoCommit( sal_Bool autoCommit ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- m_bAutoCommit = autoCommit;
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::getAutoCommit( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- return m_bAutoCommit;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::commit( ) throw(SQLException, RuntimeException)
-{
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::rollback( ) throw(SQLException, RuntimeException)
-{
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::isClosed( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- return OConnection_BASE::rBHelper.bDisposed;
-}
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL OConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if(!xMetaData.is())
- {
- xMetaData = new ODatabaseMetaData(this);
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- m_bReadOnly = readOnly;
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- return m_bReadOnly;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& /*catalog*/ ) throw(SQLException, RuntimeException)
-{
- throwFeatureNotImplementedException( "XConnection::setCatalog", *this );
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConnection::getCatalog( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 /*level*/ ) throw(SQLException, RuntimeException)
-{
- throwFeatureNotImplementedException( "XConnection::setTransactionIsolation", *this );
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OConnection::getTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- return 0;
-}
-// --------------------------------------------------------------------------------
-Reference< XNameAccess > SAL_CALL OConnection::getTypeMap( ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setTypeMap( const Reference< XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
-}
-// --------------------------------------------------------------------------------
-// XCloseable
-void SAL_CALL OConnection::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-}
-// --------------------------------------------------------------------------------
-// XWarningsSupplier
-Any SAL_CALL OConnection::getWarnings( ) throw(SQLException, RuntimeException)
-{
- return Any();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::clearWarnings( ) throw(SQLException, RuntimeException)
-{
-}
-//------------------------------------------------------------------------------
-void OConnection::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- OConnection_BASE::disposing();
-
- m_bClosed = sal_True;
-m_xDir.clear();
-m_xContent.clear();
- m_xCatalog = WeakReference< XTablesSupplier>();
-
- dispose_ChildImpl();
-}
-//------------------------------------------------------------------------------
-Reference< XTablesSupplier > OConnection::createCatalog()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- Reference< XTablesSupplier > xTab = m_xCatalog;
- if(!xTab.is())
- {
- xTab = new OFileCatalog(this);
- m_xCatalog = xTab;
- }
- return xTab;
-}
-// -----------------------------------------------------------------------------
-Reference< XDynamicResultSet > OConnection::getDir() const
-{
- Reference<XDynamicResultSet> xContent;
- Sequence< ::rtl::OUString > aProps(1);
- ::rtl::OUString* pProps = aProps.getArray();
- pProps[ 0 ] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title"));
- try
- {
- Reference<XContentIdentifier> xIdent = getContent()->getIdentifier();
- ::ucbhelper::Content aParent(xIdent->getContentIdentifier(),Reference< XCommandEnvironment >());
- xContent = aParent.createDynamicCursor(aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY );
- }
- catch(Exception&)
- {
- }
- return xContent;
-}
-// -----------------------------------------------------------------------------
-sal_Int64 SAL_CALL OConnection::getSomething( const Sequence< sal_Int8 >& rId ) throw (RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : (sal_Int64)0;
-}
-// -----------------------------------------------------------------------------
-Sequence< sal_Int8 > OConnection::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-// -----------------------------------------------------------------------------
-void OConnection::throwUrlNotValid(const ::rtl::OUString & _rsUrl,const ::rtl::OUString & _rsMessage)
-{
- SQLException aError;
- aError.Message = getResources().getResourceStringWithSubstitution(
- STR_NO_VALID_FILE_URL,
- "$URL$", _rsUrl
- );
-
- aError.SQLState = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000"));
- aError.ErrorCode = 0;
- aError.Context = static_cast< XConnection* >(this);
- if (_rsMessage.getLength())
- aError.NextException <<= SQLException(_rsMessage, aError.Context, ::rtl::OUString(), 0, Any());
-
- throw aError;
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
deleted file mode 100644
index 737e32d930..0000000000
--- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx
+++ /dev/null
@@ -1,1225 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "file/FDatabaseMetaData.hxx"
-#include "FDatabaseMetaDataResultSet.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/ucb/SearchRecursion.hpp>
-#include <com/sun/star/ucb/SearchCommandArgument.hpp>
-#include <com/sun/star/ucb/XSortedDynamicResultSetFactory.hpp>
-#include <com/sun/star/ucb/XContentProvider.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <tools/urlobj.hxx>
-#include "file/FDriver.hxx"
-#include "file/FTable.hxx"
-#include <comphelper/extract.hxx>
-#include <ucbhelper/content.hxx>
-#include <ucbhelper/contentbroker.hxx>
-#include <tools/debug.hxx>
-#include <rtl/logfile.hxx>
-
-
-using namespace com::sun::star::ucb;
-using namespace connectivity::file;
-using namespace connectivity;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::container;
-
-DBG_NAME( file_ODatabaseMetaData )
-ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon) : ::connectivity::ODatabaseMetaDataBase(_pCon,_pCon->getConnectionInfo())
- ,m_pConnection(_pCon)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::ODatabaseMetaData" );
- DBG_CTOR( file_ODatabaseMetaData, NULL );
-}
-// -------------------------------------------------------------------------
-ODatabaseMetaData::~ODatabaseMetaData()
-{
- DBG_DTOR( file_ODatabaseMetaData, NULL );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > ODatabaseMetaData::impl_getTypeInfo_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_getTypeInfo_throw" );
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTypeInfo );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaData::impl_getCatalogSeparator_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_getCatalogSeparator_throw" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& /*tableNamePattern*/,
- const ::rtl::OUString& /*columnNamePattern*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getColumns" );
- OSL_FAIL("Should be overloaded!");
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eColumns );
-}
-
-// -------------------------------------------------------------------------
-namespace
-{
- sal_Int16 isCaseSensitiveParentFolder( const String& _rFolderOrDoc, const String& _rDocName )
- {
- sal_Int16 nIsCS = 1;
- try
- {
- // first get the real content for the URL
- INetURLObject aContentURL( _rFolderOrDoc );
- ::ucbhelper::Content aContent1;
- {
- ::ucbhelper::Content aFolderOrDoc( _rFolderOrDoc, Reference< XCommandEnvironment >() );
- if ( aFolderOrDoc.isDocument() )
- aContent1 = aFolderOrDoc;
- else
- {
- aContentURL = INetURLObject( _rFolderOrDoc, INetURLObject::WAS_ENCODED );
- aContentURL.Append( _rDocName );
- aContent1 = ::ucbhelper::Content( aContentURL.GetMainURL( INetURLObject::NO_DECODE ), Reference< XCommandEnvironment >() );
- }
- }
-
- // get two extensions which differ by case only
- String sExtension1 = aContentURL.getExtension();
- String sExtension2( sExtension1 );
- sExtension2.ToLowerAscii();
- if ( sExtension2 == sExtension1 )
- // the extension was already in lower case
- sExtension2.ToUpperAscii();
-
- // the complete URL for the second extension
- INetURLObject aURL2( aContentURL );
- if ( sExtension2.Len() )
- aURL2.SetExtension( sExtension2 );
- if ( aURL2.GetMainURL(INetURLObject::NO_DECODE) == aContentURL.GetMainURL(INetURLObject::NO_DECODE) )
- return -1;
-
- // the second context
- sal_Bool bCanAccess = sal_False;
- ::ucbhelper::Content aContent2;
- try
- {
- aContent2 = ::ucbhelper::Content( aURL2.GetMainURL( INetURLObject::NO_DECODE ), Reference< XCommandEnvironment >() );
- bCanAccess = aContent2.isDocument();
- }
- catch( const Exception& )
- {
- }
-
- if ( bCanAccess )
- {
- // here we have two contents whose URLs differ by case only.
- // Now let's check if both really refer to the same object ....
- Reference< XContent > xContent1 = aContent1.get();
- Reference< XContent > xContent2 = aContent2.get();
- OSL_ENSURE( xContent1.is() && xContent2.is(), "isCaseSensitiveParentFolder: invalid content interfaces!" );
- if ( xContent1.is() && xContent2.is() )
- {
- Reference< XContentIdentifier > xID1 = xContent1->getIdentifier();
- Reference< XContentIdentifier > xID2 = xContent2->getIdentifier();
- OSL_ENSURE( xID1.is() && xID2.is(), "isCaseSensitiveParentFolder: invalid ID interfaces!" );
- if ( xID1.is() && xID2.is() )
- {
- // get a generic content provider
- ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
- Reference< XContentProvider > xProvider;
- if ( pBroker )
- xProvider = pBroker->getContentProviderInterface();
- OSL_ENSURE( xProvider.is(), "isCaseSensitiveParentFolder: invalid content broker!" );
- if ( xProvider.is() )
- {
- if ( 0 == xProvider->compareContentIds( xID1, xID2 ) )
- // finally, we know that the folder is not case-sensitive ....
- nIsCS = 0;
- }
- }
- }
- }
- }
- catch( const Exception& )
- {
- OSL_FAIL( "isCaseSensitiveParentFolder: caught an unexpected exception!" );
- }
-
- return nIsCS;
- }
-}
-
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/,
- const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getTables" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTables );
- Reference< XResultSet > xRef = pResult;
-
- // check if any type is given
- // when no types are given then we have to return all tables e.g. TABLE
-
- static const ::rtl::OUString aTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
-
- sal_Bool bTableFound = sal_True;
- sal_Int32 nLength = types.getLength();
- if(nLength)
- {
- bTableFound = sal_False;
-
- const ::rtl::OUString* pBegin = types.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + nLength;
- for(;pBegin != pEnd;++pBegin)
- {
- if(*pBegin == aTable)
- {
- bTableFound = sal_True;
- break;
- }
- }
- }
- if(!bTableFound)
- return xRef;
-
- Reference<XDynamicResultSet> xContent = m_pConnection->getDir();
- Reference < XSortedDynamicResultSetFactory > xSRSFac(
- m_pConnection->getDriver()->getFactory()->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SortedDynamicResultSetFactory")) ), UNO_QUERY );
-
- Sequence< NumberedSortingInfo > aSortInfo( 1 );
- NumberedSortingInfo* pInfo = aSortInfo.getArray();
- pInfo[ 0 ].ColumnIndex = 1;
- pInfo[ 0 ].Ascending = sal_True;
-
- Reference < XAnyCompareFactory > xFactory;
- Reference< XDynamicResultSet > xDynamicResultSet;
- xDynamicResultSet = xSRSFac->createSortedDynamicResultSet( xContent, aSortInfo, xFactory );
- Reference<XResultSet> xResultSet = xDynamicResultSet->getStaticResultSet();
-
- Reference<XRow> xRow(xResultSet,UNO_QUERY);
-
- String aFilenameExtension = m_pConnection->getExtension();
- String sThisContentExtension;
- ODatabaseMetaDataResultSet::ORows aRows;
- // scan the directory for tables
- ::rtl::OUString aName;
- INetURLObject aURL;
- xResultSet->beforeFirst();
-
- sal_Bool bKnowCaseSensivity = sal_False;
- sal_Bool bCaseSensitiveDir = sal_True;
- sal_Bool bCheckEnabled = m_pConnection->isCheckEnabled();
-
- while(xResultSet->next())
- {
- aName = xRow->getString(1);
- aURL.SetSmartProtocol(INET_PROT_FILE);
- String sUrl = m_pConnection->getURL() + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + aName;
- aURL.SetSmartURL( sUrl );
- sThisContentExtension = aURL.getExtension();
-
- ODatabaseMetaDataResultSet::ORow aRow(3);
- aRow.reserve(6);
- sal_Bool bNewRow = sal_False;
-
- if ( !bKnowCaseSensivity )
- {
- bKnowCaseSensivity = sal_True;
- sal_Int16 nCase = isCaseSensitiveParentFolder( m_pConnection->getURL(), aURL.getName() );
- switch( nCase )
- {
- case 1:
- bCaseSensitiveDir = sal_True;
- break;
- case -1:
- bKnowCaseSensivity = sal_False;
- /** run through */
- case 0:
- bCaseSensitiveDir = sal_False;
- }
- if ( bKnowCaseSensivity )
- {
- m_pConnection->setCaseSensitiveExtension( bCaseSensitiveDir, OConnection::GrantAccess() );
- if ( !bCaseSensitiveDir )
- aFilenameExtension.ToLowerAscii();
- }
- }
-
- if (aFilenameExtension.Len())
- {
- if ( !bCaseSensitiveDir )
- sThisContentExtension.ToLowerAscii();
-
- if ( sThisContentExtension == aFilenameExtension )
- {
- aName = aName.replaceAt(aName.getLength()-(aFilenameExtension.Len()+1),aFilenameExtension.Len()+1,::rtl::OUString());
- sal_Unicode nChar = aName.toChar();
- if ( match(tableNamePattern,aName,'\0') && ( !bCheckEnabled || ( bCheckEnabled && ((nChar < '0' || nChar > '9')))) )
- {
- aRow.push_back(new ORowSetValueDecorator(aName));
- bNewRow = sal_True;
- }
- }
- }
- else // no extension, filter myself
- {
- sal_Bool bErg = sal_False;
- do
- {
- if (!aURL.getExtension().getLength())
- {
- sal_Unicode nChar = aURL.getBase().getStr()[0];
- if(match(tableNamePattern,aURL.getBase(),'\0') && ( !bCheckEnabled || ( bCheckEnabled && ((nChar < '0' || nChar > '9')))) )
- {
- aRow.push_back(new ORowSetValueDecorator(::rtl::OUString(aURL.getBase())));
- bNewRow = sal_True;
- }
- break;
- }
- else if ( ( bErg = xResultSet->next() ) != sal_False )
- {
- aName = xRow->getString(1);
- aURL.SetSmartURL(aName);
- }
- } while (bErg);
- }
- if(bNewRow)
- {
- aRow.push_back(new ORowSetValueDecorator(aTable));
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
-
- aRows.push_back(aRow);
- }
- }
-
- pResult->setRows(aRows);
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxBinaryLiteralLength" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxRowSize" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxCatalogNameLength" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxCharLiteralLength" );
- return STRING_MAXLEN;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxColumnNameLength" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxColumnsInIndex" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxCursorNameLength" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxConnections" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxColumnsInTable" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaData::impl_getMaxStatements_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_getMaxStatements_throw" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxTableNameLength" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaData::impl_getMaxTablesInSelect_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_getMaxTablesInSelect_throw" );
- return 1;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getTablePrivileges" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges );
- Reference< XResultSet > xRef = pResult;
- ODatabaseMetaDataResultSet::ORows aRows;
-
-
- Reference< XTablesSupplier > xTabSup = m_pConnection->createCatalog();
- if( xTabSup.is())
- {
- Reference< XNameAccess> xNames = xTabSup->getTables();
- Sequence< ::rtl::OUString > aNames = xNames->getElementNames();
- const ::rtl::OUString* pBegin = aNames.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + aNames.getLength();
- for(;pBegin != pEnd;++pBegin)
- {
- if(match(tableNamePattern,*pBegin,'\0'))
- {
- static ODatabaseMetaDataResultSet::ORow aRow(8);
-
- aRow[2] = new ORowSetValueDecorator(*pBegin);
- aRow[6] = ODatabaseMetaDataResultSet::getSelectValue();
- aRow[7] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NO")));
- aRows.push_back(aRow);
-
- Reference< XPropertySet> xTable;
- ::cppu::extractInterface(xTable,xNames->getByName(*pBegin));
- if(xTable.is())
- {
- Reference<XUnoTunnel> xTunnel(xTable,UNO_QUERY);
- if(xTunnel.is())
- {
- OFileTable* pTable = reinterpret_cast< OFileTable* >( xTunnel->getSomething(OFileTable::getUnoTunnelImplementationId()) );
- if(pTable)
- {
- if(!pTable->isReadOnly())
- {
- aRow[6] = ODatabaseMetaDataResultSet::getInsertValue();
- aRows.push_back(aRow);
- if(!m_pConnection->showDeleted())
- {
- aRow[6] = ODatabaseMetaDataResultSet::getDeleteValue();
- aRows.push_back(aRow);
- }
- aRow[6] = ODatabaseMetaDataResultSet::getUpdateValue();
- aRows.push_back(aRow);
- aRow[6] = ODatabaseMetaDataResultSet::getCreateValue();
- aRows.push_back(aRow);
- aRow[6] = ODatabaseMetaDataResultSet::getReadValue();
- aRows.push_back(aRow);
- aRow[6] = ODatabaseMetaDataResultSet::getAlterValue();
- aRows.push_back(aRow);
- aRow[6] = ODatabaseMetaDataResultSet::getDropValue();
- aRows.push_back(aRow);
- }
- }
- }
- }
- }
- }
- }
-
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::doesMaxRowSizeIncludeBlobs" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::storesLowerCaseQuotedIdentifiers" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::storesLowerCaseIdentifiers" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::storesMixedCaseIdentifiers" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::storesUpperCaseQuotedIdentifiers" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::storesUpperCaseIdentifiers" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxIndexLength" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsNonNullableColumns" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getCatalogTerm" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaData::impl_getIdentifierQuoteString_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_getIdentifierQuoteString_throw" );
- static const ::rtl::OUString sQuote(RTL_CONSTASCII_USTRINGPARAM("\""));
- return sQuote;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getExtraNameCharacters" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsDifferentTableCorrelationNames" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_isCatalogAtStart_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_isCatalogAtStart_throw" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::dataDefinitionIgnoredInTransactions" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::dataDefinitionCausesTransactionCommit" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsDataManipulationTransactionsOnly" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsPositionedDelete" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsPositionedUpdate" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsOpenStatementsAcrossRollback" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsOpenStatementsAcrossCommit" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsOpenCursorsAcrossCommit" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsOpenCursorsAcrossRollback" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 /*level*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsTransactionIsolationLevel" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsANSI92FullSQL" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsANSI92EntryLevelSQL" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsIntegrityEnhancementFacility" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsSchemasInIndexDefinitions" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsCatalogsInIndexDefinitions" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsOuterJoins" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getTableTypes" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTableTypes );
- Reference< XResultSet > xRef = pResult;
- static ODatabaseMetaDataResultSet::ORows aRows;
- if(aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow;
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE"))));
- aRows.push_back(aRow);
- }
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxStatementLength" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxProcedureNameLength" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxSchemaNameLength" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsTransactions" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::allProceduresAreCallable" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsStoredProcedures" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsSelectForUpdate" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::allTablesAreSelectable" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::isReadOnly" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::usesLocalFiles" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::usesLocalFilePerTable" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsTypeConversion" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::nullPlusNonNullIsNull" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsColumnAliasing" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsTableCorrelationNames" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 /*fromType*/, sal_Int32 /*toType*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsConvert" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsExpressionsInOrderBy" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsGroupBy" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsGroupByBeyondSelect" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsGroupByUnrelated" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsMultipleTransactions" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsMultipleResultSets" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsLikeEscapeClause" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsOrderByUnrelated" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsUnion" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsUnionAll" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsMixedCaseIdentifiers" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::nullsAreSortedAtEnd" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::nullsAreSortedAtStart" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::nullsAreSortedHigh" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::nullsAreSortedLow" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsSchemasInProcedureCalls" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsCatalogsInProcedureCalls" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsCorrelatedSubqueries" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsSubqueriesInComparisons" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsSubqueriesInExists" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsSubqueriesInIns" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsSubqueriesInQuantifieds" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsANSI92IntermediateSQL" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getURL" );
- static const ::rtl::OUString aValue( RTL_CONSTASCII_USTRINGPARAM( "sdbc:file:" ));
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getUserName" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getDriverName" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverVersion( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getDriverVersion" );
- return ::rtl::OUString::valueOf((sal_Int32)1);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getDatabaseProductVersion" );
- return ::rtl::OUString::valueOf((sal_Int32)0);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getDatabaseProductName" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getProcedureTerm" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getSchemaTerm" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getDriverMajorVersion" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getDefaultTransactionIsolation" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getDriverMinorVersion" );
- return 0;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getSQLKeywords" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getSearchStringEscape" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getStringFunctions" );
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UCASE,LCASE,ASCII,LENGTH,OCTET_LENGTH,CHAR_LENGTH,CHARACTER_LENGTH,CHAR,CONCAT,LOCATE,SUBSTRING,LTRIM,RTRIM,SPACE,REPLACE,REPEAT,INSERT,LEFT,RIGHT"));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getTimeDateFunctions" );
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DAYOFWEEK,DAYOFMONTH,DAYOFYEAR,MONTH,DAYNAME,MONTHNAME,QUARTER,WEEK,YEAR,HOUR,MINUTE,SECOND,CURDATE,CURTIME,NOW"));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getSystemFunctions" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getNumericFunctions" );
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ABS,SIGN,MOD,FLOOR,CEILING,ROUND,EXP,LN,LOG,LOG10,POWER,SQRT,PI,COS,SIN,TAN,ACOS,ASIN,ATAN,ATAN2,DEGREES,RADIANS"));
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsExtendedSQLGrammar" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsCoreSQLGrammar" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsMinimumSQLGrammar" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsFullOuterJoins" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsLimitedOuterJoins" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxColumnsInGroupBy" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxColumnsInOrderBy" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxColumnsInSelect" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getMaxUserNameLength" );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsResultSetType" );
- switch(setType)
- {
- case ResultSetType::FORWARD_ONLY:
- return sal_True;
- case ResultSetType::SCROLL_INSENSITIVE:
- case ResultSetType::SCROLL_SENSITIVE:
- break;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 /*concurrency*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsResultSetConcurrency" );
- switch(setType)
- {
- case ResultSetType::FORWARD_ONLY:
- return sal_True;
- case ResultSetType::SCROLL_INSENSITIVE:
- case ResultSetType::SCROLL_SENSITIVE:
- break;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::ownUpdatesAreVisible" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::ownDeletesAreVisible" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::ownInsertsAreVisible" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::othersUpdatesAreVisible" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::othersDeletesAreVisible" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::othersInsertsAreVisible" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::updatesAreDetected" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::deletesAreDetected" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::insertsAreDetected" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::supportsBatchUpdates" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getUDTs( const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& /*typeNamePattern*/, const Sequence< sal_Int32 >& /*types*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ODatabaseMetaData::getUDTs" );
- return NULL;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FDateFunctions.cxx b/connectivity/source/drivers/file/FDateFunctions.cxx
deleted file mode 100644
index ac2b26d41c..0000000000
--- a/connectivity/source/drivers/file/FDateFunctions.cxx
+++ /dev/null
@@ -1,292 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "file/FDateFunctions.hxx"
-#include <tools/date.hxx>
-#include <tools/time.hxx>
-#include <tools/datetime.hxx>
-
-using namespace connectivity;
-using namespace connectivity::file;
-//------------------------------------------------------------------
-ORowSetValue OOp_DayOfWeek::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- sal_Int32 nRet = 0;
- ::com::sun::star::util::Date aD = lhs;
- Date aDate(aD.Day,aD.Month,aD.Year);
- DayOfWeek eDayOfWeek = aDate.GetDayOfWeek();
- switch(eDayOfWeek)
- {
- case MONDAY:
- nRet = 2;
- break;
- case TUESDAY:
- nRet = 3;
- break;
- case WEDNESDAY:
- nRet = 4;
- break;
- case THURSDAY:
- nRet = 5;
- break;
- case FRIDAY:
- nRet = 6;
- break;
- case SATURDAY:
- nRet = 7;
- break;
- case SUNDAY:
- nRet = 1;
- break;
- default:
- OSL_FAIL("Error in enum values for date");
- }
- return nRet;
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_DayOfMonth::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- ::com::sun::star::util::Date aD = lhs;
- return static_cast<sal_Int16>(aD.Day);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_DayOfYear::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- ::com::sun::star::util::Date aD = lhs;
- Date aDate(aD.Day,aD.Month,aD.Year);
- return static_cast<sal_Int16>(aDate.GetDayOfYear());
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Month::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- ::com::sun::star::util::Date aD = lhs;
- return static_cast<sal_Int16>(aD.Month);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_DayName::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- ::rtl::OUString sRet;
- ::com::sun::star::util::Date aD = lhs;
- Date aDate(aD.Day,aD.Month,aD.Year);
- DayOfWeek eDayOfWeek = aDate.GetDayOfWeek();
- switch(eDayOfWeek)
- {
- case MONDAY:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Monday"));
- break;
- case TUESDAY:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Tuesday"));
- break;
- case WEDNESDAY:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Wednesday"));
- break;
- case THURSDAY:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Thursday"));
- break;
- case FRIDAY:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Friday"));
- break;
- case SATURDAY:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Saturday"));
- break;
- case SUNDAY:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Sunday"));
- break;
- default:
- OSL_FAIL("Error in enum values for date");
- }
- return sRet;
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_MonthName::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- ::rtl::OUString sRet;
- ::com::sun::star::util::Date aD = lhs;
- switch(aD.Month)
- {
- case 1:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("January"));
- break;
- case 2:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("February"));
- break;
- case 3:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("March"));
- break;
- case 4:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("April"));
- break;
- case 5:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("May"));
- break;
- case 6:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("June"));
- break;
- case 7:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("July"));
- break;
- case 8:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("August"));
- break;
- case 9:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("September"));
- break;
- case 10:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("October"));
- break;
- case 11:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("November"));
- break;
- case 12:
- sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("December"));
- break;
- }
- return sRet;
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Quarter::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- sal_Int32 nRet = 1;
- ::com::sun::star::util::Date aD = lhs;
- Date aDate(aD.Day,aD.Month,aD.Year);
- if ( aD.Month >= 4 && aD.Month < 7 )
- nRet = 2;
- else if ( aD.Month >= 7 && aD.Month < 10 )
- nRet = 3;
- else if ( aD.Month >= 10 && aD.Month <= 12 )
- nRet = 4;
- return nRet;
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Week::operate(const ::std::vector<ORowSetValue>& lhs) const
-{
- if ( lhs.empty() || lhs.size() > 2 )
- return ORowSetValue();
-
- size_t nSize = lhs.size();
-
- ::com::sun::star::util::Date aD = lhs[nSize-1];
- Date aDate(aD.Day,aD.Month,aD.Year);
-
- sal_Int16 nStartDay = SUNDAY;
- if ( nSize == 2 && !lhs[0].isNull() )
- nStartDay = lhs[0];
-
- return static_cast<sal_Int16>(aDate.GetWeekOfYear(static_cast<DayOfWeek>(nStartDay)));
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Year::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- ::com::sun::star::util::Date aD = lhs;
- return static_cast<sal_Int16>(aD.Year);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Hour::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- ::com::sun::star::util::Time aT = lhs;
- return static_cast<sal_Int16>(aT.Hours);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Minute::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- ::com::sun::star::util::Time aT = lhs;
- return static_cast<sal_Int16>(aT.Minutes);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Second::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- ::com::sun::star::util::Time aT = lhs;
- return static_cast<sal_Int16>(aT.Seconds);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_CurDate::operate(const ::std::vector<ORowSetValue>& lhs) const
-{
- if ( !lhs.empty() )
- return ORowSetValue();
-
- Date aCurDate;
- return ::com::sun::star::util::Date(aCurDate.GetDay(),aCurDate.GetMonth(),aCurDate.GetYear());
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_CurTime::operate(const ::std::vector<ORowSetValue>& lhs) const
-{
- if ( !lhs.empty() )
- return ORowSetValue();
-
- Time aCurTime;
- return ::com::sun::star::util::Time(aCurTime.Get100Sec(),aCurTime.GetSec(),aCurTime.GetMin(),aCurTime.GetHour());
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Now::operate(const ::std::vector<ORowSetValue>& lhs) const
-{
- if ( !lhs.empty() )
- return ORowSetValue();
-
- DateTime aCurTime;
- return ::com::sun::star::util::DateTime(aCurTime.Get100Sec(),aCurTime.GetSec(),aCurTime.GetMin(),aCurTime.GetHour(),
- aCurTime.GetDay(),aCurTime.GetMonth(),aCurTime.GetYear());
-}
-//------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FDriver.cxx b/connectivity/source/drivers/file/FDriver.cxx
deleted file mode 100644
index 363c29cef5..0000000000
--- a/connectivity/source/drivers/file/FDriver.cxx
+++ /dev/null
@@ -1,287 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "file/FDriver.hxx"
-#include "file/FConnection.hxx"
-#include "file/fcode.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/types.hxx>
-#include "connectivity/dbexception.hxx"
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-#include <rtl/logfile.hxx>
-
-
-using namespace connectivity::file;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-// --------------------------------------------------------------------------------
-OFileDriver::OFileDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory)
- : ODriver_BASE(m_aMutex)
- ,m_xFactory(_rxFactory)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileDriver::OFileDriver" );
-}
-// --------------------------------------------------------------------------------
-void OFileDriver::disposing()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileDriver::disposing" );
- ::osl::MutexGuard aGuard(m_aMutex);
-
-
- for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
- {
- Reference< XComponent > xComp(i->get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- }
- m_xConnections.clear();
-
- ODriver_BASE::disposing();
-}
-
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString OFileDriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.driver.file.Driver"));
-}
-//------------------------------------------------------------------------------
-Sequence< ::rtl::OUString > OFileDriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
-{
- Sequence< ::rtl::OUString > aSNS( 2 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"));
- aSNS[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Driver"));
- return aSNS;
-}
-
-//------------------------------------------------------------------
-::rtl::OUString SAL_CALL OFileDriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-
-//------------------------------------------------------------------
-sal_Bool SAL_CALL OFileDriver::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-
-//------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL OFileDriver::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-
-// --------------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL OFileDriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileDriver::connect" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODriver_BASE::rBHelper.bDisposed);
-
- OConnection* pCon = new OConnection(this);
- Reference< XConnection > xCon = pCon;
- pCon->construct(url,info);
- m_xConnections.push_back(WeakReferenceHelper(*pCon));
-
- return xCon;
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OFileDriver::acceptsURL( const ::rtl::OUString& url )
- throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileDriver::acceptsURL" );
- return (!url.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:file:")),10));
-}
-// --------------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL OFileDriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileDriver::getPropertyInfo" );
- if ( acceptsURL(url) )
- {
- ::std::vector< DriverPropertyInfo > aDriverInfo;
-
- Sequence< ::rtl::OUString > aBoolean(2);
- aBoolean[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"));
- aBoolean[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1"));
-
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet of the database."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extension"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extension of the file format."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".*"))
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowDeleted"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Display inactive records."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"))
- ,aBoolean)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EnableSQL92Check"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Use SQL92 naming constraints."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"))
- ,aBoolean)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseRelativePath"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Handle the connection url as relative path."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"))
- ,aBoolean)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The URL of the database document which is used to create an absolute path."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- return Sequence< DriverPropertyInfo >(&(aDriverInfo[0]),aDriverInfo.size());
- } // if ( acceptsURL(url) )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- } // if ( ! acceptsURL(url) )
- return Sequence< DriverPropertyInfo >();
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OFileDriver::getMajorVersion( ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileDriver::getMajorVersion" );
- return 1;
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OFileDriver::getMinorVersion( ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileDriver::getMinorVersion" );
- return 0;
-}
-// --------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------
-// XDataDefinitionSupplier
-Reference< XTablesSupplier > SAL_CALL OFileDriver::getDataDefinitionByConnection( const Reference< ::com::sun::star::sdbc::XConnection >& connection ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileDriver::getDataDefinitionByConnection" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODriver_BASE::rBHelper.bDisposed);
-
- Reference< XTablesSupplier > xTab = NULL;
- Reference< ::com::sun::star::lang::XUnoTunnel> xTunnel(connection,UNO_QUERY);
- if(xTunnel.is())
- {
- OConnection* pSearchConnection = reinterpret_cast< OConnection* >( xTunnel->getSomething(OConnection::getUnoTunnelImplementationId()) );
- OConnection* pConnection = NULL;
- for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
- {
- if ((OConnection*) Reference< XConnection >::query(i->get().get()).get() == pSearchConnection)
- {
- pConnection = pSearchConnection;
- break;
- }
- }
-
- if(pConnection)
- xTab = pConnection->createCatalog();
- }
- return xTab;
-}
-
-// --------------------------------------------------------------------------------
-Reference< XTablesSupplier > SAL_CALL OFileDriver::getDataDefinitionByURL( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileDriver::getDataDefinitionByURL" );
- if ( ! acceptsURL(url) )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- }
- return getDataDefinitionByConnection(connect(url,info));
-}
-// -----------------------------------------------------------------------------
-void OOperandParam::describe(const Reference< XPropertySet>& rColumn, ::rtl::Reference<connectivity::OSQLColumns> rParameterColumns)
-{
- // den alten namen beibehalten
-
- OSL_ENSURE(getRowPos() < rParameterColumns->get().size(),"Invalid index for orderkey values!");
-
- Reference< XPropertySet> xColumn = (rParameterColumns->get())[getRowPos()];
-
- try
- {
- xColumn->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME),rColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)));
- xColumn->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE),rColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)));
- xColumn->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION),rColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)));
- xColumn->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE),rColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)));
- xColumn->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE),rColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)));
- xColumn->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE),rColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)));
- xColumn->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT),rColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)));
- }
- catch(const Exception&)
- {
- }
-
- m_eDBType = ::comphelper::getINT32(rColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)));
-}
-// -----------------------------------------------------------------------------
-OOperandAttr::OOperandAttr(sal_uInt16 _nPos,const Reference< XPropertySet>& _xColumn)
- : OOperandRow(_nPos,::comphelper::getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))))
- , m_xColumn(_xColumn)
-{
-}
-// -----------------------------------------------------------------------------
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FNoException.cxx b/connectivity/source/drivers/file/FNoException.cxx
deleted file mode 100644
index 93e7cb4b2a..0000000000
--- a/connectivity/source/drivers/file/FNoException.cxx
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "file/FCatalog.hxx"
-#include "file/fcomp.hxx"
-#include "file/fanalyzer.hxx"
-#include "file/FResultSet.hxx"
-#include "file/FPreparedStatement.hxx"
-#include <connectivity/FValue.hxx>
-#include <tools/debug.hxx>
-#include "TKeyValue.hxx"
-#include <rtl/logfile.hxx>
-
-using namespace connectivity;
-using namespace connectivity::file;
-// -----------------------------------------------------------------------------
-void OFileCatalog::refreshViews()
-{}
-void OFileCatalog::refreshGroups()
-{}
-void OFileCatalog::refreshUsers()
-{
-}
-// -----------------------------------------------------------------------------
-OPredicateInterpreter::~OPredicateInterpreter()
-{
- while(!m_aStack.empty())
- {
- delete m_aStack.top();
- m_aStack.pop();
- }
- // m_aStack.clear();
-}
-// -----------------------------------------------------------------------------
-void OPredicateCompiler::Clean()
-{
- for(OCodeList::reverse_iterator aIter = m_aCodeList.rbegin(); aIter != m_aCodeList.rend();++aIter)
- {
- delete *aIter;
- }
- m_aCodeList.clear();
-}
-// -----------------------------------------------------------------------------
-void OSQLAnalyzer::clean()
-{
- m_aCompiler->Clean();
-}
-// -----------------------------------------------------------------------------
-void OSQLAnalyzer::bindParameterRow(OValueRefRow& _pRow)
-{
- OCodeList& rCodeList = m_aCompiler->m_aCodeList;
- for(OCodeList::iterator aIter = rCodeList.begin(); aIter != rCodeList.end();++aIter)
- {
- OOperandParam* pParam = PTR_CAST(OOperandParam,(*aIter));
- if ( pParam )
- pParam->bindValue(_pRow);
- }
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::scanParameter(OSQLParseNode* pParseNode,::std::vector< OSQLParseNode*>& _rParaNodes)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::scanParameter" );
- DBG_ASSERT(pParseNode != NULL,"OResultSet: interner Fehler: ungueltiger ParseNode");
-
- // found parameter Name-Rule?
- if (SQL_ISRULE(pParseNode,parameter))
- {
- DBG_ASSERT(pParseNode->count() >= 1,"OResultSet: Parse Tree fehlerhaft");
- DBG_ASSERT(pParseNode->getChild(0)->getNodeType() == SQL_NODE_PUNCTUATION,"OResultSet: Parse Tree fehlerhaft");
-
- _rParaNodes.push_back(pParseNode);
- // Further descend not nessesary
- return;
- }
-
- // Further descend in Parse Tree
- for (sal_uInt32 i = 0; i < pParseNode->count(); i++)
- scanParameter(pParseNode->getChild(i),_rParaNodes);
-}
-// -----------------------------------------------------------------------------
-OKeyValue* OResultSet::GetOrderbyKeyValue(OValueRefRow& _rRow)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::GetOrderbyKeyValue" );
- sal_uInt32 nBookmarkValue = Abs((sal_Int32)(_rRow->get())[0]->getValue());
-
- OKeyValue* pKeyValue = OKeyValue::createKeyValue((sal_uInt32)nBookmarkValue);
-
- ::std::vector<sal_Int32>::iterator aIter = m_aOrderbyColumnNumber.begin();
- for (;aIter != m_aOrderbyColumnNumber.end(); ++aIter)
- {
- OSL_ENSURE(*aIter < static_cast<sal_Int32>(_rRow->get().size()),"Invalid index for orderkey values!");
- pKeyValue->pushKey(new ORowSetValueDecorator((_rRow->get())[*aIter]->getValue()));
- }
-
- return pKeyValue;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FNumericFunctions.cxx b/connectivity/source/drivers/file/FNumericFunctions.cxx
deleted file mode 100644
index 7800eb6b68..0000000000
--- a/connectivity/source/drivers/file/FNumericFunctions.cxx
+++ /dev/null
@@ -1,252 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <cmath>
-#include "file/FNumericFunctions.hxx"
-#include <rtl/math.hxx>
-
-using namespace connectivity;
-using namespace connectivity::file;
-//------------------------------------------------------------------
-ORowSetValue OOp_Abs::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- double nVal(lhs);
- if ( nVal < 0 )
- nVal *= -1.0;
- return fabs(nVal);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Sign::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- sal_Int32 nRet = 0;
- double nVal(lhs);
- if ( nVal < 0 )
- nRet = -1;
- else if ( nVal > 0 )
- nRet = 1;
-
- return nRet;
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Mod::operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const
-{
- if ( lhs.isNull() || rhs.isNull() )
- return ORowSetValue();
-
- return fmod((double)lhs,(double)rhs);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Floor::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- return floor((double)lhs);
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Ceiling::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- double nVal(lhs);
- return ceil(nVal);
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Round::operate(const ::std::vector<ORowSetValue>& lhs) const
-{
- if ( lhs.empty() || lhs.size() > 2 )
- return ORowSetValue();
-
- size_t nSize = lhs.size();
- double nVal = lhs[nSize-1];
-
- sal_Int32 nDec = 0;
- if ( nSize == 2 && !lhs[0].isNull() )
- nDec = lhs[0];
- return ::rtl::math::round(nVal,nDec);
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Exp::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- double nVal(lhs);
- return exp(nVal);
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Ln::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() || static_cast<double>(lhs) < 0.0 )
- return lhs;
-
- double nVal(lhs);
- nVal = log(nVal);
- if ( rtl::math::isNan(nVal) )
- return ORowSetValue();
- return nVal;
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Log::operate(const ::std::vector<ORowSetValue>& lhs) const
-{
- if ( lhs.empty() || lhs.size() > 2 )
- return ORowSetValue();
- size_t nSize = lhs.size();
- double nVal = log( (double)lhs[nSize-1] );
-
-
- if ( nSize == 2 && !lhs[0].isNull() )
- nVal /= log((double)lhs[0]);
-
- if ( rtl::math::isNan(nVal) )
- return ORowSetValue();
- return nVal;
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Log10::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() || static_cast<double>(lhs) < 0.0 )
- return lhs;
-
- double nVal = log((double)lhs);
- if ( rtl::math::isNan(nVal) )
- return ORowSetValue();
- nVal /= log(10.0);
- return nVal;
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Pow::operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const
-{
- if ( lhs.isNull() || rhs.isNull() )
- return lhs;
-
- return pow((double)lhs,(double)rhs);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Sqrt::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- double nVal = sqrt((double)lhs);
- if ( rtl::math::isNan(nVal) )
- return ORowSetValue();
- return nVal;
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Pi::operate(const ::std::vector<ORowSetValue>& /*lhs*/) const
-{
- return 3.141592653589793116;
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Cos::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- return cos((double)lhs);
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Sin::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- return sin((double)lhs);
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Tan::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- return tan((double)lhs);
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_ACos::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- return acos((double)lhs);
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_ASin::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- return asin((double)lhs);
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_ATan::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- return atan((double)lhs);
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_ATan2::operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const
-{
- if ( lhs.isNull() || rhs.isNull() )
- return lhs;
-
- return atan2((double)lhs,(double)rhs);
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Degrees::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- double nLhs = lhs;
- return nLhs*180*(1.0/3.141592653589793116);
-}
-// -----------------------------------------------------------------------------
-ORowSetValue OOp_Radians::operate(const ORowSetValue& lhs) const
-{
- if ( lhs.isNull() )
- return lhs;
-
- double nLhs = lhs;
- return nLhs*3.141592653589793116*(1.0/180.0);
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx
deleted file mode 100644
index 9b797fb483..0000000000
--- a/connectivity/source/drivers/file/FPreparedStatement.cxx
+++ /dev/null
@@ -1,635 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include "connectivity/sdbcx/VColumn.hxx"
-#include <osl/diagnose.h>
-#include "file/FPreparedStatement.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include "file/FResultSetMetaData.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/dbconversion.hxx"
-#include "connectivity/dbexception.hxx"
-#include "connectivity/dbtools.hxx"
-#include "connectivity/PColumn.hxx"
-#include "diagnose_ex.h"
-#include <comphelper/types.hxx>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <tools/debug.hxx>
-#include "resource/file_res.hrc"
-#include <rtl/logfile.hxx>
-
-using namespace connectivity;
-using namespace comphelper;
-using namespace ::dbtools;
-using namespace connectivity::file;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::util;
-
-IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbc.driver.file.PreparedStatement","com.sun.star.sdbc.PreparedStatement");
-
-DBG_NAME( file_OPreparedStatement )
-// -------------------------------------------------------------------------
-OPreparedStatement::OPreparedStatement( OConnection* _pConnection)
- : OStatement_BASE2( _pConnection )
- ,m_pResultSet(NULL)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::OPreparedStatement" );
- DBG_CTOR( file_OPreparedStatement, NULL );
-}
-
-// -------------------------------------------------------------------------
-OPreparedStatement::~OPreparedStatement()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::~OPreparedStatement" );
- DBG_DTOR( file_OPreparedStatement, NULL );
-}
-
-// -------------------------------------------------------------------------
-void OPreparedStatement::disposing()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::disposing" );
- ::osl::MutexGuard aGuard(m_aMutex);
-
- clearMyResultSet();
- OStatement_BASE2::disposing();
-
- if(m_pResultSet)
- {
- m_pResultSet->release();
- m_pResultSet = NULL;
- }
-
- m_xParamColumns = NULL;
- m_xMetaData.clear();
- if(m_aParameterRow.is())
- {
- m_aParameterRow->get().clear();
- m_aParameterRow = NULL;
- }
-
-
-}
-// -------------------------------------------------------------------------
-void OPreparedStatement::construct(const ::rtl::OUString& sql) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::construct" );
- OStatement_Base::construct(sql);
-
- m_aParameterRow = new OValueRefVector();
- m_aParameterRow->get().push_back(new ORowSetValueDecorator(sal_Int32(0)) );
-
- Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
-
- if ( m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT )
- m_xParamColumns = m_aSQLIterator.getParameters();
- else
- {
- m_xParamColumns = new OSQLColumns();
- // describe all parameters need for the resultset
- describeParameter();
- }
-
- OValueRefRow aTemp;
- OResultSet::setBoundedColumns(m_aEvaluateRow,aTemp,m_xParamColumns,xNames,sal_False,m_xDBMetaData,m_aColMapping);
-
- m_pResultSet = createResultSet();
- m_pResultSet->acquire();
- m_xResultSet = Reference<XResultSet>(m_pResultSet);
- initializeResultSet(m_pResultSet);
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::queryInterface" );
- Any aRet = OStatement_BASE2::queryInterface(rType);
- return aRet.hasValue() ? aRet : ::cppu::queryInterface( rType,
- static_cast< XPreparedStatement*>(this),
- static_cast< XParameters*>(this),
- static_cast< XResultSetMetaDataSupplier*>(this));
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL OPreparedStatement::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::getTypes" );
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const ::com::sun::star::uno::Reference< XPreparedStatement > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< XParameters > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< XResultSetMetaDataSupplier > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_BASE2::getTypes());
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::getMetaData" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- if(!m_xMetaData.is())
- m_xMetaData = new OResultSetMetaData(m_aSQLIterator.getSelectColumns(),m_aSQLIterator.getTables().begin()->first,m_pTable);
- return m_xMetaData;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::close" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- clearMyResultSet();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::execute" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- initResultSet();
-
- return m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::executeUpdate" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- initResultSet();
-
- return m_pResultSet ? m_pResultSet->getRowCountResult() : sal_Int32(0);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setString" );
- setParameter(parameterIndex,x);
-}
-// -------------------------------------------------------------------------
-
-Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::getConnection" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- return (Reference< XConnection >)m_pConnection;
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::executeQuery" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- return initResultSet();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setBoolean" );
- setParameter(parameterIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setByte" );
- setParameter(parameterIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const Date& aData ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setDate" );
- setParameter(parameterIndex,DBTypeConversion::toDouble(aData));
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const Time& aVal ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setTime" );
- setParameter(parameterIndex,DBTypeConversion::toDouble(aVal));
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const DateTime& aVal ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setTimestamp" );
- setParameter(parameterIndex,DBTypeConversion::toDouble(aVal));
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setDouble" );
- setParameter(parameterIndex,x);
-}
-
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setFloat" );
- setParameter(parameterIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setInt" );
- setParameter(parameterIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setLong( sal_Int32 /*parameterIndex*/, sal_Int64 /*aVal*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setLong" );
- throwFeatureNotImplementedException( "XParameters::setLong", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setNull" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkAndResizeParameters(parameterIndex);
-
- if ( m_aAssignValues.is() )
- (m_aAssignValues->get())[m_aParameterIndexes[parameterIndex]]->setNull();
- else
- (m_aParameterRow->get())[parameterIndex]->setNull();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setClob( sal_Int32 /*parameterIndex*/, const Reference< XClob >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setClob" );
- throwFeatureNotImplementedException( "XParameters::setClob", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBlob( sal_Int32 /*parameterIndex*/, const Reference< XBlob >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setBlob" );
- throwFeatureNotImplementedException( "XParameters::setBlob", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setArray( sal_Int32 /*parameterIndex*/, const Reference< XArray >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setArray" );
- throwFeatureNotImplementedException( "XParameters::setArray", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setRef( sal_Int32 /*parameterIndex*/, const Reference< XRef >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setRef" );
- throwFeatureNotImplementedException( "XParameters::setRef", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 sqlType, sal_Int32 scale ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setObjectWithInfo" );
- switch(sqlType)
- {
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- setString(parameterIndex,::comphelper::getString(x));
- break;
- default:
- ::dbtools::setObjectWithInfo(this,parameterIndex,x,sqlType,scale);
- break;
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& /*typeName*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setObjectNull" );
- setNull(parameterIndex,sqlType);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setObject" );
- if(!::dbtools::implSetObject(this,parameterIndex,x))
- {
- const ::rtl::OUString sError( m_pConnection->getResources().getResourceStringWithSubstitution(
- STR_UNKNOWN_PARA_TYPE,
- "$position$", ::rtl::OUString::valueOf(parameterIndex)
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
- // setObject (parameterIndex, x, sqlType, 0);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setShort" );
- setParameter(parameterIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setBytes" );
- setParameter(parameterIndex,x);
-}
-// -------------------------------------------------------------------------
-
-
-void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setCharacterStream" );
- setBinaryStream(parameterIndex,x,length );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setBinaryStream" );
- if(!x.is())
- ::dbtools::throwFunctionSequenceException(*this);
-
- Sequence<sal_Int8> aSeq;
- x->readBytes(aSeq,length);
- setParameter(parameterIndex,aSeq);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::clearParameters( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::clearParameters" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- m_aParameterRow->get().clear();
- m_aParameterRow->get().push_back(new ORowSetValueDecorator(sal_Int32(0)) );
-}
-// -------------------------------------------------------------------------
-OResultSet* OPreparedStatement::createResultSet()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::createResultSet" );
- return new OResultSet(this,m_aSQLIterator);
-}
-// -----------------------------------------------------------------------------
-Reference<XResultSet> OPreparedStatement::initResultSet()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::initResultSet" );
- m_pResultSet->clear();
- Reference<XResultSet> xRs(m_pResultSet);
-
- // check if we got enough paramters
- if ( (m_aParameterRow.is() && ( m_aParameterRow->get().size() -1 ) < m_xParamColumns->get().size()) ||
- (m_xParamColumns.is() && !m_aParameterRow.is() && !m_aParameterRow->get().empty()) )
- m_pConnection->throwGenericSQLException(STR_INVALID_PARA_COUNT,*this);
-
- m_pResultSet->OpenImpl();
- m_pResultSet->setMetaData(getMetaData());
-
- return xRs;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::acquire() throw()
-{
- OStatement_BASE2::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::release() throw()
-{
- OStatement_BASE2::release();
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::checkAndResizeParameters(sal_Int32 parameterIndex)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::checkAndResizeParameters" );
- ::connectivity::checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- if ( m_aAssignValues.is() && (parameterIndex < 1 || parameterIndex >= static_cast<sal_Int32>(m_aParameterIndexes.size())) )
- throwInvalidIndexException(*this);
- else if ( static_cast<sal_Int32>((m_aParameterRow->get()).size()) <= parameterIndex )
- {
- sal_Int32 i = m_aParameterRow->get().size();
- (m_aParameterRow->get()).resize(parameterIndex+1);
- for ( ;i <= parameterIndex+1; ++i )
- {
- if ( !(m_aParameterRow->get())[i].is() )
- (m_aParameterRow->get())[i] = new ORowSetValueDecorator;
- }
- }
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::setParameter(sal_Int32 parameterIndex, const ORowSetValue& x)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::setParameter" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkAndResizeParameters(parameterIndex);
-
- if(m_aAssignValues.is())
- *(m_aAssignValues->get())[m_aParameterIndexes[parameterIndex]] = x;
- else
- *((m_aParameterRow->get())[parameterIndex]) = x;
-}
-// -----------------------------------------------------------------------------
-sal_uInt32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Reference<XPropertySet>& _xCol)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::AddParameter" );
- OSL_UNUSED( pParameter );
- OSL_ENSURE(SQL_ISRULE(pParameter,parameter),"OResultSet::AddParameter: Argument ist kein Parameter");
- OSL_ENSURE(pParameter->count() > 0,"OResultSet: Fehler im Parse Tree");
-#if OSL_DEBUG_LEVEL > 0
- OSQLParseNode * pMark = pParameter->getChild(0);
- OSL_UNUSED( pMark );
-#endif
-
- ::rtl::OUString sParameterName;
- // set up Parameter-Column:
- sal_Int32 eType = DataType::VARCHAR;
- sal_uInt32 nPrecision = 255;
- sal_Int32 nScale = 0;
- sal_Int32 nNullable = ColumnValue::NULLABLE;
-
- if (_xCol.is())
- {
- // Use type, precision, scale ... from the given column,
- // because this Column will get a value assigned or
- // with this Column the value will be compared.
- _xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= eType;
- _xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)) >>= nPrecision;
- _xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)) >>= nScale;
- _xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)) >>= nNullable;
- _xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sParameterName;
- }
-
- Reference<XPropertySet> xParaColumn = new connectivity::parse::OParseColumn(sParameterName
- ,::rtl::OUString()
- ,::rtl::OUString()
- ,::rtl::OUString()
- ,nNullable
- ,nPrecision
- ,nScale
- ,eType
- ,sal_False
- ,sal_False
- ,m_aSQLIterator.isCaseSensitive());
- m_xParamColumns->get().push_back(xParaColumn);
- return m_xParamColumns->get().size();
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::describeColumn(OSQLParseNode* _pParameter,OSQLParseNode* _pNode,const OSQLTable& _xTable)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::describeColumn" );
- Reference<XPropertySet> xProp;
- if(SQL_ISRULE(_pNode,column_ref))
- {
- ::rtl::OUString sColumnName,sTableRange;
- m_aSQLIterator.getColumnRange(_pNode,sColumnName,sTableRange);
- if ( sColumnName.getLength() )
- {
- Reference<XNameAccess> xNameAccess = _xTable->getColumns();
- if(xNameAccess->hasByName(sColumnName))
- xNameAccess->getByName(sColumnName) >>= xProp;
- AddParameter(_pParameter,xProp);
- }
- }
- // else
- // AddParameter(_pParameter,xProp);
-}
-// -------------------------------------------------------------------------
-void OPreparedStatement::describeParameter()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::describeParameter" );
- ::std::vector< OSQLParseNode*> aParseNodes;
- scanParameter(m_pParseTree,aParseNodes);
- if ( !aParseNodes.empty() )
- {
- // m_xParamColumns = new OSQLColumns();
- const OSQLTables& xTabs = m_aSQLIterator.getTables();
- if( !xTabs.empty() )
- {
- OSQLTable xTable = xTabs.begin()->second;
- ::std::vector< OSQLParseNode*>::const_iterator aIter = aParseNodes.begin();
- for (;aIter != aParseNodes.end();++aIter )
- {
- describeColumn(*aIter,(*aIter)->getParent()->getChild(0),xTable);
- }
- }
- }
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::initializeResultSet(OResultSet* _pResult)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::initializeResultSet" );
- OStatement_Base::initializeResultSet(_pResult);
-
- m_pResultSet->setParameterColumns(m_xParamColumns);
- m_pResultSet->setParameterRow(m_aParameterRow);
-
- // Substitute parameter (AssignValues and criteria):
- if (!m_xParamColumns->get().empty())
- {
- // begin with AssignValues
- sal_uInt16 nParaCount=0; // gives the current number of previously set Parameters
-
- // search for parameters to be substituted:
- size_t nCount = m_aAssignValues.is() ? m_aAssignValues->get().size() : 1; // 1 is important for the Criteria
- for (size_t j = 1; j < nCount; j++)
- {
- sal_uInt32 nParameter = (*m_aAssignValues).getParameterIndex(j);
- if (nParameter == SQL_NO_PARAMETER)
- continue; // this AssignValue is no Parameter
-
- ++nParaCount; // now the Parameter is valid
- // Replace Parameter. If the Parameter isn't available, set value to NULL
- // (*m_aAssignValues)[j] = (*m_aParameterRow)[(UINT16)nParameter];
- }
-
- if (m_aParameterRow.is() && (m_xParamColumns->get().size()+1) != m_aParameterRow->get().size() )
- {
- sal_Int32 i = m_aParameterRow->get().size();
- sal_Int32 nParamColumns = m_xParamColumns->get().size()+1;
- m_aParameterRow->get().resize(nParamColumns);
- for ( ;i < nParamColumns; ++i )
- {
- if ( !(m_aParameterRow->get())[i].is() )
- (m_aParameterRow->get())[i] = new ORowSetValueDecorator;
- }
- //m_aParameterRow->resize(m_xParamColumns->size()+1);
- }
- if (m_aParameterRow.is() && nParaCount < m_aParameterRow->get().size() )
- {
-
- m_pSQLAnalyzer->bindParameterRow(m_aParameterRow);
- }
- }
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::parseParamterElem(const String& _sColumnName,OSQLParseNode* pRow_Value_Constructor_Elem)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::parseParamterElem" );
- Reference<XPropertySet> xCol;
- m_xColNames->getByName(_sColumnName) >>= xCol;
- sal_Int32 nParameter = -1;
- if(m_xParamColumns.is())
- {
- OSQLColumns::Vector::const_iterator aIter = find(m_xParamColumns->get().begin(),m_xParamColumns->get().end(),_sColumnName,::comphelper::UStringMixEqual(m_pTable->isCaseSensitive()));
- if(aIter != m_xParamColumns->get().end())
- nParameter = m_xParamColumns->get().size() - (m_xParamColumns->get().end() - aIter) + 1;// +1 because the rows start at 1
- }
- if(nParameter == -1)
- nParameter = AddParameter(pRow_Value_Constructor_Elem,xCol);
- // Save number of parameter in the variable:
- SetAssignValue(_sColumnName, String(), sal_True, nParameter);
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
deleted file mode 100644
index c6fda6944a..0000000000
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ /dev/null
@@ -1,1872 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#ifdef GCC
-#include <iostream>
-#endif
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "file/FResultSet.hxx"
-#include "file/FResultSetMetaData.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <comphelper/property.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include "connectivity/dbconversion.hxx"
-#include "connectivity/dbtools.hxx"
-#include <cppuhelper/propshlp.hxx>
-#include <iterator>
-#include <tools/debug.hxx>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
-
-#include <algorithm>
-#include <comphelper/extract.hxx>
-#include "connectivity/dbexception.hxx"
-#include <comphelper/types.hxx>
-#include "resource/file_res.hrc"
-#include "resource/sharedresources.hxx"
-#include <rtl/logfile.hxx>
-
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::file;
-using namespace ::cppu;
-using namespace dbtools;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-
-// Maximal number of Rows, that can be processed being sorted with ORDER BY:
-#define MAX_KEYSET_SIZE 0x40000 // 256K
-
-namespace
-{
- void lcl_throwError(sal_uInt16 _nErrorId,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xContext)
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(_nErrorId);
- ::dbtools::throwGenericSQLException(sMessage ,_xContext);
- }
-}
-//------------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.drivers.file.ResultSet","com.sun.star.sdbc.ResultSet");
-DBG_NAME( file_OResultSet )
-// -------------------------------------------------------------------------
-OResultSet::OResultSet(OStatement_Base* pStmt,OSQLParseTreeIterator& _aSQLIterator) : OResultSet_BASE(m_aMutex)
- ,::comphelper::OPropertyContainer(OResultSet_BASE::rBHelper)
- ,m_aAssignValues(NULL)
- ,m_pEvaluationKeySet(NULL)
- ,m_aSkipDeletedSet(this)
- ,m_pFileSet(NULL)
- ,m_pSortIndex(NULL)
- ,m_pTable(NULL)
- ,m_pParseTree(pStmt->getParseTree())
- ,m_pSQLAnalyzer(NULL)
- ,m_aSQLIterator(_aSQLIterator)
- ,m_nFetchSize(0)
- ,m_nResultSetType(ResultSetType::SCROLL_INSENSITIVE)
- ,m_nFetchDirection(FetchDirection::FORWARD)
- ,m_nResultSetConcurrency(ResultSetConcurrency::UPDATABLE)
- ,m_xStatement(*pStmt)
- ,m_xMetaData(NULL)
- ,m_xDBMetaData(pStmt->getOwnConnection()->getMetaData())
- ,m_nTextEncoding(pStmt->getOwnConnection()->getTextEncoding())
- ,m_nRowPos(-1)
- ,m_nFilePos(0)
- ,m_nLastVisitedPos(-1)
- ,m_nRowCountResult(-1)
- ,m_nCurrentPosition(0)
- ,m_nColumnCount(0)
- ,m_bWasNull(sal_False)
- ,m_bEOF(sal_False)
- ,m_bLastRecord(sal_False)
- ,m_bInserted(sal_False)
- ,m_bRowUpdated(sal_False)
- ,m_bRowInserted(sal_False)
- ,m_bRowDeleted(sal_False)
- ,m_bShowDeleted(pStmt->getOwnConnection()->showDeleted())
- ,m_bIsCount(sal_False)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::OResultSet" );
- DBG_CTOR( file_OResultSet, NULL );
- osl_incrementInterlockedCount( &m_refCount );
- m_bIsCount = (m_pParseTree &&
- m_pParseTree->count() > 2 &&
- SQL_ISRULE(m_pParseTree->getChild(2),scalar_exp_commalist) &&
- SQL_ISRULE(m_pParseTree->getChild(2)->getChild(0),derived_column) &&
- SQL_ISRULE(m_pParseTree->getChild(2)->getChild(0)->getChild(0),general_set_fct) &&
- m_pParseTree->getChild(2)->getChild(0)->getChild(0)->count() == 4
- );
-
- m_nResultSetConcurrency = isCount() ? ResultSetConcurrency::READ_ONLY : ResultSetConcurrency::UPDATABLE;
- construct();
- m_aSkipDeletedSet.SetDeletedVisible(m_bShowDeleted);
- osl_decrementInterlockedCount( &m_refCount );
-}
-
-// -------------------------------------------------------------------------
-OResultSet::~OResultSet()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::~OResultSet" );
- osl_incrementInterlockedCount( &m_refCount );
- disposing();
- DBG_DTOR( file_OResultSet, NULL );
-}
-// -------------------------------------------------------------------------
-void OResultSet::construct()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::construct" );
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHSIZE), PROPERTY_ID_FETCHSIZE, 0,&m_nFetchSize, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETTYPE), PROPERTY_ID_RESULTSETTYPE, PropertyAttribute::READONLY,&m_nResultSetType, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHDIRECTION), PROPERTY_ID_FETCHDIRECTION, 0,&m_nFetchDirection, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETCONCURRENCY), PROPERTY_ID_RESULTSETCONCURRENCY,PropertyAttribute::READONLY,&m_nResultSetConcurrency, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
-}
-// -------------------------------------------------------------------------
-void OResultSet::disposing(void)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::disposing" );
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
- m_xStatement.clear();
- m_xMetaData.clear();
- m_pParseTree = NULL;
- m_xColNames.clear();
- m_xColumns = NULL;
- m_xParamColumns = NULL;
- m_xColsIdx.clear();
-
- Reference<XComponent> xComp = m_pTable;
- if ( xComp.is() )
- xComp->removeEventListener(this);
- if(m_pTable)
- {
- m_pTable->release();
- m_pTable = NULL;
- }
- clear();
-}
-// -----------------------------------------------------------------------------
-void OResultSet::clear()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::clear" );
- m_pFileSet = NULL;
- DELETEZ(m_pSortIndex);
-
- if(m_aInsertRow.is())
- m_aInsertRow->get().clear();
-
- m_aSkipDeletedSet.clear();
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::queryInterface" );
- Any aRet = OPropertySetHelper::queryInterface(rType);
- return aRet.hasValue() ? aRet : OResultSet_BASE::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OResultSet::getTypes( ) throw(RuntimeException)
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getTypes" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- OTypeCollection aTypes( ::getCppuType( (const Reference< ::com::sun::star::beans::XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XPropertySet > *)0 ),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XPropertySet > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),OResultSet_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::findColumn" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- Reference< XResultSetMetaData > xMeta = getMetaData();
- sal_Int32 nLen = xMeta->getColumnCount();
- sal_Int32 i = 1;
- for(;i<=nLen;++i)
- if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
- columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
- break;
- return i;
-}
-// -----------------------------------------------------------------------------
-const ORowSetValue& OResultSet::getValue(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getValue" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- checkIndex(columnIndex );
-
-
- m_bWasNull = (m_aSelectRow->get())[columnIndex]->getValue().isNull();
- return *(m_aSelectRow->get())[columnIndex];
-}
-// -----------------------------------------------------------------------------
-void OResultSet::checkIndex(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException)
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::checkIndex" );
- if ( columnIndex <= 0
- || columnIndex >= m_nColumnCount )
- ::dbtools::throwInvalidIndexException(*this);
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getBinaryStream" );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getCharacterStream" );
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getBoolean" );
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getByte" );
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getBytes" );
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-::com::sun::star::util::Date SAL_CALL OResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getDate" );
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getDouble" );
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getFloat" );
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getInt" );
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSet::getRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getRow" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- OSL_ENSURE((m_bShowDeleted || !m_aRow->isDeleted()),"getRow called for deleted row");
-
- return m_aSkipDeletedSet.getMappedPosition((m_aRow->get())[0]->getValue());
-}
-// -------------------------------------------------------------------------
-
-sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getLong" );
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getMetaData" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(!m_xMetaData.is())
- m_xMetaData = new OResultSetMetaData(m_xColumns,m_aSQLIterator.getTables().begin()->first,m_pTable);
- return m_xMetaData;
-}
-// -------------------------------------------------------------------------
-Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getArray" );
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-
-Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getClob" );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XBlob > SAL_CALL OResultSet::getBlob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getBlob" );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getRef" );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getObject" );
- return getValue(columnIndex).makeAny();
-}
-// -------------------------------------------------------------------------
-
-sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getShort" );
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getString" );
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-::com::sun::star::util::Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getTime" );
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-::com::sun::star::util::DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getTimestamp" );
- return getValue(columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::isAfterLast" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_nRowPos == sal_Int32(m_pFileSet->get().size());
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::isFirst" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_nRowPos == 0;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::isLast" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_nRowPos == sal_Int32(m_pFileSet->get().size() - 1);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::beforeFirst" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(first())
- previous();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::afterLast( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::afterLast" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(last())
- next();
- m_bEOF = sal_True;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::close" );
- dispose();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::first( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::first" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- return m_pTable ? m_aSkipDeletedSet.skipDeleted(IResultSetHelper::FIRST,1,sal_True) : sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::last( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::last" );
- // here I know definitely that I stand on the last record
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- return m_pTable ? m_aSkipDeletedSet.skipDeleted(IResultSetHelper::LAST,1,sal_True) : sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::absolute" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- return m_pTable ? m_aSkipDeletedSet.skipDeleted(IResultSetHelper::ABSOLUTE,row,sal_True) : sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::relative" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- return m_pTable ? m_aSkipDeletedSet.skipDeleted(IResultSetHelper::RELATIVE,row,sal_True) : sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::previous( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::previous" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- return m_pTable ? m_aSkipDeletedSet.skipDeleted(IResultSetHelper::PRIOR,0,sal_True) : sal_False;
-}
-// -------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL OResultSet::getStatement( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getStatement" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_xStatement;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::rowDeleted( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::rowDeleted" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_bRowDeleted;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::rowInserted( ) throw(SQLException, RuntimeException)
-{ ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_bRowInserted;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::rowInserted" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_bRowUpdated;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::isBeforeFirst" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_nRowPos == -1;
-}
-// -------------------------------------------------------------------------
-sal_Bool OResultSet::evaluate()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::evaluate" );
- OSL_ENSURE(m_pSQLAnalyzer,"OResultSet::evaluate: Analyzer isn't set!");
- sal_Bool bRet = sal_True;
- while(!m_pSQLAnalyzer->evaluateRestriction())
- {
- if(m_pEvaluationKeySet)
- {
- if(m_aEvaluateIter == m_pEvaluationKeySet->end())
- return sal_False;
- bRet = m_pTable->seekRow(IResultSetHelper::BOOKMARK,(*m_aEvaluateIter),m_nRowPos);
- ++m_aEvaluateIter;
- }
- else
- bRet = m_pTable->seekRow(IResultSetHelper::NEXT,1,m_nRowPos);
- if(bRet)
- {
- if(m_pEvaluationKeySet)
- {
- bRet = m_pTable->fetchRow(m_aEvaluateRow,*(m_pTable->getTableColumns()),sal_True,sal_True);
- evaluate();
-
- }
- else
- bRet = m_pTable->fetchRow(m_aRow,*m_xColumns,sal_False,sal_True);
- }
- }
-
- return bRet;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::next( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::next" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return m_pTable ? m_aSkipDeletedSet.skipDeleted(IResultSetHelper::NEXT,1,sal_True) : sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::wasNull( ) throw(SQLException, RuntimeException)
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::wasNull" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return m_bWasNull;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::cancel( ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::cancel" );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::clearWarnings" );
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OResultSet::getWarnings( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getWarnings" );
- return Any();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::insertRow" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(!m_bInserted || !m_pTable)
- throwFunctionSequenceException(*this);
-
- // we know that we append new rows at the end
- // so we have to know where the end is
- m_aSkipDeletedSet.skipDeleted(IResultSetHelper::LAST,1,sal_False);
- m_bRowInserted = m_pTable->InsertRow(*m_aInsertRow, sal_True, m_xColsIdx);
- if(m_bRowInserted && m_pFileSet.is())
- {
- sal_Int32 nPos = (m_aInsertRow->get())[0]->getValue();
- m_pFileSet->get().push_back(nPos);
- *(m_aInsertRow->get())[0] = sal_Int32(m_pFileSet->get().size());
- clearInsertRow();
-
- m_aSkipDeletedSet.insertNewPosition((m_aRow->get())[0]->getValue());
- }
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateRow" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- if(!m_pTable || m_pTable->isReadOnly())
- lcl_throwError(STR_TABLE_READONLY,*this);
-
- m_bRowUpdated = m_pTable->UpdateRow(*m_aInsertRow, m_aRow,m_xColsIdx);
- *(m_aInsertRow->get())[0] = (sal_Int32)(m_aRow->get())[0]->getValue();
-
- clearInsertRow();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::deleteRow() throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::deleteRow" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(!m_pTable || m_pTable->isReadOnly())
- lcl_throwError(STR_TABLE_READONLY,*this);
- if (m_bShowDeleted)
- lcl_throwError(STR_DELETE_ROW,*this);
- if(m_aRow->isDeleted())
- lcl_throwError(STR_ROW_ALREADY_DELETED,*this);
-
- sal_Int32 nPos = (sal_Int32)(m_aRow->get())[0]->getValue();
- m_bRowDeleted = m_pTable->DeleteRow(*m_xColumns);
- if(m_bRowDeleted && m_pFileSet.is())
- {
- m_aRow->setDeleted(sal_True);
- // don't touch the m_pFileSet member here
- m_aSkipDeletedSet.deletePosition(nPos);
- }
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::cancelRowUpdates" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_bInserted = sal_False;
- m_bRowUpdated = sal_False;
- m_bRowInserted = sal_False;
- m_bRowDeleted = sal_False;
-
- if(m_aInsertRow.is())
- {
- OValueRefVector::Vector::iterator aIter = m_aInsertRow->get().begin()+1;
- for(;aIter != m_aInsertRow->get().end();++aIter)
- {
- (*aIter)->setBound(sal_False);
- (*aIter)->setNull();
- }
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::moveToInsertRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::moveToInsertRow" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- if(!m_pTable || m_pTable->isReadOnly())
- lcl_throwError(STR_TABLE_READONLY,*this);
-
- m_bInserted = sal_True;
-
- OValueRefVector::Vector::iterator aIter = m_aInsertRow->get().begin()+1;
- for(;aIter != m_aInsertRow->get().end();++aIter)
- {
- (*aIter)->setBound(sal_False);
- (*aIter)->setNull();
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::moveToCurrentRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::moveToCurrentRow" );
-}
-// -------------------------------------------------------------------------
-void OResultSet::updateValue(sal_Int32 columnIndex ,const ORowSetValue& x) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateValue" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- checkIndex(columnIndex );
- columnIndex = mapColumn(columnIndex);
-
- (m_aInsertRow->get())[columnIndex]->setBound(sal_True);
- *(m_aInsertRow->get())[columnIndex] = x;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateNull" );
- ORowSetValue aEmpty;
- updateValue(columnIndex,aEmpty);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateBoolean" );
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateByte" );
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateShort" );
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateInt" );
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateLong( sal_Int32 /*columnIndex*/, sal_Int64 /*x*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateLong" );
- ::dbtools::throwFeatureNotImplementedException( "XRowUpdate::updateLong", *this );
-}
-// -----------------------------------------------------------------------
-void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateFloat" );
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateDouble" );
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateString" );
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateBytes" );
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateDate" );
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateTime" );
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateTimestamp" );
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateBinaryStream" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- if(!x.is())
- ::dbtools::throwFunctionSequenceException(*this);
-
- Sequence<sal_Int8> aSeq;
- x->readBytes(aSeq,length);
- updateValue(columnIndex,aSeq);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateCharacterStream" );
- updateBinaryStream(columnIndex,x,length);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::refreshRow" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateObject" );
- if (!::dbtools::implUpdateObject(this, columnIndex, x))
- throw SQLException();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 /*scale*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::updateNumericObject" );
- if (!::dbtools::implUpdateObject(this, columnIndex, x))
- throw SQLException();
-}
-// -------------------------------------------------------------------------
-IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::createArrayHelper" );
- Sequence< Property > aProps;
- describeProperties(aProps);
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-IPropertyArrayHelper & OResultSet::getInfoHelper()
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getInfoHelper" );
- return *const_cast<OResultSet*>(this)->getArrayHelper();
-}
-
-//------------------------------------------------------------------
-sal_Bool OResultSet::ExecuteRow(IResultSetHelper::Movement eFirstCursorPosition,
- sal_Int32 nFirstOffset,
- sal_Bool bEvaluate,
- sal_Bool bRetrieveData)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::ExecuteRow" );
- OSL_ENSURE(m_pSQLAnalyzer,"OResultSet::ExecuteRow: Analyzer isn't set!");
-
- // For further Fetch-Operations this information may possibly be changed ...
- IResultSetHelper::Movement eCursorPosition = eFirstCursorPosition;
- sal_Int32 nOffset = nFirstOffset;
-
- const OSQLColumns & rTableCols = *(m_pTable->getTableColumns());
- sal_Bool bHasRestriction = m_pSQLAnalyzer->hasRestriction();
-again:
-
- // protect from reading over the end when someboby is inserting while we are reading
- // this method works only for dBase at the moment !!!!
- if (eCursorPosition == IResultSetHelper::NEXT && m_nFilePos == m_nLastVisitedPos)
- {
- return sal_False;
- }
-
- if (!m_pTable || !m_pTable->seekRow(eCursorPosition, nOffset, m_nFilePos))
- {
- return sal_False;
- }
-
- if (!bEvaluate) // If no evaluation runs, then just fill the results-row
- {
- m_pTable->fetchRow(m_aRow,rTableCols, sal_True,bRetrieveData);
- }
- else
- {
- m_pTable->fetchRow(m_aEvaluateRow, rTableCols, sal_True,bRetrieveData || bHasRestriction);
-
- if ( ( !m_bShowDeleted
- && m_aEvaluateRow->isDeleted()
- )
- || ( bHasRestriction
- && !m_pSQLAnalyzer->evaluateRestriction()
- )
- )
- { // Evaluate the next record
- // delete current row in Keyset
- if (m_pEvaluationKeySet)
- {
- ++m_aEvaluateIter;
- if (m_pEvaluationKeySet->end() != m_aEvaluateIter)
- nOffset = (*m_aEvaluateIter);
- else
- {
- return sal_False;
- }
- }
- else if (m_pFileSet.is())
- {
- OSL_ENSURE(eCursorPosition == IResultSetHelper::NEXT, "Falsche CursorPosition!");
- eCursorPosition = IResultSetHelper::NEXT;
- nOffset = 1;
- }
- else if (eCursorPosition == IResultSetHelper::FIRST ||
- eCursorPosition == IResultSetHelper::NEXT ||
- eCursorPosition == IResultSetHelper::ABSOLUTE)
- {
- eCursorPosition = IResultSetHelper::NEXT;
- nOffset = 1;
- }
- else if (eCursorPosition == IResultSetHelper::LAST ||
- eCursorPosition == IResultSetHelper::PRIOR)
- {
- eCursorPosition = IResultSetHelper::PRIOR;
- nOffset = 1;
- }
- else if (eCursorPosition == IResultSetHelper::RELATIVE)
- {
- eCursorPosition = (nOffset >= 0) ? IResultSetHelper::NEXT : IResultSetHelper::PRIOR;
- }
- else
- {
- return sal_False;
- }
- // Try again ...
- goto again;
- }
- }
-
- // Evaluate may only be set,
- // if the Keyset will be constructed further
- if ( ( m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT )
- && !isCount()
- && bEvaluate
- )
- {
- if (m_pSortIndex)
- {
- OKeyValue* pKeyValue = GetOrderbyKeyValue( m_aSelectRow );
- m_pSortIndex->AddKeyValue(pKeyValue);
- }
- else if (m_pFileSet.is())
- {
- sal_uInt32 nBookmarkValue = Abs((sal_Int32)(m_aEvaluateRow->get())[0]->getValue());
- m_pFileSet->get().push_back(nBookmarkValue);
- }
- }
- else if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_UPDATE)
- {
- sal_Bool bOK = sal_True;
- if (bEvaluate)
- {
- // read the actual result-row
- bOK = m_pTable->fetchRow(m_aEvaluateRow, *(m_pTable->getTableColumns()), sal_True,sal_True);
- }
-
- if (bOK)
- {
- // just give the values to be changed:
- if(!m_pTable->UpdateRow(*m_aAssignValues,m_aEvaluateRow, m_xColsIdx))
- return sal_False;
- }
- }
- else if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_DELETE)
- {
- sal_Bool bOK = sal_True;
- if (bEvaluate)
- {
- bOK = m_pTable->fetchRow(m_aEvaluateRow, *(m_pTable->getTableColumns()), sal_True,sal_True);
- }
- if (bOK)
- {
- if(!m_pTable->DeleteRow(*m_xColumns))
- return sal_False;
- }
- }
- return sal_True;
-}
-
-//-------------------------------------------------------------------
-sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Bool bRetrieveData)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::Move" );
-
-//IgnoreDeletedRows:
-//
- sal_Int32 nTempPos = m_nRowPos;
-
- if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT &&
- !isCount())
- {
- if (!m_pFileSet.is()) //no Index available
- {
- // Normal FETCH
- ExecuteRow(eCursorPosition,nOffset,sal_False,bRetrieveData);
-
- // now set the bookmark for outside this is the logical pos and not the file pos
- *(*m_aRow->get().begin()) = sal_Int32(m_nRowPos + 1);
- }
- else
- {
- switch(eCursorPosition)
- {
- case IResultSetHelper::NEXT:
- ++m_nRowPos;
- break;
- case IResultSetHelper::PRIOR:
- if (m_nRowPos >= 0)
- --m_nRowPos;
- break;
- case IResultSetHelper::FIRST:
- m_nRowPos = 0;
- break;
- case IResultSetHelper::LAST:
- m_nRowPos = m_pFileSet->get().size() - 1;
- break;
- case IResultSetHelper::RELATIVE:
- m_nRowPos += nOffset;
- break;
- case IResultSetHelper::ABSOLUTE:
- case IResultSetHelper::BOOKMARK:
- if ( m_nRowPos == (nOffset -1) )
- return sal_True;
- m_nRowPos = nOffset -1;
- break;
- }
-
- // OffRange?
- // The FileCursor is outside of the valid range, if:
- // a.) m_nRowPos < 1
- // b.) a KeySet exists and m_nRowPos > m_pFileSet->size()
- if (m_nRowPos < 0 || (m_pFileSet->isFrozen() && eCursorPosition != IResultSetHelper::BOOKMARK && m_nRowPos >= (sal_Int32)m_pFileSet->get().size() )) // && m_pFileSet->IsFrozen()
- {
- goto Error;
- }
- else
- {
- if (m_nRowPos < (sal_Int32)m_pFileSet->get().size())
- {
- // Fetch via Index
- ExecuteRow(IResultSetHelper::BOOKMARK,(m_pFileSet->get())[m_nRowPos],sal_False,bRetrieveData);
-
- // now set the bookmark for outside
- *(*m_aRow->get().begin()) = sal_Int32(m_nRowPos + 1);
- if ( (bRetrieveData || m_pSQLAnalyzer->hasRestriction()) && m_pSQLAnalyzer->hasFunctions() )
- {
- m_pSQLAnalyzer->setSelectionEvaluationResult(m_aSelectRow,m_aColMapping);
- }
- }
- else // Index must be further constructed
- {
- // set first on the last known row
- if (!m_pFileSet->get().empty())
- {
- m_aFileSetIter = m_pFileSet->get().end()-1;
- m_pTable->seekRow(IResultSetHelper::BOOKMARK, *m_aFileSetIter, m_nFilePos);
- }
- sal_Bool bOK = sal_True;
- // Determine the number of further Fetches
- while (bOK && m_nRowPos >= (sal_Int32)m_pFileSet->get().size())
- {
- if (m_pEvaluationKeySet)
- {
- if (m_nRowPos >= (sal_Int32)m_pEvaluationKeySet->size())
- return sal_False;
- else if (m_nRowPos == 0)
- {
- m_aEvaluateIter = m_pEvaluationKeySet->begin();
- bOK = ExecuteRow(IResultSetHelper::BOOKMARK,*m_aEvaluateIter,sal_True, bRetrieveData);
- }
- else
- {
- ++m_aEvaluateIter;
- bOK = ExecuteRow(IResultSetHelper::BOOKMARK,*m_aEvaluateIter,sal_True, bRetrieveData);
- }
- }
- else
- bOK = ExecuteRow(IResultSetHelper::NEXT,1,sal_True, sal_False);//bRetrieveData);
- }
-
- if (bOK)
- {
- // read the results again
- m_pTable->fetchRow(m_aRow, *(m_pTable->getTableColumns()), sal_True,bRetrieveData);
-
- // now set the bookmark for outside
- *(*m_aRow->get().begin()) = sal_Int32(m_nRowPos + 1);
-
- if ( (bRetrieveData || m_pSQLAnalyzer->hasRestriction()) && m_pSQLAnalyzer->hasFunctions() )
- {
- m_pSQLAnalyzer->setSelectionEvaluationResult(m_aSelectRow,m_aColMapping);
- }
- }
- else if (!m_pFileSet->isFrozen()) // no valid record found
- {
- m_pFileSet->setFrozen();
- m_pEvaluationKeySet = NULL;
- goto Error;
- }
- }
- }
- }
- }
- else if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT && isCount())
- {
- // Fetch the COUNT(*)
- switch (eCursorPosition)
- {
- case IResultSetHelper::NEXT:
- ++m_nRowPos;
- break;
- case IResultSetHelper::PRIOR:
- --m_nRowPos;
- break;
- case IResultSetHelper::FIRST:
- m_nRowPos = 0;
- break;
- case IResultSetHelper::LAST:
- m_nRowPos = 0;
- break;
- case IResultSetHelper::RELATIVE:
- m_nRowPos += nOffset;
- break;
- case IResultSetHelper::ABSOLUTE:
- case IResultSetHelper::BOOKMARK:
- m_nRowPos = nOffset - 1;
- break;
- }
-
- if ( m_nRowPos < 0 )
- goto Error;
- else if (m_nRowPos == 0)
- {
- // put COUNT(*) in result-row
- // (must be the first and only variable in the row)
- if (m_aRow->get().size() >= 2)
- {
- *(m_aRow->get())[1] = m_nRowCountResult;
- *(m_aRow->get())[0] = sal_Int32(1);
- (m_aRow->get())[1]->setBound(sal_True);
- (m_aSelectRow->get())[1] = (m_aRow->get())[1];
- }
- }
- else
- {
- m_bEOF = sal_True;
- m_nRowPos = 1;
- return sal_False;
- }
- }
- else
- // Fetch only possible at SELECT!
- return sal_False;
-
- return sal_True;
-
-Error:
- // is the Cursor positioned before the first row
- // then the position will be maintained
- if (nTempPos == -1)
- m_nRowPos = nTempPos;
- else
- {
- switch(eCursorPosition)
- {
- case IResultSetHelper::PRIOR:
- case IResultSetHelper::FIRST:
- m_nRowPos = -1;
- break;
- case IResultSetHelper::LAST:
- case IResultSetHelper::NEXT:
- case IResultSetHelper::ABSOLUTE:
- case IResultSetHelper::RELATIVE:
- if (nOffset > 0)
- m_nRowPos = m_pFileSet.is() ? (sal_Int32)m_pFileSet->get().size() : -1;
- else if (nOffset < 0)
- m_nRowPos = -1;
- break;
- case IResultSetHelper::BOOKMARK:
- m_nRowPos = nTempPos; // last Position
- }
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void OResultSet::sortRows()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::sortRows" );
- if (!m_pSQLAnalyzer->hasRestriction() && m_aOrderbyColumnNumber.size() == 1)
- {
- // is just one field given for sorting
- // and this field is indexed, then the Index will be used
- Reference<XIndexesSupplier> xIndexSup;
- m_pTable->queryInterface(::getCppuType((const Reference<XIndexesSupplier>*)0)) >>= xIndexSup;
-
- Reference<XIndexAccess> xIndexes;
- if(xIndexSup.is())
- {
- xIndexes.set(xIndexSup->getIndexes(),UNO_QUERY);
- Reference<XPropertySet> xColProp;
- if(m_aOrderbyColumnNumber[0] < xIndexes->getCount())
- {
- xColProp.set(xIndexes->getByIndex(m_aOrderbyColumnNumber[0]),UNO_QUERY);
- // iterate through the indexes to find the matching column
- const sal_Int32 nCount = xIndexes->getCount();
- for(sal_Int32 i=0; i < nCount;++i)
- {
- Reference<XColumnsSupplier> xIndex(xIndexes->getByIndex(i),UNO_QUERY);
- Reference<XNameAccess> xIndexCols = xIndex->getColumns();
- if(xIndexCols->hasByName(comphelper::getString(xColProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)))))
- {
- m_pFileSet = new OKeySet();
-
- if(fillIndexValues(xIndex))
- return;
- }
- }
- }
- }
- }
-
- OSortIndex::TKeyTypeVector eKeyType(m_aOrderbyColumnNumber.size());
- ::std::vector<sal_Int32>::iterator aOrderByIter = m_aOrderbyColumnNumber.begin();
- for (::std::vector<sal_Int16>::size_type i=0;aOrderByIter != m_aOrderbyColumnNumber.end(); ++aOrderByIter,++i)
- {
- OSL_ENSURE((sal_Int32)m_aSelectRow->get().size() > *aOrderByIter,"Invalid Index");
- switch ((*(m_aSelectRow->get().begin()+*aOrderByIter))->getValue().getTypeKind())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- eKeyType[i] = SQL_ORDERBYKEY_STRING;
- break;
-
- case DataType::OTHER:
- case DataType::TINYINT:
- case DataType::SMALLINT:
- case DataType::INTEGER:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::REAL:
- case DataType::DOUBLE:
- case DataType::DATE:
- case DataType::TIME:
- case DataType::TIMESTAMP:
- case DataType::BIT:
- eKeyType[i] = SQL_ORDERBYKEY_DOUBLE;
- break;
-
- // Other types aren't implemented (so they are always FALSE)
- default:
- eKeyType[i] = SQL_ORDERBYKEY_NONE;
- OSL_FAIL("OFILECursor::Execute: Datentyp nicht implementiert");
- break;
- }
- (m_aSelectRow->get())[*aOrderByIter]->setBound(sal_True);
- }
-
- m_pSortIndex = new OSortIndex(eKeyType,m_aOrderbyAscending);
-
- if (m_pEvaluationKeySet)
- {
- m_aEvaluateIter = m_pEvaluationKeySet->begin();
-
- while (m_aEvaluateIter != m_pEvaluationKeySet->end())
- {
- ExecuteRow(IResultSetHelper::BOOKMARK,(*m_aEvaluateIter),sal_True);
- ++m_aEvaluateIter;
- }
- }
- else
- {
- while ( ExecuteRow( IResultSetHelper::NEXT, 1, sal_False, sal_True ) )
- {
- m_aSelectRow->get()[0]->setValue( m_aRow->get()[0]->getValue() );
- if ( m_pSQLAnalyzer->hasFunctions() )
- m_pSQLAnalyzer->setSelectionEvaluationResult( m_aSelectRow, m_aColMapping );
- const sal_Int32 nBookmark = (*m_aRow->get().begin())->getValue();
- ExecuteRow( IResultSetHelper::BOOKMARK, nBookmark, sal_True, sal_False );
- }
- }
-
- // create sorted Keyset
- m_pEvaluationKeySet = NULL;
- m_pFileSet = NULL;
- m_pFileSet = m_pSortIndex->CreateKeySet();
- DELETEZ(m_pSortIndex);
- // now access to a sorted set is possible via Index
-}
-
-
-// -------------------------------------------------------------------------
-sal_Bool OResultSet::OpenImpl()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::OpenImpl" );
- OSL_ENSURE(m_pSQLAnalyzer,"No analyzer set with setSqlAnalyzer!");
- if(!m_pTable)
- {
- const OSQLTables& xTabs = m_aSQLIterator.getTables();
- if ((xTabs.begin() == xTabs.end()) || !xTabs.begin()->second.is())
- lcl_throwError(STR_QUERY_TOO_COMPLEX,*this);
-
- if ( xTabs.size() > 1 || m_aSQLIterator.hasErrors() )
- lcl_throwError(STR_QUERY_MORE_TABLES,*this);
-
- OSQLTable xTable = xTabs.begin()->second;
- m_xColumns = m_aSQLIterator.getSelectColumns();
-
- m_xColNames = xTable->getColumns();
- m_xColsIdx.set(m_xColNames,UNO_QUERY);
- doTableSpecials(xTable);
- Reference<XComponent> xComp(xTable,UNO_QUERY);
- if(xComp.is())
- xComp->addEventListener(this);
- }
-
- m_pTable->refreshHeader();
-
- sal_Int32 nColumnCount = m_xColsIdx->getCount();
-
- initializeRow(m_aRow,nColumnCount);
- initializeRow(m_aEvaluateRow,nColumnCount);
- initializeRow(m_aInsertRow,nColumnCount);
-
-
- m_nResultSetConcurrency = (m_pTable->isReadOnly() || isCount()) ? ResultSetConcurrency::READ_ONLY : ResultSetConcurrency::UPDATABLE;
-
- // create new Index:
- m_pFileSet = NULL;
-
- // position at the beginning
- m_nRowPos = -1;
- m_nFilePos = 0;
- m_nRowCountResult = -1;
-
- m_nLastVisitedPos = m_pTable->getCurrentLastPos();
-
- switch(m_aSQLIterator.getStatementType())
- {
- case SQL_STATEMENT_SELECT:
- {
- if(isCount())
- {
- if(m_xColumns->get().size() > 1)
- lcl_throwError(STR_QUERY_COMPLEX_COUNT,*this);
-
- m_nRowCountResult = 0;
- // for now simply iterate over all rows and
- // do all actions (or just count)
- {
- sal_Bool bOK = sal_True;
- if (m_pEvaluationKeySet)
- {
- m_aEvaluateIter = m_pEvaluationKeySet->begin();
- bOK = m_aEvaluateIter == m_pEvaluationKeySet->end();
-
- }
- while (bOK)
- {
- if (m_pEvaluationKeySet)
- ExecuteRow(IResultSetHelper::BOOKMARK,(*m_aEvaluateIter),sal_True);
- else
- bOK = ExecuteRow(IResultSetHelper::NEXT,1,sal_True);
-
- if (bOK)
- {
- m_nRowCountResult++;
- if(m_pEvaluationKeySet)
- {
- ++m_aEvaluateIter;
- bOK = m_aEvaluateIter == m_pEvaluationKeySet->end();
- }
- }
- }
-
- // save result of COUNT(*) in m_nRowCountResult.
- // nRowCount (number of Rows in the result) = 1 for this request!
- m_pEvaluationKeySet = NULL;
- }
- }
- else
- {
- sal_Bool bDistinct = sal_False;
- sal_Bool bWasSorted = sal_False;
- OSQLParseNode *pDistinct = m_pParseTree->getChild(1);
- ::std::vector<sal_Int32> aOrderbyColumnNumberSave;
- ::std::vector<TAscendingOrder> aOrderbyAscendingSave;
-
- if (pDistinct && pDistinct->getTokenID() == SQL_TOKEN_DISTINCT )
- {
- // Sort on all columns, saving original order for later
- if(IsSorted())
- {
- aOrderbyColumnNumberSave = m_aOrderbyColumnNumber;
- m_aOrderbyColumnNumber.clear();
- aOrderbyAscendingSave.assign(m_aOrderbyAscending.begin(), m_aOrderbyAscending.end());
- bWasSorted = sal_True;
- }
-
- // the first column is the bookmark column
- ::std::vector<sal_Int32>::iterator aColStart = (m_aColMapping.begin()+1);
- ::std::copy(aColStart, m_aColMapping.end(),::std::back_inserter(m_aOrderbyColumnNumber));
- m_aOrderbyAscending.assign(m_aColMapping.size()-1, SQL_ASC);
- bDistinct = sal_True;
- }
-
- if (IsSorted())
- sortRows();
-
- if (!m_pFileSet.is())
- {
- m_pFileSet = new OKeySet();
-
- if (!m_pSQLAnalyzer->hasRestriction())
- // now the Keyset can be filled!
- // But be careful: It is assumed, that the FilePositions will be stored as sequence 1..n
- {
- if ( m_nLastVisitedPos > 0)
- m_pFileSet->get().reserve( m_nLastVisitedPos );
- for (sal_Int32 i = 0; i < m_nLastVisitedPos; i++)
- m_pFileSet->get().push_back(i + 1);
- }
- }
- OSL_ENSURE(m_pFileSet.is(),"Kein KeySet vorhanden! :-(");
-
- if(bDistinct && m_pFileSet.is())
- {
- OValueRow aSearchRow = new OValueVector(m_aRow->get().size());
- OValueRefVector::Vector::iterator aRowIter = m_aRow->get().begin();
- OValueVector::Vector::iterator aSearchIter = aSearchRow->get().begin();
- for ( ++aRowIter,++aSearchIter; // the first column is the bookmark column
- aRowIter != m_aRow->get().end();
- ++aRowIter,++aSearchIter)
- aSearchIter->setBound((*aRowIter)->isBound());
-
- size_t nMaxRow = m_pFileSet->get().size();
-
- if (nMaxRow)
- {
- #if OSL_DEBUG_LEVEL > 1
- sal_Int32 nFound=0;
- #endif
- sal_Int32 nPos;
- sal_Int32 nKey;
-
- for( size_t j = nMaxRow-1; j > 0; --j)
- {
- nPos = (m_pFileSet->get())[j];
- ExecuteRow(IResultSetHelper::BOOKMARK,nPos,sal_False);
- m_pSQLAnalyzer->setSelectionEvaluationResult(m_aSelectRow,m_aColMapping);
- { // copy row values
- OValueRefVector::Vector::iterator copyFrom = m_aSelectRow->get().begin();
- OValueVector::Vector::iterator copyTo = aSearchRow->get().begin();
- for ( ++copyFrom,++copyTo; // the first column is the bookmark column
- copyFrom != m_aSelectRow->get().end();
- ++copyFrom,++copyTo)
- *copyTo = *(*copyFrom);
- }
-
- // compare with next row
- nKey = (m_pFileSet->get())[j-1];
- ExecuteRow(IResultSetHelper::BOOKMARK,nKey,sal_False);
- m_pSQLAnalyzer->setSelectionEvaluationResult(m_aSelectRow,m_aColMapping);
- OValueRefVector::Vector::iterator loopInRow = m_aSelectRow->get().begin();
- OValueVector::Vector::iterator existentInSearchRow = aSearchRow->get().begin();
- for ( ++loopInRow,++existentInSearchRow; // the first column is the bookmark column
- loopInRow != m_aSelectRow->get().end();
- ++loopInRow,++existentInSearchRow)
- {
- if ( (*loopInRow)->isBound() && !( *(*loopInRow) == *existentInSearchRow) )
- break;
- }
-
- if(loopInRow == m_aSelectRow->get().end())
- (m_pFileSet->get())[j] = 0; // Rows match -- Mark for deletion by setting key to 0
- #if OSL_DEBUG_LEVEL > 1
- else
- nFound++;
- #endif
- }
-
- m_pFileSet->get().erase(::std::remove_if(m_pFileSet->get().begin(),m_pFileSet->get().end(),
- ::std::bind2nd(::std::equal_to<sal_Int32>(),0))
- ,m_pFileSet->get().end());
-
- if (bWasSorted)
- {
- // Re-sort on original requested order
- m_aOrderbyColumnNumber = aOrderbyColumnNumberSave;
- m_aOrderbyAscending.assign(aOrderbyAscendingSave.begin(), aOrderbyAscendingSave.end());
-
- TIntVector aEvaluationKeySet(m_pFileSet->get());
- m_pEvaluationKeySet = &aEvaluationKeySet;
- sortRows();
- }
- else
- {
- m_aOrderbyColumnNumber.clear();
- m_aOrderbyAscending.clear();
- ::std::sort(m_pFileSet->get().begin(),m_pFileSet->get().end());
- }
- }
- }
- }
- } break;
-
- case SQL_STATEMENT_UPDATE:
- case SQL_STATEMENT_DELETE:
- // during processing count the number of processed Rows
- m_nRowCountResult = 0;
- // for now simply iterate over all rows and
- // run the actions (or simply count):
- {
-
- sal_Bool bOK = sal_True;
- if (m_pEvaluationKeySet)
- {
- m_aEvaluateIter = m_pEvaluationKeySet->begin();
- bOK = m_aEvaluateIter == m_pEvaluationKeySet->end();
-
- }
- while (bOK)
- {
- if (m_pEvaluationKeySet)
- ExecuteRow(IResultSetHelper::BOOKMARK,(*m_aEvaluateIter),sal_True);
- else
- bOK = ExecuteRow(IResultSetHelper::NEXT,1,sal_True);
-
- if (bOK)
- {
- m_nRowCountResult++;
- if(m_pEvaluationKeySet)
- {
- ++m_aEvaluateIter;
- bOK = m_aEvaluateIter == m_pEvaluationKeySet->end();
- }
- }
- }
-
- // save result of COUNT(*) in nRowCountResult.
- // nRowCount (number of rows in the result-set) = 1 for this request!
- m_pEvaluationKeySet = NULL;
- }
- break;
- case SQL_STATEMENT_INSERT:
- m_nRowCountResult = 0;
-
- OSL_ENSURE(m_aAssignValues.is(),"No assign values set!");
- if(!m_pTable->InsertRow(*m_aAssignValues, sal_True,m_xColsIdx))
- {
- m_nFilePos = 0;
- return sal_False;
- }
-
- m_nRowCountResult = 1;
- break;
- default:
- OSL_FAIL( "OResultSet::OpenImpl: unsupported statement type!" );
- break;
- }
-
- // reset FilePos
- m_nFilePos = 0;
-
- return sal_True;
-}
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > OResultSet::getUnoTunnelImplementationId()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getUnoTunnelImplementationId" );
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OResultSet::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getSomething" );
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : 0;
-}
-// -----------------------------------------------------------------------------
-void OResultSet::setBoundedColumns(const OValueRefRow& _rRow,
- const OValueRefRow& _rSelectRow,
- const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
- const Reference<XIndexAccess>& _xNames,
- sal_Bool _bSetColumnMapping,
- const Reference<XDatabaseMetaData>& _xMetaData,
- ::std::vector<sal_Int32>& _rColMapping)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::setBoundedColumns" );
- ::comphelper::UStringMixEqual aCase(_xMetaData->supportsMixedCaseQuotedIdentifiers());
-
- Reference<XPropertySet> xTableColumn;
- ::rtl::OUString sTableColumnName, sSelectColumnRealName;
-
- const ::rtl::OUString sName = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME);
- const ::rtl::OUString sRealName = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME);
- const ::rtl::OUString sType = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE);
-
- typedef ::std::map<OSQLColumns::Vector::iterator,sal_Bool> IterMap;
- IterMap aSelectIters;
- OValueRefVector::Vector::iterator aRowIter = _rRow->get().begin()+1;
- for (sal_Int32 i=0; // the first column is the bookmark column
- aRowIter != _rRow->get().end();
- ++i, ++aRowIter
- )
- {
- (*aRowIter)->setBound(sal_False);
- try
- {
- // get the table column and it's name
- _xNames->getByIndex(i) >>= xTableColumn;
- OSL_ENSURE(xTableColumn.is(), "OResultSet::setBoundedColumns: invalid table column!");
- if (xTableColumn.is())
- xTableColumn->getPropertyValue(sName) >>= sTableColumnName;
- else
- sTableColumnName = ::rtl::OUString();
-
- // look if we have such a select column
- // TODO: would like to have a O(log n) search here ...
- for ( OSQLColumns::Vector::iterator aIter = _rxColumns->get().begin();
- aIter != _rxColumns->get().end();
- ++aIter
- )
- {
- if((*aIter)->getPropertySetInfo()->hasPropertyByName(sRealName))
- (*aIter)->getPropertyValue(sRealName) >>= sSelectColumnRealName;
- else
- (*aIter)->getPropertyValue(sName) >>= sSelectColumnRealName;
-
- if ( aCase(sTableColumnName, sSelectColumnRealName) && !(*aRowIter)->isBound() && aSelectIters.end() == aSelectIters.find(aIter) )
- {
- aSelectIters.insert(IterMap::value_type(aIter,sal_True));
- if(_bSetColumnMapping)
- {
- sal_Int32 nSelectColumnPos = aIter - _rxColumns->get().begin() + 1;
- // the getXXX methods are 1-based ...
- sal_Int32 nTableColumnPos = i + 1;
- // get first table column is the bookmark column ...
- _rColMapping[nSelectColumnPos] = nTableColumnPos;
- (_rSelectRow->get())[nSelectColumnPos] = *aRowIter;
- }
-
- (*aRowIter)->setBound(sal_True);
- sal_Int32 nType = DataType::OTHER;
- if (xTableColumn.is())
- xTableColumn->getPropertyValue(sType) >>= nType;
- (*aRowIter)->setTypeKind(nType);
-
- break;
- }
- }
- }
- catch (Exception&)
- {
- OSL_FAIL("OResultSet::setBoundedColumns: caught an Exception!");
- }
- }
- // in this case we got more select columns as columns exist in the table
- if ( _bSetColumnMapping && aSelectIters.size() != _rColMapping.size() )
- {
- Reference<XNameAccess> xNameAccess(_xNames,UNO_QUERY);
- Sequence< ::rtl::OUString > aSelectColumns = xNameAccess->getElementNames();
-
- for ( OSQLColumns::Vector::iterator aIter = _rxColumns->get().begin();
- aIter != _rxColumns->get().end();
- ++aIter
- )
- {
- if ( aSelectIters.end() == aSelectIters.find(aIter) )
- {
- if ( (*aIter)->getPropertySetInfo()->hasPropertyByName(sRealName) )
- (*aIter)->getPropertyValue(sRealName) >>= sSelectColumnRealName;
- else
- (*aIter)->getPropertyValue(sName) >>= sSelectColumnRealName;
-
- if ( xNameAccess->hasByName( sSelectColumnRealName ) )
- {
- aSelectIters.insert(IterMap::value_type(aIter,sal_True));
- sal_Int32 nSelectColumnPos = aIter - _rxColumns->get().begin() + 1;
- const ::rtl::OUString* pBegin = aSelectColumns.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + aSelectColumns.getLength();
- for(sal_Int32 i=0;pBegin != pEnd;++pBegin,++i)
- {
- if ( aCase(*pBegin, sSelectColumnRealName) )
- {
- // the getXXX methods are 1-based ...
- sal_Int32 nTableColumnPos = i + 1;
- // get first table column is the bookmark column ...
- _rColMapping[nSelectColumnPos] = nTableColumnPos;
- (_rSelectRow->get())[nSelectColumnPos] = (_rRow->get())[nTableColumnPos];
- break;
- }
- }
- }
- }
- }
- }
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OResultSet::acquire() throw()
-{
- OResultSet_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OResultSet::release() throw()
-{
- OResultSet_BASE::release();
-}
-// -----------------------------------------------------------------------------
-Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInfo( ) throw(RuntimeException)
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getPropertySetInfo" );
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-void OResultSet::doTableSpecials(const OSQLTable& _xTable)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::doTableSpecials" );
- Reference< ::com::sun::star::lang::XUnoTunnel> xTunnel(_xTable,UNO_QUERY);
- if(xTunnel.is())
- {
- m_pTable = reinterpret_cast< OFileTable* >( xTunnel->getSomething(OFileTable::getUnoTunnelImplementationId()) );
- if(m_pTable)
- m_pTable->acquire();
- }
-}
-// -----------------------------------------------------------------------------
-void OResultSet::clearInsertRow()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::clearInsertRow" );
- m_aRow->setDeleted(sal_False); // set to false here because this is the new row
- OValueRefVector::Vector::iterator aIter = m_aInsertRow->get().begin();
- const OValueRefVector::Vector::iterator aEnd = m_aInsertRow->get().end();
- for(sal_Int32 nPos = 0;aIter != aEnd;++aIter,++nPos)
- {
- ORowSetValueDecoratorRef& rValue = (*aIter);
- if ( rValue->isBound() )
- {
- (m_aRow->get())[nPos]->setValue( (*aIter)->getValue() );
- }
- rValue->setBound(nPos == 0);
- rValue->setModified(sal_False);
- rValue->setNull();
- }
-}
-// -----------------------------------------------------------------------------
-void OResultSet::initializeRow(OValueRefRow& _rRow,sal_Int32 _nColumnCount)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::initializeRow" );
- if(!_rRow.is())
- {
- _rRow = new OValueRefVector(_nColumnCount);
- (_rRow->get())[0]->setBound(sal_True);
- ::std::for_each(_rRow->get().begin()+1,_rRow->get().end(),TSetRefBound(sal_False));
- }
-}
-// -----------------------------------------------------------------------------
-sal_Bool OResultSet::fillIndexValues(const Reference< XColumnsSupplier> &/*_xIndex*/)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::fillIndexValues" );
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OResultSet::move(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::move" );
- return Move(_eCursorPosition,_nOffset,_bRetrieveData);
-}
-// -----------------------------------------------------------------------------
-sal_Int32 OResultSet::getDriverPos() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::getDriverPos" );
- return (m_aRow->get())[0]->getValue();
-}
-// -----------------------------------------------------------------------------
-sal_Bool OResultSet::deletedVisible() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::deletedVisible" );
- return m_bShowDeleted;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OResultSet::isRowDeleted() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::isRowDeleted" );
- return m_aRow->isDeleted();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OResultSet::disposing( const EventObject& Source ) throw (RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::disposing" );
- Reference<XPropertySet> xProp = m_pTable;
- if(m_pTable && Source.Source == xProp)
- {
- m_pTable->release();
- m_pTable = NULL;
- }
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FResultSetMetaData.cxx b/connectivity/source/drivers/file/FResultSetMetaData.cxx
deleted file mode 100644
index fc45a15afb..0000000000
--- a/connectivity/source/drivers/file/FResultSetMetaData.cxx
+++ /dev/null
@@ -1,221 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "file/FResultSetMetaData.hxx"
-#include "file/FTable.hxx"
-#include <comphelper/extract.hxx>
-#include "connectivity/dbexception.hxx"
-#include <comphelper/types.hxx>
-#include <rtl/logfile.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace dbtools;
-using namespace connectivity::file;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -------------------------------------------------------------------------
-OResultSetMetaData::OResultSetMetaData(const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,const ::rtl::OUString& _aTableName,OFileTable* _pTable)
- :m_aTableName(_aTableName)
- ,m_xColumns(_rxColumns)
- ,m_pTable(_pTable)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::OResultSetMetaData" );
-}
-
-// -------------------------------------------------------------------------
-OResultSetMetaData::~OResultSetMetaData()
-{
- m_xColumns = NULL;
-}
-// -----------------------------------------------------------------------------
-void OResultSetMetaData::checkColumnIndex(sal_Int32 column) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::checkColumnIndex" );
- if(column <= 0 || column > (sal_Int32)(sal_Int32)m_xColumns->get().size())
- throwInvalidIndexException(*this);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::getColumnDisplaySize" );
- return getPrecision(column);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::getColumnType" );
- checkColumnIndex(column);
- return getINT32((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)));
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSetMetaData::getColumnCount( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::getColumnCount" );
- return (m_xColumns->get()).size();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::isCaseSensitive" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL OResultSetMetaData::getSchemaName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::getSchemaName" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::getColumnName" );
- checkColumnIndex(column);
-
- Any aName((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)));
- return aName.hasValue() ? getString(aName) : getString((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getTableName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::getTableName" );
- return m_aTableName;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getCatalogName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::getCatalogName" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnTypeName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::getColumnTypeName" );
- checkColumnIndex(column);
- return getString((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnLabel( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::getColumnLabel" );
- return getColumnName(column);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnServiceName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::getColumnServiceName" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isCurrency( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::isCurrency" );
- checkColumnIndex(column);
- return getBOOL((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)));
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isAutoIncrement( sal_Int32 /*setCatalogcolumn*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::isAutoIncrement" );
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSetMetaData::isSigned( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::isSigned" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getPrecision( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::getPrecision" );
- checkColumnIndex(column);
- return getINT32((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)));
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::getScale" );
- checkColumnIndex(column);
- return getINT32((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)));
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::isNullable" );
- checkColumnIndex(column);
- return getINT32((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)));
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isSearchable( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::isSearchable" );
- return sal_True;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isReadOnly( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::isReadOnly" );
- checkColumnIndex(column);
- return m_pTable->isReadOnly() || (
- (m_xColumns->get())[column-1]->getPropertySetInfo()->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION)) &&
- ::cppu::any2bool((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION))));
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isDefinitelyWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::isDefinitelyWritable" );
- return !isReadOnly(column);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSetMetaData::isWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSetMetaData::isWritable" );
- return !isReadOnly(column);
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
deleted file mode 100644
index 78232769c2..0000000000
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ /dev/null
@@ -1,828 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <osl/diagnose.h>
-#include "file/FStatement.hxx"
-#include "file/FConnection.hxx"
-#include "file/FDriver.hxx"
-#include "file/FResultSet.hxx"
-#include <comphelper/property.hxx>
-#include <comphelper/uno3.hxx>
-#include <osl/thread.h>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include "connectivity/dbexception.hxx"
-#include "resource/file_res.hrc"
-#include <algorithm>
-#include <tools/debug.hxx>
-#include <rtl/logfile.hxx>
-
-#define THROW_SQL(x) \
- OTools::ThrowException(x,m_aStatementHandle,SQL_HANDLE_STMT,*this)
-
-namespace connectivity
-{
- namespace file
- {
-
-//------------------------------------------------------------------------------
-using namespace dbtools;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-DBG_NAME( file_OStatement_Base )
-
-//------------------------------------------------------------------------------
-OStatement_Base::OStatement_Base(OConnection* _pConnection )
- :OStatement_BASE(m_aMutex)
- ,::comphelper::OPropertyContainer(OStatement_BASE::rBHelper)
- ,m_xDBMetaData(_pConnection->getMetaData())
- ,m_aParser(_pConnection->getDriver()->getFactory())
- ,m_aSQLIterator( _pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL )
- ,m_pConnection(_pConnection)
- ,m_pParseTree(NULL)
- ,m_pSQLAnalyzer(NULL)
- ,m_pEvaluationKeySet(NULL)
- ,m_pTable(NULL)
- ,m_nMaxFieldSize(0)
- ,m_nMaxRows(0)
- ,m_nQueryTimeOut(0)
- ,m_nFetchSize(0)
- ,m_nResultSetType(ResultSetType::FORWARD_ONLY)
- ,m_nFetchDirection(FetchDirection::FORWARD)
- ,m_nResultSetConcurrency(ResultSetConcurrency::UPDATABLE)
- ,m_bEscapeProcessing(sal_True)
- ,rBHelper(OStatement_BASE::rBHelper)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::OStatement_Base" );
- DBG_CTOR( file_OStatement_Base, NULL );
-
- m_pConnection->acquire();
-
- sal_Int32 nAttrib = 0;
-
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_CURSORNAME), PROPERTY_ID_CURSORNAME, nAttrib,&m_aCursorName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MAXFIELDSIZE), PROPERTY_ID_MAXFIELDSIZE, nAttrib,&m_nMaxFieldSize, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MAXROWS), PROPERTY_ID_MAXROWS, nAttrib,&m_nMaxRows, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_QUERYTIMEOUT), PROPERTY_ID_QUERYTIMEOUT, nAttrib,&m_nQueryTimeOut, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHSIZE), PROPERTY_ID_FETCHSIZE, nAttrib,&m_nFetchSize, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETTYPE), PROPERTY_ID_RESULTSETTYPE, nAttrib,&m_nResultSetType, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHDIRECTION), PROPERTY_ID_FETCHDIRECTION, nAttrib,&m_nFetchDirection, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ESCAPEPROCESSING),PROPERTY_ID_ESCAPEPROCESSING, nAttrib,&m_bEscapeProcessing,::getCppuBooleanType());
-
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETCONCURRENCY), PROPERTY_ID_RESULTSETCONCURRENCY, nAttrib,&m_nResultSetConcurrency, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
-}
-// -----------------------------------------------------------------------------
-OStatement_Base::~OStatement_Base()
-{
- osl_incrementInterlockedCount( &m_refCount );
- disposing();
- delete m_pSQLAnalyzer;
-
- DBG_DTOR( file_OStatement_Base, NULL );
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::disposeResultSet()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::disposeResultSet" );
- // free the cursor if alive
- Reference< XComponent > xComp(m_xResultSet.get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- m_xResultSet = Reference< XResultSet>();
-}
-//------------------------------------------------------------------------------
-void OStatement_BASE2::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- disposeResultSet();
-
- if(m_pSQLAnalyzer)
- m_pSQLAnalyzer->dispose();
-
- if(m_aRow.is())
- {
- m_aRow->get().clear();
- m_aRow = NULL;
- }
-
- m_aSQLIterator.dispose();
-
- if(m_pTable)
- {
- m_pTable->release();
- m_pTable = NULL;
- }
-
- if (m_pConnection)
- {
- m_pConnection->release();
- m_pConnection = NULL;
- }
-
- dispose_ChildImpl();
-
- if ( m_pParseTree )
- {
- delete m_pParseTree;
- m_pParseTree = NULL;
- }
-
- OStatement_Base::disposing();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::acquire() throw()
-{
- OStatement_BASE::acquire();
-}
-//-----------------------------------------------------------------------------
-void SAL_CALL OStatement_BASE2::release() throw()
-{
- relase_ChildImpl();
-}
-//-----------------------------------------------------------------------------
-Any SAL_CALL OStatement_Base::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::queryInterface" );
- const Any aRet = OStatement_BASE::queryInterface(rType);
- return aRet.hasValue() ? aRet : OPropertySetHelper::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OStatement_Base::getTypes( ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::getTypes" );
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const Reference< ::com::sun::star::beans::XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XFastPropertySet > *)0 ),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XPropertySet > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OStatement_Base::cancel( ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::cancel" );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OStatement_Base::close( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::close" );
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-
-void OStatement_Base::reset() throw (SQLException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::reset" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- clearWarnings ();
-
- if (m_xResultSet.get().is())
- clearMyResultSet();
-}
-//--------------------------------------------------------------------
-// clearMyResultSet
-// If a ResultSet was created for this Statement, close it
-//--------------------------------------------------------------------
-
-void OStatement_Base::clearMyResultSet () throw (SQLException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::clearMyResultSet " );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- try
- {
- Reference<XCloseable> xCloseable;
- if ( ::comphelper::query_interface( m_xResultSet.get(), xCloseable ) )
- xCloseable->close();
- }
- catch( const DisposedException& ) { }
-
- m_xResultSet = Reference< XResultSet>();
-}
-//--------------------------------------------------------------------
-// setWarning
-// Sets the warning
-//--------------------------------------------------------------------
-
-void OStatement_Base::setWarning (const SQLWarning &ex) throw( SQLException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::setWarning " );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- m_aLastWarning = ex;
-}
-
-// -------------------------------------------------------------------------
-Any SAL_CALL OStatement_Base::getWarnings( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::getWarnings" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- return makeAny(m_aLastWarning);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::clearWarnings" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- m_aLastWarning = SQLWarning();
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OStatement_Base::createArrayHelper( ) const
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::createArrayHelper" );
- Sequence< Property > aProps;
- describeProperties(aProps);
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OStatement_Base::getInfoHelper()
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::getInfoHelper" );
- return *const_cast<OStatement_Base*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-OResultSet* OStatement::createResultSet()
-{
- return new OResultSet(this,m_aSQLIterator);
-}
-// -------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OStatement,"com.sun.star.sdbc.driver.file.Statement","com.sun.star.sdbc.Statement");
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement::acquire() throw()
-{
- OStatement_BASE2::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement::release() throw()
-{
- OStatement_BASE2::release();
-}
-// -----------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OStatement::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- executeQuery(sql);
-
- return m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT;
-}
-
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL OStatement::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- construct(sql);
- Reference< XResultSet > xRS;
- OResultSet* pResult = createResultSet();
- xRS = pResult;
- initializeResultSet(pResult);
- m_xResultSet = Reference<XResultSet>(pResult);
-
- pResult->OpenImpl();
-
- return xRS;
-}
-// -------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL OStatement::getConnection( ) throw(SQLException, RuntimeException)
-{
- return (Reference< XConnection >)m_pConnection;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OStatement::executeUpdate( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- construct(sql);
- OResultSet* pResult = createResultSet();
- Reference< XResultSet > xRS = pResult;
- initializeResultSet(pResult);
- pResult->OpenImpl();
-
- return pResult->getRowCountResult();
-}
-
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::disposing(void)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::disposing" );
- if(m_aEvaluateRow.is())
- {
- m_aEvaluateRow->get().clear();
- m_aEvaluateRow = NULL;
- }
- delete m_pEvaluationKeySet;
- OStatement_BASE::disposing();
-}
-// -----------------------------------------------------------------------------
-Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OStatement_Base::getPropertySetInfo( ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::getPropertySetInfo" );
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-Any SAL_CALL OStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OStatement_XStatement::queryInterface( rType);
- return aRet.hasValue() ? aRet : OStatement_BASE2::queryInterface( rType);
-}
-// -----------------------------------------------------------------------------
-OSQLAnalyzer* OStatement_Base::createAnalyzer()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::createAnalyzer" );
- return new OSQLAnalyzer(m_pConnection);
-}
-// -----------------------------------------------------------------------------
-void OStatement_Base::anylizeSQL()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::anylizeSQL" );
- OSL_ENSURE(m_pSQLAnalyzer,"OResultSet::anylizeSQL: Analyzer isn't set!");
- // start analysing the statement
- m_pSQLAnalyzer->setOrigColumns(m_xColNames);
- m_pSQLAnalyzer->start(m_pParseTree);
-
- const OSQLParseNode* pOrderbyClause = m_aSQLIterator.getOrderTree();
- if(pOrderbyClause)
- {
- OSQLParseNode * pOrderingSpecCommalist = pOrderbyClause->getChild(2);
- OSL_ENSURE(SQL_ISRULE(pOrderingSpecCommalist,ordering_spec_commalist),"OResultSet: Fehler im Parse Tree");
-
- for (sal_uInt32 m = 0; m < pOrderingSpecCommalist->count(); m++)
- {
- OSQLParseNode * pOrderingSpec = pOrderingSpecCommalist->getChild(m);
- OSL_ENSURE(SQL_ISRULE(pOrderingSpec,ordering_spec),"OResultSet: Fehler im Parse Tree");
- OSL_ENSURE(pOrderingSpec->count() == 2,"OResultSet: Fehler im Parse Tree");
-
- OSQLParseNode * pColumnRef = pOrderingSpec->getChild(0);
- if(!SQL_ISRULE(pColumnRef,column_ref))
- {
- throw SQLException();
- }
- OSQLParseNode * pAscendingDescending = pOrderingSpec->getChild(1);
- setOrderbyColumn(pColumnRef,pAscendingDescending);
- }
- }
-}
-//------------------------------------------------------------------
-void OStatement_Base::setOrderbyColumn( OSQLParseNode* pColumnRef,
- OSQLParseNode* pAscendingDescending)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::setOrderbyColumn" );
- ::rtl::OUString aColumnName;
- if (pColumnRef->count() == 1)
- aColumnName = pColumnRef->getChild(0)->getTokenValue();
- else if (pColumnRef->count() == 3)
- {
- pColumnRef->getChild(2)->parseNodeToStr( aColumnName, getOwnConnection(), NULL, sal_False, sal_False );
- }
- else
- {
- throw SQLException();
- }
-
- Reference<XColumnLocate> xColLocate(m_xColNames,UNO_QUERY);
- if(!xColLocate.is())
- return;
- // Everything tested and we have the name of the Column.
- // What number is the Column?
- ::rtl::Reference<OSQLColumns> aSelectColumns = m_aSQLIterator.getSelectColumns();
- ::comphelper::UStringMixEqual aCase;
- OSQLColumns::Vector::const_iterator aFind = ::connectivity::find(aSelectColumns->get().begin(),aSelectColumns->get().end(),aColumnName,aCase);
- if ( aFind == aSelectColumns->get().end() )
- throw SQLException();
- m_aOrderbyColumnNumber.push_back((aFind - aSelectColumns->get().begin()) + 1);
-
- // Ascending or Descending?
- m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? SQL_DESC : SQL_ASC);
-}
-
-// -----------------------------------------------------------------------------
-void OStatement_Base::construct(const ::rtl::OUString& sql) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::construct" );
- ::rtl::OUString aErr;
- m_pParseTree = m_aParser.parseTree(aErr,sql);
- if(m_pParseTree)
- {
- m_aSQLIterator.setParseTree(m_pParseTree);
- m_aSQLIterator.traverseAll();
- const OSQLTables& xTabs = m_aSQLIterator.getTables();
-
- // sanity checks
- if ( xTabs.empty() )
- // no tables -> nothing to operate on -> error
- m_pConnection->throwGenericSQLException(STR_QUERY_NO_TABLE,*this);
-
- if ( xTabs.size() > 1 || m_aSQLIterator.hasErrors() )
- // more than one table -> can't operate on them -> error
- m_pConnection->throwGenericSQLException(STR_QUERY_MORE_TABLES,*this);
-
- if ( (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT) && m_aSQLIterator.getSelectColumns()->get().empty() )
- // SELECT statement without columns -> error
- m_pConnection->throwGenericSQLException(STR_QUERY_NO_COLUMN,*this);
-
- switch(m_aSQLIterator.getStatementType())
- {
- case SQL_STATEMENT_CREATE_TABLE:
- case SQL_STATEMENT_ODBC_CALL:
- case SQL_STATEMENT_UNKNOWN:
- m_pConnection->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,*this);
- break;
- default:
- break;
- }
-
- // at this moment we support only one table per select statement
- Reference< ::com::sun::star::lang::XUnoTunnel> xTunnel(xTabs.begin()->second,UNO_QUERY);
- if(xTunnel.is())
- {
- if(m_pTable)
- m_pTable->release();
- m_pTable = reinterpret_cast<OFileTable*>(xTunnel->getSomething(OFileTable::getUnoTunnelImplementationId()));
- if(m_pTable)
- m_pTable->acquire();
- }
- OSL_ENSURE(m_pTable,"No table!");
- if ( m_pTable )
- m_xColNames = m_pTable->getColumns();
- Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
- // set the binding of the resultrow
- m_aRow = new OValueRefVector(xNames->getCount());
- (m_aRow->get())[0]->setBound(sal_True);
- ::std::for_each(m_aRow->get().begin()+1,m_aRow->get().end(),TSetRefBound(sal_False));
-
- // set the binding of the resultrow
- m_aEvaluateRow = new OValueRefVector(xNames->getCount());
-
- (m_aEvaluateRow->get())[0]->setBound(sal_True);
- ::std::for_each(m_aEvaluateRow->get().begin()+1,m_aEvaluateRow->get().end(),TSetRefBound(sal_False));
-
- // set the select row
- m_aSelectRow = new OValueRefVector(m_aSQLIterator.getSelectColumns()->get().size());
- ::std::for_each(m_aSelectRow->get().begin(),m_aSelectRow->get().end(),TSetRefBound(sal_True));
-
- // create the column mapping
- createColumnMapping();
-
- m_pSQLAnalyzer = createAnalyzer();
-
- Reference<XIndexesSupplier> xIndexSup(xTunnel,UNO_QUERY);
- if(xIndexSup.is())
- m_pSQLAnalyzer->setIndexes(xIndexSup->getIndexes());
-
- anylizeSQL();
- }
- else
- throw SQLException(aErr,*this,::rtl::OUString(),0,Any());
-}
-// -----------------------------------------------------------------------------
-void OStatement_Base::createColumnMapping()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::createColumnMapping" );
- // initialize the column index map (mapping select columns to table columns)
- ::rtl::Reference<connectivity::OSQLColumns> xColumns = m_aSQLIterator.getSelectColumns();
- m_aColMapping.resize(xColumns->get().size() + 1);
- for (sal_Int32 i=0; i<(sal_Int32)m_aColMapping.size(); ++i)
- m_aColMapping[i] = i;
-
- Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
- // now check which columns are bound
- OResultSet::setBoundedColumns(m_aRow,m_aSelectRow,xColumns,xNames,sal_True,m_xDBMetaData,m_aColMapping);
-}
-// -----------------------------------------------------------------------------
-void OStatement_Base::initializeResultSet(OResultSet* _pResult)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::initializeResultSet" );
- GetAssignValues();
-
- _pResult->setSqlAnalyzer(m_pSQLAnalyzer);
- _pResult->setOrderByColumns(m_aOrderbyColumnNumber);
- _pResult->setOrderByAscending(m_aOrderbyAscending);
- _pResult->setBindingRow(m_aRow);
- _pResult->setColumnMapping(m_aColMapping);
- _pResult->setEvaluationRow(m_aEvaluateRow);
- _pResult->setAssignValues(m_aAssignValues);
- _pResult->setSelectRow(m_aSelectRow);
-
- m_pSQLAnalyzer->bindSelectRow(m_aRow);
- m_pEvaluationKeySet = m_pSQLAnalyzer->bindEvaluationRow(m_aEvaluateRow); // Set values in the code of the Compiler
- _pResult->setEvaluationKeySet(m_pEvaluationKeySet);
-}
-// -----------------------------------------------------------------------------
-void OStatement_Base::GetAssignValues()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::GetAssignValues" );
- if (m_pParseTree == NULL)
- {
- ::dbtools::throwFunctionSequenceException(*this);
- return;
- }
-
- if (SQL_ISRULE(m_pParseTree,select_statement))
- // no values have to be set for SELECT
- return;
- else if (SQL_ISRULE(m_pParseTree,insert_statement))
- {
- // Create Row for the values to be set (Reference trough new)
- if(m_aAssignValues.is())
- m_aAssignValues->get().clear();
- sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY)->getCount();
- m_aAssignValues = new OAssignValues(nCount);
- // unbound all
- ::std::for_each(m_aAssignValues->get().begin()+1,m_aAssignValues->get().end(),TSetRefBound(sal_False));
-
- m_aParameterIndexes.resize(nCount+1,SQL_NO_PARAMETER);
-
- // List of Column-Names, that exist in the column_commalist (seperated by ;):
- ::std::vector<String> aColumnNameList;
-
- OSL_ENSURE(m_pParseTree->count() >= 4,"OResultSet: Fehler im Parse Tree");
-
- OSQLParseNode * pOptColumnCommalist = m_pParseTree->getChild(3);
- OSL_ENSURE(pOptColumnCommalist != NULL,"OResultSet: Fehler im Parse Tree");
- OSL_ENSURE(SQL_ISRULE(pOptColumnCommalist,opt_column_commalist),"OResultSet: Fehler im Parse Tree");
- if (pOptColumnCommalist->count() == 0)
- {
- const Sequence< ::rtl::OUString>& aNames = m_xColNames->getElementNames();
- const ::rtl::OUString* pBegin = aNames.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + aNames.getLength();
- for (; pBegin != pEnd; ++pBegin)
- aColumnNameList.push_back(*pBegin);
- }
- else
- {
- OSL_ENSURE(pOptColumnCommalist->count() == 3,"OResultSet: Fehler im Parse Tree");
-
- OSQLParseNode * pColumnCommalist = pOptColumnCommalist->getChild(1);
- OSL_ENSURE(pColumnCommalist != NULL,"OResultSet: Fehler im Parse Tree");
- OSL_ENSURE(SQL_ISRULE(pColumnCommalist,column_commalist),"OResultSet: Fehler im Parse Tree");
- OSL_ENSURE(pColumnCommalist->count() > 0,"OResultSet: Fehler im Parse Tree");
-
- // All Columns in the column_commalist ...
- for (sal_uInt32 i = 0; i < pColumnCommalist->count(); i++)
- {
- OSQLParseNode * pCol = pColumnCommalist->getChild(i);
- OSL_ENSURE(pCol != NULL,"OResultSet: Fehler im Parse Tree");
- aColumnNameList.push_back(pCol->getTokenValue());
- }
- }
- if ( aColumnNameList.empty() )
- throwFunctionSequenceException(*this);
-
- // Values ...
- OSQLParseNode * pValuesOrQuerySpec = m_pParseTree->getChild(4);
- OSL_ENSURE(pValuesOrQuerySpec != NULL,"OResultSet: pValuesOrQuerySpec darf nicht NULL sein!");
- OSL_ENSURE(SQL_ISRULE(pValuesOrQuerySpec,values_or_query_spec),"OResultSet: ! SQL_ISRULE(pValuesOrQuerySpec,values_or_query_spec)");
- OSL_ENSURE(pValuesOrQuerySpec->count() > 0,"OResultSet: pValuesOrQuerySpec->count() <= 0");
-
- // just "VALUES" is allowed ...
- if (! SQL_ISTOKEN(pValuesOrQuerySpec->getChild(0),VALUES))
- throwFunctionSequenceException(*this);
-
- OSL_ENSURE(pValuesOrQuerySpec->count() == 4,"OResultSet: pValuesOrQuerySpec->count() != 4");
-
- // List of values
- OSQLParseNode * pInsertAtomCommalist = pValuesOrQuerySpec->getChild(2);
- OSL_ENSURE(pInsertAtomCommalist != NULL,"OResultSet: pInsertAtomCommalist darf nicht NULL sein!");
- OSL_ENSURE(pInsertAtomCommalist->count() > 0,"OResultSet: pInsertAtomCommalist <= 0");
-
- String aColumnName;
- OSQLParseNode * pRow_Value_Const;
- xub_StrLen nIndex=0;
- for (sal_uInt32 i = 0; i < pInsertAtomCommalist->count(); i++)
- {
- pRow_Value_Const = pInsertAtomCommalist->getChild(i); // row_value_constructor
- OSL_ENSURE(pRow_Value_Const != NULL,"OResultSet: pRow_Value_Const darf nicht NULL sein!");
- if(SQL_ISRULE(pRow_Value_Const,parameter))
- {
- ParseAssignValues(aColumnNameList,pRow_Value_Const,nIndex++); // only one Columnname allowed per loop
- }
- else if(pRow_Value_Const->isToken())
- ParseAssignValues(aColumnNameList,pRow_Value_Const,static_cast<xub_StrLen>(i));
- else
- {
- if(pRow_Value_Const->count() == aColumnNameList.size())
- {
- for (sal_uInt32 j = 0; j < pRow_Value_Const->count(); ++j)
- ParseAssignValues(aColumnNameList,pRow_Value_Const->getChild(j),nIndex++);
- }
- else
- throwFunctionSequenceException(*this);
- }
- }
- }
- else if (SQL_ISRULE(m_pParseTree,update_statement_searched))
- {
- if(m_aAssignValues.is())
- m_aAssignValues->get().clear();
- sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY)->getCount();
- m_aAssignValues = new OAssignValues(nCount);
- // unbound all
- ::std::for_each(m_aAssignValues->get().begin()+1,m_aAssignValues->get().end(),TSetRefBound(sal_False));
-
- m_aParameterIndexes.resize(nCount+1,SQL_NO_PARAMETER);
-
- OSL_ENSURE(m_pParseTree->count() >= 4,"OResultSet: Fehler im Parse Tree");
-
- OSQLParseNode * pAssignmentCommalist = m_pParseTree->getChild(3);
- OSL_ENSURE(pAssignmentCommalist != NULL,"OResultSet: pAssignmentCommalist == NULL");
- OSL_ENSURE(SQL_ISRULE(pAssignmentCommalist,assignment_commalist),"OResultSet: Fehler im Parse Tree");
- OSL_ENSURE(pAssignmentCommalist->count() > 0,"OResultSet: pAssignmentCommalist->count() <= 0");
-
- // work on all assignments (commalist) ...
- ::std::vector< String> aList(1);
- for (sal_uInt32 i = 0; i < pAssignmentCommalist->count(); i++)
- {
- OSQLParseNode * pAssignment = pAssignmentCommalist->getChild(i);
- OSL_ENSURE(pAssignment != NULL,"OResultSet: pAssignment == NULL");
- OSL_ENSURE(SQL_ISRULE(pAssignment,assignment),"OResultSet: Fehler im Parse Tree");
- OSL_ENSURE(pAssignment->count() == 3,"OResultSet: pAssignment->count() != 3");
-
- OSQLParseNode * pCol = pAssignment->getChild(0);
- OSL_ENSURE(pCol != NULL,"OResultSet: pCol == NULL");
-
- OSQLParseNode * pComp = pAssignment->getChild(1);
- OSL_ENSURE(pComp != NULL,"OResultSet: pComp == NULL");
- OSL_ENSURE(pComp->getNodeType() == SQL_NODE_EQUAL,"OResultSet: pComp->getNodeType() != SQL_NODE_COMPARISON");
- if (pComp->getTokenValue().toChar() != '=')
- {
- throwFunctionSequenceException(*this);
- }
-
- OSQLParseNode * pVal = pAssignment->getChild(2);
- OSL_ENSURE(pVal != NULL,"OResultSet: pVal == NULL");
- aList[0] = pCol->getTokenValue();
- ParseAssignValues(aList,pVal,0);
- }
-
- }
-}
-// -------------------------------------------------------------------------
-void OStatement_Base::ParseAssignValues(const ::std::vector< String>& aColumnNameList,OSQLParseNode* pRow_Value_Constructor_Elem,xub_StrLen nIndex)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::ParseAssignValues" );
- OSL_ENSURE(nIndex <= aColumnNameList.size(),"SdbFileCursor::ParseAssignValues: nIndex > aColumnNameList.GetTokenCount()");
- String aColumnName(aColumnNameList[nIndex]);
- OSL_ENSURE(aColumnName.Len() > 0,"OResultSet: Column-Name nicht gefunden");
- OSL_ENSURE(pRow_Value_Constructor_Elem != NULL,"OResultSet: pRow_Value_Constructor_Elem darf nicht NULL sein!");
-
- if (pRow_Value_Constructor_Elem->getNodeType() == SQL_NODE_STRING ||
- pRow_Value_Constructor_Elem->getNodeType() == SQL_NODE_INTNUM ||
- pRow_Value_Constructor_Elem->getNodeType() == SQL_NODE_APPROXNUM)
- {
- // set value:
- SetAssignValue(aColumnName, pRow_Value_Constructor_Elem->getTokenValue());
- }
- else if (SQL_ISTOKEN(pRow_Value_Constructor_Elem,NULL))
- {
- // set NULL
- SetAssignValue(aColumnName, String(), sal_True);
- }
- else if (SQL_ISRULE(pRow_Value_Constructor_Elem,parameter))
- parseParamterElem(aColumnName,pRow_Value_Constructor_Elem);
- else
- {
- throwFunctionSequenceException(*this);
- }
-}
-//------------------------------------------------------------------
-void OStatement_Base::SetAssignValue(const String& aColumnName,
- const String& aValue,
- sal_Bool bSetNull,
- sal_uInt32 nParameter)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::SetAssignValue" );
- Reference<XPropertySet> xCol;
- m_xColNames->getByName(aColumnName) >>= xCol;
- sal_Int32 nId = Reference<XColumnLocate>(m_xColNames,UNO_QUERY)->findColumn(aColumnName);
- // does this column actually exist in the file?
-
- if (!xCol.is())
- {
- // This Column doesn't exist!
- throwFunctionSequenceException(*this);
- }
-
-
- // Everything tested and we have the names of the Column.
- // Now allocate one Value, set the value and tie the value to the Row.
- if (bSetNull)
- (m_aAssignValues->get())[nId]->setNull();
- else
- {
- switch (::comphelper::getINT32(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))))
- {
- // put criteria depending on the Type as String or double in the variable
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- *(m_aAssignValues->get())[nId] = ORowSetValue(aValue);
- //Characterset is already converted, since the entire statement was converted
- break;
-
- case DataType::BIT:
- {
- if (aValue.EqualsIgnoreCaseAscii("TRUE") || aValue.GetChar(0) == '1')
- *(m_aAssignValues->get())[nId] = sal_True;
- else if (aValue.EqualsIgnoreCaseAscii("FALSE") || aValue.GetChar(0) == '0')
- *(m_aAssignValues->get())[nId] = sal_False;
- else
- {
- throwFunctionSequenceException(*this);
- }
- }
- break;
- case DataType::TINYINT:
- case DataType::SMALLINT:
- case DataType::INTEGER:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::REAL:
- case DataType::DOUBLE:
- case DataType::DATE:
- case DataType::TIME:
- case DataType::TIMESTAMP:
- {
- *(m_aAssignValues->get())[nId] = ORowSetValue(aValue);
- } break;
- default:
- throwFunctionSequenceException(*this);
- }
- }
-
- // save Parameter-No. (as User Data)
- // SQL_NO_PARAMETER = no Parameter.
- m_aAssignValues->setParameterIndex(nId,nParameter);
- if(nParameter != SQL_NO_PARAMETER)
- m_aParameterIndexes[nParameter] = nId;
-}
-// -----------------------------------------------------------------------------
-void OStatement_Base::parseParamterElem(const String& /*_sColumnName*/,OSQLParseNode* /*pRow_Value_Constructor_Elem*/)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::parseParamterElem" );
- // do nothing here
-}
-// =============================================================================
- } // namespace file
-// =============================================================================
-}// namespace connectivity
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FStringFunctions.cxx b/connectivity/source/drivers/file/FStringFunctions.cxx
deleted file mode 100644
index 490d9c7bef..0000000000
--- a/connectivity/source/drivers/file/FStringFunctions.cxx
+++ /dev/null
@@ -1,269 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "file/FStringFunctions.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <rtl/logfile.hxx>
-
-using namespace connectivity;
-using namespace connectivity::file;
-//------------------------------------------------------------------
-ORowSetValue OOp_Upper::operate(const ORowSetValue& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_Upper::operate" );
- if ( lhs.isNull() )
- return lhs;
-
- return lhs.getString().toAsciiUpperCase();
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Lower::operate(const ORowSetValue& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_Lower::operate" );
- if ( lhs.isNull() )
- return lhs;
-
- return lhs.getString().toAsciiLowerCase();
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Ascii::operate(const ORowSetValue& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_Ascii::operate" );
- if ( lhs.isNull() )
- return lhs;
- ::rtl::OString sStr(::rtl::OUStringToOString(lhs,RTL_TEXTENCODING_ASCII_US));
- sal_Int32 nAscii = sStr.toChar();
- return nAscii;
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_CharLength::operate(const ORowSetValue& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_CharLength::operate" );
- if ( lhs.isNull() )
- return lhs;
-
- return lhs.getString().getLength();
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Char::operate(const ::std::vector<ORowSetValue>& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_Char::operate" );
- if ( lhs.empty() )
- return ORowSetValue();
-
- ::rtl::OUString sRet;
- ::std::vector<ORowSetValue>::const_reverse_iterator aIter = lhs.rbegin();
- ::std::vector<ORowSetValue>::const_reverse_iterator aEnd = lhs.rend();
- for (; aIter != aEnd; ++aIter)
- {
- if ( !aIter->isNull() )
- {
- sal_Char c = static_cast<sal_Char>(static_cast<sal_Int32>(*aIter));
-
- sRet += ::rtl::OUString(&c,1,RTL_TEXTENCODING_ASCII_US);
- }
- }
-
- return sRet;
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Concat::operate(const ::std::vector<ORowSetValue>& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_Concat::operate" );
- if ( lhs.empty() )
- return ORowSetValue();
-
- ::rtl::OUStringBuffer sRet;
- ::std::vector<ORowSetValue>::const_reverse_iterator aIter = lhs.rbegin();
- ::std::vector<ORowSetValue>::const_reverse_iterator aEnd = lhs.rend();
- for (; aIter != aEnd; ++aIter)
- {
- if ( aIter->isNull() )
- return ORowSetValue();
-
- sRet.append(aIter->operator ::rtl::OUString());
- }
-
- return sRet.makeStringAndClear();
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Locate::operate(const ::std::vector<ORowSetValue>& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_Locate::operate" );
- ::std::vector<ORowSetValue>::const_iterator aIter = lhs.begin();
- ::std::vector<ORowSetValue>::const_iterator aEnd = lhs.end();
- for (; aIter != aEnd; ++aIter)
- {
- if ( aIter->isNull() )
- return ORowSetValue();
- }
- if ( lhs.size() == 2 )
- return ::rtl::OUString::valueOf(lhs[0].getString().indexOf(lhs[1].getString())+1);
-
- else if ( lhs.size() != 3 )
- return ORowSetValue();
-
- return lhs[1].getString().indexOf(lhs[2].getString(),lhs[0]) + 1;
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_SubString::operate(const ::std::vector<ORowSetValue>& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_SubString::operate" );
- ::std::vector<ORowSetValue>::const_iterator aIter = lhs.begin();
- ::std::vector<ORowSetValue>::const_iterator aEnd = lhs.end();
- for (; aIter != aEnd; ++aIter)
- {
- if ( aIter->isNull() )
- return ORowSetValue();
- }
- if ( lhs.size() == 2 && static_cast<sal_Int32>(lhs[0]) >= sal_Int32(0) )
- return lhs[1].getString().copy(static_cast<sal_Int32>(lhs[0])-1);
-
- else if ( lhs.size() != 3 || static_cast<sal_Int32>(lhs[1]) < sal_Int32(0))
- return ORowSetValue();
-
- return lhs[2].getString().copy(static_cast<sal_Int32>(lhs[1])-1,lhs[0]);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_LTrim::operate(const ORowSetValue& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_LTrim::operate" );
- if ( lhs.isNull() )
- return lhs;
-
- ::rtl::OUString sRet = lhs;
- ::rtl::OUString sNew = sRet.trim();
- return sRet.copy(sRet.indexOf(sNew));
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_RTrim::operate(const ORowSetValue& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_RTrim::operate" );
- if ( lhs.isNull() )
- return lhs;
-
- ::rtl::OUString sRet = lhs;
- ::rtl::OUString sNew = sRet.trim();
- return sRet.copy(0,sRet.lastIndexOf(sNew.getStr()[sNew.getLength()-1])+1);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Space::operate(const ORowSetValue& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_Space::operate" );
- if ( lhs.isNull() )
- return lhs;
-
- const sal_Char c = ' ';
- ::rtl::OUStringBuffer sRet;
- sal_Int32 nCount = lhs;
- for (sal_Int32 i=0; i < nCount; ++i)
- {
- sRet.appendAscii(&c,1);
- }
- return sRet.makeStringAndClear();
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Replace::operate(const ::std::vector<ORowSetValue>& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_Replace::operate" );
- if ( lhs.size() != 3 )
- return ORowSetValue();
-
- ::rtl::OUString sStr = lhs[2];
- ::rtl::OUString sFrom = lhs[1];
- ::rtl::OUString sTo = lhs[0];
- sal_Int32 nIndexOf = sStr.indexOf(sFrom);
- while( nIndexOf != -1 )
- {
- sStr = sStr.replaceAt(nIndexOf,sFrom.getLength(),sTo);
- nIndexOf = sStr.indexOf(sFrom,nIndexOf + sTo.getLength());
- }
-
- return sStr;
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Repeat::operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_Repeat::operate" );
- if ( lhs.isNull() || rhs.isNull() )
- return lhs;
-
- ::rtl::OUString sRet;
- sal_Int32 nCount = rhs;
- for (sal_Int32 i=0; i < nCount; ++i)
- {
- sRet += lhs;
- }
- return sRet;
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Insert::operate(const ::std::vector<ORowSetValue>& lhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_Insert::operate" );
- if ( lhs.size() != 4 )
- return ORowSetValue();
-
- ::rtl::OUString sStr = lhs[3];
-
- sal_Int32 nStart = static_cast<sal_Int32>(lhs[2]);
- if ( nStart < 1 )
- nStart = 1;
- return sStr.replaceAt(nStart-1,static_cast<sal_Int32>(lhs[1]),lhs[0]);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Left::operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_Left::operate" );
- if ( lhs.isNull() || rhs.isNull() )
- return lhs;
-
- ::rtl::OUString sRet = lhs;
- sal_Int32 nCount = rhs;
- if ( nCount < 0 )
- return ORowSetValue();
- return sRet.copy(0,nCount);
-}
-//------------------------------------------------------------------
-ORowSetValue OOp_Right::operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_Right::operate" );
- if ( lhs.isNull() || rhs.isNull() )
- return lhs;
-
- sal_Int32 nCount = rhs;
- ::rtl::OUString sRet = lhs;
- if ( nCount < 0 || nCount >= sRet.getLength() )
- return ORowSetValue();
-
- return sRet.copy(sRet.getLength()-nCount,nCount);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FTable.cxx b/connectivity/source/drivers/file/FTable.cxx
deleted file mode 100644
index 892a57ca35..0000000000
--- a/connectivity/source/drivers/file/FTable.cxx
+++ /dev/null
@@ -1,259 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include "file/FTable.hxx"
-#include "file/FColumns.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <unotools/ucbstreamhelper.hxx>
-#include <tools/debug.hxx>
-#include <rtl/logfile.hxx>
-
-using namespace connectivity;
-using namespace connectivity::file;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-DBG_NAME( file_OFileTable )
-OFileTable::OFileTable(sdbcx::OCollection* _pTables,OConnection* _pConnection)
-: OTable_TYPEDEF(_pTables,_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers())
- ,m_pConnection(_pConnection)
- ,m_pFileStream(NULL)
- ,m_nFilePos(0)
- ,m_pBuffer(NULL)
- ,m_nBufferSize(0)
- ,m_bWriteable(sal_False)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::OFileTable" );
- DBG_CTOR( file_OFileTable, NULL );
- construct();
- TStringVector aVector;
- // m_pColumns = new OColumns(this,m_aMutex,aVector);
- m_aColumns = new OSQLColumns();
-}
-// -------------------------------------------------------------------------
-OFileTable::OFileTable( sdbcx::OCollection* _pTables,OConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description ,
- const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName
- ) : OTable_TYPEDEF(_pTables,_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers(),
- _Name,
- _Type,
- _Description,
- _SchemaName,
- _CatalogName)
- ,m_pConnection(_pConnection)
- ,m_pFileStream(NULL)
- ,m_nFilePos(0)
- ,m_pBuffer(NULL)
- ,m_nBufferSize(0)
- ,m_bWriteable(sal_False)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::OFileTable" );
- DBG_CTOR( file_OFileTable, NULL );
- m_aColumns = new OSQLColumns();
- construct();
- // refreshColumns();
-}
-// -------------------------------------------------------------------------
-OFileTable::~OFileTable( )
-{
- DBG_DTOR( file_OFileTable, NULL );
-}
-// -------------------------------------------------------------------------
-void OFileTable::refreshColumns()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::refreshColumns" );
- TStringVector aVector;
- Reference< XResultSet > xResult = m_pConnection->getMetaData()->getColumns(Any(),
- m_SchemaName,m_Name,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")));
-
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- aVector.push_back(xRow->getString(4));
- }
-
- if(m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new OColumns(this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void OFileTable::refreshKeys()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::refreshKeys" );
-}
-// -------------------------------------------------------------------------
-void OFileTable::refreshIndexes()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::refreshIndexes" );
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OFileTable::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::queryInterface" );
- if( rType == ::getCppuType((const Reference<XKeysSupplier>*)0) ||
- rType == ::getCppuType((const Reference<XRename>*)0) ||
- rType == ::getCppuType((const Reference<XAlterTable>*)0) ||
- rType == ::getCppuType((const Reference<XIndexesSupplier>*)0) ||
- rType == ::getCppuType((const Reference<XDataDescriptorFactory>*)0))
- return Any();
-
- return OTable_TYPEDEF::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OFileTable::disposing(void)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::disposing" );
- OTable::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
-
- FileClose();
-}
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > OFileTable::getUnoTunnelImplementationId()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::getUnoTunnelImplementationId" );
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OFileTable::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::getSomething" );
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OTable_TYPEDEF::getSomething(rId);
-}
-// -----------------------------------------------------------------------------
-void OFileTable::FileClose()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::FileClose" );
- ::osl::MutexGuard aGuard(m_aMutex);
-
- if (m_pFileStream && m_pFileStream->IsWritable())
- m_pFileStream->Flush();
-
- delete m_pFileStream;
- m_pFileStream = NULL;
-
- if (m_pBuffer)
- {
- delete[] m_pBuffer;
- m_pBuffer = NULL;
- }
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OFileTable::acquire() throw()
-{
- OTable_TYPEDEF::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OFileTable::release() throw()
-{
- OTable_TYPEDEF::release();
-}
-// -----------------------------------------------------------------------------
-sal_Bool OFileTable::InsertRow(OValueRefVector& /*rRow*/, sal_Bool /*bFlush*/,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& /*_xCols*/)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::InsertRow" );
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OFileTable::DeleteRow(const OSQLColumns& /*_rCols*/)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::DeleteRow" );
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OFileTable::UpdateRow(OValueRefVector& /*rRow*/, OValueRefRow& /*pOrgRow*/,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& /*_xCols*/)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::UpdateRow" );
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-void OFileTable::addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& /*descriptor*/)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::addColumn" );
- OSL_FAIL( "OFileTable::addColumn: not implemented!" );
-}
-// -----------------------------------------------------------------------------
-void OFileTable::dropColumn(sal_Int32 /*_nPos*/)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::dropColumn" );
- OSL_FAIL( "OFileTable::addColumn: not implemented!" );
-}
-
-// -----------------------------------------------------------------------------
-SvStream* OFileTable::createStream_simpleError( const String& _rFileName, StreamMode _eOpenMode)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::createStream_simpleError" );
- utl::UcbLockBytesHandler* p_null_dummy=NULL;
- SvStream* pReturn = ::utl::UcbStreamHelper::CreateStream( _rFileName, _eOpenMode, (_eOpenMode & STREAM_NOCREATE) == STREAM_NOCREATE ,p_null_dummy);
- if (pReturn && (ERRCODE_NONE != pReturn->GetErrorCode()))
- {
- delete pReturn;
- pReturn = NULL;
- }
- return pReturn;
-}
-
-// -----------------------------------------------------------------------------
-void OFileTable::refreshHeader()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::refreshHeader" );
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/FTables.cxx b/connectivity/source/drivers/file/FTables.cxx
deleted file mode 100644
index c56cf59a66..0000000000
--- a/connectivity/source/drivers/file/FTables.cxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "file/FTables.hxx"
-#include "file/FTable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include "file/FCatalog.hxx"
-#include "file/FConnection.hxx"
-
-using namespace connectivity;
-using namespace connectivity::file;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-namespace starutil = ::com::sun::star::util;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OTables::createObject(const ::rtl::OUString& /*_rName*/)
-{
- return sdbcx::ObjectType();
-}
-// -------------------------------------------------------------------------
-void OTables::impl_refresh( ) throw(RuntimeException)
-{
- static_cast<OFileCatalog&>(m_rParent).refreshTables();
-}
-// -------------------------------------------------------------------------
-void OTables::disposing(void)
-{
-m_xMetaData.clear();
- OCollection::disposing();
-}
-//------------------------------------------------------------------
-Any SAL_CALL OTables::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- if( rType == ::getCppuType((const Reference<XColumnLocate>*)0) ||
- rType == ::getCppuType((const Reference<XDataDescriptorFactory>*)0) ||
- rType == ::getCppuType((const Reference<XAppend>*)0) ||
- rType == ::getCppuType((const Reference<XDrop>*)0))
- return Any();
-
- typedef sdbcx::OCollection OTables_BASE;
- return OTables_BASE::queryInterface(rType);
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/fanalyzer.cxx b/connectivity/source/drivers/file/fanalyzer.cxx
deleted file mode 100644
index cbff002d24..0000000000
--- a/connectivity/source/drivers/file/fanalyzer.cxx
+++ /dev/null
@@ -1,343 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "file/fanalyzer.hxx"
-#include "connectivity/sqlparse.hxx"
-#include <osl/diagnose.h>
-#include <tools/debug.hxx>
-#include <comphelper/extract.hxx>
-#include "connectivity/sqlnode.hxx"
-#include "connectivity/dbexception.hxx"
-#include "file/FConnection.hxx"
-#include "resource/file_res.hrc"
-
-using namespace ::connectivity;
-using namespace ::connectivity::file;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-DBG_NAME( file_OSQLAnalyzer )
-//------------------------------------------------------------------
-OSQLAnalyzer::OSQLAnalyzer(OConnection* _pConnection)
- :m_pConnection(_pConnection)
- ,m_bHasSelectionCode(sal_False)
- ,m_bSelectionFirstTime(sal_True)
-{
- DBG_CTOR( file_OSQLAnalyzer, NULL );
- m_aCompiler = new OPredicateCompiler(this);
- m_aInterpreter = new OPredicateInterpreter(m_aCompiler);
-}
-
-// -----------------------------------------------------------------------------
-OSQLAnalyzer::~OSQLAnalyzer()
-{
- DBG_DTOR( file_OSQLAnalyzer, NULL );
-}
-
-// -----------------------------------------------------------------------------
-void OSQLAnalyzer::setIndexes(const Reference< XNameAccess>& _xIndexes)
-{
- m_aCompiler->m_xIndexes = _xIndexes;
-}
-//------------------------------------------------------------------
-void OSQLAnalyzer::start(OSQLParseNode* pSQLParseNode)
-{
- if (SQL_ISRULE(pSQLParseNode,select_statement))
- {
- DBG_ASSERT(pSQLParseNode->count() >= 4,"OFILECursor: Fehler im Parse Tree");
-
- // check that we don't use anything other than count(*) as function
- OSQLParseNode* pSelection = pSQLParseNode->getChild(2);
- if ( SQL_ISRULE(pSelection,scalar_exp_commalist) )
- {
- for (sal_uInt32 i = 0; i < pSelection->count(); i++)
- {
- OSQLParseNode *pColumnRef = pSelection->getChild(i)->getChild(0);
- if ( ( SQL_ISRULE(pColumnRef,set_fct_spec) && pColumnRef->count() == 4 )
- || SQL_ISRULE(pColumnRef,char_value_fct)
- || SQL_ISRULE(pColumnRef,char_substring_fct)
- || SQL_ISRULE(pColumnRef,position_exp)
- || SQL_ISRULE(pColumnRef,fold)
- || SQL_ISRULE(pColumnRef,length_exp)
- || SQL_ISRULE(pColumnRef,num_value_exp)
- || SQL_ISRULE(pColumnRef,term)
- || SQL_ISRULE(pColumnRef,factor)
- || SQL_ISRULE(pColumnRef,set_fct_spec) )
- {
- ::rtl::Reference<OPredicateCompiler> pCompiler = new OPredicateCompiler(this);
- pCompiler->setOrigColumns(m_aCompiler->getOrigColumns());
- ::rtl::Reference<OPredicateInterpreter> pInterpreter = new OPredicateInterpreter(pCompiler);
- pCompiler->execute( pColumnRef );
- m_aSelectionEvaluations.push_back( TPredicates(pCompiler,pInterpreter) );
- }
- else if ( ( SQL_ISRULE(pColumnRef,general_set_fct) && pColumnRef->count() != 4 ) )
- {
- m_pConnection->throwGenericSQLException(STR_QUERY_COMPLEX_COUNT,NULL);
- }
- else
- {
- if ( SQL_ISPUNCTUATION( pColumnRef, "*" )
- || ( SQL_ISRULE( pColumnRef, column_ref )
- && ( pColumnRef->count() == 3 )
- && ( pColumnRef->getChild(0)->getNodeType() == SQL_NODE_NAME )
- && SQL_ISPUNCTUATION( pColumnRef->getChild(1), "." )
- && SQL_ISRULE( pColumnRef->getChild(2), column_val )
- && SQL_ISPUNCTUATION( pColumnRef->getChild(2)->getChild(0), "*" )
- )
- )
- {
- // push one element for each column of our table
- const Reference< XNameAccess > xColumnNames( m_aCompiler->getOrigColumns() );
- const Sequence< ::rtl::OUString > aColumnNames( xColumnNames->getElementNames() );
- for ( sal_Int32 j=0; j<aColumnNames.getLength(); ++j )
- m_aSelectionEvaluations.push_back( TPredicates() );
- }
- else
- m_aSelectionEvaluations.push_back( TPredicates() );
- }
- }
- }
- }
-
- m_aCompiler->start(pSQLParseNode);
-}
-
-//------------------------------------------------------------------
-void OSQLAnalyzer::bindRow(OCodeList& rCodeList,const OValueRefRow& _pRow,OEvaluateSetList& _rEvaluateSetList)
-{
- // count criteria
- // if only one criterion, and the corresponding field is indexed
- // then the index will be used
- OEvaluateSet* pEvaluateSet = NULL;
-
- for (OCodeList::iterator aIter = rCodeList.begin(); aIter != rCodeList.end(); ++aIter)
- {
- OOperandAttr* pAttr = PTR_CAST(OOperandAttr,(*aIter));
- if (pAttr)
- {
- if (pAttr->isIndexed() && !m_aCompiler->hasORCondition())
- {
- OCode* pCode1 = *(aIter + 1);
- OCode* pCode2 = *(aIter + 2);
-
- if (PTR_CAST(OOperand,pCode1))
- pEvaluateSet = pAttr->preProcess(PTR_CAST(OBoolOperator,pCode2), PTR_CAST(OOperand,pCode1));
- else
- pEvaluateSet = pAttr->preProcess(PTR_CAST(OBoolOperator,pCode1));
- }
-
- if (pEvaluateSet)
- {
- _rEvaluateSetList.push_back(pEvaluateSet);
- pEvaluateSet = NULL;
- }
- pAttr->bindValue(_pRow);
- }
- }
-}
-//------------------------------------------------------------------
-void OSQLAnalyzer::bindSelectRow(const OValueRefRow& _pRow)
-{
- // first the select part
- OEvaluateSetList aEvaluateSetList;
- for ( ::std::vector< TPredicates >::iterator aIter = m_aSelectionEvaluations.begin(); aIter != m_aSelectionEvaluations.end();++aIter)
- {
- if ( aIter->first.is() )
- bindRow( aIter->first->m_aCodeList,_pRow,aEvaluateSetList);
- }
-}
-//------------------------------------------------------------------
-::std::vector<sal_Int32>* OSQLAnalyzer::bindEvaluationRow(OValueRefRow& _pRow)
-{
- OEvaluateSetList aEvaluateSetList;
- bindRow( m_aCompiler->m_aCodeList,_pRow,aEvaluateSetList);
-
- ::std::vector<sal_Int32>* pKeySet = NULL;
- OEvaluateSet* pEvaluateSet = NULL;
-
- // create Keyset with smallest list
- if(!aEvaluateSetList.empty())
- {
- // which list has the smallest count?
- OEvaluateSetList::iterator i = aEvaluateSetList.begin();
- pEvaluateSet = *(i);
- for(++i; i != aEvaluateSetList.end();++i)
- {
- OEvaluateSet* pEvaluateSetComp = (*i);
- for(OEvaluateSet::reverse_iterator j = pEvaluateSet->rbegin(); j != pEvaluateSet->rend(); ++j)
- {
- if (pEvaluateSetComp->find(j->second) != pEvaluateSetComp->end())
- pEvaluateSet->erase(j->second);
- }
- }
- pKeySet = new ::std::vector<sal_Int32>(pEvaluateSet->size());
- sal_Int32 k=0;
- for(OEvaluateSet::iterator j = pEvaluateSet->begin(); j != pEvaluateSet->end(); ++j,++k)
- {
- (*pKeySet)[k] = j->second;
- }
-
- // delete all
- for(i = aEvaluateSetList.begin(); i != aEvaluateSetList.end();++i)
- delete (*i);
- }
-
- return pKeySet;
-}
-
-//------------------------------------------------------------------
-void OSQLAnalyzer::describeParam(::rtl::Reference<OSQLColumns> rParameterColumns)
-{
- OCodeList& rCodeList = m_aCompiler->m_aCodeList;
- OCodeStack aCodeStack;
-
- if (!rCodeList.size())
- return; // no predicate
- if (!rParameterColumns->get().size())
- return; // no parameters
-
- // Create columns, that have a more precise description for the included
- ::rtl::Reference<OSQLColumns> aNewParamColumns = new OSQLColumns(*rParameterColumns);
-
-
- // Create a Test-row, is needed to describe the parameters
- OValueRefRow aParameterRow = new OValueRefVector(rParameterColumns->get().size());
- bindParameterRow(aParameterRow);
-
- OValueRefRow aTestRow = new OValueRefVector(Reference< XIndexAccess>(m_aCompiler->getOrigColumns(),UNO_QUERY)->getCount());
- delete bindEvaluationRow(aTestRow); // Bind the attributes to the values
-
- for(OCodeList::iterator aIter = rCodeList.begin(); aIter != rCodeList.end(); ++aIter)
- {
- OOperand* pOperand = PTR_CAST(OOperand,(*aIter));
- OOperator* pOperator = PTR_CAST(OOperator,(*aIter));
- if (pOperand)
- aCodeStack.push(pOperand);
- else
- {
- if (pOperator->getRequestedOperands() == 2) // with two Operands it is possible
- { // to specify one parameter better
- OOperandParam *pParam = PTR_CAST(OOperandParam,aCodeStack.top());
- if (pParam) // adjust the Parameter-types, if the left Operand is an attribute
- {
- OOperandAttr *pLeft = PTR_CAST(OOperandAttr,*(rCodeList.end() - 2));
- if (pLeft)
- {
- Reference< XPropertySet> xCol;
- Reference< XIndexAccess>(m_aCompiler->getOrigColumns(),UNO_QUERY)->getByIndex(pLeft->getRowPos()) >>= xCol;
- OSL_ENSURE(xCol.is(), "Ungueltige Struktur");
- pParam->describe(xCol, aNewParamColumns);
- }
- }
- }
- pOperator->Exec(aCodeStack);
- }
- }
- OOperand* pOperand = aCodeStack.top();
- aCodeStack.pop();
-
- OSL_ENSURE(aCodeStack.size() == 0, "StackFehler");
- OSL_ENSURE(pOperand, "StackFehler");
- if (IS_TYPE(OOperandResult,pOperand))
- delete pOperand;
- else
- OSL_FAIL("Illegal here!");
-
- rParameterColumns = aNewParamColumns;
-}
-
-// -----------------------------------------------------------------------------
-OOperandAttr* OSQLAnalyzer::createOperandAttr(sal_Int32 _nPos,
- const Reference< XPropertySet>& _xCol,
- const Reference< XNameAccess>& /*_xIndexes*/)
-{
- return new OOperandAttr(static_cast<sal_uInt16>(_nPos),_xCol);
-}
-// -----------------------------------------------------------------------------
-sal_Bool OSQLAnalyzer::hasRestriction() const
-{
- return m_aCompiler->hasCode();
-}
-// -----------------------------------------------------------------------------
-sal_Bool OSQLAnalyzer::hasFunctions() const
-{
- if ( m_bSelectionFirstTime )
- {
- m_bSelectionFirstTime = sal_False;
- for ( ::std::vector< TPredicates >::const_iterator aIter = m_aSelectionEvaluations.begin(); aIter != m_aSelectionEvaluations.end() && !m_bHasSelectionCode ;++aIter)
- {
- if ( aIter->first.is() )
- m_bHasSelectionCode = aIter->first->hasCode();
- }
- }
- return m_bHasSelectionCode;;
-}
-// -----------------------------------------------------------------------------
-void OSQLAnalyzer::setSelectionEvaluationResult(OValueRefRow& _pRow,const ::std::vector<sal_Int32>& _rColumnMapping)
-{
- sal_Int32 nPos = 1;
- for ( ::std::vector< TPredicates >::iterator aIter = m_aSelectionEvaluations.begin(); aIter != m_aSelectionEvaluations.end();++aIter,++nPos)
- {
- if ( aIter->second.is() )
- {
- // the first column (index 0) is for convenience only. The first real select column is no 1.
- sal_Int32 map = nPos;
- if ( nPos < static_cast< sal_Int32 >( _rColumnMapping.size() ) )
- map = _rColumnMapping[nPos];
- if ( map > 0 )
- aIter->second->startSelection( (_pRow->get())[map] );
- }
- }
-}
-// -----------------------------------------------------------------------------
-void OSQLAnalyzer::dispose()
-{
- m_aCompiler->dispose();
- for ( ::std::vector< TPredicates >::iterator aIter = m_aSelectionEvaluations.begin(); aIter != m_aSelectionEvaluations.end();++aIter)
- {
- if ( aIter->first.is() )
- aIter->first->dispose();
- }
-}
-// -----------------------------------------------------------------------------
-void OSQLAnalyzer::setOrigColumns(const OFileColumns& rCols)
-{
- m_aCompiler->setOrigColumns(rCols);
- for ( ::std::vector< TPredicates >::iterator aIter = m_aSelectionEvaluations.begin(); aIter != m_aSelectionEvaluations.end();++aIter)
- {
- if ( aIter->first.is() )
- aIter->first->setOrigColumns(rCols);
- }
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx
deleted file mode 100644
index ad8662c7d0..0000000000
--- a/connectivity/source/drivers/file/fcode.cxx
+++ /dev/null
@@ -1,514 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "file/fcode.hxx"
-#include <osl/diagnose.h>
-#include "connectivity/sqlparse.hxx"
-#include <i18npool/mslangid.hxx>
-#include <tools/debug.hxx>
-#include <tools/string.hxx>
-#include "TConnection.hxx"
-#include <com/sun/star/sdb/SQLFilterOperator.hpp>
-#include <comphelper/types.hxx>
-#include <com/sun/star/sdb/SQLFilterOperator.hpp>
-#include <rtl/logfile.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::file;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdb;
-
-TYPEINIT0(OCode);
-TYPEINIT1(OOperand, OCode);
-TYPEINIT1(OOperandRow, OOperand);
-TYPEINIT1(OOperandAttr, OOperandRow);
-TYPEINIT1(OOperandParam, OOperandRow);
-TYPEINIT1(OOperandValue, OOperand);
-TYPEINIT1(OOperandConst, OOperandValue);
-TYPEINIT1(OOperandResult, OOperandValue);
-TYPEINIT1(OStopOperand, OOperandValue);
-
-TYPEINIT1(OOperator, OCode);
-TYPEINIT1(OBoolOperator,OOperator);
-TYPEINIT1(OOp_NOT, OBoolOperator);
-TYPEINIT1(OOp_AND, OBoolOperator);
-TYPEINIT1(OOp_OR, OBoolOperator);
-TYPEINIT1(OOp_ISNULL, OBoolOperator);
-TYPEINIT1(OOp_ISNOTNULL, OOp_ISNULL);
-TYPEINIT1(OOp_LIKE, OBoolOperator);
-TYPEINIT1(OOp_NOTLIKE, OOp_LIKE);
-TYPEINIT1(OOp_COMPARE, OBoolOperator);
-TYPEINIT1(ONumOperator, OOperator);
-TYPEINIT1(ONthOperator, OOperator);
-TYPEINIT1(OBinaryOperator, OOperator);
-TYPEINIT1(OUnaryOperator, OOperator);
-
-//------------------------------------------------------------------
-DBG_NAME(OCode )
-OCode::OCode()
-{
- DBG_CTOR(OCode ,NULL);
-}
-// -----------------------------------------------------------------------------
-OCode::~OCode()
-{
- DBG_DTOR(OCode,NULL);
-}
-
-//------------------------------------------------------------------
-OEvaluateSet* OOperand::preProcess(OBoolOperator* /*pOp*/, OOperand* /*pRight*/)
-{
- return NULL;
-}
-// -----------------------------------------------------------------------------
-OOperandRow::OOperandRow(sal_uInt16 _nPos, sal_Int32 _rType)
- : OOperand(_rType)
- , m_nRowPos(_nPos)
-{}
-//------------------------------------------------------------------
-void OOperandRow::bindValue(const OValueRefRow& _pRow)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOperandRow::OOperandRow" );
- OSL_ENSURE(_pRow.is(),"NO EMPTY row allowed!");
- m_pRow = _pRow;
- OSL_ENSURE(m_pRow.is() && m_nRowPos < m_pRow->get().size(),"Invalid RowPos is >= vector.size()");
- (m_pRow->get())[m_nRowPos]->setBound(sal_True);
-}
-// -----------------------------------------------------------------------------
-void OOperandRow::setValue(const ORowSetValue& _rVal)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOperandRow::setValue" );
- OSL_ENSURE(m_pRow.is() && m_nRowPos < m_pRow->get().size(),"Invalid RowPos is >= vector.size()");
- (*(m_pRow->get())[m_nRowPos]) = _rVal;
-}
-//------------------------------------------------------------------
-const ORowSetValue& OOperandRow::getValue() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOperandRow::getValue" );
- OSL_ENSURE(m_pRow.is() && m_nRowPos < m_pRow->get().size(),"Invalid RowPos is >= vector.size()");
- return (m_pRow->get())[m_nRowPos]->getValue();
-}
-
-// -----------------------------------------------------------------------------
-void OOperandValue::setValue(const ORowSetValue& _rVal)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOperandValue::setValue" );
- m_aValue = _rVal;
-}
-// -------------------------------------------------------------------------
-sal_Bool OOperandAttr::isIndexed() const
-{
- return sal_False;
-}
-//------------------------------------------------------------------
-OOperandParam::OOperandParam(OSQLParseNode* pNode, sal_Int32 _nPos)
- : OOperandRow(static_cast<sal_uInt16>(_nPos), DataType::VARCHAR) // Standard-Type
-{
- OSL_ENSURE(SQL_ISRULE(pNode,parameter),"Argument ist kein Parameter");
- OSL_ENSURE(pNode->count() > 0,"Fehler im Parse Tree");
- OSQLParseNode *pMark = pNode->getChild(0);
-
- String aParameterName;
- if (SQL_ISPUNCTUATION(pMark,"?"))
- aParameterName = '?';
- else if (SQL_ISPUNCTUATION(pMark,":"))
- aParameterName = pNode->getChild(1)->getTokenValue();
- else
- {
- OSL_FAIL("Fehler im Parse Tree");
- }
-
- // set up Parameter-Column with default type, can be specified more precisely later using Describe-Parameter
-
- // save Identity (not escpecially necessary here, just for the sake of symmetry)
-
- // todo
- // OColumn* pColumn = new OFILEColumn(aParameterName,eDBType,255,0,SQL_FLAGS_NULLALLOWED);
- // rParamColumns->AddColumn(pColumn);
-
- // the value will be set just before the evaluation
-}
-
-
-//------------------------------------------------------------------
-const ORowSetValue& OOperandValue::getValue() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOperandValue::getValue" );
- return m_aValue;
-}
-
-//------------------------------------------------------------------
-OOperandConst::OOperandConst(const OSQLParseNode& rColumnRef, const rtl::OUString& aStrValue)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOperandConst::OOperandConst" );
- switch (rColumnRef.getNodeType())
- {
- case SQL_NODE_STRING:
- m_aValue = aStrValue;
- m_eDBType = DataType::VARCHAR;
- m_aValue.setBound(sal_True);
- return;
- case SQL_NODE_INTNUM:
- case SQL_NODE_APPROXNUM:
- {
- m_aValue = aStrValue.toDouble();
- m_eDBType = DataType::DOUBLE;
- m_aValue.setBound(sal_True);
- return;
- }
- default:
- break;
- }
-
- if (SQL_ISTOKEN(&rColumnRef,TRUE))
- {
- m_aValue = 1.0;
- m_eDBType = DataType::BIT;
- }
- else if (SQL_ISTOKEN(&rColumnRef,FALSE))
- {
- m_aValue = 0.0;
- m_eDBType = DataType::BIT;
- }
- else
- {
- OSL_FAIL("Parse Error");
- }
- m_aValue.setBound(sal_True);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Implementation of the operators
-
-//------------------------------------------------------------------
-sal_uInt16 OOperator::getRequestedOperands() const {return 2;}
-
-//------------------------------------------------------------------
-sal_Bool OBoolOperator::operate(const OOperand*, const OOperand*) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OBoolOperator::operate" );
- return sal_False;
-}
-
-
-//------------------------------------------------------------------
-void OBoolOperator::Exec(OCodeStack& rCodeStack)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OBoolOperator::Exec" );
- OOperand *pRight = rCodeStack.top();
- rCodeStack.pop();
- OOperand *pLeft = rCodeStack.top();
- rCodeStack.pop();
-
- rCodeStack.push(new OOperandResultBOOL(operate(pLeft, pRight)));
- if (IS_TYPE(OOperandResult,pLeft))
- delete pLeft;
- if (IS_TYPE(OOperandResult,pRight))
- delete pRight;
-}
-//------------------------------------------------------------------
-sal_Bool OOp_NOT::operate(const OOperand* pLeft, const OOperand* ) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_AND::operate" );
- return !pLeft->isValid();
-}
-//------------------------------------------------------------------
-void OOp_NOT::Exec(OCodeStack& rCodeStack)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_ISNULL::Exec" );
- OOperand* pOperand = rCodeStack.top();
- rCodeStack.pop();
-
- rCodeStack.push(new OOperandResultBOOL(operate(pOperand)));
- if (IS_TYPE(OOperandResult,pOperand))
- delete pOperand;
-}
-//------------------------------------------------------------------
-sal_uInt16 OOp_NOT::getRequestedOperands() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_NOT::getRequestedOperands" );
- return 1;
-}
-
-//------------------------------------------------------------------
-sal_Bool OOp_AND::operate(const OOperand* pLeft, const OOperand* pRight) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_AND::operate" );
- return pLeft->isValid() && pRight->isValid();
-}
-
-//------------------------------------------------------------------
-sal_Bool OOp_OR::operate(const OOperand* pLeft, const OOperand* pRight) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_OR::operate" );
- return pLeft->isValid() || pRight->isValid();
-}
-
-//------------------------------------------------------------------
-sal_uInt16 OOp_ISNULL::getRequestedOperands() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_ISNULL::getRequestedOperands" );
- return 1;
-}
-
-//------------------------------------------------------------------
-void OOp_ISNULL::Exec(OCodeStack& rCodeStack)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_ISNULL::Exec" );
- OOperand* pOperand = rCodeStack.top();
- rCodeStack.pop();
-
- rCodeStack.push(new OOperandResultBOOL(operate(pOperand)));
- if (IS_TYPE(OOperandResult,pOperand))
- delete pOperand;
-}
-
-//------------------------------------------------------------------
-sal_Bool OOp_ISNULL::operate(const OOperand* pOperand, const OOperand*) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_ISNULL::operate" );
- return pOperand->getValue().isNull();
-}
-
-//------------------------------------------------------------------
-sal_Bool OOp_ISNOTNULL::operate(const OOperand* pOperand, const OOperand*) const
-{
- return !OOp_ISNULL::operate(pOperand);
-}
-
-//------------------------------------------------------------------
-sal_Bool OOp_LIKE::operate(const OOperand* pLeft, const OOperand* pRight) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_ISNULL::operate" );
- sal_Bool bMatch;
- ORowSetValue aLH(pLeft->getValue());
- ORowSetValue aRH(pRight->getValue());
-
- if (aLH.isNull() || aRH.isNull())
- bMatch = sal_False;
- else
- {
- bMatch = match(aRH.getString(), aLH.getString(), cEscape);
- }
- return bMatch;
-}
-
-//------------------------------------------------------------------
-sal_Bool OOp_NOTLIKE::operate(const OOperand* pLeft, const OOperand* pRight) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_NOTLIKE::operate" );
- return !OOp_LIKE::operate(pLeft, pRight);
-}
-
-//------------------------------------------------------------------
-sal_Bool OOp_COMPARE::operate(const OOperand* pLeft, const OOperand* pRight) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_COMPARE::operate" );
- ORowSetValue aLH(pLeft->getValue());
- ORowSetValue aRH(pRight->getValue());
-
- if (aLH.isNull() || aRH.isNull()) // if (!aLH.getValue() || !aRH.getValue())
- return sal_False;
-
- sal_Bool bResult = sal_False;
- sal_Int32 eDBType = pLeft->getDBType();
-
- // Comparison (depending on Data-type):
- switch (eDBType)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- {
- rtl::OUString sLH = aLH, sRH = aRH;
- sal_Int32 nRes = rtl_ustr_compareIgnoreAsciiCase_WithLength
- (
- sLH.pData->buffer,
- sLH.pData->length,
- sRH.pData->buffer,
- sRH.pData->length );
- switch(aPredicateType)
- {
- case SQLFilterOperator::EQUAL: bResult = (nRes == 0); break;
- case SQLFilterOperator::NOT_EQUAL: bResult = (nRes != 0); break;
- case SQLFilterOperator::LESS: bResult = (nRes < 0); break;
- case SQLFilterOperator::LESS_EQUAL: bResult = (nRes <= 0); break;
- case SQLFilterOperator::GREATER: bResult = (nRes > 0); break;
- case SQLFilterOperator::GREATER_EQUAL: bResult = (nRes >= 0); break;
- default: bResult = sal_False;
- }
- } break;
- case DataType::TINYINT:
- case DataType::SMALLINT:
- case DataType::INTEGER:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::REAL:
- case DataType::DOUBLE:
- case DataType::BIT:
- case DataType::TIMESTAMP:
- case DataType::DATE:
- case DataType::TIME:
- {
- double n = aLH ,m = aRH;
-
- switch (aPredicateType)
- {
- case SQLFilterOperator::EQUAL: bResult = (n == m); break;
- case SQLFilterOperator::LIKE: bResult = (n == m); break;
- case SQLFilterOperator::NOT_EQUAL: bResult = (n != m); break;
- case SQLFilterOperator::NOT_LIKE: bResult = (n != m); break;
- case SQLFilterOperator::LESS: bResult = (n < m); break;
- case SQLFilterOperator::LESS_EQUAL: bResult = (n <= m); break;
- case SQLFilterOperator::GREATER: bResult = (n > m); break;
- case SQLFilterOperator::GREATER_EQUAL: bResult = (n >= m); break;
- default: bResult = sal_False;
- }
- } break;
- default:
- bResult = aLH == aRH;
- }
- return bResult;
-}
-
-//------------------------------------------------------------------
-void ONumOperator::Exec(OCodeStack& rCodeStack)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ONumOperator::Exec" );
-
- OOperand *pRight = rCodeStack.top();
- rCodeStack.pop();
- OOperand *pLeft = rCodeStack.top();
- rCodeStack.pop();
-
- rCodeStack.push(new OOperandResultNUM(operate(pLeft->getValue(), pRight->getValue())));
- if (IS_TYPE(OOperandResult,pLeft))
- delete pLeft;
- if (IS_TYPE(OOperandResult,pRight))
- delete pRight;
-}
-//------------------------------------------------------------------
-double OOp_ADD::operate(const double& fLeft,const double& fRight) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_ADD::operate" );
- return fLeft + fRight;
-}
-
-//------------------------------------------------------------------
-double OOp_SUB::operate(const double& fLeft,const double& fRight) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_SUB::operate" );
- return fLeft - fRight;
-}
-
-//------------------------------------------------------------------
-double OOp_MUL::operate(const double& fLeft,const double& fRight) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_MUL::operate" );
- return fLeft * fRight;
-}
-
-//------------------------------------------------------------------
-double OOp_DIV::operate(const double& fLeft,const double& fRight) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOp_DIV::operate" );
- return fLeft / fRight;
-}
-// -----------------------------------------------------------------------------
-OEvaluateSet* OOperandAttr::preProcess(OBoolOperator* /*pOp*/, OOperand* /*pRight*/)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OOperandAttr::preProcess" );
- return NULL;
-}
-//------------------------------------------------------------------
-void ONthOperator::Exec(OCodeStack& rCodeStack)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "ONthOperator::Exec" );
- ::std::vector<ORowSetValue> aValues;
- ::std::vector<OOperand*> aOperands;
- OOperand* pOperand;
- do
- {
- OSL_ENSURE(!rCodeStack.empty(),"Stack must be none empty!");
- pOperand = rCodeStack.top();
- rCodeStack.pop();
- if ( !IS_TYPE(OStopOperand,pOperand) )
- aValues.push_back( pOperand->getValue() );
- aOperands.push_back( pOperand );
- }
- while ( !IS_TYPE(OStopOperand,pOperand) );
-
- rCodeStack.push(new OOperandResult(operate(aValues)));
-
- ::std::vector<OOperand*>::iterator aIter = aOperands.begin();
- ::std::vector<OOperand*>::iterator aEnd = aOperands.end();
- for (; aIter != aEnd; ++aIter)
- {
- if (IS_TYPE(OOperandResult,*aIter))
- delete *aIter;
- }
-}
-//------------------------------------------------------------------
-void OBinaryOperator::Exec(OCodeStack& rCodeStack)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OBinaryOperator::Exec" );
- OOperand *pRight = rCodeStack.top();
- rCodeStack.pop();
- OOperand *pLeft = rCodeStack.top();
- rCodeStack.pop();
-
- if ( !rCodeStack.empty() && IS_TYPE(OStopOperand,rCodeStack.top()) )
- rCodeStack.pop();
-
- rCodeStack.push(new OOperandResult(operate(pLeft->getValue(),pRight->getValue())));
- if (IS_TYPE(OOperandResult,pRight))
- delete pRight;
- if (IS_TYPE(OOperandResult,pLeft))
- delete pLeft;
-}
-//------------------------------------------------------------------
-void OUnaryOperator::Exec(OCodeStack& rCodeStack)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OUnaryOperator::Exec" );
- OSL_ENSURE(!rCodeStack.empty(),"Stack is empty!");
- OOperand* pOperand = rCodeStack.top();
- rCodeStack.pop();
-
- rCodeStack.push(new OOperandResult(operate(pOperand->getValue())));
- if (IS_TYPE(OOperandResult,pOperand))
- delete pOperand;
-}
-// -----------------------------------------------------------------------------
-sal_uInt16 OUnaryOperator::getRequestedOperands() const {return 1;}
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
deleted file mode 100644
index fd7ce73c93..0000000000
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ /dev/null
@@ -1,925 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "file/fcomp.hxx"
-#include <tools/debug.hxx>
-#include "TConnection.hxx"
-#include "connectivity/sqlparse.hxx"
-#include "file/fanalyzer.hxx"
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/util/DateTime.hpp>
-#include <com/sun/star/util/Date.hpp>
-#include <com/sun/star/util/Time.hpp>
-#include "connectivity/dbexception.hxx"
-#include "connectivity/dbconversion.hxx"
-#include <com/sun/star/sdb/SQLFilterOperator.hpp>
-#include "resource/file_res.hrc"
-#include "file/FStringFunctions.hxx"
-#include "file/FDateFunctions.hxx"
-#include "file/FNumericFunctions.hxx"
-#include "file/FConnection.hxx"
-#include <com/sun/star/sdb/SQLFilterOperator.hpp>
-
-using namespace connectivity;
-using namespace connectivity::file;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdb;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
-
-DBG_NAME(OPredicateCompiler)
-//------------------------------------------------------------------
-OPredicateCompiler::OPredicateCompiler(OSQLAnalyzer* pAnalyzer)//,OCursor& rCurs)
- : m_pAnalyzer(pAnalyzer)
- , m_nParamCounter(0)
- , m_bORCondition(sal_False)
-{
- DBG_CTOR(OPredicateCompiler,NULL);
-}
-
-//------------------------------------------------------------------
-OPredicateCompiler::~OPredicateCompiler()
-{
- Clean();
- DBG_DTOR(OPredicateCompiler,NULL);
-}
-// -----------------------------------------------------------------------------
-void OPredicateCompiler::dispose()
-{
- Clean();
- m_orgColumns = NULL;
-m_xIndexes.clear();
-}
-
-void OPredicateCompiler::start(OSQLParseNode* pSQLParseNode)
-{
- if (!pSQLParseNode)
- return;
-
- m_nParamCounter = 0;
- // analyse Parse Tree (depending on Statement-type)
- // and set pointer on WHERE-clause:
- OSQLParseNode * pWhereClause = NULL;
- OSQLParseNode * pOrderbyClause = NULL;
-
- if (SQL_ISRULE(pSQLParseNode,select_statement))
- {
- DBG_ASSERT(pSQLParseNode->count() >= 4,"OFILECursor: Fehler im Parse Tree");
-
- OSQLParseNode * pTableExp = pSQLParseNode->getChild(3);
- DBG_ASSERT(pTableExp != NULL,"Fehler im Parse Tree");
- DBG_ASSERT(SQL_ISRULE(pTableExp,table_exp)," Fehler im Parse Tree");
- DBG_ASSERT(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"Fehler im Parse Tree");
-
- // check that we don't use anything other than count(*) as function
- OSQLParseNode* pSelection = pSQLParseNode->getChild(2);
- if ( SQL_ISRULE(pSelection,scalar_exp_commalist) )
- {
- for (sal_uInt32 i = 0; i < pSelection->count(); i++)
- {
- OSQLParseNode *pColumnRef = pSelection->getChild(i)->getChild(0);
- if ( SQL_ISRULE(pColumnRef,general_set_fct) && pColumnRef->count() != 4 )
- {
- m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_COMPLEX_COUNT,NULL);
- }
- }
- }
-
-
- pWhereClause = pTableExp->getChild(1);
- pOrderbyClause = pTableExp->getChild(ORDER_BY_CHILD_POS);
- (void)pOrderbyClause;
- }
- else if (SQL_ISRULE(pSQLParseNode,update_statement_searched))
- {
- DBG_ASSERT(pSQLParseNode->count() == 5,"OFILECursor: Fehler im Parse Tree");
- pWhereClause = pSQLParseNode->getChild(4);
- }
- else if (SQL_ISRULE(pSQLParseNode,delete_statement_searched))
- {
- DBG_ASSERT(pSQLParseNode->count() == 4,"Fehler im Parse Tree");
- pWhereClause = pSQLParseNode->getChild(3);
- }
- else
- // Other Statement. no selection-criteria
- return;
-
- if (SQL_ISRULE(pWhereClause,where_clause))
- {
- // a where-clause is not allowed to be empty:
- DBG_ASSERT(pWhereClause->count() == 2,"OFILECursor: Fehler im Parse Tree");
-
- OSQLParseNode * pComparisonPredicate = pWhereClause->getChild(1);
- DBG_ASSERT(pComparisonPredicate != NULL,"OFILECursor: Fehler im Parse Tree");
-
- execute( pComparisonPredicate );
- }
- else
- {
- // The where-clause is optionally in the majority of cases, i.e. it might be an "optional-where-clause".
- DBG_ASSERT(SQL_ISRULE(pWhereClause,opt_where_clause),"OPredicateCompiler: Fehler im Parse Tree");
- }
-}
-
-//------------------------------------------------------------------
-OOperand* OPredicateCompiler::execute(OSQLParseNode* pPredicateNode)
-{
- OOperand* pOperand = NULL;
- if (pPredicateNode->count() == 3 && // Expression is bracketed
- SQL_ISPUNCTUATION(pPredicateNode->getChild(0),"(") &&
- SQL_ISPUNCTUATION(pPredicateNode->getChild(2),")"))
- {
- execute(pPredicateNode->getChild(1));
- }
- else if ((SQL_ISRULE(pPredicateNode,search_condition) || (SQL_ISRULE(pPredicateNode,boolean_term)))
- && // AND/OR-linkage:
- pPredicateNode->count() == 3)
- {
- execute(pPredicateNode->getChild(0)); // process the left branch
- execute(pPredicateNode->getChild(2)); // process the right branch
-
- if (SQL_ISTOKEN(pPredicateNode->getChild(1),OR)) // OR-Operator
- {
- m_aCodeList.push_back(new OOp_OR());
- m_bORCondition = sal_True;
- }
- else if (SQL_ISTOKEN(pPredicateNode->getChild(1),AND)) // AND-Operator
- m_aCodeList.push_back(new OOp_AND());
- else
- {
- OSL_FAIL("OPredicateCompiler: Fehler im Parse Tree");
- }
- }
- else if (SQL_ISRULE(pPredicateNode,boolean_factor))
- {
- execute(pPredicateNode->getChild(1));
- m_aCodeList.push_back(new OOp_NOT());
- }
- else if (SQL_ISRULE(pPredicateNode,comparison_predicate))
- {
- execute_COMPARE(pPredicateNode);
- }
- else if (SQL_ISRULE(pPredicateNode,like_predicate))
- {
- execute_LIKE(pPredicateNode);
- }
- else if (SQL_ISRULE(pPredicateNode,between_predicate))
- {
- execute_BETWEEN(pPredicateNode);
- }
- else if (SQL_ISRULE(pPredicateNode,test_for_null))
- {
- execute_ISNULL(pPredicateNode);
- }
- else if(SQL_ISRULE(pPredicateNode,num_value_exp))
- {
- execute(pPredicateNode->getChild(0)); // process the left branch
- execute(pPredicateNode->getChild(2)); // process the right branch
- if (SQL_ISPUNCTUATION(pPredicateNode->getChild(1),"+"))
- {
- m_aCodeList.push_back(new OOp_ADD());
- }
- else if (SQL_ISPUNCTUATION(pPredicateNode->getChild(1),"-"))
- m_aCodeList.push_back(new OOp_SUB());
- else
- {
- OSL_FAIL("OPredicateCompiler: Fehler im Parse Tree num_value_exp");
- }
- }
- else if(SQL_ISRULE(pPredicateNode,term))
- {
- execute(pPredicateNode->getChild(0)); // process the left branch
- execute(pPredicateNode->getChild(2)); // process the right branch
- if (SQL_ISPUNCTUATION(pPredicateNode->getChild(1),"*"))
- {
- m_aCodeList.push_back(new OOp_MUL());
- }
- else if (SQL_ISPUNCTUATION(pPredicateNode->getChild(1),"/"))
- m_aCodeList.push_back(new OOp_DIV());
- else
- {
- OSL_FAIL("OPredicateCompiler: Fehler im Parse Tree num_value_exp");
- }
- }
- else
- pOperand = execute_Operand(pPredicateNode); // now only simple operands will be processed
-
- return pOperand;
-}
-
-//------------------------------------------------------------------
-OOperand* OPredicateCompiler::execute_COMPARE(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
-{
- DBG_ASSERT(pPredicateNode->count() == 3,"OFILECursor: Fehler im Parse Tree");
-
- if ( !(SQL_ISRULE(pPredicateNode->getChild(0),column_ref) ||
- pPredicateNode->getChild(2)->getNodeType() == SQL_NODE_STRING ||
- pPredicateNode->getChild(2)->getNodeType() == SQL_NODE_INTNUM ||
- pPredicateNode->getChild(2)->getNodeType() == SQL_NODE_APPROXNUM ||
- SQL_ISTOKEN(pPredicateNode->getChild(2),TRUE) ||
- SQL_ISTOKEN(pPredicateNode->getChild(2),FALSE) ||
- SQL_ISRULE(pPredicateNode->getChild(2),parameter) ||
- // odbc date
- SQL_ISRULE(pPredicateNode->getChild(2),set_fct_spec) ||
- SQL_ISRULE(pPredicateNode->getChild(2),position_exp) ||
- SQL_ISRULE(pPredicateNode->getChild(2),char_substring_fct) ||
- // upper, lower etc.
- SQL_ISRULE(pPredicateNode->getChild(2),fold)) )
- {
- m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,NULL);
- return NULL;
- }
-
- sal_Int32 ePredicateType( SQLFilterOperator::EQUAL );
- OSQLParseNode *pPrec = pPredicateNode->getChild(1);
-
- if (pPrec->getNodeType() == SQL_NODE_EQUAL)
- ePredicateType = SQLFilterOperator::EQUAL;
- else if (pPrec->getNodeType() == SQL_NODE_NOTEQUAL)
- ePredicateType = SQLFilterOperator::NOT_EQUAL;
- else if (pPrec->getNodeType() == SQL_NODE_LESS)
- ePredicateType = SQLFilterOperator::LESS;
- else if (pPrec->getNodeType() == SQL_NODE_LESSEQ)
- ePredicateType = SQLFilterOperator::LESS_EQUAL;
- else if (pPrec->getNodeType() == SQL_NODE_GREATEQ)
- ePredicateType = SQLFilterOperator::GREATER_EQUAL;
- else if (pPrec->getNodeType() == SQL_NODE_GREAT)
- ePredicateType = SQLFilterOperator::GREATER;
- else
- OSL_FAIL( "OPredicateCompiler::execute_COMPARE: unexpected node type!" );
-
- execute(pPredicateNode->getChild(0));
- execute(pPredicateNode->getChild(2));
- m_aCodeList.push_back( new OOp_COMPARE(ePredicateType) );
-
- return NULL;
-}
-
-//------------------------------------------------------------------
-OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
-{
- DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
- const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
-
- sal_Unicode cEscape = L'\0';
- const bool bNotLike = pPart2->getChild(0)->isToken();
-
- OSQLParseNode* pAtom = pPart2->getChild(pPart2->count()-2);
- OSQLParseNode* pOptEscape = pPart2->getChild(pPart2->count()-1);
-
- if (!(pAtom->getNodeType() == SQL_NODE_STRING ||
- SQL_ISRULE(pAtom,parameter) ||
- // odbc date
- SQL_ISRULE(pAtom,set_fct_spec) ||
- SQL_ISRULE(pAtom,position_exp) ||
- SQL_ISRULE(pAtom,char_substring_fct) ||
- // upper, lower etc.
- SQL_ISRULE(pAtom,fold)) )
- {
- m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,NULL);
- return NULL;
- }
-
- if (pOptEscape->count() != 0)
- {
- if (pOptEscape->count() != 2)
- {
- m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_INVALID_LIKE_STRING,NULL);
- }
- OSQLParseNode *pEscNode = pOptEscape->getChild(1);
- if (pEscNode->getNodeType() != SQL_NODE_STRING)
- {
- m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_INVALID_LIKE_STRING,NULL);
- }
- else
- cEscape = pEscNode->getTokenValue().toChar();
- }
-
- execute(pPredicateNode->getChild(0));
- execute(pAtom);
-
- OBoolOperator* pOperator = bNotLike
- ? new OOp_NOTLIKE(cEscape)
- : new OOp_LIKE(cEscape);
- m_aCodeList.push_back(pOperator);
-
- return NULL;
-}
-//------------------------------------------------------------------
-OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
-{
- DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
-
- OSQLParseNode* pColumn = pPredicateNode->getChild(0);
- const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
- OSQLParseNode* p1stValue = pPart2->getChild(2);
- OSQLParseNode* p2ndtValue = pPart2->getChild(4);
-
- if (
- !(p1stValue->getNodeType() == SQL_NODE_STRING || SQL_ISRULE(p1stValue,parameter))
- && !(p2ndtValue->getNodeType() == SQL_NODE_STRING || SQL_ISRULE(p2ndtValue,parameter))
- )
- {
- m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_INVALID_BETWEEN,NULL);
- }
-
- sal_Bool bNot = SQL_ISTOKEN(pPart2->getChild(0),NOT);
-
- OOperand* pColumnOp = execute(pColumn);
- OOperand* pOb1 = execute(p1stValue);
- OBoolOperator* pOperator = new OOp_COMPARE(bNot ? SQLFilterOperator::LESS_EQUAL : SQLFilterOperator::GREATER);
- m_aCodeList.push_back(pOperator);
-
- execute(pColumn);
- OOperand* pOb2 = execute(p2ndtValue);
- pOperator = new OOp_COMPARE(bNot ? SQLFilterOperator::GREATER_EQUAL : SQLFilterOperator::LESS);
- m_aCodeList.push_back(pOperator);
-
- if ( pColumnOp && pOb1 && pOb2 )
- {
- switch(pColumnOp->getDBType())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- pOb1->setValue(pOb1->getValue().getString());
- pOb2->setValue(pOb2->getValue().getString());
- break;
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- pOb1->setValue((double)pOb1->getValue());
- pOb2->setValue((double)pOb2->getValue());
- break;
- case DataType::FLOAT:
- pOb1->setValue((float)pOb1->getValue());
- pOb2->setValue((float)pOb2->getValue());
- break;
- case DataType::DOUBLE:
- case DataType::REAL:
- pOb1->setValue((double)pOb1->getValue());
- pOb2->setValue((double)pOb2->getValue());
- break;
- case DataType::DATE:
- pOb1->setValue((Date)pOb1->getValue());
- pOb2->setValue((Date)pOb2->getValue());
- break;
- case DataType::TIME:
- pOb1->setValue((Time)pOb1->getValue());
- pOb2->setValue((Time)pOb2->getValue());
- break;
- case DataType::TIMESTAMP:
- pOb1->setValue((DateTime)pOb1->getValue());
- pOb2->setValue((DateTime)pOb2->getValue());
- break;
- }
- }
-
-
-
- OBoolOperator* pBoolOp = NULL;
- if ( bNot )
- pBoolOp = new OOp_OR();
- else
- pBoolOp = new OOp_AND();
- m_aCodeList.push_back(pBoolOp);
-
- return NULL;
-}
-//------------------------------------------------------------------
-OOperand* OPredicateCompiler::execute_ISNULL(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
-{
- DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
- const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
- DBG_ASSERT(SQL_ISTOKEN(pPart2->getChild(0),IS),"OFILECursor: Fehler im Parse Tree");
-
- sal_Int32 ePredicateType;
- if (SQL_ISTOKEN(pPart2->getChild(1),NOT))
- ePredicateType = SQLFilterOperator::NOT_SQLNULL;
- else
- ePredicateType = SQLFilterOperator::SQLNULL;
-
- execute(pPredicateNode->getChild(0));
- OBoolOperator* pOperator = (ePredicateType == SQLFilterOperator::SQLNULL) ?
- new OOp_ISNULL() : new OOp_ISNOTNULL();
- m_aCodeList.push_back(pOperator);
-
- return NULL;
-}
-//------------------------------------------------------------------
-OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
-{
- OOperand* pOperand = NULL;
-
- if (SQL_ISRULE(pPredicateNode,column_ref))
- {
- ::rtl::OUString aColumnName;
- if (pPredicateNode->count() == 1)
- {
- aColumnName = pPredicateNode->getChild(0)->getTokenValue();
- }
- else if (pPredicateNode->count() == 3)
- {
- ::rtl::OUString aTableName = pPredicateNode->getChild(0)->getTokenValue();
- if(SQL_ISRULE(pPredicateNode->getChild(2),column_val))
- aColumnName = pPredicateNode->getChild(2)->getChild(0)->getTokenValue();
- else
- aColumnName = pPredicateNode->getChild(2)->getTokenValue();
- }
-
- if(!m_orgColumns->hasByName(aColumnName))
- {
- const ::rtl::OUString sError( m_pAnalyzer->getConnection()->getResources().getResourceStringWithSubstitution(
- STR_INVALID_COLUMNNAME,
- "$columnname$", aColumnName
- ) );
- ::dbtools::throwGenericSQLException( sError, NULL );
- }
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xCol;
- try
- {
- if (m_orgColumns->getByName(aColumnName) >>= xCol)
- {
- pOperand = m_pAnalyzer->createOperandAttr(Reference< XColumnLocate>(m_orgColumns,UNO_QUERY)->findColumn(aColumnName),xCol,m_xIndexes);
- }
- else
- {// Column doesn't exist in the Result-set
- const ::rtl::OUString sError( m_pAnalyzer->getConnection()->getResources().getResourceStringWithSubstitution(
- STR_INVALID_COLUMNNAME,
- "$columnname$", aColumnName
- ) );
- ::dbtools::throwGenericSQLException( sError, NULL );
- }
- }
- catch(Exception &)
- {
- OSL_FAIL("OPredicateCompiler::execute_Operand Exception");
- }
- }
- else if (SQL_ISRULE(pPredicateNode,parameter))
- {
- pOperand = new OOperandParam(pPredicateNode, ++m_nParamCounter);
- }
- else if (pPredicateNode->getNodeType() == SQL_NODE_STRING ||
- pPredicateNode->getNodeType() == SQL_NODE_INTNUM ||
- pPredicateNode->getNodeType() == SQL_NODE_APPROXNUM ||
- pPredicateNode->getNodeType() == SQL_NODE_NAME ||
- SQL_ISTOKEN(pPredicateNode,TRUE) ||
- SQL_ISTOKEN(pPredicateNode,FALSE) ||
- SQL_ISRULE(pPredicateNode,parameter))
- {
- pOperand = new OOperandConst(*pPredicateNode, pPredicateNode->getTokenValue());
- }
- else if((pPredicateNode->count() == 2) &&
- (SQL_ISPUNCTUATION(pPredicateNode->getChild(0),"+") || SQL_ISPUNCTUATION(pPredicateNode->getChild(0),"-")) &&
- pPredicateNode->getChild(1)->getNodeType() == SQL_NODE_INTNUM)
- { // if -1 or +1 is there
- ::rtl::OUString aValue(pPredicateNode->getChild(0)->getTokenValue());
- aValue += pPredicateNode->getChild(1)->getTokenValue();
- pOperand = new OOperandConst(*pPredicateNode->getChild(1), aValue);
- }
- else if( SQL_ISRULE(pPredicateNode,set_fct_spec) && SQL_ISPUNCTUATION(pPredicateNode->getChild(0),"{") )
- {
- const OSQLParseNode* pODBCNode = pPredicateNode->getChild(1);
- const OSQLParseNode* pODBCNodeChild = pODBCNode->getChild(0);
-
- // Odbc Date or time
- if (pODBCNodeChild->getNodeType() == SQL_NODE_KEYWORD && (
- SQL_ISTOKEN(pODBCNodeChild,D) ||
- SQL_ISTOKEN(pODBCNodeChild,T) ||
- SQL_ISTOKEN(pODBCNodeChild,TS) ))
- {
- ::rtl::OUString sDateTime = pODBCNode->getChild(1)->getTokenValue();
- pOperand = new OOperandConst(*pODBCNode->getChild(1), sDateTime);
- if(SQL_ISTOKEN(pODBCNodeChild,D))
- {
- pOperand->setValue(::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDate(sDateTime)));
- }
- else if(SQL_ISTOKEN(pODBCNodeChild,T))
- {
- pOperand->setValue(::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toTime(sDateTime)));
- }
- else if(SQL_ISTOKEN(pODBCNodeChild,TS))
- {
- pOperand->setValue(::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDateTime(sDateTime)));
- }
- }
- else
- m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,NULL);
-
- }
- else if( SQL_ISRULE(pPredicateNode,fold) )
- {
- execute_Fold(pPredicateNode);
- }
- else if( SQL_ISRULE(pPredicateNode,set_fct_spec)
- || SQL_ISRULE(pPredicateNode,position_exp)
- || SQL_ISRULE(pPredicateNode,char_substring_fct)
- )
- {
- executeFunction(pPredicateNode);
- }
- else if( SQL_ISRULE(pPredicateNode,length_exp) )
- {
- executeFunction(pPredicateNode->getChild(0));
- }
- else
- {
- m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,NULL);
- }
- if (pOperand)
- m_aCodeList.push_back(pOperand);
- return pOperand;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool OPredicateInterpreter::evaluate(OCodeList& rCodeList)
-{
- static sal_Bool bResult;
-
- OCodeList::iterator aIter = rCodeList.begin();
- if (!(*aIter))
- return sal_True; // no Predicate
-
- for(;aIter != rCodeList.end();++aIter)
- {
- OOperand* pOperand = PTR_CAST(OOperand,(*aIter));
- if (pOperand)
- m_aStack.push(pOperand);
- else
- ((OOperator *)(*aIter))->Exec(m_aStack);
- }
-
- OOperand* pOperand = m_aStack.top();
- m_aStack.pop();
-
- DBG_ASSERT(m_aStack.size() == 0, "StackFehler");
- DBG_ASSERT(pOperand, "StackFehler");
-
- bResult = pOperand->isValid();
- if (IS_TYPE(OOperandResult,pOperand))
- delete pOperand;
- return bResult;
-}
-// -----------------------------------------------------------------------------
-void OPredicateInterpreter::evaluateSelection(OCodeList& rCodeList,ORowSetValueDecoratorRef& _rVal)
-{
- OCodeList::iterator aIter = rCodeList.begin();
- if (!(*aIter))
- return ; // no Predicate
-
- for(;aIter != rCodeList.end();++aIter)
- {
- OOperand* pOperand = PTR_CAST(OOperand,(*aIter));
- if (pOperand)
- m_aStack.push(pOperand);
- else
- ((OOperator *)(*aIter))->Exec(m_aStack);
- }
-
- OOperand* pOperand = m_aStack.top();
- m_aStack.pop();
-
- DBG_ASSERT(m_aStack.size() == 0, "StackFehler");
- DBG_ASSERT(pOperand, "StackFehler");
-
- (*_rVal) = pOperand->getValue();
- if (IS_TYPE(OOperandResult,pOperand))
- delete pOperand;
-}
-// -----------------------------------------------------------------------------
-OOperand* OPredicateCompiler::execute_Fold(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
-{
- DBG_ASSERT(pPredicateNode->count() >= 4,"OFILECursor: Fehler im Parse Tree");
-
- sal_Bool bUpper = SQL_ISTOKEN(pPredicateNode->getChild(0),UPPER);
-
- execute(pPredicateNode->getChild(2));
- OOperator* pOperator = NULL;
- if ( bUpper )
- pOperator = new OOp_Upper();
- else
- pOperator = new OOp_Lower();
-
- m_aCodeList.push_back(pOperator);
- return NULL;
-}
-// -----------------------------------------------------------------------------
-OOperand* OPredicateCompiler::executeFunction(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
-{
- OOperator* pOperator = NULL;
-
- OSL_ENSURE(pPredicateNode->getChild(0)->isToken(),"The first one must be the name of the function!");
- sal_Int32 nTokenId = pPredicateNode->getChild(0)->getTokenID();
- switch ( nTokenId )
- {
- case SQL_TOKEN_CHAR_LENGTH:
- case SQL_TOKEN_LENGTH:
- case SQL_TOKEN_OCTET_LENGTH:
- case SQL_TOKEN_ASCII:
- case SQL_TOKEN_LCASE:
- case SQL_TOKEN_LTRIM:
- case SQL_TOKEN_RTRIM:
- case SQL_TOKEN_SPACE:
- case SQL_TOKEN_UCASE:
- case SQL_TOKEN_ABS:
- case SQL_TOKEN_ACOS:
- case SQL_TOKEN_ASIN:
- case SQL_TOKEN_ATAN:
- case SQL_TOKEN_CEILING:
- case SQL_TOKEN_COS:
- case SQL_TOKEN_DEGREES:
- case SQL_TOKEN_EXP:
- case SQL_TOKEN_FLOOR:
- case SQL_TOKEN_LOG10:
- case SQL_TOKEN_LN:
- case SQL_TOKEN_RADIANS:
- case SQL_TOKEN_SIGN:
- case SQL_TOKEN_SIN:
- case SQL_TOKEN_SQRT:
- case SQL_TOKEN_TAN:
- case SQL_TOKEN_DAYNAME:
- case SQL_TOKEN_DAYOFMONTH:
- case SQL_TOKEN_DAYOFWEEK:
- case SQL_TOKEN_DAYOFYEAR:
- case SQL_TOKEN_HOUR:
- case SQL_TOKEN_MINUTE:
- case SQL_TOKEN_MONTH:
- case SQL_TOKEN_MONTHNAME:
- case SQL_TOKEN_QUARTER:
- case SQL_TOKEN_SECOND:
- case SQL_TOKEN_YEAR:
-
- execute(pPredicateNode->getChild(2));
-
- switch( nTokenId )
- {
- case SQL_TOKEN_CHAR_LENGTH:
- case SQL_TOKEN_LENGTH:
- case SQL_TOKEN_OCTET_LENGTH:
- pOperator = new OOp_CharLength();
- break;
- case SQL_TOKEN_ASCII:
- pOperator = new OOp_Ascii();
- break;
- case SQL_TOKEN_LCASE:
- pOperator = new OOp_Lower();
- break;
-
- case SQL_TOKEN_LTRIM:
- pOperator = new OOp_LTrim();
- break;
- case SQL_TOKEN_RTRIM:
- pOperator = new OOp_RTrim();
- break;
- case SQL_TOKEN_SPACE:
- pOperator = new OOp_Space();
- break;
- case SQL_TOKEN_UCASE:
- pOperator = new OOp_Upper();
- break;
- case SQL_TOKEN_ABS:
- pOperator = new OOp_Abs();
- break;
- case SQL_TOKEN_ACOS:
- pOperator = new OOp_ACos();
- break;
- case SQL_TOKEN_ASIN:
- pOperator = new OOp_ASin();
- break;
- case SQL_TOKEN_ATAN:
- pOperator = new OOp_ATan();
- break;
- case SQL_TOKEN_CEILING:
- pOperator = new OOp_Ceiling();
- break;
- case SQL_TOKEN_COS:
- pOperator = new OOp_Cos();
- break;
- case SQL_TOKEN_DEGREES:
- pOperator = new OOp_Degrees();
- break;
- case SQL_TOKEN_EXP:
- pOperator = new OOp_Exp();
- break;
- case SQL_TOKEN_FLOOR:
- pOperator = new OOp_Floor();
- break;
- case SQL_TOKEN_LOG10:
- pOperator = new OOp_Log10();
- break;
- case SQL_TOKEN_LN:
- pOperator = new OOp_Ln();
- break;
- case SQL_TOKEN_RADIANS:
- pOperator = new OOp_Radians();
- break;
- case SQL_TOKEN_SIGN:
- pOperator = new OOp_Sign();
- break;
- case SQL_TOKEN_SIN:
- pOperator = new OOp_Sin();
- break;
- case SQL_TOKEN_SQRT:
- pOperator = new OOp_Sqrt();
- break;
- case SQL_TOKEN_TAN:
- pOperator = new OOp_Tan();
- break;
- case SQL_TOKEN_DAYOFWEEK:
- pOperator = new OOp_DayOfWeek();
- break;
- case SQL_TOKEN_DAYOFMONTH:
- pOperator = new OOp_DayOfMonth();
- break;
- case SQL_TOKEN_DAYOFYEAR:
- pOperator = new OOp_DayOfYear();
- break;
- case SQL_TOKEN_MONTH:
- pOperator = new OOp_Month();
- break;
- case SQL_TOKEN_DAYNAME:
- pOperator = new OOp_DayName();
- break;
- case SQL_TOKEN_MONTHNAME:
- pOperator = new OOp_MonthName();
- break;
- case SQL_TOKEN_QUARTER:
- pOperator = new OOp_Quarter();
- break;
- case SQL_TOKEN_YEAR:
- pOperator = new OOp_Year();
- break;
- case SQL_TOKEN_HOUR:
- pOperator = new OOp_Hour();
- break;
- case SQL_TOKEN_MINUTE:
- pOperator = new OOp_Minute();
- break;
- case SQL_TOKEN_SECOND:
- pOperator = new OOp_Second();
- break;
- default:
- OSL_FAIL("Error in switch!");
- }
- break;
- case SQL_TOKEN_CHAR:
- case SQL_TOKEN_CONCAT:
- case SQL_TOKEN_INSERT:
- case SQL_TOKEN_LEFT:
- case SQL_TOKEN_LOCATE:
- case SQL_TOKEN_LOCATE_2:
- case SQL_TOKEN_REPEAT:
- case SQL_TOKEN_REPLACE:
- case SQL_TOKEN_RIGHT:
- case SQL_TOKEN_MOD:
- case SQL_TOKEN_ROUND:
- case SQL_TOKEN_LOGF:
- case SQL_TOKEN_LOG:
- case SQL_TOKEN_POWER:
- case SQL_TOKEN_ATAN2:
- case SQL_TOKEN_PI:
- case SQL_TOKEN_CURDATE:
- case SQL_TOKEN_CURTIME:
- case SQL_TOKEN_NOW:
- case SQL_TOKEN_WEEK:
- {
- m_aCodeList.push_back(new OStopOperand);
- OSQLParseNode* pList = pPredicateNode->getChild(2);
- for (sal_uInt32 i=0; i < pList->count(); ++i)
- execute(pList->getChild(i));
-
- switch( nTokenId )
- {
- case SQL_TOKEN_CHAR:
- pOperator = new OOp_Char();
- break;
- case SQL_TOKEN_CONCAT:
- pOperator = new OOp_Concat();
- break;
- case SQL_TOKEN_INSERT:
- pOperator = new OOp_Insert();
- break;
- case SQL_TOKEN_LEFT:
- pOperator = new OOp_Left();
- break;
- case SQL_TOKEN_LOCATE:
- case SQL_TOKEN_LOCATE_2:
- pOperator = new OOp_Locate();
- break;
- case SQL_TOKEN_REPEAT:
- pOperator = new OOp_Repeat();
- break;
- case SQL_TOKEN_REPLACE:
- pOperator = new OOp_Replace();
- break;
- case SQL_TOKEN_RIGHT:
- pOperator = new OOp_Right();
- break;
- case SQL_TOKEN_MOD:
- pOperator = new OOp_Mod();
- break;
- case SQL_TOKEN_ROUND:
- pOperator = new OOp_Round();
- break;
- case SQL_TOKEN_LOGF:
- case SQL_TOKEN_LOG:
- pOperator = new OOp_Log();
- break;
- case SQL_TOKEN_POWER:
- pOperator = new OOp_Pow();
- break;
- case SQL_TOKEN_ATAN2:
- pOperator = new OOp_ATan2();
- break;
- case SQL_TOKEN_PI:
- pOperator = new OOp_Pi();
- break;
- case SQL_TOKEN_CURDATE:
- pOperator = new OOp_CurDate();
- break;
- case SQL_TOKEN_CURTIME:
- pOperator = new OOp_CurTime();
- break;
- case SQL_TOKEN_NOW:
- pOperator = new OOp_Now();
- break;
- case SQL_TOKEN_WEEK:
- pOperator = new OOp_Week();
- break;
- default:
- OSL_FAIL("Error in switch!");
- }
- }
- break;
-
- case SQL_TOKEN_SUBSTRING:
- m_aCodeList.push_back(new OStopOperand);
- if ( pPredicateNode->count() == 4 ) //char_substring_fct
- {
- OSQLParseNode* pList = pPredicateNode->getChild(2);
- for (sal_uInt32 i=0; i < pList->count(); ++i)
- execute(pList->getChild(i));
- }
- else
- {
- execute(pPredicateNode->getChild(2));
- execute(pPredicateNode->getChild(4));
- execute(pPredicateNode->getChild(5)->getChild(1));
- }
- pOperator = new OOp_SubString();
- break;
-
- case SQL_TOKEN_POSITION:
- m_aCodeList.push_back(new OStopOperand);
- if ( pPredicateNode->count() == 4 ) //position_exp
- {
- OSQLParseNode* pList = pPredicateNode->getChild(2);
- for (sal_uInt32 i=0; i < pList->count(); ++i)
- execute(pList->getChild(i));
- }
- else
- {
- execute(pPredicateNode->getChild(2));
- execute(pPredicateNode->getChild(4));
- }
- pOperator = new OOp_Locate();
- break;
- default:
- m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_FUNCTION_NOT_SUPPORTED,NULL);
- }
-
- m_aCodeList.push_back(pOperator);
- return NULL;
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/file.xml b/connectivity/source/drivers/file/file.xml
deleted file mode 100755
index b3b681c305..0000000000
--- a/connectivity/source/drivers/file/file.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description>
- <module-name>file</module-name>
- <component-description>
- <author>Ocke Jannsen</author>
- <name>com.sun.star.sdbc.driver.file.Driver</name>
- <description>This library implements basic functionallity for file-base drivers.
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service>com.sun.star.sdbc.Driver</supported-service>
- <supported-service>com.sun.star.sdbcx.Driver</supported-service>
- <service-dependency> ... </service-dependency>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>osl</runtime-module-dependency>
- <runtime-module-dependency>svtools-light1</runtime-module-dependency>
- <runtime-module-dependency>svtools</runtime-module-dependency>
- <runtime-module-dependency>ucbhelper</runtime-module-dependency>
- <runtime-module-dependency>dbtools</runtime-module-dependency>
- <runtime-module-dependency>unotools</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
diff --git a/connectivity/source/drivers/file/makefile.mk b/connectivity/source/drivers/file/makefile.mk
deleted file mode 100755
index 41f061de80..0000000000
--- a/connectivity/source/drivers/file/makefile.mk
+++ /dev/null
@@ -1,108 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=file
-
-USE_DEFFILE=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/version.mk
-
-CDEFS += -DOOO_DLLIMPLEMENTATION_FILE
-
-# --- Files -------------------------------------
-EXCEPTIONSFILES=\
- $(SLO)$/FCatalog.obj \
- $(SLO)$/FColumns.obj \
- $(SLO)$/FConnection.obj \
- $(SLO)$/FDatabaseMetaData.obj \
- $(SLO)$/FDateFunctions.obj \
- $(SLO)$/FDriver.obj \
- $(SLO)$/FNoException.obj \
- $(SLO)$/FNumericFunctions.obj \
- $(SLO)$/FPreparedStatement.obj \
- $(SLO)$/FResultSet.obj \
- $(SLO)$/FResultSetMetaData.obj \
- $(SLO)$/FStatement.obj \
- $(SLO)$/FStringFunctions.obj \
- $(SLO)$/FTable.obj \
- $(SLO)$/FTables.obj \
- $(SLO)$/fanalyzer.obj \
- $(SLO)$/fcode.obj \
- $(SLO)$/fcomp.obj
-
-SLOFILES=\
- $(EXCEPTIONSFILES) \
- $(SLO)$/quotedstring.obj
-
-
-# --- Library -----------------------------------
-SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SVLLIB) \
- $(TOOLSLIB) \
- $(UCBHELPERLIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(DBTOOLSLIB) \
- $(UNOTOOLSLIB) \
- $(COMPHELPERLIB)
-
-SHL1DEPN=
-SHL1IMPLIB= i$(TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt \
- $(SLB)$/$(TARGET).lib
-DEFLIB1NAME=$(TARGET)
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
-
-# --- filter file ------------------------------
-
-$(MISC)$/$(SHL1TARGET).flt: makefile.mk
- @echo ------------------------------
- @echo _TI >$@
- @echo _real >>$@
-
diff --git a/connectivity/source/drivers/file/quotedstring.cxx b/connectivity/source/drivers/file/quotedstring.cxx
deleted file mode 100644
index c71afa3d41..0000000000
--- a/connectivity/source/drivers/file/quotedstring.cxx
+++ /dev/null
@@ -1,166 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "file/quotedstring.hxx"
-#include <rtl/logfile.hxx>
-
-namespace connectivity
-{
- //==================================================================
- //= QuotedTokenizedString
- //==================================================================
- //------------------------------------------------------------------
- xub_StrLen QuotedTokenizedString::GetTokenCount( sal_Unicode cTok, sal_Unicode cStrDel ) const
- {
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "QuotedTokenizedString::GetTokenCount" );
- const xub_StrLen nLen = m_sString.Len();
- if ( !nLen )
- return 0;
-
- xub_StrLen nTokCount = 1;
- sal_Bool bStart = sal_True; // Are we on the first character in the Token?
- sal_Bool bInString = sal_False; // Are we WITHIN a (cStrDel delimited) String?
-
- // Search for String-end after the first not matching character
- for( xub_StrLen i = 0; i < nLen; ++i )
- {
- const sal_Unicode cChar = m_sString.GetChar(i);
- if (bStart)
- {
- bStart = sal_False;
- // First character a String-Delimiter?
- if ( cChar == cStrDel )
- {
- bInString = sal_True; // then we are now WITHIN the string!
- continue; // skip this character!
- }
- }
-
- if (bInString)
- {
- // when now the String-Delimiter-character occurs ...
- if ( cChar == cStrDel )
- {
- if ((i+1 < nLen) && (m_sString.GetChar(i+1) == cStrDel))
- {
- // double String-Delimter-character:
- ++i; // no string-end, skip next character.
- }
- else
- {
- // String-End
- bInString = sal_False;
- }
- }
- } // if (bInString)
- else
- {
- // does the Token-character match, then raise TokCount
- if ( cChar == cTok )
- {
- ++nTokCount;
- bStart = sal_True;
- }
- }
- }
- //OSL_TRACE("QuotedTokenizedString::nTokCount = %d\n", ((OUtoCStr(::rtl::OUString(nTokCount))) ? (OUtoCStr(::rtl::OUString(nTokCount))):("NULL")) );
-
- return nTokCount;
- }
-
- //------------------------------------------------------------------
- void QuotedTokenizedString::GetTokenSpecial( String& _rStr,xub_StrLen& nStartPos, sal_Unicode cTok, sal_Unicode cStrDel ) const
- {
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "QuotedTokenizedString::GetTokenCount" );
- _rStr.Erase();
- const xub_StrLen nLen = m_sString.Len();
- if ( nLen )
- {
- sal_Bool bInString = (nStartPos < nLen) && (m_sString.GetChar(nStartPos) == cStrDel); // are we WITHIN a (cStrDel delimited) String?
-
- // First character a String-Delimiter?
- if (bInString )
- ++nStartPos; // skip this character!
- if ( nStartPos >= nLen )
- return;
-
- sal_Unicode* pData = _rStr.AllocBuffer( nLen - nStartPos + 1 );
- const sal_Unicode* pStart = pData;
- // Search until end of string for the first not matching character
- for( xub_StrLen i = nStartPos; i < nLen; ++i )
- {
- const sal_Unicode cChar = m_sString.GetChar(i);
- if (bInString)
- {
- // when now the String-Delimiter-character occurs ...
- if ( cChar == cStrDel )
- {
- if ((i+1 < nLen) && (m_sString.GetChar(i+1) == cStrDel))
- {
- // double String Delimiter-character
- // no end of string, skip next character.
- ++i;
- *pData++ = m_sString.GetChar(i); // character belongs to Result-String
- }
- else
- {
- //end of String
- bInString = sal_False;
- *pData = 0;
- }
- }
- else
- {
- *pData++ = cChar; // character belongs to Result-String
- }
-
- }
- else
- {
- // does the Token-sign match, then raise nTok
- if ( cChar == cTok )
- {
- // premature break of loop possible, because we found what we were looking for
- nStartPos = i+1;
- break;
- }
- else
- {
- *pData++ = cChar; // character belongs to Result-String
- }
- }
- } // for( xub_StrLen i = nStartPos; i < nLen; ++i )
- *pData = 0;
- _rStr.ReleaseBufferAccess(xub_StrLen(pData - pStart));
- }
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/flat/ECatalog.cxx b/connectivity/source/drivers/flat/ECatalog.cxx
deleted file mode 100644
index f82eb7de00..0000000000
--- a/connectivity/source/drivers/flat/ECatalog.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include "flat/ECatalog.hxx"
-
-#include "flat/EConnection.hxx"
-#include "flat/ETables.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-// -------------------------------------------------------------------------
-using namespace connectivity::flat;
-// -------------------------------------------------------------------------
-OFlatCatalog::OFlatCatalog(OFlatConnection* _pCon) : file::OFileCatalog(_pCon)
-{
-}
-// -------------------------------------------------------------------------
-void OFlatCatalog::refreshTables()
-{
- TStringVector aVector;
- Sequence< ::rtl::OUString > aTypes;
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),aTypes);
-
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- aVector.push_back(xRow->getString(3));
- }
- if(m_pTables)
- m_pTables->reFill(aVector);
- else
- m_pTables = new OFlatTables(m_xMetaData,*this,m_aMutex,aVector);
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/flat/EColumns.cxx b/connectivity/source/drivers/flat/EColumns.cxx
deleted file mode 100644
index 7fdbeca25c..0000000000
--- a/connectivity/source/drivers/flat/EColumns.cxx
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "flat/EColumns.hxx"
-#include "flat/ETable.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-
-using namespace connectivity::flat;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-
-sdbcx::ObjectType OFlatColumns::createObject(const ::rtl::OUString& _rName)
-{
-
- OFlatTable* pTable = (OFlatTable*)m_pTable;
- ::rtl::Reference<OSQLColumns> aCols = pTable->getTableColumns();
- OSQLColumns::Vector::const_iterator aIter = find(aCols->get().begin(),aCols->get().end(),_rName,::comphelper::UStringMixEqual(isCaseSensitive()));
- sdbcx::ObjectType xRet;
- if(aIter != aCols->get().end())
- xRet = sdbcx::ObjectType(*aIter,UNO_QUERY);
- return xRet;
-}
-// -------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/flat/EConnection.cxx b/connectivity/source/drivers/flat/EConnection.cxx
deleted file mode 100644
index fa1abf048a..0000000000
--- a/connectivity/source/drivers/flat/EConnection.cxx
+++ /dev/null
@@ -1,185 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "flat/EConnection.hxx"
-#include "flat/EDatabaseMetaData.hxx"
-#include "flat/ECatalog.hxx"
-#include "flat/EDriver.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <tools/urlobj.hxx>
-#include "flat/EPreparedStatement.hxx"
-#include "flat/EStatement.hxx"
-#include <comphelper/extract.hxx>
-#include <connectivity/dbexception.hxx>
-
-using namespace connectivity::flat;
-using namespace connectivity::file;
-
-typedef connectivity::file::OConnection OConnection_B;
-
-//------------------------------------------------------------------------------
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-
-// --------------------------------------------------------------------------------
-OFlatConnection::OFlatConnection(ODriver* _pDriver) : OConnection(_pDriver)
- ,m_nMaxRowsToScan(50)
- ,m_bHeaderLine(sal_True)
- ,m_cFieldDelimiter(';')
- ,m_cStringDelimiter('"')
- ,m_cDecimalDelimiter(',')
- ,m_cThousandDelimiter('.')
-{
-}
-//-----------------------------------------------------------------------------
-OFlatConnection::~OFlatConnection()
-{
-}
-
-// XServiceInfo
-// --------------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OFlatConnection, "com.sun.star.sdbc.drivers.flat.Connection", "com.sun.star.sdbc.Connection")
-
-//-----------------------------------------------------------------------------
-void OFlatConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyValue >& info) throw(SQLException)
-{
- osl_incrementInterlockedCount( &m_refCount );
-
- ::rtl::OUString aExt;
- const PropertyValue *pBegin = info.getConstArray();
- const PropertyValue *pEnd = pBegin + info.getLength();
- for(;pBegin != pEnd;++pBegin)
- {
- if(!pBegin->Name.compareToAscii("HeaderLine"))
- OSL_VERIFY( pBegin->Value >>= m_bHeaderLine );
- else if(!pBegin->Name.compareToAscii("FieldDelimiter"))
- {
- ::rtl::OUString aVal;
- OSL_VERIFY( pBegin->Value >>= aVal );
- m_cFieldDelimiter = aVal.toChar();
- }
- else if(!pBegin->Name.compareToAscii("StringDelimiter"))
- {
- ::rtl::OUString aVal;
- OSL_VERIFY( pBegin->Value >>= aVal );
- m_cStringDelimiter = aVal.toChar();
- }
- else if(!pBegin->Name.compareToAscii("DecimalDelimiter"))
- {
- ::rtl::OUString aVal;
- OSL_VERIFY( pBegin->Value >>= aVal );
- m_cDecimalDelimiter = aVal.toChar();
- }
- else if(!pBegin->Name.compareToAscii("ThousandDelimiter"))
- {
- ::rtl::OUString aVal;
- OSL_VERIFY( pBegin->Value >>= aVal );
- m_cThousandDelimiter = aVal.toChar();
- }
- else if ( !pBegin->Name.compareToAscii("MaxRowScan") )
- {
- pBegin->Value >>= m_nMaxRowsToScan;
- }
- }
-
- osl_decrementInterlockedCount( &m_refCount );
- OConnection::construct(url,info);
- m_bShowDeleted = sal_True; // we do not supported rows for this type
-}
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL OFlatConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_B::rBHelper.bDisposed);
-
-
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if(!xMetaData.is())
- {
- xMetaData = new OFlatDatabaseMetaData(this);
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-//------------------------------------------------------------------------------
-::com::sun::star::uno::Reference< XTablesSupplier > OFlatConnection::createCatalog()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- Reference< XTablesSupplier > xTab = m_xCatalog;
- if(!xTab.is())
- {
- OFlatCatalog *pCat = new OFlatCatalog(this);
- xTab = pCat;
- m_xCatalog = xTab;
- }
- return xTab;
-}
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL OFlatConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_B::rBHelper.bDisposed);
-
- OFlatStatement* pStmt = new OFlatStatement(this);
-
- Reference< XStatement > xStmt = pStmt;
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return xStmt;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OFlatConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_B::rBHelper.bDisposed);
-
-
- OFlatPreparedStatement* pStmt = new OFlatPreparedStatement(this);
- Reference< XPreparedStatement > xStmt = pStmt;
- pStmt->construct(sql);
-
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return xStmt;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OFlatConnection::prepareCall( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_B::rBHelper.bDisposed);
-
- ::dbtools::throwFeatureNotImplementedException( "XConnection::prepareCall", *this );
- return NULL;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/flat/EDatabaseMetaData.cxx b/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
deleted file mode 100644
index 85d65153d4..0000000000
--- a/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
+++ /dev/null
@@ -1,268 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include "flat/EDatabaseMetaData.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/beans/XFastPropertySet.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
-#include <tools/urlobj.hxx>
-#include "FDatabaseMetaDataResultSet.hxx"
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include <rtl/logfile.hxx>
-
-using namespace ::comphelper;
-
-using namespace connectivity;
-using namespace connectivity::flat;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-
-
-OFlatDatabaseMetaData::OFlatDatabaseMetaData(::connectivity::file::OConnection* _pCon) :ODatabaseMetaData(_pCon)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatDatabaseMetaData::OFlatDatabaseMetaData" );
-}
-// -------------------------------------------------------------------------
-OFlatDatabaseMetaData::~OFlatDatabaseMetaData()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatDatabaseMetaData::~OFlatDatabaseMetaData" );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > OFlatDatabaseMetaData::impl_getTypeInfo_throw( )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatDatabaseMetaData::impl_getTypeInfo_throw" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
- Reference< XResultSet > xRef = pResult;
-
- static ODatabaseMetaDataResultSet::ORows aRows;
- if(aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow;
-
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CHAR"))));
- aRow.push_back(new ORowSetValueDecorator(DataType::CHAR));
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)254));
- aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnValue::NULLABLE));
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnSearch::CHAR));
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)10));
-
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR")));
- aRow[2] = new ORowSetValueDecorator(DataType::VARCHAR);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRows.push_back(aRow);
-
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LONGVARCHAR")));
- aRow[2] = new ORowSetValueDecorator(DataType::LONGVARCHAR);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)65535);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATE")));
- aRow[2] = new ORowSetValueDecorator(DataType::DATE);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)10);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIME")));
- aRow[2] = new ORowSetValueDecorator(DataType::TIME);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)8);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP")));
- aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)19);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BOOL")));
- aRow[2] = new ORowSetValueDecorator(DataType::BIT);
- aRow[3] = ODatabaseMetaDataResultSet::get1Value();
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DECIMAL")));
- aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
- aRow[15] = new ORowSetValueDecorator((sal_Int32)15);
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DOUBLE")));
- aRow[2] = new ORowSetValueDecorator(DataType::DOUBLE);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
- aRow[15] = ODatabaseMetaDataResultSet::get0Value();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NUMERIC")));
- aRow[2] = new ORowSetValueDecorator(DataType::NUMERIC);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
- aRow[15] = new ORowSetValueDecorator((sal_Int32)20);
- aRows.push_back(aRow);
- }
-
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL OFlatDatabaseMetaData::getColumns(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& tableNamePattern,
- const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatDatabaseMetaData::getColumns" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- Reference< XTablesSupplier > xTables = m_pConnection->createCatalog();
- if(!xTables.is())
- throw SQLException();
-
- Reference< XNameAccess> xNames = xTables->getTables();
- if(!xNames.is())
- throw SQLException();
-
- ODatabaseMetaDataResultSet::ORows aRows;
- ODatabaseMetaDataResultSet::ORow aRow(19);
- aRow[10] = new ORowSetValueDecorator((sal_Int32)10);
- Sequence< ::rtl::OUString> aTabNames(xNames->getElementNames());
- const ::rtl::OUString* pTabBegin = aTabNames.getConstArray();
- const ::rtl::OUString* pTabEnd = pTabBegin + aTabNames.getLength();
- for(;pTabBegin != pTabEnd;++pTabBegin)
- {
- if(match(tableNamePattern,*pTabBegin,'\0'))
- {
- Reference< XColumnsSupplier> xTable;
- ::cppu::extractInterface(xTable,xNames->getByName(*pTabBegin));
- aRow[3] = new ORowSetValueDecorator(*pTabBegin);
-
- Reference< XNameAccess> xColumns = xTable->getColumns();
- if(!xColumns.is())
- throw SQLException();
-
- Sequence< ::rtl::OUString> aColNames(xColumns->getElementNames());
-
- const ::rtl::OUString* pBegin = aColNames.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + aColNames.getLength();
- Reference< XPropertySet> xColumn;
- for(sal_Int32 i=1;pBegin != pEnd;++pBegin,++i)
- {
- if(match(columnNamePattern,*pBegin,'\0'))
- {
- aRow[4] = new ORowSetValueDecorator(*pBegin);
-
- ::cppu::extractInterface(xColumn,xColumns->getByName(*pBegin));
- OSL_ENSURE(xColumn.is(),"Columns contains a column who isn't a fastpropertyset!");
- aRow[5] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))));
- aRow[6] = new ORowSetValueDecorator(getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME))));
- aRow[7] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))));
- aRow[9] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))));
- aRow[11] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))));
- aRow[13] = new ORowSetValueDecorator(getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE))));
-
- switch((sal_Int32)aRow[5]->getValue())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- aRow[16] = new ORowSetValueDecorator((sal_Int32)254);
- break;
- case DataType::LONGVARCHAR:
- aRow[16] = new ORowSetValueDecorator((sal_Int32)65535);
- break;
- default:
- aRow[16] = new ORowSetValueDecorator((sal_Int32)0);
- }
- aRow[17] = new ORowSetValueDecorator(i);
- switch(sal_Int32(aRow[11]->getValue()))
- {
- case ColumnValue::NO_NULLS:
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NO")));
- break;
- case ColumnValue::NULLABLE:
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("YES")));
- break;
- default:
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString());
- }
- aRows.push_back(aRow);
- }
- }
- }
- }
-
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns);
- Reference< XResultSet > xRef = pResult;
- pResult->setRows(aRows);
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OFlatDatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatDatabaseMetaData::getURL" );
- ::osl::MutexGuard aGuard( m_aMutex );
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:flat:")) + m_pConnection->getURL();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/flat/EDriver.cxx b/connectivity/source/drivers/flat/EDriver.cxx
deleted file mode 100644
index 48560bfb46..0000000000
--- a/connectivity/source/drivers/flat/EDriver.cxx
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "flat/EDriver.hxx"
-#include "flat/EConnection.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/dbexception.hxx"
-#include <comphelper/sequence.hxx>
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-
-
-using namespace connectivity::flat;
-using namespace connectivity::file;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-
-
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString ODriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdbc.flat.ODriver"));
-}
-
-//------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-
-//------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL connectivity::flat::ODriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
-{
- return *(new ODriver(_rxFactory));
-}
-// --------------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL ODriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- if ( ! acceptsURL(url) )
- return NULL;
-
- OFlatConnection* pCon = new OFlatConnection(this);
- pCon->construct(url,info);
- Reference< XConnection > xCon = pCon;
- m_xConnections.push_back(WeakReferenceHelper(*pCon));
-
- return xCon;
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL ODriver::acceptsURL( const ::rtl::OUString& url )
- throw(SQLException, RuntimeException)
-{
- return url.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:flat:")),10) == 0;
-}
-// -----------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL ODriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- if ( acceptsURL(url) )
- {
- ::std::vector< DriverPropertyInfo > aDriverInfo;
-
- Sequence< ::rtl::OUString > aBoolean(2);
- aBoolean[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"));
- aBoolean[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1"));
-
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FieldDelimiter"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Field separator."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderLine"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text contains headers."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"))
- ,aBoolean)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StringDelimiter"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text separator."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"))
- ,aBoolean)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DecimalDelimiter"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Decimal separator."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"))
- ,aBoolean)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ThousandDelimiter"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Thousands separator."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"))
- ,aBoolean)
- );
- return ::comphelper::concatSequences(OFileDriver::getPropertyInfo(url,info ),
- Sequence< DriverPropertyInfo >(&aDriverInfo[0],aDriverInfo.size()));
- }
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- return Sequence< DriverPropertyInfo >();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/flat/EPreparedStatement.cxx b/connectivity/source/drivers/flat/EPreparedStatement.cxx
deleted file mode 100644
index 601aadbb7b..0000000000
--- a/connectivity/source/drivers/flat/EPreparedStatement.cxx
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "flat/EPreparedStatement.hxx"
-#include "flat/EResultSet.hxx"
-
-using namespace connectivity::flat;
-using namespace connectivity::file;
-using namespace ::com::sun::star::uno;
-// -------------------------------------------------------------------------
-OResultSet* OFlatPreparedStatement::createResultSet()
-{
- return new OFlatResultSet(this,m_aSQLIterator);
-}
-// -------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OFlatPreparedStatement,"com.sun.star.sdbc.driver.flat.PreparedStatement","com.sun.star.sdbc.PreparedStatement");
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/flat/EResultSet.cxx b/connectivity/source/drivers/flat/EResultSet.cxx
deleted file mode 100644
index 94d47c3002..0000000000
--- a/connectivity/source/drivers/flat/EResultSet.cxx
+++ /dev/null
@@ -1,190 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <com/sun/star/sdbcx/CompareBookmark.hpp>
-#include <com/sun/star/sdbcx/XDeleteRows.hpp>
-#include "flat/EResultSet.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/sequence.hxx>
-#include <comphelper/types.hxx>
-
-using namespace ::comphelper;
-
-using namespace connectivity::flat;
-using namespace connectivity::file;
-using namespace ::cppu;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-
-//------------------------------------------------------------------------------
-OFlatResultSet::OFlatResultSet( OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator)
- : file::OResultSet(pStmt,_aSQLIterator)
- ,m_bBookmarkable(sal_True)
-{
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISBOOKMARKABLE), PROPERTY_ID_ISBOOKMARKABLE, PropertyAttribute::READONLY,&m_bBookmarkable, ::getBooleanCppuType());
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OFlatResultSet::getImplementationName( ) throw ( RuntimeException)
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.flat.ResultSet"));
-}
-// -------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL OFlatResultSet::getSupportedServiceNames( ) throw( RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(2);
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.ResultSet"));
- aSupported[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.ResultSet"));
- return aSupported;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OFlatResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw( RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OFlatResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- if(rType == ::getCppuType((const Reference<XDeleteRows>*)0) || rType == ::getCppuType((const Reference<XResultSetUpdate>*)0)
- || rType == ::getCppuType((const Reference<XRowUpdate>*)0))
- return Any();
-
- const Any aRet = OResultSet::queryInterface(rType);
- return aRet.hasValue() ? aRet : OFlatResultSet_BASE::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OFlatResultSet::getTypes( ) throw( RuntimeException)
-{
- Sequence< Type > aTypes = OResultSet::getTypes();
- ::std::vector<Type> aOwnTypes;
- aOwnTypes.reserve(aTypes.getLength());
- const Type* pBegin = aTypes.getConstArray();
- const Type* pEnd = pBegin + aTypes.getLength();
- for(;pBegin != pEnd;++pBegin)
- {
- if(!(*pBegin == ::getCppuType((const Reference<XDeleteRows>*)0) ||
- *pBegin == ::getCppuType((const Reference<XResultSetUpdate>*)0) ||
- *pBegin == ::getCppuType((const Reference<XRowUpdate>*)0)))
- {
- aOwnTypes.push_back(*pBegin);
- }
- }
- Type* pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- Sequence< Type > aRet(pTypes, aOwnTypes.size());
- return ::comphelper::concatSequences(aRet,OFlatResultSet_BASE::getTypes());
-}
-
-// -------------------------------------------------------------------------
-// XRowLocate
-Any SAL_CALL OFlatResultSet::getBookmark( ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return makeAny((sal_Int32)(m_aRow->get())[0]->getValue());
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OFlatResultSet::moveToBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False;
-
- return Move(IResultSetHelper::BOOKMARK,comphelper::getINT32(bookmark),sal_True);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OFlatResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_bRowDeleted = m_bRowInserted = m_bRowUpdated = sal_False;
-
- Move(IResultSetHelper::BOOKMARK,comphelper::getINT32(bookmark),sal_False);
-
- return relative(rows);
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OFlatResultSet::compareBookmarks( const Any& lhs, const Any& rhs ) throw( SQLException, RuntimeException)
-{
- return (lhs == rhs) ? 0 : 2;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OFlatResultSet::hasOrderedBookmarks( ) throw( SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OFlatResultSet::hashBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
-{
- return comphelper::getINT32(bookmark);
-}
-// -------------------------------------------------------------------------
-IPropertyArrayHelper* OFlatResultSet::createArrayHelper( ) const
-{
- Sequence< Property > aProps;
- describeProperties(aProps);
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-IPropertyArrayHelper & OFlatResultSet::getInfoHelper()
-{
- return *OFlatResultSet_BASE3::getArrayHelper();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OFlatResultSet::acquire() throw()
-{
- OFlatResultSet_BASE2::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OFlatResultSet::release() throw()
-{
- OFlatResultSet_BASE2::release();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OFlatResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/flat/EStatement.cxx b/connectivity/source/drivers/flat/EStatement.cxx
deleted file mode 100644
index 6dd16a00b6..0000000000
--- a/connectivity/source/drivers/flat/EStatement.cxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "flat/EStatement.hxx"
-#include "flat/EResultSet.hxx"
-
-using namespace connectivity::flat;
-using namespace connectivity::file;
-using namespace com::sun::star::uno;
-// -------------------------------------------------------------------------
-OResultSet* OFlatStatement::createResultSet()
-{
- return new OFlatResultSet(this,m_aSQLIterator);
-}
-// -------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OFlatStatement,"com.sun.star.sdbc.driver.flat.Statement","com.sun.star.sdbc.Statement");
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
deleted file mode 100644
index 886e639923..0000000000
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ /dev/null
@@ -1,926 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <ctype.h>
-#include "flat/ETable.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/ucb/XContentAccess.hpp>
-#include <svl/converter.hxx>
-#include "flat/EConnection.hxx"
-#include "flat/EColumns.hxx"
-#include <osl/thread.h>
-#include <tools/config.hxx>
-#include <comphelper/sequence.hxx>
-#include <svl/zforlist.hxx>
-#include <rtl/math.hxx>
-#include <stdio.h> //sprintf
-#include <comphelper/extract.hxx>
-#include <comphelper/numbers.hxx>
-#include "flat/EDriver.hxx"
-#include <com/sun/star/util/NumberFormat.hpp>
-#include <unotools/configmgr.hxx>
-#include <i18npool/mslangid.hxx>
-#include "connectivity/dbconversion.hxx"
-#include <comphelper/types.hxx>
-#include "file/quotedstring.hxx"
-#include <unotools/syslocale.hxx>
-#include <rtl/logfile.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::flat;
-using namespace connectivity::file;
-using namespace ::cppu;
-using namespace utl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -------------------------------------------------------------------------
-void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::fillColumns" );
- sal_Bool bRead = sal_True;
-
- QuotedTokenizedString aHeaderLine;
- OFlatConnection* pConnection = (OFlatConnection*)m_pConnection;
- const rtl_TextEncoding nEncoding = m_pConnection->getTextEncoding();
- const sal_Bool bHasHeaderLine = pConnection->isHeaderLine();
- if ( bHasHeaderLine )
- {
- while(bRead && !aHeaderLine.Len())
- {
- bRead = m_pFileStream->ReadByteStringLine(aHeaderLine,nEncoding);
- }
- m_nStartRowFilePos = m_pFileStream->Tell();
- }
-
- // read first row
- QuotedTokenizedString aFirstLine;
- bRead = m_pFileStream->ReadByteStringLine(aFirstLine,nEncoding);
-
- if ( !bHasHeaderLine || !aHeaderLine.Len())
- {
- while(bRead && !aFirstLine.Len())
- {
- bRead = m_pFileStream->ReadByteStringLine(aFirstLine,nEncoding);
- }
- // use first row as headerline because we need the number of columns
- aHeaderLine = aFirstLine;
- }
- // column count
- const xub_StrLen nFieldCount = aHeaderLine.GetTokenCount(m_cFieldDelimiter,m_cStringDelimiter);
-
- if(!m_aColumns.is())
- m_aColumns = new OSQLColumns();
- else
- m_aColumns->get().clear();
-
- m_aTypes.clear();
- m_aPrecisions.clear();
- m_aScales.clear();
- // reserve some space
- m_aColumns->get().reserve(nFieldCount+1);
- m_aTypes.assign(nFieldCount+1,DataType::SQLNULL);
- m_aPrecisions.assign(nFieldCount+1,-1);
- m_aScales.assign(nFieldCount+1,-1);
-
- const sal_Bool bCase = m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers();
- CharClass aCharClass(pConnection->getDriver()->getFactory(),_aLocale);
- // read description
- const sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
- const sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter();
- String aColumnName;
- ::rtl::OUString aTypeName;
- ::comphelper::UStringMixEqual aCase(bCase);
- ::std::vector<String> aColumnNames,m_aTypeNames;
- m_aTypeNames.resize(nFieldCount);
- const sal_Int32 nMaxRowsToScan = pConnection->getMaxRowsToScan();
- sal_Int32 nRowCount = 0;
- do
- {
- xub_StrLen nStartPosHeaderLine = 0; // use for eficient way to get the tokens
- xub_StrLen nStartPosFirstLine = 0; // use for eficient way to get the tokens
- xub_StrLen nStartPosFirstLine2 = 0;
- for (xub_StrLen i = 0; i < nFieldCount; i++)
- {
- if ( nRowCount == 0)
- {
- if ( bHasHeaderLine )
- {
- aHeaderLine.GetTokenSpecial(aColumnName,nStartPosHeaderLine,m_cFieldDelimiter,m_cStringDelimiter);
- if ( !aColumnName.Len() )
- {
- aColumnName = 'C';
- aColumnName += String::CreateFromInt32(i+1);
- }
- }
- else
- {
- // no column name so ...
- aColumnName = 'C';
- aColumnName += String::CreateFromInt32(i+1);
- }
- aColumnNames.push_back(aColumnName);
- }
- impl_fillColumnInfo_nothrow(aFirstLine,nStartPosFirstLine,nStartPosFirstLine2,m_aTypes[i],m_aPrecisions[i],m_aScales[i],m_aTypeNames[i],cDecimalDelimiter,cThousandDelimiter,aCharClass);
- }
- ++nRowCount;
- }
- while(nRowCount < nMaxRowsToScan && m_pFileStream->ReadByteStringLine(aFirstLine,nEncoding) && !m_pFileStream->IsEof());
-
- for (xub_StrLen i = 0; i < nFieldCount; i++)
- {
- // check if the columname already exists
- String aAlias(aColumnNames[i]);
- OSQLColumns::Vector::const_iterator aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
- sal_Int32 nExprCnt = 0;
- while(aFind != m_aColumns->get().end())
- {
- (aAlias = aColumnNames[i]) += String::CreateFromInt32(++nExprCnt);
- aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
- }
-
- sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,m_aTypeNames[i],::rtl::OUString(),::rtl::OUString(),
- ColumnValue::NULLABLE,
- m_aPrecisions[i],
- m_aScales[i],
- m_aTypes[i],
- sal_False,
- sal_False,
- sal_False,
- bCase);
- Reference< XPropertySet> xCol = pColumn;
- m_aColumns->get().push_back(xCol);
- }
- m_pFileStream->Seek(m_nStartRowFilePos);
-}
-void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine,xub_StrLen& nStartPosFirstLine,xub_StrLen& nStartPosFirstLine2
- ,sal_Int32& io_nType,sal_Int32& io_nPrecisions,sal_Int32& io_nScales,String& o_sTypeName
- ,const sal_Unicode cDecimalDelimiter,const sal_Unicode cThousandDelimiter,const CharClass& aCharClass)
-{
- if ( io_nType != DataType::VARCHAR )
- {
- sal_Bool bNumeric = io_nType == DataType::SQLNULL || io_nType == DataType::DOUBLE || io_nType == DataType::DECIMAL || io_nType == DataType::INTEGER;
- sal_uLong nIndex = 0;
-
- if ( bNumeric )
- {
- // first without fielddelimiter
- String aField;
- aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
- if (aField.Len() == 0 ||
- (m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
- {
- bNumeric = sal_False;
- if ( m_cStringDelimiter != '\0' )
- aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
- else
- nStartPosFirstLine2 = nStartPosFirstLine;
- }
- else
- {
- String aField2;
- if ( m_cStringDelimiter != '\0' )
- aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
- else
- aField2 = aField;
-
- if (aField2.Len() == 0)
- {
- bNumeric = sal_False;
- }
- else
- {
- bNumeric = sal_True;
- xub_StrLen nDot = 0;
- xub_StrLen nDecimalDelCount = 0;
- xub_StrLen nSpaceCount = 0;
- for (xub_StrLen j = 0; j < aField2.Len(); j++)
- {
- const sal_Unicode c = aField2.GetChar(j);
- if ( j == nSpaceCount && m_cFieldDelimiter != 32 && c == 32 )
- {
- ++nSpaceCount;
- continue;
- }
- // just digits, decimal- and thousands-delimiter?
- if ( ( !cDecimalDelimiter || c != cDecimalDelimiter ) &&
- ( !cThousandDelimiter || c != cThousandDelimiter ) &&
- !aCharClass.isDigit(aField2,j) &&
- ( j != 0 || (c != '+' && c != '-' ) ) )
- {
- bNumeric = sal_False;
- break;
- }
- if (cDecimalDelimiter && c == cDecimalDelimiter)
- {
- io_nPrecisions = 15; // we have an decimal value
- io_nScales = 2;
- ++nDecimalDelCount;
- } // if (cDecimalDelimiter && c == cDecimalDelimiter)
- if ( c == '.' )
- ++nDot;
- }
-
- if (nDecimalDelCount > 1 || nDot > 1 ) // if there is more than one dot it isn't a number
- bNumeric = sal_False;
- if (bNumeric && cThousandDelimiter)
- {
- // Is the delimiter correct?
- const String aValue = aField2.GetToken(0,cDecimalDelimiter);
- for (sal_Int32 j = aValue.Len() - 4; j >= 0; j -= 4)
- {
- const sal_Unicode c = aValue.GetChar(static_cast<sal_uInt16>(j));
- // just digits, decimal- and thousands-delimiter?
- if (c == cThousandDelimiter && j)
- continue;
- else
- {
- bNumeric = sal_False;
- break;
- }
- }
- }
-
- // now also check for a date field
- if (!bNumeric)
- {
- try
- {
- nIndex = m_xNumberFormatter->detectNumberFormat(::com::sun::star::util::NumberFormat::ALL,aField2);
- }
- catch(Exception&)
- {
- }
- }
- }
- }
- }
- else if ( io_nType == DataType::DATE || io_nType == DataType::TIMESTAMP || io_nType == DataType::TIME)
- {
- String aField;
- aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
- if (aField.Len() == 0 ||
- (m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
- {
- }
- else
- {
- String aField2;
- if ( m_cStringDelimiter != '\0' )
- aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
- else
- aField2 = aField;
- if (aField2.Len() )
- {
- try
- {
- nIndex = m_xNumberFormatter->detectNumberFormat(::com::sun::star::util::NumberFormat::ALL,aField2);
- }
- catch(Exception&)
- {
- }
- }
- }
- }
-
- sal_Int32 nFlags = 0;
- if (bNumeric)
- {
- if (cDecimalDelimiter)
- {
- if(io_nPrecisions)
- {
- io_nType = DataType::DECIMAL;
- static const ::rtl::OUString s_sDECIMAL(RTL_CONSTASCII_USTRINGPARAM("DECIMAL"));
- o_sTypeName = s_sDECIMAL;
- }
- else
- {
- io_nType = DataType::DOUBLE;
- static const ::rtl::OUString s_sDOUBLE(RTL_CONSTASCII_USTRINGPARAM("DOUBLE"));
- o_sTypeName = s_sDOUBLE;
- }
- }
- else
- {
- io_nType = DataType::INTEGER;
- io_nPrecisions = 0;
- io_nScales = 0;
- }
- nFlags = ColumnSearch::BASIC;
- }
- else
- {
- switch (comphelper::getNumberFormatType(m_xNumberFormatter,nIndex))
- {
- case NUMBERFORMAT_DATE:
- io_nType = DataType::DATE;
- {
- static const ::rtl::OUString s_sDATE(RTL_CONSTASCII_USTRINGPARAM("DATE"));
- o_sTypeName = s_sDATE;
- }
- break;
- case NUMBERFORMAT_DATETIME:
- io_nType = DataType::TIMESTAMP;
- {
- static const ::rtl::OUString s_sTIMESTAMP(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP"));
- o_sTypeName = s_sTIMESTAMP;
- }
- break;
- case NUMBERFORMAT_TIME:
- io_nType = DataType::TIME;
- {
- static const ::rtl::OUString s_sTIME(RTL_CONSTASCII_USTRINGPARAM("TIME"));
- o_sTypeName = s_sTIME;
- }
- break;
- default:
- io_nType = DataType::VARCHAR;
- io_nPrecisions = 0; // nyi: Data can be longer!
- io_nScales = 0;
- {
- static const ::rtl::OUString s_sVARCHAR(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
- o_sTypeName = s_sVARCHAR;
- }
- };
- nFlags |= ColumnSearch::CHAR;
- }
- }
- else
- {
- String aField;
- aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
- if (aField.Len() == 0 ||
- (m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
- {
- if ( m_cStringDelimiter != '\0' )
- aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
- else
- nStartPosFirstLine2 = nStartPosFirstLine;
- }
- else
- {
- String aField2;
- if ( m_cStringDelimiter != '\0' )
- aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
- }
- }
-}
-// -------------------------------------------------------------------------
-OFlatTable::OFlatTable(sdbcx::OCollection* _pTables,OFlatConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description ,
- const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName
- ) : OFlatTable_BASE(_pTables,_pConnection,_Name,
- _Type,
- _Description,
- _SchemaName,
- _CatalogName)
- ,m_nStartRowFilePos(0)
- ,m_nRowPos(0)
- ,m_nMaxRowCount(0)
- ,m_cStringDelimiter(_pConnection->getStringDelimiter())
- ,m_cFieldDelimiter(_pConnection->getFieldDelimiter())
- ,m_bNeedToReadLine(false)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::OFlatTable" );
-
-}
-// -----------------------------------------------------------------------------
-void OFlatTable::construct()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::construct" );
- SvtSysLocale aLocale;
- ::com::sun::star::lang::Locale aAppLocale(aLocale.GetLocaleDataPtr()->getLocale());
- Sequence< ::com::sun::star::uno::Any > aArg(1);
- aArg[0] <<= aAppLocale;
-
- Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(m_pConnection->getDriver()->getFactory()->createInstanceWithArguments(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatsSupplier")),aArg),UNO_QUERY);
- m_xNumberFormatter = Reference< ::com::sun::star::util::XNumberFormatter >(m_pConnection->getDriver()->getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter"))),UNO_QUERY);
- m_xNumberFormatter->attachNumberFormatsSupplier(xSupplier);
- Reference<XPropertySet> xProp(xSupplier->getNumberFormatSettings(),UNO_QUERY);
- xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NullDate"))) >>= m_aNullDate;
-
- INetURLObject aURL;
- aURL.SetURL(getEntry());
-
- if(aURL.getExtension() != rtl::OUString(m_pConnection->getExtension()))
- aURL.setExtension(m_pConnection->getExtension());
-
- String aFileName = aURL.GetMainURL(INetURLObject::NO_DECODE);
-
- m_pFileStream = createStream_simpleError( aFileName,STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
-
- if(!m_pFileStream)
- m_pFileStream = createStream_simpleError( aFileName,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE);
-
- if(m_pFileStream)
- {
- m_pFileStream->Seek(STREAM_SEEK_TO_END);
- sal_Int32 nSize = m_pFileStream->Tell();
- m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN);
-
- // Buffersize is dependent on the file-size
- m_pFileStream->SetBufferSize(nSize > 1000000 ? 32768 :
- nSize > 100000 ? 16384 :
- nSize > 10000 ? 4096 : 1024);
-
- fillColumns(aAppLocale);
-
- refreshColumns();
- }
-}
-// -------------------------------------------------------------------------
-String OFlatTable::getEntry()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::getEntry" );
- ::rtl::OUString sURL;
- try
- {
- Reference< XResultSet > xDir = m_pConnection->getDir()->getStaticResultSet();
- Reference< XRow> xRow(xDir,UNO_QUERY);
- ::rtl::OUString sName;
- ::rtl::OUString sExt;
-
- INetURLObject aURL;
- xDir->beforeFirst();
- static const ::rtl::OUString s_sSeparator(RTL_CONSTASCII_USTRINGPARAM("/"));
- while(xDir->next())
- {
- sName = xRow->getString(1);
- aURL.SetSmartProtocol(INET_PROT_FILE);
- String sUrl = m_pConnection->getURL() + s_sSeparator + sName;
- aURL.SetSmartURL( sUrl );
-
- // cut the extension
- sExt = aURL.getExtension();
-
- // name and extension have to coincide
- if ( m_pConnection->matchesExtension( sExt ) )
- {
- if ( sExt.getLength() )
- sName = sName.replaceAt(sName.getLength()-(sExt.getLength()+1),sExt.getLength()+1,::rtl::OUString());
- if ( sName == m_Name )
- {
- Reference< XContentAccess > xContentAccess( xDir, UNO_QUERY );
- sURL = xContentAccess->queryContentIdentifierString();
- break;
- }
- }
- }
- xDir->beforeFirst(); // move back to before first record
- }
- catch(Exception&)
- {
- OSL_ASSERT(0);
- }
- return sURL.getStr();
-}
-// -------------------------------------------------------------------------
-void OFlatTable::refreshColumns()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::refreshColumns" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- TStringVector aVector;
- aVector.reserve(m_aColumns->get().size());
-
- for(OSQLColumns::Vector::const_iterator aIter = m_aColumns->get().begin();aIter != m_aColumns->get().end();++aIter)
- aVector.push_back(Reference< XNamed>(*aIter,UNO_QUERY)->getName());
-
- if(m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new OFlatColumns(this,m_aMutex,aVector);
-}
-
-// -------------------------------------------------------------------------
-void SAL_CALL OFlatTable::disposing(void)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::disposing" );
- OFileTable::disposing();
- ::osl::MutexGuard aGuard(m_aMutex);
- m_aColumns = NULL;
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OFlatTable::getTypes( ) throw(RuntimeException)
-{
- Sequence< Type > aTypes = OTable_TYPEDEF::getTypes();
- ::std::vector<Type> aOwnTypes;
- aOwnTypes.reserve(aTypes.getLength());
- const Type* pBegin = aTypes.getConstArray();
- const Type* pEnd = pBegin + aTypes.getLength();
- for(;pBegin != pEnd;++pBegin)
- {
- if(!(*pBegin == ::getCppuType((const Reference<XKeysSupplier>*)0) ||
- *pBegin == ::getCppuType((const Reference<XRename>*)0) ||
- *pBegin == ::getCppuType((const Reference<XIndexesSupplier>*)0) ||
- *pBegin == ::getCppuType((const Reference<XAlterTable>*)0) ||
- *pBegin == ::getCppuType((const Reference<XDataDescriptorFactory>*)0)))
- {
- aOwnTypes.push_back(*pBegin);
- }
- }
- Type *pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
-}
-
-// -------------------------------------------------------------------------
-Any SAL_CALL OFlatTable::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- if( rType == ::getCppuType((const Reference<XKeysSupplier>*)0) ||
- rType == ::getCppuType((const Reference<XIndexesSupplier>*)0) ||
- rType == ::getCppuType((const Reference<XRename>*)0) ||
- rType == ::getCppuType((const Reference<XAlterTable>*)0) ||
- rType == ::getCppuType((const Reference<XDataDescriptorFactory>*)0))
- return Any();
-
- Any aRet = OTable_TYPEDEF::queryInterface(rType);
- return aRet.hasValue() ? aRet : ::cppu::queryInterface(rType,static_cast< ::com::sun::star::lang::XUnoTunnel*> (this));
-}
-
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > OFlatTable::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OFlatTable::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::getSomething" );
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OFlatTable_BASE::getSomething(rId);
-}
-//------------------------------------------------------------------
-sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal_Bool bIsTable,sal_Bool bRetrieveData)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::fetchRow" );
- *(_rRow->get())[0] = m_nFilePos;
-
- if (!bRetrieveData)
- return sal_True;
- if ( m_bNeedToReadLine )
- {
- sal_Int32 nCurrentPos = 0;
- m_pFileStream->Seek(m_nFilePos);
- readLine(nCurrentPos);
- m_bNeedToReadLine = false;
- }
-
- OFlatConnection* pConnection = (OFlatConnection*)m_pConnection;
- const sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
- const sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter();
- // Fields:
- xub_StrLen nStartPos = 0;
- String aStr;
- OSQLColumns::Vector::const_iterator aIter = _rCols.get().begin();
- OSQLColumns::Vector::const_iterator aEnd = _rCols.get().end();
- const OValueRefVector::Vector::size_type nCount = _rRow->get().size();
- for (OValueRefVector::Vector::size_type i = 1; aIter != aEnd && i < nCount;
- ++aIter, i++)
- {
- m_aCurrentLine.GetTokenSpecial(aStr,nStartPos,m_cFieldDelimiter,m_cStringDelimiter);
-
- if (aStr.Len() == 0)
- (_rRow->get())[i]->setNull();
- else
- {
- // lengths depending on data-type:
- sal_Int32 nLen,
- nType = 0;
- if(bIsTable)
- {
- nLen = m_aPrecisions[i-1];
- nType = m_aTypes[i-1];
- }
- else
- {
- Reference< XPropertySet> xColumn = *aIter;
- xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)) >>= nLen;
- xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
- }
- switch(nType)
- {
- case DataType::TIMESTAMP:
- case DataType::DATE:
- case DataType::TIME:
- {
- try
- {
- double nRes = m_xNumberFormatter->convertStringToNumber(::com::sun::star::util::NumberFormat::ALL,aStr);
-
- switch(nType)
- {
- case DataType::DATE:
- *(_rRow->get())[i] = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDate(nRes,m_aNullDate));
- break;
- case DataType::TIMESTAMP:
- *(_rRow->get())[i] = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDateTime(nRes,m_aNullDate));
- break;
- default:
- *(_rRow->get())[i] = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toTime(nRes));
- }
- }
- catch(Exception&)
- {
- (_rRow->get())[i]->setNull();
- }
- } break;
- case DataType::DOUBLE:
- case DataType::INTEGER:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- {
-
- String aStrConverted;
- if ( DataType::INTEGER != nType )
- {
- sal_Unicode* pData = aStrConverted.AllocBuffer(aStr.Len());
- const sal_Unicode* pStart = pData;
-
- OSL_ENSURE((cDecimalDelimiter && nType != DataType::INTEGER) ||
- (!cDecimalDelimiter && nType == DataType::INTEGER),
- "FalscherTyp");
-
- // convert to Standard-Notation (DecimalPOINT without thousands-comma):
- for (xub_StrLen j = 0; j < aStr.Len(); ++j)
- {
- const sal_Unicode cChar = aStr.GetChar(j);
- if (cDecimalDelimiter && cChar == cDecimalDelimiter)
- *pData++ = '.';
- //aStrConverted.Append( '.' );
- else if ( cChar == '.' ) // special case, if decimal seperator isn't '.' we have to put the string after it
- continue;
- else if (cThousandDelimiter && cChar == cThousandDelimiter)
- {
- // leave out
- }
- else
- *pData++ = cChar;
- //aStrConverted.Append(cChar);
- } // for (xub_StrLen j = 0; j < aStr.Len(); ++j)
- aStrConverted.ReleaseBufferAccess(xub_StrLen(pData - pStart));
- } // if ( DataType::INTEGER != nType )
- else
- {
- aStrConverted = aStr;
- if ( cThousandDelimiter )
- aStrConverted.EraseAllChars(cThousandDelimiter);
- }
- const double nVal = ::rtl::math::stringToDouble(aStrConverted,'.',',',NULL,NULL);
-
- // #99178# OJ
- if ( DataType::DECIMAL == nType || DataType::NUMERIC == nType )
- *(_rRow->get())[i] = ::rtl::OUString::valueOf(nVal);
- else
- *(_rRow->get())[i] = nVal;
- } break;
-
- default:
- {
- // Copy Value as String in Row-Variable
- *(_rRow->get())[i] = ORowSetValue(aStr);
- }
- break;
- } // switch(nType)
- (_rRow->get())[i]->setTypeKind(nType);
- }
- }
- return sal_True;
-}
-void OFlatTable::refreshHeader()
-{
- m_nRowPos = 0;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::seekRow" );
- OSL_ENSURE(m_pFileStream,"OFlatTable::seekRow: FileStream is NULL!");
- // ----------------------------------------------------------
- // Prepare positioning:
- m_nFilePos = nCurPos;
-
- switch(eCursorPosition)
- {
- case IResultSetHelper::FIRST:
- m_nRowPos = 0;
- // run through
- case IResultSetHelper::NEXT:
- {
- ++m_nRowPos;
- ::std::map<sal_Int32,TRowPositionsInFile::iterator>::const_iterator aFind = m_aRowPosToFilePos.find(m_nRowPos);
- m_bNeedToReadLine = aFind != m_aRowPosToFilePos.end();
- if ( m_bNeedToReadLine )
- {
- m_nFilePos = aFind->second->first;
- nCurPos = aFind->second->second;
- } // if ( m_bNeedToReadLine )
- else
- {
- if ( m_nRowPos == 1 )
- m_nFilePos = m_nStartRowFilePos;
- m_pFileStream->Seek(m_nFilePos);
- if ( m_pFileStream->IsEof() || !readLine(nCurPos) /*|| !checkHeaderLine()*/)
- {
- m_nMaxRowCount = m_nRowPos -1;
- return sal_False;
- } // if ( m_pFileStream->IsEof() || !readLine(nCurPos) /*|| !checkHeaderLine()*/)
-
- TRowPositionsInFile::iterator aPos = m_aFilePosToEndLinePos.insert(TRowPositionsInFile::value_type(m_nFilePos,nCurPos)).first;
- m_aRowPosToFilePos.insert(::std::map<sal_Int32,TRowPositionsInFile::iterator>::value_type(m_nRowPos,aPos));
- }
- }
-
- break;
- case IResultSetHelper::PRIOR:
- --m_nRowPos;
- if(m_nRowPos > 0)
- {
- TRowPositionsInFile::iterator aPositions = m_aRowPosToFilePos[m_nRowPos];
- m_nFilePos = aPositions->first;
- nCurPos = aPositions->second;
- m_bNeedToReadLine = true;
- }
- else
- m_nRowPos = 0;
-
- break;
- case IResultSetHelper::LAST:
- if ( m_nMaxRowCount )
- {
- ::std::map<sal_Int32,TRowPositionsInFile::iterator>::reverse_iterator aLastPos = m_aRowPosToFilePos.rbegin();
- m_nRowPos = aLastPos->first;
- m_nFilePos = aLastPos->second->first;
- nCurPos = aLastPos->second->second;
-
- //m_pFileStream->Seek(m_nFilePos);
- m_bNeedToReadLine = true;
- //if ( m_pFileStream->IsEof() /*|| !checkHeaderLine()*/ || !readLine(nCurPos) )
- // return sal_False;
- }
- else
- {
- while(seekRow(IResultSetHelper::NEXT,1,nCurPos)) ; // run through after last row
- // now I know all
- seekRow(IResultSetHelper::PRIOR,1,nCurPos);
- }
- break;
- case IResultSetHelper::RELATIVE:
- if(nOffset > 0)
- {
- for(sal_Int32 i = 0;i<nOffset;++i)
- seekRow(IResultSetHelper::NEXT,1,nCurPos);
- }
- else if(nOffset < 0)
- {
- for(sal_Int32 i = nOffset;i;++i)
- seekRow(IResultSetHelper::PRIOR,1,nCurPos);
- }
- break;
- case IResultSetHelper::ABSOLUTE:
- {
- if(nOffset < 0)
- nOffset = m_nRowPos + nOffset;
- ::std::map<sal_Int32,TRowPositionsInFile::iterator>::const_iterator aIter = m_aRowPosToFilePos.find(nOffset);
- if(aIter != m_aRowPosToFilePos.end())
- {
- m_nFilePos = aIter->second->first;
- nCurPos = aIter->second->second;
- //m_pFileStream->Seek(m_nFilePos);
- m_bNeedToReadLine = true;
- //if ( m_pFileStream->IsEof() /*|| !checkHeaderLine()*/ || !readLine(nCurPos) )
- // return sal_False;
- }
- else if(m_nMaxRowCount && nOffset > m_nMaxRowCount) // offset is outside the table
- {
- m_nRowPos = m_nMaxRowCount;
- return sal_False;
- }
- else
- {
- aIter = m_aRowPosToFilePos.upper_bound(nOffset);
- if(aIter == m_aRowPosToFilePos.end())
- {
- ::std::map<sal_Int32,TRowPositionsInFile::iterator>::reverse_iterator aLastPos = m_aRowPosToFilePos.rbegin();
- m_nRowPos = aLastPos->first;
- nCurPos = m_nFilePos = aLastPos->second->first;
- while(m_nRowPos != nOffset)
- seekRow(IResultSetHelper::NEXT,1,nCurPos);
- }
- else
- {
- --aIter;
- m_nRowPos = aIter->first;
- m_nFilePos = aIter->second->first;
- nCurPos = aIter->second->second;
- //m_pFileStream->Seek(m_nFilePos);
- m_bNeedToReadLine = true;
- //if ( m_pFileStream->IsEof() /*|| !checkHeaderLine()*/ || !readLine(nCurPos) )
- // return sal_False;
- }
- }
- }
-
- break;
- case IResultSetHelper::BOOKMARK:
- {
- TRowPositionsInFile::const_iterator aFind = m_aFilePosToEndLinePos.find(nOffset);
- m_bNeedToReadLine = aFind != m_aFilePosToEndLinePos.end();
- if ( m_bNeedToReadLine )
- {
- m_nFilePos = aFind->first;
- nCurPos = aFind->second;
- }
- else
- {
- m_nFilePos = nOffset;
- m_pFileStream->Seek(nOffset);
- if (m_pFileStream->IsEof() || !readLine(nCurPos) )
- return sal_False;
- }
- break;
- }
- }
-
- //nCurPos = m_nFilePos;
-
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OFlatTable::readLine(sal_Int32& _rnCurrentPos)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::readLine" );
- const rtl_TextEncoding nEncoding = m_pConnection->getTextEncoding();
- m_pFileStream->ReadByteStringLine(m_aCurrentLine,nEncoding);
- if (m_pFileStream->IsEof())
- return sal_False;
-
- QuotedTokenizedString sLine = m_aCurrentLine; // check if the string continues on next line
- while( (sLine.GetString().GetTokenCount(m_cStringDelimiter) % 2) != 1 )
- {
- m_pFileStream->ReadByteStringLine(sLine,nEncoding);
- if ( !m_pFileStream->IsEof() )
- {
- m_aCurrentLine.GetString().Append('\n');
- m_aCurrentLine.GetString() += sLine.GetString();
- sLine = m_aCurrentLine;
- }
- else
- break;
- }
- _rnCurrentPos = m_pFileStream->Tell();
- return sal_True;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/flat/ETables.cxx b/connectivity/source/drivers/flat/ETables.cxx
deleted file mode 100644
index e709141b52..0000000000
--- a/connectivity/source/drivers/flat/ETables.cxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "flat/ETables.hxx"
-#include "flat/ETable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include "file/FCatalog.hxx"
-#include "file/FConnection.hxx"
-#include <comphelper/types.hxx>
-
-using namespace connectivity;
-using namespace ::comphelper;
-using namespace connectivity::flat;
-using namespace connectivity::file;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-namespace starutil = ::com::sun::star::util;
-
-sdbcx::ObjectType OFlatTables::createObject(const ::rtl::OUString& _rName)
-{
- OFlatTable* pRet = new OFlatTable(this,(OFlatConnection*)static_cast<OFileCatalog&>(m_rParent).getConnection(),
- _rName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE")));
- sdbcx::ObjectType xRet = pRet;
- pRet->construct();
- return xRet;
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/flat/Eservices.cxx b/connectivity/source/drivers/flat/Eservices.cxx
deleted file mode 100644
index 445d81f7cf..0000000000
--- a/connectivity/source/drivers/flat/Eservices.cxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "flat/EDriver.hxx"
-#include <cppuhelper/factory.hxx>
-
-using namespace connectivity::flat;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pT
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- ODriver::getImplementationName_Static(),
- ODriver::getSupportedServiceNames_Static(),
- ODriver_CreateInstance, ::cppu::createSingleFactory)
- ;
-
- if(aReq.xRet.is())
- aReq.xRet->acquire();
-
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/flat/exports.dxp b/connectivity/source/drivers/flat/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/drivers/flat/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/drivers/flat/flat.component b/connectivity/source/drivers/flat/flat.component
deleted file mode 100755
index fe8b79ee73..0000000000
--- a/connectivity/source/drivers/flat/flat.component
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.sdbc.flat.ODriver">
- <service name="com.sun.star.sdbc.Driver"/>
- <service name="com.sun.star.sdbcx.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/flat/flat.mxp.map b/connectivity/source/drivers/flat/flat.mxp.map
deleted file mode 100755
index 9a6cbf91b7..0000000000
--- a/connectivity/source/drivers/flat/flat.mxp.map
+++ /dev/null
@@ -1,139 +0,0 @@
-component_getFactory
-__mh_dylib_header
-___builtin_delete
-___builtin_vec_delete
-___builtin_vec_new
-___check_eh_spec
-___cp_pop_exception
-___cp_push_exception
-___eh_alloc
-___get_eh_context
-___pure_virtual
-___rtti_class
-___rtti_si
-___rtti_user
-___sjthrow
-___start_cp_handler
-___terminate
-_terminate__Fv
-dyld_stub_binding_helper
-rest_world
-save_world
-___eh_rtime_match
-___builtin_new
-___tf9bad_alloc
-__._10bad_typeid
-__._8bad_cast
-___get_eh_info
-___is_pointer__FPv
-___throw_type_match_rtti
-___vt_10bad_typeid
-___vt_8bad_cast
-__keymgr_get_per_thread_data
-__keymgr_set_per_thread_data
-___tf9exception
-___ti9exception
-___vt_9exception
-_what__C9exception
-__._9bad_alloc
-___vt_9bad_alloc
-__._9type_info
-___eq__C9type_infoRCB0
-___tf16__user_type_info
-___tf9type_info
-___ti9type_info
-___vt_9type_info
-__._Q312connectivity4flat18UStringDescription
-___Q312connectivity4flat18UStringDescriptionPFv_PCc
-_getPropertySetInfo__Q312connectivity4flat14OFlatResultSet
-_release__Q312connectivity4flat14OFlatResultSet
-_acquire__Q312connectivity4flat14OFlatResultSet
-__._Q312connectivity4flat14OFlatResultSet
-__._Q312connectivity4flat14OFlatStatement
-__._Q312connectivity4flat22OFlatPreparedStatement
-__._Q312connectivity4flat10OFlatTable
-_toDouble__FRC10ByteString
-_checkHeaderLine__Q312connectivity4flat10OFlatTable
-_refreshColumns__Q312connectivity4flat10OFlatTable
-_AllocBuffer__Q312connectivity4flat10OFlatTable
-_fillColumns__Q312connectivity4flat10OFlatTable
-_getEntry__Q312connectivity4flat10OFlatTable
-_GetToken__CQ312connectivity4flat11OFlatStringUsUcUc
-_GetTokenCount__CQ312connectivity4flat11OFlatStringUcUc
-_refreshTables__Q312connectivity4flat12OFlatCatalog
-_getPropertySetInfo__Q312connectivity4file26ODatabaseMetaDataResultSet
-_release__Q312connectivity4file26ODatabaseMetaDataResultSet
-_acquire__Q312connectivity4file26ODatabaseMetaDataResultSet
-_getPropertySetInfo__Q312connectivity4file10OResultSet
-_release__Q312connectivity4file10OResultSet
-_acquire__Q312connectivity4file10OResultSet
-_scanParameter__Q312connectivity4file10OResultSetPQ212connectivity13OSQLParseNodeRQ24_STLt6vector2ZPB1ZQ24_STLt9allocator1ZPB1
-_AddParameter__Q312connectivity4file10OResultSetPQ212connectivity13OSQLParseNodeRCQ53com3sun4star3unot9Reference1ZQ53com3sun4star5beans12XPropertySet
-_SetAssignValue__Q312connectivity4file10OResultSetRC6Stringn1UcUl
-_ParseAssignValues__Q312connectivity4file10OResultSetRCQ24_STLt6vector2Z6StringZQ24_STLt9allocator1ZB2PQ212connectivity13OSQLParseNodeUs
-_getUnoTunnelImplementationId__Q312connectivity4file10OResultSet
-_setOrderbyColumn__Q312connectivity4file10OResultSetUsPQ212connectivity13OSQLParseNoden1
-_CreateKeySet__Q312connectivity4file14OFILESortIndex
-___Q312connectivity4file14OFILESortIndexPCQ312connectivity4file8OKeyTypePCUclUs
-_anylizeSQL__Q312connectivity4file10OResultSet
-_GetAssignValues__Q312connectivity4file10OResultSet
-_moveAbsolute__Q312connectivity4file10OResultSetlUc
-_ExecuteRow__Q312connectivity4file10OResultSetQ412connectivity4file10OFileTable12FilePositionlUcn2
-_AddKeyValue__Q312connectivity4file14OFILESortIndexPQ312connectivity4file13OFILEKeyValue
-_GetOrderbyKeyValue__Q312connectivity4file10OResultSetGQ23vost4ORef1ZQ312connectivity4file12OValueVector
-_evaluate__Q312connectivity4file10OResultSet
-_SkipDeleted__Q312connectivity4file10OResultSetQ412connectivity4file10OFileTable12FilePositionlUc
-__._Q312connectivity4file14OFILESortIndex
-_construct__Q312connectivity4file10OResultSet
-_isCount__CQ312connectivity4file10OResultSet
-__._Q312connectivity4file18UStringDescription
-___Q312connectivity4file18UStringDescriptionPFv_PCc
-_disposing__Q312connectivity4file15OStatement_Base
-_acquire__Q312connectivity4file15OStatement_Base
-__._Q312connectivity4file16OStatement_BASE2
-__._Q312connectivity4file10OStatement
-_disposeResultSet__Q312connectivity4file15OStatement_Base
-_getImplementationName_Static__Q312connectivity4file11OFileDriver
-_operate__CQ312connectivity4file8OOp_LIKEPCQ312connectivity4file8OOperandn1
-_operate__CQ312connectivity4file10OOp_ISNULLPCQ312connectivity4file8OOperandn1
-_IsOf__Q312connectivity4file12ONumOperatorPFv_Pv
-_StaticType__Q312connectivity4file12ONumOperator
-_IsOf__Q312connectivity4file11OOp_COMPAREPFv_Pv
-_StaticType__Q312connectivity4file11OOp_COMPARE
-_IsOf__Q312connectivity4file11OOp_NOTLIKEPFv_Pv
-_StaticType__Q312connectivity4file11OOp_NOTLIKE
-_IsOf__Q312connectivity4file8OOp_LIKEPFv_Pv
-_StaticType__Q312connectivity4file8OOp_LIKE
-_IsOf__Q312connectivity4file13OOp_ISNOTNULLPFv_Pv
-_StaticType__Q312connectivity4file13OOp_ISNOTNULL
-_IsOf__Q312connectivity4file10OOp_ISNULLPFv_Pv
-_StaticType__Q312connectivity4file10OOp_ISNULL
-_IsOf__Q312connectivity4file6OOp_ORPFv_Pv
-_StaticType__Q312connectivity4file6OOp_OR
-_IsOf__Q312connectivity4file7OOp_ANDPFv_Pv
-_StaticType__Q312connectivity4file7OOp_AND
-_IsOf__Q312connectivity4file13OBoolOperatorPFv_Pv
-_IsOf__Q312connectivity4file9OOperatorPFv_Pv
-_IsOf__Q312connectivity4file14OOperandResultPFv_Pv
-_IsOf__Q312connectivity4file13OOperandConstPFv_Pv
-_IsOf__Q312connectivity4file13OOperandValuePFv_Pv
-_StaticType__Q312connectivity4file13OOperandValue
-_IsOf__Q312connectivity4file13OOperandParamPFv_Pv
-_IsOf__Q312connectivity4file16OFILEOperandAttrPFv_Pv
-_StaticType__Q312connectivity4file16OFILEOperandAttr
-_IsOf__Q312connectivity4file12OOperandAttrPFv_Pv
-_IsOf__Q312connectivity4file11OOperandRowPFv_Pv
-_StaticType__Q312connectivity4file11OOperandRow
-_IsOf__Q312connectivity4file8OOperandPFv_Pv
-_IsOf__Q312connectivity4file5OCodePFv_Pv
-_StaticType__Q312connectivity4file5OCode
-__._Q312connectivity4file5OCode
-_execute_Operand__Q312connectivity4file18OPredicateCompilerPQ212connectivity13OSQLParseNode
-_execute_ISNULL__Q312connectivity4file18OPredicateCompilerPQ212connectivity13OSQLParseNode
-_execute_LIKE__Q312connectivity4file18OPredicateCompilerPQ212connectivity13OSQLParseNode
-_execute_COMPARE__Q312connectivity4file18OPredicateCompilerPQ212connectivity13OSQLParseNode
-___tf13bad_exception
-___uncatch_exception
-___eh_free
-___tfv
-___dynamic_cast
diff --git a/connectivity/source/drivers/flat/flat.xcu b/connectivity/source/drivers/flat/flat.xcu
deleted file mode 100644
index ba43121844..0000000000
--- a/connectivity/source/drivers/flat/flat.xcu
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:flat:*" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.flat.ODriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Text</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="CharSet" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="Extension" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="HeaderLine" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FieldDelimiter" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>,</value>
- </prop>
- </node>
- <node oor:name="StringDelimiter" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>"</value>
- </prop>
- </node>
- <node oor:name="DecimalDelimiter" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>.</value>
- </prop>
- </node>
- <node oor:name="ThousandDelimiter" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="EnableSQL92Check" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="MaxRowScan" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:int">
- <value>100</value>
- </prop>
- </node>
- </node>
- <node oor:name="Features">
- <node oor:name="MaxRowScan" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsBrowsing" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FileSystemBased" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="MediaType" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>text/csv</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/flat/flat.xml b/connectivity/source/drivers/flat/flat.xml
deleted file mode 100755
index 77b45c48da..0000000000
--- a/connectivity/source/drivers/flat/flat.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description>
- <module-name>file</module-name>
- <component-description>
- <author>Ocke Jannsen</author>
- <name>com.sun.star.comp.sdbc.flat.ODriver</name>
- <description>This library implements the database driver for flat file formats.
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service>com.sun.star.sdbc.Driver</supported-service>
- <supported-service>com.sun.star.sdbcx.Driver</supported-service>
- <service-dependency> ... </service-dependency>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>file</runtime-module-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>osl</runtime-module-dependency>
- <runtime-module-dependency>svtools-light1</runtime-module-dependency>
- <runtime-module-dependency>svtools</runtime-module-dependency>
- <runtime-module-dependency>ucbhelper</runtime-module-dependency>
- <runtime-module-dependency>dbtools</runtime-module-dependency>
- <runtime-module-dependency>unotools</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
diff --git a/connectivity/source/drivers/flat/makefile.mk b/connectivity/source/drivers/flat/makefile.mk
deleted file mode 100755
index 0fe857919d..0000000000
--- a/connectivity/source/drivers/flat/makefile.mk
+++ /dev/null
@@ -1,115 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=flat
-
-VISIBILITY_HIDDEN=TRUE
-
-# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/EResultSet.obj \
- $(SLO)$/EStatement.obj \
- $(SLO)$/EPreparedStatement.obj \
- $(SLO)$/ETable.obj \
- $(SLO)$/EDatabaseMetaData.obj \
- $(SLO)$/ECatalog.obj \
- $(SLO)$/EColumns.obj \
- $(SLO)$/ETables.obj \
- $(SLO)$/EConnection.obj \
- $(SLO)$/Eservices.obj \
- $(SLO)$/EDriver.obj
-
-EXCEPTIONSFILES=\
- $(SLO)$/EResultSet.obj \
- $(SLO)$/EStatement.obj \
- $(SLO)$/EPreparedStatement.obj \
- $(SLO)$/ETable.obj \
- $(SLO)$/EDatabaseMetaData.obj \
- $(SLO)$/ECatalog.obj \
- $(SLO)$/EColumns.obj \
- $(SLO)$/ETables.obj \
- $(SLO)$/EConnection.obj \
- $(SLO)$/Eservices.obj \
- $(SLO)$/EDriver.obj
-
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-
-# --- Library -----------------------------------
-SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(TOOLSLIB) \
- $(SVLLIB) \
- $(UNOTOOLSLIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(DBTOOLSLIB) \
- $(DBFILELIB) \
- $(COMPHELPERLIB)
-
-.IF "$(DBFILELIB)" == ""
-SHL1STDLIBS+= ifile.lib
-.ENDIF
-
-SHL1DEPN=
-SHL1IMPLIB= i$(TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-
-# --- Targets ----------------------------------
-
-.INCLUDE : $(PRJ)$/target.pmk
-
-
-
-ALLTAR : $(MISC)/flat.component
-
-$(MISC)/flat.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- flat.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt flat.component
diff --git a/connectivity/source/drivers/hsqldb/HCatalog.cxx b/connectivity/source/drivers/hsqldb/HCatalog.cxx
deleted file mode 100644
index 7c7d66fc00..0000000000
--- a/connectivity/source/drivers/hsqldb/HCatalog.cxx
+++ /dev/null
@@ -1,167 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "hsqldb/HCatalog.hxx"
-#include "hsqldb/HUsers.hxx"
-#include "hsqldb/HTables.hxx"
-#include "hsqldb/HViews.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <comphelper/types.hxx>
-
-
-// -------------------------------------------------------------------------
-using namespace connectivity;
-using namespace connectivity::hsqldb;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -------------------------------------------------------------------------
-OHCatalog::OHCatalog(const Reference< XConnection >& _xConnection) : sdbcx::OCatalog(_xConnection)
- ,m_xConnection(_xConnection)
-{
-}
-// -----------------------------------------------------------------------------
-void OHCatalog::refreshObjects(const Sequence< ::rtl::OUString >& _sKindOfObject,TStringVector& _rNames)
-{
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),
- _sKindOfObject);
- fillNames(xResult,_rNames);
-}
-// -------------------------------------------------------------------------
-void OHCatalog::refreshTables()
-{
- TStringVector aVector;
- static const ::rtl::OUString s_sTableTypeView(RTL_CONSTASCII_USTRINGPARAM("VIEW"));
- static const ::rtl::OUString s_sTableTypeTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
-
- Sequence< ::rtl::OUString > sTableTypes(2);
- sTableTypes[0] = s_sTableTypeView;
- sTableTypes[1] = s_sTableTypeTable;
-
- refreshObjects(sTableTypes,aVector);
-
- if ( m_pTables )
- m_pTables->reFill(aVector);
- else
- m_pTables = new OTables(m_xMetaData,*this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void OHCatalog::refreshViews()
-{
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW"));
-
- sal_Bool bSupportsViews = sal_False;
- try
- {
- Reference<XResultSet> xRes = m_xMetaData->getTableTypes();
- Reference<XRow> xRow(xRes,UNO_QUERY);
- while ( xRow.is() && xRes->next() )
- {
- if ( (bSupportsViews = xRow->getString(1).equalsIgnoreAsciiCase(aTypes[0])) )
- {
- break;
- }
- }
- }
- catch(const SQLException&)
- {
- }
-
- TStringVector aVector;
- if ( bSupportsViews )
- refreshObjects(aTypes,aVector);
-
- if ( m_pViews )
- m_pViews->reFill(aVector);
- else
- m_pViews = new HViews( m_xConnection, *this, m_aMutex, aVector );
-}
-// -------------------------------------------------------------------------
-void OHCatalog::refreshGroups()
-{
-}
-// -------------------------------------------------------------------------
-void OHCatalog::refreshUsers()
-{
- TStringVector aVector;
- Reference< XStatement > xStmt = m_xConnection->createStatement( );
- Reference< XResultSet > xResult = xStmt->executeQuery(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("select User from hsqldb.user group by User")));
- if ( xResult.is() )
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- TString2IntMap aMap;
- while( xResult->next() )
- aVector.push_back(xRow->getString(1));
- ::comphelper::disposeComponent(xResult);
- }
- ::comphelper::disposeComponent(xStmt);
-
- if(m_pUsers)
- m_pUsers->reFill(aVector);
- else
- m_pUsers = new OUsers(*this,m_aMutex,aVector,m_xConnection,this);
-}
-// -----------------------------------------------------------------------------
-Any SAL_CALL OHCatalog::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- if ( rType == ::getCppuType((const Reference<XGroupsSupplier>*)0) )
- return Any();
-
- return OCatalog::queryInterface(rType);
-}
-// -----------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OHCatalog::getTypes( ) throw(RuntimeException)
-{
- Sequence< Type > aTypes = OCatalog::getTypes();
- ::std::vector<Type> aOwnTypes;
- aOwnTypes.reserve(aTypes.getLength());
- const Type* pBegin = aTypes.getConstArray();
- const Type* pEnd = pBegin + aTypes.getLength();
- for(;pBegin != pEnd;++pBegin)
- {
- if ( !(*pBegin == ::getCppuType((const Reference<XGroupsSupplier>*)0)))
- {
- aOwnTypes.push_back(*pBegin);
- }
- }
- const Type* pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HColumns.cxx b/connectivity/source/drivers/hsqldb/HColumns.cxx
deleted file mode 100644
index 8c7b58c33d..0000000000
--- a/connectivity/source/drivers/hsqldb/HColumns.cxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "hsqldb/HColumns.hxx"
-#include "TConnection.hxx"
-
-
-using namespace ::comphelper;
-using namespace connectivity::hsqldb;
-using namespace connectivity::sdbcx;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-OHSQLColumns::OHSQLColumns( ::cppu::OWeakObject& _rParent
- ,sal_Bool _bCase
- ,::osl::Mutex& _rMutex
- ,const TStringVector &_rVector
- ,sal_Bool _bUseHardRef
- ) : OColumnsHelper(_rParent,_bCase,_rMutex,_rVector,_bUseHardRef)
-{
-}
-// -----------------------------------------------------------------------------
-Reference< XPropertySet > OHSQLColumns::createDescriptor()
-{
- return new OHSQLColumn(sal_True);
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-OHSQLColumn::OHSQLColumn( sal_Bool _bCase)
- : connectivity::sdbcx::OColumn( _bCase )
-{
- construct();
-}
-// -------------------------------------------------------------------------
-void OHSQLColumn::construct()
-{
- m_sAutoIncrement = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IDENTITY"));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION),PROPERTY_ID_AUTOINCREMENTCREATION,0,&m_sAutoIncrement, ::getCppuType(&m_sAutoIncrement));
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OHSQLColumn::createArrayHelper( sal_Int32 /*_nId*/ ) const
-{
- return doCreateArrayHelper();
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & SAL_CALL OHSQLColumn::getInfoHelper()
-{
- return *OHSQLColumn_PROP::getArrayHelper(isNew() ? 1 : 0);
-}
-// -----------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL OHSQLColumn::getSupportedServiceNames( ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(1);
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Column"));
-
- return aSupported;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx
deleted file mode 100644
index 34888d13d1..0000000000
--- a/connectivity/source/drivers/hsqldb/HConnection.cxx
+++ /dev/null
@@ -1,386 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "hsqldb/HConnection.hxx"
-#include "hsqldb/HTools.hxx"
-#include "hsqlui.hrc"
-
-#include <connectivity/dbtools.hxx>
-
-/** === begin UNO includes === **/
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
-#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/graphic/XGraphicProvider.hpp>
-#include <com/sun/star/graphic/GraphicColorMode.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/sdbc/XDatabaseMetaData2.hpp>
-/** === end UNO includes === **/
-
-#include <comphelper/componentcontext.hxx>
-#include <comphelper/listenernotification.hxx>
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/exc_hlp.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <tools/diagnose_ex.h>
-
-#include "resource/sharedresources.hxx"
-#include "resource/hsqldb_res.hrc"
-
-/** === begin UNO using === **/
-using ::com::sun::star::util::XFlushListener;
-using ::com::sun::star::lang::EventObject;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::sdbc::XStatement;
-using ::com::sun::star::sdbc::XConnection;
-using ::com::sun::star::sdbcx::XDataDefinitionSupplier;
-using ::com::sun::star::sdbcx::XTablesSupplier;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::beans::NamedValue;
-using ::com::sun::star::lang::WrappedTargetException;
-using ::com::sun::star::lang::ServiceNotRegisteredException;
-using ::com::sun::star::sdbc::XDriver;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::graphic::XGraphic;
-using ::com::sun::star::graphic::XGraphicProvider;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::lang::IllegalArgumentException;
-using ::com::sun::star::ui::dialogs::XExecutableDialog;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::makeAny;
-using ::com::sun::star::sdbc::XResultSet;
-using ::com::sun::star::sdbc::XDatabaseMetaData;
-using ::com::sun::star::sdbc::XDatabaseMetaData2;
-using ::com::sun::star::sdbc::XRow;
-using ::com::sun::star::sdb::application::XDatabaseDocumentUI;
-using ::com::sun::star::beans::PropertyValue;
-/** === end UNO using === **/
-namespace GraphicColorMode = ::com::sun::star::graphic::GraphicColorMode;
-
-namespace connectivity { namespace hsqldb
-{
- // =============================================================================
- // = FlushListeners
- // =============================================================================
- typedef ::comphelper::OListenerContainerBase< XFlushListener, EventObject > FlushListeners_Base;
- class FlushListeners : public FlushListeners_Base
- {
- public:
- FlushListeners( ::osl::Mutex& _rMutex ) :FlushListeners_Base( _rMutex ) { }
-
- protected:
- virtual bool implTypedNotify(
- const Reference< XFlushListener >& _rxListener,
- const EventObject& _rEvent
- ) SAL_THROW( ( Exception ) );
- };
-
- // -----------------------------------------------------------------------------
- bool FlushListeners::implTypedNotify( const Reference< XFlushListener >& _rxListener, const EventObject& _rEvent ) SAL_THROW( ( Exception ) )
- {
- _rxListener->flushed( _rEvent );
- return true; // continue notifying the other listeners, if any
- }
-
- // =============================================================================
- // = OHsqlConnection
- // =============================================================================
- // -----------------------------------------------------------------------------
- void SAL_CALL OHsqlConnection::disposing(void)
- {
- m_aFlushListeners.disposeAndClear( EventObject( *this ) );
- OHsqlConnection_BASE::disposing();
- OConnectionWrapper::disposing();
- }
- // -----------------------------------------------------------------------------
- OHsqlConnection::OHsqlConnection( const Reference< XDriver > _rxDriver,
- const Reference< XConnection >& _xConnection ,const Reference< XMultiServiceFactory>& _xORB )
- :OHsqlConnection_BASE( m_aMutex )
- ,m_aFlushListeners( m_aMutex )
- ,m_xDriver( _rxDriver )
- ,m_xORB( _xORB )
- ,m_bIni(true)
- ,m_bReadOnly(false)
- {
- setDelegation(_xConnection,_xORB,m_refCount);
- }
- // -----------------------------------------------------------------------------
- OHsqlConnection::~OHsqlConnection()
- {
- if ( !OHsqlConnection_BASE::rBHelper.bDisposed )
- {
- osl_incrementInterlockedCount( &m_refCount );
- dispose();
- }
- }
- // -----------------------------------------------------------------------------
- IMPLEMENT_FORWARD_XINTERFACE2(OHsqlConnection,OHsqlConnection_BASE,OConnectionWrapper)
- IMPLEMENT_SERVICE_INFO(OHsqlConnection, "com.sun.star.sdbc.drivers.hsqldb.OHsqlConnection", "com.sun.star.sdbc.Connection")
- IMPLEMENT_FORWARD_XTYPEPROVIDER2(OHsqlConnection,OHsqlConnection_BASE,OConnectionWrapper)
-
- //--------------------------------------------------------------------
- ::osl::Mutex& OHsqlConnection::getMutex() const
- {
- return m_aMutex;
- }
-
- //--------------------------------------------------------------------
- void OHsqlConnection::checkDisposed() const
- {
- ::connectivity::checkDisposed( rBHelper.bDisposed );
- }
-
- // XFlushable
- //--------------------------------------------------------------------
- void SAL_CALL OHsqlConnection::flush( ) throw (RuntimeException)
- {
- MethodGuard aGuard( *this );
-
- try
- {
- if ( m_xConnection.is() )
- {
- if ( m_bIni )
- {
- m_bIni = false;
- Reference< XDatabaseMetaData2 > xMeta2(m_xConnection->getMetaData(),UNO_QUERY_THROW);
- const Sequence< PropertyValue > aInfo = xMeta2->getConnectionInfo();
- const PropertyValue* pIter = aInfo.getConstArray();
- const PropertyValue* pEnd = pIter + aInfo.getLength();
- for(;pIter != pEnd;++pIter)
- {
- if ( pIter->Name.compareToAscii("readonly") == 0 )
- m_bReadOnly = true;
- }
- }
- if ( !m_bReadOnly )
- {
- Reference< XStatement > xStmt( m_xConnection->createStatement(), UNO_QUERY_THROW );
- xStmt->execute( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CHECKPOINT" ) ) );
- }
- }
-
- EventObject aFlushedEvent( *this );
- m_aFlushListeners.notifyEach( &XFlushListener::flushed, aFlushedEvent );
- }
- catch(const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL OHsqlConnection::addFlushListener( const Reference< XFlushListener >& l ) throw (RuntimeException)
- {
- MethodGuard aGuard( *this );
- m_aFlushListeners.addInterface( l );
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL OHsqlConnection::removeFlushListener( const Reference< XFlushListener >& l ) throw (RuntimeException)
- {
- MethodGuard aGuard( *this );
- m_aFlushListeners.removeInterface( l );
- }
-
- // -------------------------------------------------------------------
- Reference< XGraphic > SAL_CALL OHsqlConnection::getTableIcon( const ::rtl::OUString& _TableName, ::sal_Int32 /*_ColorMode*/ ) throw (RuntimeException)
- {
- MethodGuard aGuard( *this );
-
- impl_checkExistingTable_throw( _TableName );
- if ( !impl_isTextTable_nothrow( _TableName ) )
- return NULL;
-
- return impl_getTextTableIcon_nothrow();
- }
-
- // -------------------------------------------------------------------
- Reference< XInterface > SAL_CALL OHsqlConnection::getTableEditor( const Reference< XDatabaseDocumentUI >& _DocumentUI, const ::rtl::OUString& _TableName ) throw (IllegalArgumentException, WrappedTargetException, RuntimeException)
- {
- MethodGuard aGuard( *this );
-
- impl_checkExistingTable_throw( _TableName );
- if ( !impl_isTextTable_nothrow( _TableName ) )
- return NULL;
-
- if ( !_DocumentUI.is() )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(STR_NO_DOCUMENTUI));
- throw IllegalArgumentException(
- sError,
- *this,
- 0
- );
- } // if ( !_DocumentUI.is() )
-
-
-// Reference< XExecutableDialog > xEditor = impl_createLinkedTableEditor_throw( _DocumentUI, _TableName );
-// return xEditor.get();
- return NULL;
- // editor not yet implemented in this CWS
- }
-
- // -------------------------------------------------------------------
- Reference< XNameAccess > OHsqlConnection::impl_getTableContainer_throw()
- {
- Reference< XNameAccess > xTables;
- try
- {
- Reference< XConnection > xMe( *this, UNO_QUERY );
- Reference< XDataDefinitionSupplier > xDefinitionsSupp( m_xDriver, UNO_QUERY_THROW );
- Reference< XTablesSupplier > xTablesSupp( xDefinitionsSupp->getDataDefinitionByConnection( xMe ), UNO_QUERY_THROW );
- xTables.set( xTablesSupp->getTables(), UNO_QUERY_THROW );
- }
- catch( const RuntimeException& ) { throw; }
- catch( const Exception& )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(STR_NO_TABLE_CONTAINER));
- throw WrappedTargetException( sError ,*this, ::cppu::getCaughtException() );
- }
-
- OSL_POSTCOND( xTables.is(), "OHsqlConnection::impl_getTableContainer_throw: post condition not met!" );
- return xTables;
- }
-
- //TODO: resource
- // -------------------------------------------------------------------
- void OHsqlConnection::impl_checkExistingTable_throw( const ::rtl::OUString& _rTableName )
- {
- bool bDoesExist = false;
- try
- {
- Reference< XNameAccess > xTables( impl_getTableContainer_throw(), UNO_QUERY_THROW );
- if ( xTables.is() )
- bDoesExist = xTables->hasByName( _rTableName );
- }
- catch( const Exception& )
- {
- // that's a serious error in impl_getTableContainer_throw, or hasByName, however, we're only
- // allowed to throw an IllegalArgumentException ourself
- DBG_UNHANDLED_EXCEPTION();
- }
-
- if ( !bDoesExist )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_NO_TABLENAME,
- "$tablename$", _rTableName
- ));
- throw IllegalArgumentException( sError,*this, 0 );
- } // if ( !bDoesExist )
- }
-
- // -------------------------------------------------------------------
- bool OHsqlConnection::impl_isTextTable_nothrow( const ::rtl::OUString& _rTableName )
- {
- bool bIsTextTable = false;
- try
- {
- Reference< XConnection > xMe( *this, UNO_QUERY_THROW );
-
- // split the fully qualified name
- Reference< XDatabaseMetaData > xMetaData( xMe->getMetaData(), UNO_QUERY_THROW );
- ::rtl::OUString sCatalog, sSchema, sName;
- ::dbtools::qualifiedNameComponents( xMetaData, _rTableName, sCatalog, sSchema, sName, ::dbtools::eComplete );
-
- // get the table information
- ::rtl::OUStringBuffer sSQL;
- sSQL.appendAscii( "SELECT HSQLDB_TYPE FROM INFORMATION_SCHEMA.SYSTEM_TABLES" );
- HTools::appendTableFilterCrit( sSQL, sCatalog, sSchema, sName, true );
- sSQL.appendAscii( " AND TABLE_TYPE = 'TABLE'" );
-
- Reference< XStatement > xStatement( xMe->createStatement(), UNO_QUERY_THROW );
- Reference< XResultSet > xTableHsqlType( xStatement->executeQuery( sSQL.makeStringAndClear() ), UNO_QUERY_THROW );
-
- if ( xTableHsqlType->next() ) // might not succeed in case of VIEWs
- {
- Reference< XRow > xValueAccess( xTableHsqlType, UNO_QUERY_THROW );
- ::rtl::OUString sTableType = xValueAccess->getString( 1 );
- bIsTextTable = sTableType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "TEXT" ) );
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- return bIsTextTable;
- }
-
- // -------------------------------------------------------------------
- Reference< XGraphic > OHsqlConnection::impl_getTextTableIcon_nothrow()
- {
- Reference< XGraphic > xGraphic;
- try
- {
- // create a graphic provider
- Reference< XGraphicProvider > xProvider;
- if ( m_xORB.is() )
- xProvider.set( m_xORB->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.graphic.GraphicProvider" ) ) ), UNO_QUERY_THROW );
-
- // assemble the image URL
- ::rtl::OUStringBuffer aImageURL;
- // load the graphic from the global graphic repository
- aImageURL.appendAscii( "private:graphicrepository/" );
- // the relative path within the images.zip
- aImageURL.appendAscii( "database/" );
- aImageURL.appendAscii( LINKED_TEXT_TABLE_IMAGE_RESOURCE );
- // the name of the graphic to use
- ::rtl::OUString sImageURL( aImageURL.makeStringAndClear() );
-
- // ask the provider to obtain a graphic
- Sequence< PropertyValue > aMediaProperties( 1 );
- aMediaProperties[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
- aMediaProperties[0].Value <<= sImageURL;
- xGraphic = xProvider->queryGraphic( aMediaProperties );
- OSL_ENSURE( xGraphic.is(), "OHsqlConnection::impl_getTextTableIcon_nothrow: the provider did not give us a graphic object!" );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return xGraphic;
- }
-
-} } // namespace connectivity::hsqldb
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
deleted file mode 100644
index bdad9dac75..0000000000
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ /dev/null
@@ -1,924 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "hsqldb/HDriver.hxx"
-#include "hsqldb/HConnection.hxx"
-#include <osl/diagnose.h>
-#include "connectivity/dbexception.hxx"
-#include <com/sun/star/sdbc/XDriverAccess.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/embed/XTransactionBroadcaster.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-#include "TConnection.hxx"
-#include "hsqldb/HStorageMap.hxx"
-#include <jvmfwk/framework.h>
-#include <com/sun/star/reflection/XProxyFactory.hpp>
-#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-#include <com/sun/star/lang/Locale.hpp>
-#include <com/sun/star/util/XFlushable.hpp>
-#include "HTerminateListener.hxx"
-#include "hsqldb/HCatalog.hxx"
-#include "diagnose_ex.h"
-#include <rtl/ustrbuf.hxx>
-#include <osl/file.h>
-#include <osl/process.h>
-#include <connectivity/dbexception.hxx>
-#include <comphelper/namedvaluecollection.hxx>
-#include <unotools/confignode.hxx>
-#include <unotools/ucbstreamhelper.hxx>
-#include "resource/hsqldb_res.hrc"
-#include "resource/sharedresources.hxx"
-
-#include <o3tl/compat_functional.hxx>
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
- using namespace hsqldb;
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::sdbcx;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::frame;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::embed;
- using namespace ::com::sun::star::io;
- using namespace ::com::sun::star::task;
- using namespace ::com::sun::star::util;
- using namespace ::com::sun::star::reflection;
-
- namespace hsqldb
- {
- Reference< XInterface > SAL_CALL ODriverDelegator_CreateInstance(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFac) throw( Exception )
- {
- return *(new ODriverDelegator(_rxFac));
- }
- }
-
-
-
- //====================================================================
- //= ODriverDelegator
- //====================================================================
- //--------------------------------------------------------------------
- ODriverDelegator::ODriverDelegator(const Reference< XMultiServiceFactory >& _rxFactory)
- : ODriverDelegator_BASE(m_aMutex)
- ,m_xFactory(_rxFactory)
- ,m_bInShutDownConnections(sal_False)
- {
- }
-
- //--------------------------------------------------------------------
- ODriverDelegator::~ODriverDelegator()
- {
- try
- {
- ::comphelper::disposeComponent(m_xDriver);
- }
- catch(const Exception&)
- {
- }
- }
-
- // --------------------------------------------------------------------------------
- void SAL_CALL ODriverDelegator::disposing()
- {
- ::osl::MutexGuard aGuard(m_aMutex);
-
- try
- {
- for (TWeakPairVector::iterator i = m_aConnections.begin(); m_aConnections.end() != i; ++i)
- {
- Reference<XInterface > xTemp = i->first.get();
- ::comphelper::disposeComponent(xTemp);
- }
- }
- catch(Exception&)
- {
- // not interested in
- }
- m_aConnections.clear();
- TWeakPairVector().swap(m_aConnections);
-
- cppu::WeakComponentImplHelperBase::disposing();
- }
- //--------------------------------------------------------------------
- Reference< XDriver > ODriverDelegator::loadDriver( )
- {
- if ( !m_xDriver.is() )
- {
- ::rtl::OUString sURL(RTL_CONSTASCII_USTRINGPARAM("jdbc:hsqldb:db"));
- Reference<XDriverAccess> xDriverAccess(m_xFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.DriverManager")) ),UNO_QUERY);
- OSL_ENSURE(xDriverAccess.is(),"Could not load driver manager!");
- if ( xDriverAccess.is() )
- m_xDriver = xDriverAccess->getDriverByURL(sURL);
- }
-
- return m_xDriver;
- }
-
- //--------------------------------------------------------------------
- namespace
- {
- ::rtl::OUString lcl_getPermittedJavaMethods_nothrow( const Reference< XMultiServiceFactory >& _rxORB )
- {
- ::rtl::OUStringBuffer aConfigPath;
- aConfigPath.appendAscii( "/org.openoffice.Office.DataAccess/DriverSettings/" );
- aConfigPath.append ( ODriverDelegator::getImplementationName_Static() );
- aConfigPath.appendAscii( "/PermittedJavaMethods" );
- ::utl::OConfigurationTreeRoot aConfig( ::utl::OConfigurationTreeRoot::createWithServiceFactory(
- _rxORB, aConfigPath.makeStringAndClear() ) );
-
- ::rtl::OUStringBuffer aPermittedMethods;
- Sequence< ::rtl::OUString > aNodeNames( aConfig.getNodeNames() );
- for ( const ::rtl::OUString* pNodeNames = aNodeNames.getConstArray();
- pNodeNames != aNodeNames.getConstArray() + aNodeNames.getLength();
- ++pNodeNames
- )
- {
- ::rtl::OUString sPermittedMethod;
- OSL_VERIFY( aConfig.getNodeValue( *pNodeNames ) >>= sPermittedMethod );
-
- if ( aPermittedMethods.getLength() )
- aPermittedMethods.append( (sal_Unicode)';' );
- aPermittedMethods.append( sPermittedMethod );
- }
-
- return aPermittedMethods.makeStringAndClear();;
- }
- }
-
- //--------------------------------------------------------------------
- Reference< XConnection > SAL_CALL ODriverDelegator::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw (SQLException, RuntimeException)
- {
- Reference< XConnection > xConnection;
- if ( acceptsURL(url) )
- {
- Reference< XDriver > xDriver = loadDriver();
- if ( xDriver.is() )
- {
- ::rtl::OUString sURL;
- Reference<XStorage> xStorage;
- const PropertyValue* pIter = info.getConstArray();
- const PropertyValue* pEnd = pIter + info.getLength();
-
- for (;pIter != pEnd; ++pIter)
- {
- if ( pIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Storage")) )
- {
- xStorage.set(pIter->Value,UNO_QUERY);
- }
- else if ( pIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URL")) )
- {
- pIter->Value >>= sURL;
- }
- }
-
- if ( !xStorage.is() || !sURL.getLength() )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_NO_STROAGE);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- }
-
- ::rtl::OUString sSystemPath;
- osl_getSystemPathFromFileURL( sURL.pData, &sSystemPath.pData );
- sal_Int32 nIndex = sSystemPath.lastIndexOf('.');
- if ( !sURL.getLength() || !sSystemPath.getLength() )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_INVALID_FILE_URL);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- }
-
- bool bIsNewDatabase = !xStorage->hasElements();
-
- ::comphelper::NamedValueCollection aProperties;
-
- // properties for accessing the embedded storage
- ::rtl::OUString sConnPartURL = sSystemPath.copy( 0, ::std::max< sal_Int32 >( nIndex, sSystemPath.getLength() ) );
- ::rtl::OUString sKey = StorageContainer::registerStorage( xStorage, sConnPartURL );
- aProperties.put( "storage_key", sKey );
- aProperties.put( "storage_class_name",
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbcx.comp.hsqldb.StorageAccess" ) ) );
- aProperties.put( "fileaccess_class_name",
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbcx.comp.hsqldb.StorageFileAccess" ) ) );
-
- // JDBC driver and driver's classpath
- aProperties.put( "JavaDriverClass",
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.hsqldb.jdbcDriver" ) ) );
- aProperties.put( "JavaDriverClassPath",
- ::rtl::OUString(
-#ifdef SYSTEM_HSQLDB
- RTL_CONSTASCII_USTRINGPARAM(HSQLDB_JAR
- " vnd.sun.star.expand:$OOO_BASE_DIR/program/classes/sdbc_hsqldb.jar" )
-#else
- RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.expand:$OOO_BASE_DIR/program/classes/hsqldb.jar"
- " vnd.sun.star.expand:$OOO_BASE_DIR/program/classes/sdbc_hsqldb.jar" )
-#endif
- ) );
-
- // auto increment handling
- aProperties.put( "IsAutoRetrievingEnabled", true );
- aProperties.put( "AutoRetrievingStatement",
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CALL IDENTITY()" ) ) );
- aProperties.put( "IgnoreDriverPrivileges", true );
-
- // don't want to expose HSQLDB's schema capabilities which exist since 1.8.0RC10
- aProperties.put( "default_schema",
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
-
- // security: permitted Java classes
- NamedValue aPermittedClasses(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "hsqldb.method_class_names" ) ),
- makeAny( lcl_getPermittedJavaMethods_nothrow( m_xFactory ) )
- );
- aProperties.put( "SystemProperties", Sequence< NamedValue >( &aPermittedClasses, 1 ) );
-
- const ::rtl::OUString sProperties( RTL_CONSTASCII_USTRINGPARAM( "properties" ) );
- ::rtl::OUString sMessage;
- try
- {
- if ( !bIsNewDatabase && xStorage->isStreamElement(sProperties) )
- {
- Reference<XStream > xStream = xStorage->openStreamElement(sProperties,ElementModes::READ);
- if ( xStream.is() )
- {
- ::std::auto_ptr<SvStream> pStream( ::utl::UcbStreamHelper::CreateStream(xStream) );
- if ( pStream.get() )
- {
- ByteString sLine;
- ByteString sVersionString;
- while ( pStream->ReadLine(sLine) )
- {
- if ( sLine.Len() == 0 )
- continue;
- const ByteString sIniKey = sLine.GetToken( 0, '=' );
- const ByteString sValue = sLine.GetToken( 1, '=' );
- if ( sIniKey.Equals( "hsqldb.compatible_version" ) )
- {
- sVersionString = sValue;
- }
- else
- {
- if ( sIniKey.Equals( "version" )
- && ( sVersionString.Len() == 0 )
- )
- {
- sVersionString = sValue;
- }
- }
- }
- if ( sVersionString.Len() )
- {
- const sal_Int32 nMajor = sVersionString.GetToken(0,'.').ToInt32();
- const sal_Int32 nMinor = sVersionString.GetToken(1,'.').ToInt32();
- const sal_Int32 nMicro = sVersionString.GetToken(2,'.').ToInt32();
- if ( nMajor > 1
- || ( nMajor == 1 && nMinor > 8 )
- || ( nMajor == 1 && nMinor == 8 && nMicro > 0 ) )
- {
- ::connectivity::SharedResources aResources;
- sMessage = aResources.getResourceString(STR_ERROR_NEW_VERSION);
- }
- }
- }
- } // if ( xStream.is() )
- ::comphelper::disposeComponent(xStream);
- }
- }
- catch(Exception&)
- {
- }
- if ( sMessage.getLength() )
- {
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- }
-
- // readonly?
- Reference<XPropertySet> xProp(xStorage,UNO_QUERY);
- if ( xProp.is() )
- {
- sal_Int32 nMode = 0;
- xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OpenMode"))) >>= nMode;
- if ( (nMode & ElementModes::WRITE) != ElementModes::WRITE )
- {
- aProperties.put( "readonly", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
- }
- }
-
- Sequence< PropertyValue > aConnectionArgs;
- aProperties >>= aConnectionArgs;
-
- ::rtl::OUString sConnectURL(RTL_CONSTASCII_USTRINGPARAM("jdbc:hsqldb:"));
-
- sConnectURL += sConnPartURL;
- Reference<XConnection> xOrig;
- try
- {
- xOrig = xDriver->connect( sConnectURL, aConnectionArgs );
- }
- catch(const Exception& e)
- {
- StorageContainer::revokeStorage(sKey,NULL);
- (void)e;
- throw;
- }
-
- // if the storage is completely empty, then we just created a new HSQLDB
- // In this case, do some initializations.
- if ( bIsNewDatabase && xOrig.is() )
- onConnectedNewDatabase( xOrig );
-
- if ( xOrig.is() )
- {
- OMetaConnection* pMetaConnection = NULL;
- // now we have to set the URL to get the correct answer for metadata()->getURL()
- Reference< XUnoTunnel> xTunnel(xOrig,UNO_QUERY);
- if ( xTunnel.is() )
- {
- pMetaConnection = reinterpret_cast<OMetaConnection*>(xTunnel->getSomething( OMetaConnection::getUnoTunnelImplementationId() ));
- if ( pMetaConnection )
- pMetaConnection->setURL(url);
- }
-
- Reference<XComponent> xComp(xOrig,UNO_QUERY);
- if ( xComp.is() )
- xComp->addEventListener(this);
-
- // we want to close all connections when the office shuts down
- static Reference< XTerminateListener> s_xTerminateListener;
- if( !s_xTerminateListener.is() )
- {
- Reference< XDesktop > xDesktop( m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY );
-
- if( xDesktop.is() )
- {
- s_xTerminateListener = new OConnectionController(this);
- xDesktop->addTerminateListener(s_xTerminateListener);
- }
- }
- Reference< XComponent> xIfc = new OHsqlConnection( this, xOrig, m_xFactory );
- xConnection.set(xIfc,UNO_QUERY);
- m_aConnections.push_back(TWeakPair(WeakReferenceHelper(xOrig),TWeakConnectionPair(sKey,TWeakRefPair(WeakReferenceHelper(xConnection),WeakReferenceHelper()))));
-
- Reference<XTransactionBroadcaster> xBroad(xStorage,UNO_QUERY);
- if ( xBroad.is() )
- {
- Reference<XTransactionListener> xListener(*this,UNO_QUERY);
- xBroad->addTransactionListener(xListener);
- }
- }
- }
- }
- return xConnection;
- }
-
- //--------------------------------------------------------------------
- sal_Bool SAL_CALL ODriverDelegator::acceptsURL( const ::rtl::OUString& url ) throw (SQLException, RuntimeException)
- {
- sal_Bool bEnabled = sal_False;
- OSL_VERIFY_EQUALS( jfw_getEnabled( &bEnabled ), JFW_E_NONE, "error in jfw_getEnabled" );
- return bEnabled && url.compareToAscii("sdbc:embedded:hsqldb",sizeof("sdbc:embedded:hsqldb")) == 0;
- }
-
- //--------------------------------------------------------------------
- Sequence< DriverPropertyInfo > SAL_CALL ODriverDelegator::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw (SQLException, RuntimeException)
- {
- if ( !acceptsURL(url) )
- return Sequence< DriverPropertyInfo >();
- ::std::vector< DriverPropertyInfo > aDriverInfo;
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Storage"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Defines the storage where the database will be stored."))
- ,sal_True
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Defines the url of the data source."))
- ,sal_True
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoRetrievingStatement"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Defines the statement which will be executed to retrieve auto increment values."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CALL IDENTITY()"))
- ,Sequence< ::rtl::OUString >())
- );
- return Sequence< DriverPropertyInfo >(&aDriverInfo[0],aDriverInfo.size());
- }
-
- //--------------------------------------------------------------------
- sal_Int32 SAL_CALL ODriverDelegator::getMajorVersion( ) throw (RuntimeException)
- {
- return 1;
- }
-
- //--------------------------------------------------------------------
- sal_Int32 SAL_CALL ODriverDelegator::getMinorVersion( ) throw (RuntimeException)
- {
- return 0;
- }
-
- //--------------------------------------------------------------------
- Reference< XTablesSupplier > SAL_CALL ODriverDelegator::getDataDefinitionByConnection( const Reference< XConnection >& connection ) throw (SQLException, RuntimeException)
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODriverDelegator_BASE::rBHelper.bDisposed);
-
- Reference< XTablesSupplier > xTab;
-
- TWeakPairVector::iterator aEnd = m_aConnections.end();
- for (TWeakPairVector::iterator i = m_aConnections.begin(); aEnd != i; ++i)
- {
- if ( i->second.second.first.get() == connection.get() )
- {
- xTab = Reference< XTablesSupplier >(i->second.second.second.get().get(),UNO_QUERY);
- if ( !xTab.is() )
- {
- xTab = new OHCatalog(connection);
- i->second.second.second = WeakReferenceHelper(xTab);
- }
- break;
- }
- }
-
- return xTab;
- }
-
- //--------------------------------------------------------------------
- Reference< XTablesSupplier > SAL_CALL ODriverDelegator::getDataDefinitionByURL( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw (SQLException, RuntimeException)
- {
- if ( ! acceptsURL(url) )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- }
-
- return getDataDefinitionByConnection(connect(url,info));
- }
-
- // XServiceInfo
- // --------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- rtl::OUString ODriverDelegator::getImplementationName_Static( ) throw(RuntimeException)
- {
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.comp.hsqldb.Driver"));
- }
- //------------------------------------------------------------------------------
- Sequence< ::rtl::OUString > ODriverDelegator::getSupportedServiceNames_Static( ) throw (RuntimeException)
- {
- Sequence< ::rtl::OUString > aSNS( 2 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"));
- aSNS[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Driver"));
- return aSNS;
- }
- //------------------------------------------------------------------
- ::rtl::OUString SAL_CALL ODriverDelegator::getImplementationName( ) throw(RuntimeException)
- {
- return getImplementationName_Static();
- }
-
- //------------------------------------------------------------------
- sal_Bool SAL_CALL ODriverDelegator::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
- {
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
- }
- //------------------------------------------------------------------
- Sequence< ::rtl::OUString > SAL_CALL ODriverDelegator::getSupportedServiceNames( ) throw(RuntimeException)
- {
- return getSupportedServiceNames_Static();
- }
- //------------------------------------------------------------------
- void SAL_CALL ODriverDelegator::createCatalog( const Sequence< PropertyValue >& /*info*/ ) throw (SQLException, ::com::sun::star::container::ElementExistException, RuntimeException)
- {
- ::dbtools::throwFeatureNotImplementedException( "XCreateCatalog::createCatalog", *this );
- }
- //------------------------------------------------------------------
- void ODriverDelegator::shutdownConnection(const TWeakPairVector::iterator& _aIter )
- {
- OSL_ENSURE(m_aConnections.end() != _aIter,"Iterator equals .end()");
- sal_Bool bLastOne = sal_True;
- try
- {
- Reference<XConnection> _xConnection(_aIter->first.get(),UNO_QUERY);
-
- if ( _xConnection.is() )
- {
- Reference<XStatement> xStmt = _xConnection->createStatement();
- if ( xStmt.is() )
- {
- Reference<XResultSet> xRes(xStmt->executeQuery(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT COUNT(*) FROM INFORMATION_SCHEMA.SYSTEM_SESSIONS WHERE USER_NAME ='SA'"))),UNO_QUERY);
- Reference<XRow> xRow(xRes,UNO_QUERY);
- if ( xRow.is() && xRes->next() )
- bLastOne = xRow->getInt(1) == 1;
- if ( bLastOne )
- xStmt->execute(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SHUTDOWN")));
- }
- }
- }
- catch(Exception&)
- {
- }
- if ( bLastOne )
- {
- // Reference<XTransactionListener> xListener(*this,UNO_QUERY);
- // a shutdown should commit all changes to the db files
- StorageContainer::revokeStorage(_aIter->second.first,NULL);
- }
- if ( !m_bInShutDownConnections )
- m_aConnections.erase(_aIter);
- }
- //------------------------------------------------------------------
- void SAL_CALL ODriverDelegator::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException)
- {
- ::osl::MutexGuard aGuard(m_aMutex);
- Reference<XConnection> xCon(Source.Source,UNO_QUERY);
- if ( xCon.is() )
- {
- TWeakPairVector::iterator i = m_aConnections.begin();
- for (; m_aConnections.end() != i; ++i)
- {
- if ( i->first.get() == xCon.get() )
- {
- shutdownConnection(i);
- break;
- }
- }
- }
- else
- {
- Reference< XStorage> xStorage(Source.Source,UNO_QUERY);
- if ( xStorage.is() )
- {
- ::rtl::OUString sKey = StorageContainer::getRegisteredKey(xStorage);
- TWeakPairVector::iterator i = ::std::find_if(m_aConnections.begin(),m_aConnections.end(),::o3tl::compose1(
- ::std::bind2nd(::std::equal_to< ::rtl::OUString >(),sKey)
- ,::o3tl::compose1(::o3tl::select1st<TWeakConnectionPair>(),::o3tl::select2nd< TWeakPair >())));
- if ( i != m_aConnections.end() )
- shutdownConnection(i);
- }
- }
- }
- //------------------------------------------------------------------
- void ODriverDelegator::shutdownConnections()
- {
- m_bInShutDownConnections = sal_True;
- TWeakPairVector::iterator aEnd = m_aConnections.end();
- for (TWeakPairVector::iterator i = m_aConnections.begin(); aEnd != i; ++i)
- {
- try
- {
- Reference<XConnection> xCon(i->first,UNO_QUERY);
- ::comphelper::disposeComponent(xCon);
- }
- catch(Exception&)
- {
- }
- }
- m_aConnections.clear();
- m_bInShutDownConnections = sal_True;
- }
- //------------------------------------------------------------------
- void ODriverDelegator::flushConnections()
- {
- TWeakPairVector::iterator aEnd = m_aConnections.end();
- for (TWeakPairVector::iterator i = m_aConnections.begin(); aEnd != i; ++i)
- {
- try
- {
- Reference<XFlushable> xCon(i->second.second.first.get(),UNO_QUERY);
- xCon->flush();
- }
- catch(Exception&)
- {
- }
- }
- }
- //------------------------------------------------------------------
- void SAL_CALL ODriverDelegator::preCommit( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
- {
- ::osl::MutexGuard aGuard(m_aMutex);
-
- Reference< XStorage> xStorage(aEvent.Source,UNO_QUERY);
- ::rtl::OUString sKey = StorageContainer::getRegisteredKey(xStorage);
- if ( sKey.getLength() )
- {
- TWeakPairVector::iterator i = ::std::find_if(m_aConnections.begin(),m_aConnections.end(),::o3tl::compose1(
- ::std::bind2nd(::std::equal_to< ::rtl::OUString >(),sKey)
- ,::o3tl::compose1(::o3tl::select1st<TWeakConnectionPair>(),::o3tl::select2nd< TWeakPair >())));
- OSL_ENSURE( i != m_aConnections.end(), "ODriverDelegator::preCommit: they're committing a storage which I do not know!" );
- if ( i != m_aConnections.end() )
- {
- try
- {
- Reference<XConnection> xConnection(i->first,UNO_QUERY);
- if ( xConnection.is() )
- {
- Reference< XStatement> xStmt = xConnection->createStatement();
- OSL_ENSURE( xStmt.is(), "ODriverDelegator::preCommit: no statement!" );
- if ( xStmt.is() )
- xStmt->execute( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SET WRITE_DELAY 0" ) ) );
-
- sal_Bool bPreviousAutoCommit = xConnection->getAutoCommit();
- xConnection->setAutoCommit( sal_False );
- xConnection->commit();
- xConnection->setAutoCommit( bPreviousAutoCommit );
-
- if ( xStmt.is() )
- xStmt->execute( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SET WRITE_DELAY 60" ) ) );
- }
- }
- catch(Exception&)
- {
- OSL_FAIL( "ODriverDelegator::preCommit: caught an exception!" );
- }
- }
- }
- }
- //------------------------------------------------------------------
- void SAL_CALL ODriverDelegator::commited( const ::com::sun::star::lang::EventObject& /*aEvent*/ ) throw (::com::sun::star::uno::RuntimeException)
- {
- }
- //------------------------------------------------------------------
- void SAL_CALL ODriverDelegator::preRevert( const ::com::sun::star::lang::EventObject& /*aEvent*/ ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
- {
- }
- //------------------------------------------------------------------
- void SAL_CALL ODriverDelegator::reverted( const ::com::sun::star::lang::EventObject& /*aEvent*/ ) throw (::com::sun::star::uno::RuntimeException)
- {
- }
- //------------------------------------------------------------------
- namespace
- {
- //..............................................................
- const sal_Char* lcl_getCollationForLocale( const ::rtl::OUString& _rLocaleString, bool _bAcceptCountryMismatch = false )
- {
- static const sal_Char* pTranslations[] =
- {
- "af-ZA", "Afrikaans",
- "am-ET", "Amharic",
- "ar", "Arabic",
- "as-IN", "Assamese",
- "az-AZ", "Azerbaijani_Latin",
- "az-cyrillic", "Azerbaijani_Cyrillic",
- "be-BY", "Belarusian",
- "bg-BG", "Bulgarian",
- "bn-IN", "Bengali",
- "bo-CN", "Tibetan",
- "bs-BA", "Bosnian",
- "ca-ES", "Catalan",
- "cs-CZ", "Czech",
- "cy-GB", "Welsh",
- "da-DK", "Danish",
- "de-DE", "German",
- "el-GR", "Greek",
- "en-US", "Latin1_General",
- "es-ES", "Spanish",
- "et-EE", "Estonian",
- "eu", "Basque",
- "fi-FI", "Finnish",
- "fr-FR", "French",
- "gn-PY", "Guarani",
- "gu-IN", "Gujarati",
- "ha-NG", "Hausa",
- "he-IL", "Hebrew",
- "hi-IN", "Hindi",
- "hr-HR", "Croatian",
- "hu-HU", "Hungarian",
- "hy-AM", "Armenian",
- "id-ID", "Indonesian",
- "ig-NG", "Igbo",
- "is-IS", "Icelandic",
- "it-IT", "Italian",
- "iu-CA", "Inuktitut",
- "ja-JP", "Japanese",
- "ka-GE", "Georgian",
- "kk-KZ", "Kazakh",
- "km-KH", "Khmer",
- "kn-IN", "Kannada",
- "ko-KR", "Korean",
- "kok-IN", "Konkani",
- "ks", "Kashmiri",
- "ky-KG", "Kirghiz",
- "lo-LA", "Lao",
- "lt-LT", "Lithuanian",
- "lv-LV", "Latvian",
- "mi-NZ", "Maori",
- "mk-MK", "Macedonian",
- "ml-IN", "Malayalam",
- "mn-MN", "Mongolian",
- "mni-IN", "Manipuri",
- "mr-IN", "Marathi",
- "ms-MY", "Malay",
- "mt-MT", "Maltese",
- "my-MM", "Burmese",
- "nb-NO", "Danish_Norwegian",
- "ne-NP", "Nepali",
- "nl-NL", "Dutch",
- "nn-NO", "Norwegian",
- "or-IN", "Oriya",
- "pa-IN", "Punjabi",
- "pl-PL", "Polish",
- "ps-AF", "Pashto",
- "pt-PT", "Portuguese",
- "ro-RO", "Romanian",
- "ru-RU", "Russian",
- "sa-IN", "Sanskrit",
- "sd-IN", "Sindhi",
- "sk-SK", "Slovak",
- "sl-SI", "Slovenian",
- "so-SO", "Somali",
- "sq-AL", "Albanian",
- "sr-YU", "Serbian_Cyrillic",
- "sv-SE", "Swedish",
- "sw-KE", "Swahili",
- "ta-IN", "Tamil",
- "te-IN", "Telugu",
- "tg-TJ", "Tajik",
- "th-TH", "Thai",
- "tk-TM", "Turkmen",
- "tn-BW", "Tswana",
- "tr-TR", "Turkish",
- "tt-RU", "Tatar",
- "uk-UA", "Ukrainian",
- "ur-PK", "Urdu",
- "uz-UZ", "Uzbek_Latin",
- "ven-ZA", "Venda",
- "vi-VN", "Vietnamese",
- "yo-NG", "Yoruba",
- "zh-CN", "Chinese",
- "zu-ZA", "Zulu",
- NULL, NULL
- };
-
- ::rtl::OUString sLocaleString( _rLocaleString );
- sal_Char nCompareTermination = 0;
-
- if ( _bAcceptCountryMismatch )
- {
- // strip the country part from the compare string
- sal_Int32 nCountrySep = sLocaleString.indexOf( '-' );
- if ( nCountrySep > -1 )
- sLocaleString = sLocaleString.copy( 0, nCountrySep );
-
- // the entries in the translation table are compared until the
- // - character only, not until the terminating 0
- nCompareTermination = '-';
- }
-
- const sal_Char** pLookup = pTranslations;
- for ( ; *pLookup; pLookup +=2 )
- {
- sal_Int32 nCompareUntil = 0;
- while ( (*pLookup)[ nCompareUntil ] != nCompareTermination && (*pLookup)[ nCompareUntil ] != 0 )
- ++nCompareUntil;
-
- if ( sLocaleString.equalsAsciiL( *pLookup, nCompareUntil ) )
- return *( pLookup + 1 );
- }
-
- if ( !_bAcceptCountryMismatch )
- // second round, this time without matching the country
- return lcl_getCollationForLocale( _rLocaleString, true );
-
- OSL_FAIL( "lcl_getCollationForLocale: unknown locale string, falling back to Latin1_General!" );
- return "Latin1_General";
- }
-
- //..............................................................
- ::rtl::OUString lcl_getSystemLocale( const Reference< XMultiServiceFactory >& _rxORB )
- {
- ::rtl::OUString sLocaleString = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "en-US" ) );
- try
- {
- //.........................................................
- Reference< XMultiServiceFactory > xConfigProvider(
- _rxORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider")) ),
- UNO_QUERY
- );
- OSL_ENSURE( xConfigProvider.is(), "lcl_getSystemLocale: could not create the config provider!" );
-
- if ( !xConfigProvider.is() )
- return sLocaleString;
-
- //.........................................................
- // arguments for creating the config access
- Sequence< Any > aArguments(2);
- // the path to the node to open
- ::rtl::OUString sNodePath(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup/L10N" ));
- aArguments[0] <<= PropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")), 0,
- makeAny( sNodePath ), PropertyState_DIRECT_VALUE
- );
- // the depth: -1 means unlimited
- aArguments[1] <<= PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("depth")), 0,
- makeAny( (sal_Int32)-1 ), PropertyState_DIRECT_VALUE
- );
-
- //.........................................................
- // create the access
- Reference< XPropertySet > xNode(
- xConfigProvider->createInstanceWithArguments(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")),
- aArguments ),
- UNO_QUERY );
- OSL_ENSURE( xNode.is(), "lcl_getSystemLocale: invalid access returned (should throw an exception instead)!" );
-
- //.........................................................
- // ask for the system locale setting
- if ( xNode.is() )
- xNode->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooSetupSystemLocale" ) ) ) >>= sLocaleString;
- }
- catch( const Exception& )
- {
- OSL_FAIL( "lcl_getSystemLocale: caught an exception!" );
- }
- if ( !sLocaleString.getLength() )
- {
- rtl_Locale* pProcessLocale = NULL;
- osl_getProcessLocale( &pProcessLocale );
-
- ::rtl::OUStringBuffer aProcLocale;
- aProcLocale.append( pProcessLocale->Language->buffer, pProcessLocale->Language->length );
- if ( pProcessLocale->Country->length )
- {
- aProcLocale.appendAscii( "-" );
- aProcLocale.append( pProcessLocale->Country->buffer, pProcessLocale->Country->length );
- }
- sLocaleString = aProcLocale.makeStringAndClear();
- }
- return sLocaleString;
- }
- }
- //------------------------------------------------------------------
- void ODriverDelegator::onConnectedNewDatabase( const Reference< XConnection >& _rxConnection )
- {
- try
- {
- Reference< XStatement > xStatement = _rxConnection->createStatement();
- OSL_ENSURE( xStatement.is(), "ODriverDelegator::onConnectedNewDatabase: could not create a statement!" );
- if ( xStatement.is() )
- {
- ::rtl::OUStringBuffer aStatement;
- aStatement.appendAscii( "SET DATABASE COLLATION \"" );
- aStatement.appendAscii( lcl_getCollationForLocale( lcl_getSystemLocale( m_xFactory ) ) );
- aStatement.appendAscii( "\"" );
-
- xStatement->execute( aStatement.makeStringAndClear() );
- }
- }
- catch( const Exception& )
- {
- OSL_FAIL( "ODriverDelegator::onConnectedNewDatabase: caught an exception!" );
- }
- }
-
- //------------------------------------------------------------------
- //------------------------------------------------------------------
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HStorage.hxx b/connectivity/source/drivers/hsqldb/HStorage.hxx
deleted file mode 100644
index f13dc3be28..0000000000
--- a/connectivity/source/drivers/hsqldb/HStorage.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_HSQLDB_STORAGE_HXX
-#define CONNECTIVITY_HSQLDB_STORAGE_HXX
-
-#include <cppuhelper/compbase6.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/io/XStream.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/io/XSeekable.hpp>
-#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include "connectivity/CommonTools.hxx"
-#include <comphelper/broadcasthelper.hxx>
-
-
-#define DECLARE_SERVICE_INFO_STATIC() \
- DECLARE_SERVICE_INFO(); \
- static ::rtl::OUString SAL_CALL getImplementationName_Static( ) throw (::com::sun::star::uno::RuntimeException); \
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException); \
- static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > \
- SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&) \
-
-
-namespace connectivity
-{
- namespace hsqldb
- {
- typedef ::cppu::WeakComponentImplHelper6< ::com::sun::star::io::XStream
- , ::com::sun::star::io::XInputStream
- , ::com::sun::star::io::XOutputStream
- , ::com::sun::star::io::XSeekable
- , ::com::sun::star::lang::XInitialization
- , ::com::sun::star::lang::XServiceInfo> OStorage_Base;
- class OStorage : public ::comphelper::OBaseMutex
- ,public OStorage_Base
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
- ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentSubStorageSupplier> m_xDS;
-
-
- ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage> m_xStorge;
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xStream;
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xIn;
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > m_xOut;
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable > m_xSeek;
-
- OStorage(); // never implemented
- OStorage(const OStorage&); // never implemented
- int operator= (const OStorage&); // never implemented
-
- OStorage(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
- protected:
- /** this function is called upon disposing the component
- */
- virtual void SAL_CALL disposing();
- public:
- // ::com::sun::star::lang::XServiceInfo
- DECLARE_SERVICE_INFO_STATIC();
-
- // XInitialization
- virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- // XStream
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XInputStream
- virtual ::sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL skipBytes( ::sal_Int32 nBytesToSkip ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL available( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeInput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
- // XOutputStream
- virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL flush( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeOutput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
- // XSeekable
- virtual void SAL_CALL seek( ::sal_Int64 location ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int64 SAL_CALL getPosition( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int64 SAL_CALL getLength( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- };
- }
-// .......................................................................
-} // connectivity
-// .......................................................................
-#endif // CONNECTIVITY_HSQLDB_STORAGE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
deleted file mode 100644
index d1572e9753..0000000000
--- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
+++ /dev/null
@@ -1,554 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "hsqldb/HStorageAccess.hxx"
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/io/XStream.hpp>
-#include "hsqldb/HStorageMap.hxx"
-#include "hsqldb/StorageNativeInputStream.h"
-#include "accesslog.hxx"
-#include "diagnose_ex.h"
-
-#include <string.h>
-
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::embed;
-using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::lang;
-using namespace ::connectivity::hsqldb;
-
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
-#define ThrowException(env, type, msg) { \
- env->ThrowNew(env->FindClass(type), msg); }
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: openStream
- * Signature: (Ljava/lang/String;Ljava/lang/String;I)V
- */
-SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_openStream
- (JNIEnv * env, jobject /*obj_this*/,jstring name, jstring key, jint mode)
-{
-#ifdef HSQLDB_DBG
- {
- OperationLogFile( env, name, "data" ).logOperation( "openStream" );
- LogFile( env, name, "data" ).create();
- }
-#endif
-
- StorageContainer::registerStream(env,name,key,mode);
-}
-// -----------------------------------------------------------------------------
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: close
- * Signature: (Ljava/lang/String;Ljava/lang/String;)V
- */
-SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_close
- (JNIEnv * env, jobject /*obj_this*/,jstring name, jstring key)
-{
-#ifdef HSQLDB_DBG
- {
- ::rtl::OUString sKey = StorageContainer::jstring2ustring(env,key);
- ::rtl::OUString sName = StorageContainer::jstring2ustring(env,name);
- }
-#endif
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- Reference< XOutputStream> xFlush = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>();
- if ( xFlush.is() )
- try
- {
- xFlush->flush();
- }
- catch(const Exception&)
- {
- OSL_FAIL( "NativeStorageAccess::close: caught an exception while flushing!" );
- }
-#ifdef HSQLDB_DBG
- {
- OperationLogFile aOpLog( env, name, "data" );
- aOpLog.logOperation( "close" );
- aOpLog.close();
-
- LogFile aDataLog( env, name, "data" );
- aDataLog.close();
- }
-#endif
-
- StorageContainer::revokeStream(env,name,key);
-}
-// -----------------------------------------------------------------------------
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: getFilePointer
- * Signature: (Ljava/lang/String;Ljava/lang/String;)J
- */
-SAL_DLLPUBLIC_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_getFilePointer
- (JNIEnv * env, jobject /*obj_this*/,jstring name, jstring key)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile aOpLog( env, name, "data" );
- aOpLog.logOperation( "getFilePointer" );
-#endif
-
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- OSL_ENSURE(pHelper.get(),"No stream helper!");
-
- jlong nReturn = pHelper.get() ? pHelper->getSeek()->getPosition() : jlong(0);
-#ifdef HSQLDB_DBG
- aOpLog.logReturn( nReturn );
-#endif
- return nReturn;
-}
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: length
- * Signature: (Ljava/lang/String;Ljava/lang/String;)J
- */
-SAL_DLLPUBLIC_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_length
- (JNIEnv * env, jobject /*obj_this*/,jstring name, jstring key)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile aOpLog( env, name, "data" );
- aOpLog.logOperation( "length" );
-#endif
-
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- OSL_ENSURE(pHelper.get(),"No stream helper!");
-
- jlong nReturn = pHelper.get() ? pHelper->getSeek()->getLength() :jlong(0);
-#ifdef HSQLDB_DBG
- aOpLog.logReturn( nReturn );
-#endif
- return nReturn;
-}
-
-// -----------------------------------------------------------------------------
-
-jint read_from_storage_stream( JNIEnv * env, jobject /*obj_this*/, jstring name, jstring key, DataLogFile* logger )
-{
- OSL_UNUSED( logger );
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- Reference< XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference< XInputStream>();
- OSL_ENSURE(xIn.is(),"Input stream is NULL!");
- if ( xIn.is() )
- {
- Sequence< ::sal_Int8 > aData(1);
- sal_Int32 nBytesRead = -1;
- try
- {
- nBytesRead = xIn->readBytes(aData,1);
- }
- catch(const Exception& e)
- {
- StorageContainer::throwJavaException(e,env);
- return -1;
-
- }
- if (nBytesRead <= 0)
- {
- return (-1);
- }
- else
- {
- sal_Int32 tmpInt = aData[0];
- if (tmpInt < 0 )
- tmpInt = 256 +tmpInt;
-
-#ifdef HSQLDB_DBG
- if ( logger )
- logger->write( tmpInt );
-#endif
- return(tmpInt);
- }
- }
- return -1;
-}
-
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: read
- * Signature: (Ljava/lang/String;Ljava/lang/String;)I
- */
-SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_read__Ljava_lang_String_2Ljava_lang_String_2
- (JNIEnv* env, jobject obj_this, jstring name, jstring key)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile aOpLog( env, name, "data" );
- aOpLog.logOperation( "read" );
-
- DataLogFile aDataLog( env, name, "data" );
- return read_from_storage_stream( env, obj_this, name, key, &aDataLog );
-#else
- return read_from_storage_stream( env, obj_this, name, key );
-#endif
-}
-
-// -----------------------------------------------------------------------------
-
-jint read_from_storage_stream_into_buffer( JNIEnv * env, jobject /*obj_this*/,jstring name, jstring key, jbyteArray buffer, jint off, jint len, DataLogFile* logger )
-{
- OSL_UNUSED( logger );
-#ifdef HSQLDB_DBG
- {
- ::rtl::OUString sKey = StorageContainer::jstring2ustring(env,key);
- ::rtl::OUString sName = StorageContainer::jstring2ustring(env,name);
- }
-#endif
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- Reference< XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference< XInputStream>();
- OSL_ENSURE(xIn.is(),"Input stream is NULL!");
- if ( xIn.is() )
- {
- jsize nLen = env->GetArrayLength(buffer);
- if ( nLen < len || len <= 0 )
- {
- ThrowException( env,
- "java/io/IOException",
- "len is greater or equal to the buffer size");
- return -1;
- }
- sal_Int32 nBytesRead = -1;
-
- Sequence< ::sal_Int8 > aData(nLen);
- try
- {
- nBytesRead = xIn->readBytes(aData, len);
- }
- catch(const Exception& e)
- {
- StorageContainer::throwJavaException(e,env);
- return -1;
- }
-
- if (nBytesRead <= 0)
- return -1;
- env->SetByteArrayRegion(buffer,off,nBytesRead,(const jbyte*) &aData[0]);
-
-#ifdef HSQLDB_DBG
- if ( logger )
- logger->write( aData.getConstArray(), nBytesRead );
-#endif
- return nBytesRead;
- }
- ThrowException( env,
- "java/io/IOException",
- "Stream is not valid");
- return -1;
-}
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: read
- * Signature: (Ljava/lang/String;Ljava/lang/String;[BII)I
- */
-SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_read__Ljava_lang_String_2Ljava_lang_String_2_3BII
- (JNIEnv * env, jobject obj_this,jstring name, jstring key, jbyteArray buffer, jint off, jint len)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile aOpLog( env, name, "data" );
- aOpLog.logOperation( "read( byte[], int, int )" );
-
- DataLogFile aDataLog( env, name, "data" );
- return read_from_storage_stream_into_buffer( env, obj_this, name, key, buffer, off, len, &aDataLog );
-#else
- return read_from_storage_stream_into_buffer( env, obj_this, name, key, buffer, off, len );
-#endif
-}
-
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: readInt
- * Signature: (Ljava/lang/String;Ljava/lang/String;)I
- */
-SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_readInt
- (JNIEnv * env, jobject /*obj_this*/,jstring name, jstring key)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile aOpLog( env, name, "data" );
- aOpLog.logOperation( "readInt" );
-#endif
-
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- Reference< XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference< XInputStream>();
- OSL_ENSURE(xIn.is(),"Input stream is NULL!");
- if ( xIn.is() )
- {
- Sequence< ::sal_Int8 > aData(4);
- sal_Int32 nBytesRead = -1;
- try
- {
- nBytesRead = xIn->readBytes(aData, 4);
- }
- catch(const Exception& e)
- {
- StorageContainer::throwJavaException(e,env);
- return -1;
- }
-
- if ( nBytesRead != 4 ) {
- ThrowException( env,
- "java/io/IOException",
- "Bytes read != 4");
- return -1;
- }
-
- Sequence< sal_Int32 > ch(4);
- for(sal_Int32 i = 0;i < 4; ++i)
- {
- ch[i] = aData[i];
- if (ch[i] < 0 )
- ch[i] = 256 + ch[i];
- }
-
- if ((ch[0] | ch[1] | ch[2] | ch[3]) < 0)
- {
- ThrowException( env,
- "java/io/IOException",
- "One byte is < 0");
- return -1;
- }
- jint nRet = ((ch[0] << 24) + (ch[1] << 16) + (ch[2] << 8) + (ch[3] << 0));
-#ifdef HSQLDB_DBG
- DataLogFile aDataLog( env, name, "data" );
- aDataLog.write( nRet );
-
- aOpLog.logReturn( nRet );
-#endif
- return nRet;
- }
- ThrowException( env,
- "java/io/IOException",
- "No InputStream");
- return -1;
-}
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: seek
- * Signature: (Ljava/lang/String;Ljava/lang/String;J)V
- */
-SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_seek
- (JNIEnv * env, jobject /*obj_this*/,jstring name, jstring key, jlong position)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile aOpLog( env, name, "data" );
- aOpLog.logOperation( "seek", position );
-#endif
-
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- Reference< XSeekable> xSeek = pHelper.get() ? pHelper->getSeek() : Reference< XSeekable>();
-
- OSL_ENSURE(xSeek.is(),"No Seekable stream!");
- if ( xSeek.is() )
- {
- #ifdef HSQLDB_DBG
- DataLogFile aDataLog( env, name, "data" );
- #endif
-
- ::sal_Int64 nLen = xSeek->getLength();
- if ( nLen < position)
- {
- static ::sal_Int64 BUFFER_SIZE = 9192;
- #ifdef HSQLDB_DBG
- aDataLog.seek( nLen );
- #endif
- xSeek->seek(nLen);
- Reference< XOutputStream> xOut = pHelper->getOutputStream();
- OSL_ENSURE(xOut.is(),"No output stream!");
-
- ::sal_Int64 diff = position - nLen;
- sal_Int32 n;
- while( diff != 0 )
- {
- if ( BUFFER_SIZE < diff )
- {
- n = static_cast<sal_Int32>(BUFFER_SIZE);
- diff = diff - BUFFER_SIZE;
- }
- else
- {
- n = static_cast<sal_Int32>(diff);
- diff = 0;
- }
- Sequence< ::sal_Int8 > aData(n);
- memset(aData.getArray(),0,n);
- xOut->writeBytes(aData);
- #ifdef HSQLDB_DBG
- aDataLog.write( aData.getConstArray(), n );
- #endif
- }
- }
- xSeek->seek(position);
- OSL_ENSURE(xSeek->getPosition() == position,"Wrong position after seeking the stream");
-
- #ifdef HSQLDB_DBG
- aDataLog.seek( position );
- OSL_ENSURE( xSeek->getPosition() == aDataLog.tell(), "Wrong position after seeking the stream" );
- #endif
- }
-}
-// -----------------------------------------------------------------------------
-
-void write_to_storage_stream_from_buffer( JNIEnv* env, jobject /*obj_this*/, jstring name, jstring key, jbyteArray buffer, jint off, jint len, DataLogFile* logger )
-{
- OSL_UNUSED( logger );
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- Reference< XOutputStream> xOut = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>();
- OSL_ENSURE(xOut.is(),"Stream is NULL");
-
- try
- {
- if ( xOut.is() )
- {
- jbyte *buf = env->GetByteArrayElements(buffer,NULL);
- if (JNI_FALSE != env->ExceptionCheck())
- {
- env->ExceptionClear();
- OSL_FAIL("ExceptionClear");
- }
- OSL_ENSURE(buf,"buf is NULL");
- if ( buf && len > 0 && len <= env->GetArrayLength(buffer))
- {
- Sequence< ::sal_Int8 > aData((const signed char*) buf + off,len);
- env->ReleaseByteArrayElements(buffer, buf, JNI_ABORT);
- xOut->writeBytes(aData);
-#ifdef HSQLDB_DBG
- if ( logger )
- logger->write( aData.getConstArray(), len );
-#endif
- }
- }
- else
- {
- ThrowException( env,
- "java/io/IOException",
- "No OutputStream");
- }
- }
- catch(const Exception& e)
- {
- OSL_FAIL("Exception caught! : write [BII)V");
- StorageContainer::throwJavaException(e,env);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: write
- * Signature: (Ljava/lang/String;Ljava/lang/String;[BII)V
- */
-SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_write
- (JNIEnv * env, jobject obj_this,jstring name, jstring key, jbyteArray buffer, jint off, jint len)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile aOpLog( env, name, "data" );
- aOpLog.logOperation( "write( byte[], int, int )" );
-
- DataLogFile aDataLog( env, name, "data" );
- write_to_storage_stream_from_buffer( env, obj_this, name, key, buffer, off, len, &aDataLog );
-#else
- write_to_storage_stream_from_buffer( env, obj_this, name, key, buffer, off, len );
-#endif
-}
-// -----------------------------------------------------------------------------
-
-void write_to_storage_stream( JNIEnv* env, jobject /*obj_this*/, jstring name, jstring key, jint v, DataLogFile* logger )
-{
- OSL_UNUSED( logger );
-
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- Reference< XOutputStream> xOut = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>();
- OSL_ENSURE(xOut.is(),"Stream is NULL");
- try
- {
- if ( xOut.is() )
- {
- Sequence< ::sal_Int8 > oneByte(4);
- oneByte[0] = (sal_Int8) ((v >> 24) & 0xFF);
- oneByte[1] = (sal_Int8) ((v >> 16) & 0xFF);
- oneByte[2] = (sal_Int8) ((v >> 8) & 0xFF);
- oneByte[3] = (sal_Int8) ((v >> 0) & 0xFF);
-
- xOut->writeBytes(oneByte);
-#ifdef HSQLDB_DBG
- if ( logger )
- logger->write( oneByte.getConstArray(), 4 );
-#endif
- }
- else
- {
- ThrowException( env,
- "java/io/IOException",
- "No OutputStream");
- }
- }
- catch(const Exception& e)
- {
- OSL_FAIL("Exception caught! : writeBytes(aData);");
- StorageContainer::throwJavaException(e,env);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: writeInt
- * Signature: (Ljava/lang/String;Ljava/lang/String;I)V
- */
-SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_writeInt
- (JNIEnv * env, jobject obj_this,jstring name, jstring key, jint v)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile aOpLog( env, name, "data" );
- aOpLog.logOperation( "writeInt" );
-
- DataLogFile aDataLog( env, name, "data" );
- write_to_storage_stream( env, obj_this, name, key, v, &aDataLog );
-#else
- write_to_storage_stream( env, obj_this, name, key, v );
-#endif
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
deleted file mode 100644
index ba100916ff..0000000000
--- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx
+++ /dev/null
@@ -1,365 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "hsqldb/HStorageMap.hxx"
-#include <comphelper/types.hxx>
-#include <com/sun/star/embed/XTransactionBroadcaster.hpp>
-#include <com/sun/star/embed/XTransactedObject.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "diagnose_ex.h"
-#include <osl/thread.h>
-
-#include <o3tl/compat_functional.hxx>
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
- namespace hsqldb
- {
- //........................................................................
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::embed;
- using namespace ::com::sun::star::io;
-
-#define ThrowException(env, type, msg) { \
- env->ThrowNew(env->FindClass(type), msg); }
-
-
- StreamHelper::StreamHelper(const Reference< XStream>& _xStream)
- : m_xStream(_xStream)
- {
- }
- // -----------------------------------------------------------------------------
- StreamHelper::~StreamHelper()
- {
- try
- {
- m_xStream.clear();
- m_xSeek.clear();
- if ( m_xInputStream.is() )
- {
- m_xInputStream->closeInput();
- m_xInputStream.clear();
- }
- // this is done implicity by the closing of the input stream
- else if ( m_xOutputStream.is() )
- {
- m_xOutputStream->closeOutput();
- try
- {
- ::comphelper::disposeComponent(m_xOutputStream);
- }
- catch(const DisposedException&)
- {
- }
- catch(const Exception&)
- {
- OSL_FAIL("Could not dispose OutputStream");
- }
- m_xOutputStream.clear();
- }
- }
- catch(const Exception&)
- {
- OSL_FAIL("Exception caught!");
- }
- }
- // -----------------------------------------------------------------------------
- Reference< XInputStream> StreamHelper::getInputStream()
- {
- if ( !m_xInputStream.is() )
- m_xInputStream = m_xStream->getInputStream();
- return m_xInputStream;
- }
- // -----------------------------------------------------------------------------
- Reference< XOutputStream> StreamHelper::getOutputStream()
- {
- if ( !m_xOutputStream.is() )
- m_xOutputStream = m_xStream->getOutputStream();
- return m_xOutputStream;
- }
- // -----------------------------------------------------------------------------
- Reference< XSeekable> StreamHelper::getSeek()
- {
- if ( !m_xSeek.is() )
- m_xSeek.set(m_xStream,UNO_QUERY);
- return m_xSeek;
- }
- // -----------------------------------------------------------------------------
- TStorages& lcl_getStorageMap()
- {
- static TStorages s_aMap;
- return s_aMap;
- }
- // -----------------------------------------------------------------------------
- ::rtl::OUString lcl_getNextCount()
- {
- static sal_Int32 s_nCount = 0;
- return ::rtl::OUString::valueOf(s_nCount++);
- }
- // -----------------------------------------------------------------------------
- ::rtl::OUString StorageContainer::removeURLPrefix(const ::rtl::OUString& _sURL,const ::rtl::OUString& _sFileURL)
- {
- return _sURL.copy(_sFileURL.getLength()+1);
- }
- // -----------------------------------------------------------------------------
- ::rtl::OUString StorageContainer::removeOldURLPrefix(const ::rtl::OUString& _sURL)
- {
- ::rtl::OUString sRet = _sURL;
-#if defined(WNT)
- sal_Int32 nIndex = sRet.lastIndexOf('\\');
-#else
- sal_Int32 nIndex = sRet.lastIndexOf('/');
-#endif
- if ( nIndex != -1 )
- {
- sRet = _sURL.copy(nIndex+1);
- }
- return sRet;
-
- }
- /*****************************************************************************/
- /* convert jstring to rtl_uString */
-
- ::rtl::OUString StorageContainer::jstring2ustring(JNIEnv * env, jstring jstr)
- {
- if (JNI_FALSE != env->ExceptionCheck())
- {
- env->ExceptionClear();
- OSL_FAIL("ExceptionClear");
- }
- ::rtl::OUString aStr;
- if ( jstr )
- {
- jboolean bCopy(sal_True);
- const jchar* pChar = env->GetStringChars(jstr,&bCopy);
- jsize len = env->GetStringLength(jstr);
- aStr = ::rtl::OUString(pChar,len);
-
- if(bCopy)
- env->ReleaseStringChars(jstr,pChar);
- }
-
- if (JNI_FALSE != env->ExceptionCheck())
- {
- env->ExceptionClear();
- OSL_FAIL("ExceptionClear");
- }
- return aStr;
- }
-
- // -----------------------------------------------------------------------------
- ::rtl::OUString StorageContainer::registerStorage(const Reference< XStorage>& _xStorage,const ::rtl::OUString& _sURL)
- {
- OSL_ENSURE(_xStorage.is(),"Storage is NULL!");
- TStorages& rMap = lcl_getStorageMap();
- // check if the storage is already in our map
- TStorages::iterator aFind = ::std::find_if(rMap.begin(),rMap.end(),
- ::o3tl::compose1(
- ::std::bind2nd(::std::equal_to<Reference<XStorage> >(),_xStorage)
- ,::o3tl::compose1(::o3tl::select1st<TStorageURLPair>(),::o3tl::compose1(::o3tl::select1st<TStorages::mapped_type>(),::o3tl::select2nd<TStorages::value_type>())))
- );
- if ( aFind == rMap.end() )
- {
- aFind = rMap.insert(TStorages::value_type(lcl_getNextCount(),TStorages::mapped_type(TStorageURLPair(_xStorage,_sURL),TStreamMap()))).first;
- }
-
- return aFind->first;
- }
- // -----------------------------------------------------------------------------
- TStorages::mapped_type StorageContainer::getRegisteredStorage(const ::rtl::OUString& _sKey)
- {
- TStorages::mapped_type aRet;
- TStorages& rMap = lcl_getStorageMap();
- TStorages::iterator aFind = rMap.find(_sKey);
- OSL_ENSURE(aFind != rMap.end(),"Storage could not be found in list!");
- if ( aFind != rMap.end() )
- aRet = aFind->second;
-
- return aRet;
- }
- // -----------------------------------------------------------------------------
- ::rtl::OUString StorageContainer::getRegisteredKey(const Reference< XStorage>& _xStorage)
- {
- ::rtl::OUString sKey;
- OSL_ENSURE(_xStorage.is(),"Storage is NULL!");
- TStorages& rMap = lcl_getStorageMap();
- // check if the storage is already in our map
- TStorages::iterator aFind = ::std::find_if(rMap.begin(),rMap.end(),
- ::o3tl::compose1(
- ::std::bind2nd(::std::equal_to<Reference<XStorage> >(),_xStorage)
- ,::o3tl::compose1(::o3tl::select1st<TStorageURLPair>(),::o3tl::compose1(::o3tl::select1st<TStorages::mapped_type>(),::o3tl::select2nd<TStorages::value_type>())))
- );
- if ( aFind != rMap.end() )
- sKey = aFind->first;
- return sKey;
- }
- // -----------------------------------------------------------------------------
- void StorageContainer::revokeStorage(const ::rtl::OUString& _sKey,const Reference<XTransactionListener>& _xListener)
- {
- TStorages& rMap = lcl_getStorageMap();
- TStorages::iterator aFind = rMap.find(_sKey);
- if ( aFind != rMap.end() )
- {
- try
- {
- if ( _xListener.is() )
- {
- Reference<XTransactionBroadcaster> xBroad(aFind->second.first.first,UNO_QUERY);
- if ( xBroad.is() )
- xBroad->removeTransactionListener(_xListener);
- Reference<XTransactedObject> xTrans(aFind->second.first.first,UNO_QUERY);
- if ( xTrans.is() )
- xTrans->commit();
- }
- }
- catch(const Exception&)
- {
- }
- rMap.erase(aFind);
- }
- }
- // -----------------------------------------------------------------------------
- TStreamMap::mapped_type StorageContainer::registerStream(JNIEnv * env,jstring name, jstring key,sal_Int32 _nMode)
- {
- TStreamMap::mapped_type pHelper;
- TStorages& rMap = lcl_getStorageMap();
- ::rtl::OUString sKey = jstring2ustring(env,key);
- TStorages::iterator aFind = rMap.find(sKey);
- OSL_ENSURE(aFind != rMap.end(),"Storage could not be found in list!");
- if ( aFind != rMap.end() )
- {
- TStorages::mapped_type aStoragePair = StorageContainer::getRegisteredStorage(sKey);
- OSL_ENSURE(aStoragePair.first.first.is(),"No Storage available!");
- if ( aStoragePair.first.first.is() )
- {
- ::rtl::OUString sOrgName = StorageContainer::jstring2ustring(env,name);
- ::rtl::OUString sName = removeURLPrefix(sOrgName,aStoragePair.first.second);
- TStreamMap::iterator aStreamFind = aFind->second.second.find(sName);
- OSL_ENSURE( aStreamFind == aFind->second.second.end(),"A Stream was already registered for this object!");
- if ( aStreamFind != aFind->second.second.end() )
- {
- pHelper = aStreamFind->second;
- }
- else
- {
- try
- {
- try
- {
- pHelper.reset(new StreamHelper(aStoragePair.first.first->openStreamElement(sName,_nMode)));
- }
- catch(const Exception&)
- {
- ::rtl::OUString sStrippedName = removeOldURLPrefix(sOrgName);
-
- if ( ((_nMode & ElementModes::WRITE) != ElementModes::WRITE ) )
- {
- sal_Bool bIsStream = sal_True;
- try
- {
- bIsStream = aStoragePair.first.first->isStreamElement(sStrippedName);
- }
- catch(const Exception&)
- {
- bIsStream = sal_False;
- }
- if ( !bIsStream )
- return pHelper; // readonly file without data stream
- }
- pHelper.reset( new StreamHelper(aStoragePair.first.first->openStreamElement( sStrippedName, _nMode ) ) );
- }
- aFind->second.second.insert(TStreamMap::value_type(sName,pHelper));
- }
- catch(const Exception& e)
- {
-#if OSL_DEBUG_LEVEL > 0
- ::rtl::OString sMessage( "[HSQLDB-SDBC] caught an exception while opening a stream\n" );
- sMessage += "Name: ";
- sMessage += ::rtl::OString( sName.getStr(), sName.getLength(), osl_getThreadTextEncoding() );
- sMessage += "\nMode: 0x";
- if ( _nMode < 16 )
- sMessage += "0";
- sMessage += ::rtl::OString::valueOf( _nMode, 16 ).toAsciiUpperCase();
- OSL_FAIL( sMessage.getStr() );
-#endif
- StorageContainer::throwJavaException(e,env);
- }
- }
- }
- }
- return pHelper;
- }
- // -----------------------------------------------------------------------------
- void StorageContainer::revokeStream( JNIEnv * env,jstring name, jstring key)
- {
- TStorages& rMap = lcl_getStorageMap();
- TStorages::iterator aFind = rMap.find(jstring2ustring(env,key));
- OSL_ENSURE(aFind != rMap.end(),"Storage could not be found in list!");
- if ( aFind != rMap.end() )
- aFind->second.second.erase(removeURLPrefix(jstring2ustring(env,name),aFind->second.first.second));
- }
- // -----------------------------------------------------------------------------
- TStreamMap::mapped_type StorageContainer::getRegisteredStream( JNIEnv * env,jstring name, jstring key)
- {
- TStreamMap::mapped_type pRet;
- TStorages& rMap = lcl_getStorageMap();
- TStorages::iterator aFind = rMap.find(jstring2ustring(env,key));
- OSL_ENSURE(aFind != rMap.end(),"Storage could not be found in list!");
- if ( aFind != rMap.end() )
- {
- TStreamMap::iterator aStreamFind = aFind->second.second.find(removeURLPrefix(jstring2ustring(env,name),aFind->second.first.second));
- if ( aStreamFind != aFind->second.second.end() )
- pRet = aStreamFind->second;
- }
-
- return pRet;
- }
- // -----------------------------------------------------------------------------
- void StorageContainer::throwJavaException(const Exception& _aException,JNIEnv * env)
- {
- if (JNI_FALSE != env->ExceptionCheck())
- env->ExceptionClear();
- ::rtl::OString cstr( ::rtl::OUStringToOString(_aException.Message, RTL_TEXTENCODING_JAVA_UTF8 ) );
- OSL_TRACE( __FILE__": forwarding Exception: %s", cstr.getStr() );
- env->ThrowNew(env->FindClass("java/io/IOException"), cstr.getStr());
- }
- //........................................................................
- } // namespace hsqldb
- //........................................................................
-//........................................................................
-}
-// namespace connectivity
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx
deleted file mode 100644
index 732737eaf8..0000000000
--- a/connectivity/source/drivers/hsqldb/HTable.cxx
+++ /dev/null
@@ -1,429 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "hsqldb/HTable.hxx"
-#include "hsqldb/HTables.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <comphelper/property.hxx>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "connectivity/TKeys.hxx"
-#include "connectivity/TIndexes.hxx"
-#include "connectivity/TColumnsHelper.hxx"
-#include "hsqldb/HCatalog.hxx"
-#include "hsqldb/HColumns.hxx"
-#include "TConnection.hxx"
-
-#include <tools/diagnose_ex.h>
-
-
-using namespace ::comphelper;
-using namespace connectivity::hsqldb;
-using namespace connectivity::sdbcx;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-OHSQLTable::OHSQLTable( sdbcx::OCollection* _pTables,
- const Reference< XConnection >& _xConnection)
- :OTableHelper(_pTables,_xConnection,sal_True)
-{
- // we create a new table here, so we should have all the rights or ;-)
- m_nPrivileges = Privilege::DROP |
- Privilege::REFERENCE |
- Privilege::ALTER |
- Privilege::CREATE |
- Privilege::READ |
- Privilege::DELETE |
- Privilege::UPDATE |
- Privilege::INSERT |
- Privilege::SELECT;
- construct();
-}
-// -------------------------------------------------------------------------
-OHSQLTable::OHSQLTable( sdbcx::OCollection* _pTables,
- const Reference< XConnection >& _xConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description ,
- const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName,
- sal_Int32 _nPrivileges
- ) : OTableHelper( _pTables,
- _xConnection,
- sal_True,
- _Name,
- _Type,
- _Description,
- _SchemaName,
- _CatalogName)
- , m_nPrivileges(_nPrivileges)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-void OHSQLTable::construct()
-{
- OTableHelper::construct();
- if ( !isNew() )
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRIVILEGES), PROPERTY_ID_PRIVILEGES,PropertyAttribute::READONLY,&m_nPrivileges, ::getCppuType(&m_nPrivileges));
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OHSQLTable::createArrayHelper( sal_Int32 /*_nId*/ ) const
-{
- return doCreateArrayHelper();
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OHSQLTable::getInfoHelper()
-{
- return *static_cast<OHSQLTable_PROP*>(const_cast<OHSQLTable*>(this))->getArrayHelper(isNew() ? 1 : 0);
-}
-// -----------------------------------------------------------------------------
-sdbcx::OCollection* OHSQLTable::createColumns(const TStringVector& _rNames)
-{
- OHSQLColumns* pColumns = new OHSQLColumns(*this,sal_True,m_aMutex,_rNames);
- pColumns->setParent(this);
- return pColumns;
-}
-// -----------------------------------------------------------------------------
-sdbcx::OCollection* OHSQLTable::createKeys(const TStringVector& _rNames)
-{
- return new OKeysHelper(this,m_aMutex,_rNames);
-}
-// -----------------------------------------------------------------------------
-sdbcx::OCollection* OHSQLTable::createIndexes(const TStringVector& _rNames)
-{
- return new OIndexesHelper(this,m_aMutex,_rNames);
-}
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > OHSQLTable::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OHSQLTable::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OTable_TYPEDEF::getSomething(rId);
-}
-// -------------------------------------------------------------------------
-// XAlterTable
-void SAL_CALL OHSQLTable::alterColumnByName( const ::rtl::OUString& colName, const Reference< XPropertySet >& descriptor ) throw(SQLException, NoSuchElementException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(
-#ifdef GCC
- ::connectivity::sdbcx::OTableDescriptor_BASE::rBHelper.bDisposed
-#else
- rBHelper.bDisposed
-#endif
- );
-
- if ( m_pColumns && !m_pColumns->hasByName(colName) )
- throw NoSuchElementException(colName,*this);
-
-
- if ( !isNew() )
- {
- // first we have to check what should be altered
- Reference<XPropertySet> xProp;
- m_pColumns->getByName(colName) >>= xProp;
- // first check the types
- sal_Int32 nOldType = 0,nNewType = 0,nOldPrec = 0,nNewPrec = 0,nOldScale = 0,nNewScale = 0;
- ::rtl::OUString sOldTypeName, sNewTypeName;
-
- ::dbtools::OPropertyMap& rProp = OMetaConnection::getPropMap();
-
- // type/typename
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_TYPE)) >>= nOldType;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_TYPE)) >>= nNewType;
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_TYPENAME)) >>= sOldTypeName;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_TYPENAME))>>= sNewTypeName;
-
- // and precsions and scale
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_PRECISION)) >>= nOldPrec;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_PRECISION))>>= nNewPrec;
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_SCALE)) >>= nOldScale;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_SCALE)) >>= nNewScale;
-
- // second: check the "is nullable" value
- sal_Int32 nOldNullable = 0,nNewNullable = 0;
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISNULLABLE)) >>= nOldNullable;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISNULLABLE)) >>= nNewNullable;
-
- // check also the auto_increment
- sal_Bool bOldAutoIncrement = sal_False,bAutoIncrement = sal_False;
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bOldAutoIncrement;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bAutoIncrement;
-
- // now we should look if the name of the column changed
- ::rtl::OUString sNewColumnName;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_NAME)) >>= sNewColumnName;
- if ( !sNewColumnName.equals(colName) )
- {
- const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
-
- ::rtl::OUString sSql = getAlterTableColumnPart();
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ALTER COLUMN "));
- sSql += ::dbtools::quoteName(sQuote,colName);
-
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" RENAME TO "));
- sSql += ::dbtools::quoteName(sQuote,sNewColumnName);
-
- executeStatement(sSql);
- }
-
- if ( nOldType != nNewType
- || sOldTypeName != sNewTypeName
- || nOldPrec != nNewPrec
- || nOldScale != nNewScale
- || nNewNullable != nOldNullable
- || bOldAutoIncrement != bAutoIncrement )
- {
- // special handling because they change the type names to distinguish
- // if a column should be an auto_incmrement one
- if ( bOldAutoIncrement != bAutoIncrement )
- {
- /// TODO: insert special handling for auto increment "IDENTITY" and primary key
- }
- alterColumnType(nNewType,sNewColumnName,descriptor);
- }
-
- // third: check the default values
- ::rtl::OUString sNewDefault,sOldDefault;
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_DEFAULTVALUE)) >>= sOldDefault;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_DEFAULTVALUE)) >>= sNewDefault;
-
- if(sOldDefault.getLength())
- {
- dropDefaultValue(colName);
- if(sNewDefault.getLength() && sOldDefault != sNewDefault)
- alterDefaultValue(sNewDefault,sNewColumnName);
- }
- else if(!sOldDefault.getLength() && sNewDefault.getLength())
- alterDefaultValue(sNewDefault,sNewColumnName);
-
- m_pColumns->refresh();
- }
- else
- {
- if(m_pColumns)
- {
- m_pColumns->dropByName(colName);
- m_pColumns->appendByDescriptor(descriptor);
- }
- }
-
-}
-// -----------------------------------------------------------------------------
-void OHSQLTable::alterColumnType(sal_Int32 nNewType,const ::rtl::OUString& _rColName, const Reference<XPropertySet>& _xDescriptor)
-{
- ::rtl::OUString sSql = getAlterTableColumnPart();
-
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ALTER COLUMN "));
-#if OSL_DEBUG_LEVEL > 0
- try
- {
- ::rtl::OUString sDescriptorName;
- OSL_ENSURE( _xDescriptor.is()
- && ( _xDescriptor->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_NAME ) ) >>= sDescriptorName )
- && ( sDescriptorName == _rColName ),
- "OHSQLTable::alterColumnType: unexpected column name!" );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-#else
- (void)_rColName;
-#endif
-
- OHSQLColumn* pColumn = new OHSQLColumn(sal_True);
- Reference<XPropertySet> xProp = pColumn;
- ::comphelper::copyProperties(_xDescriptor,xProp);
- xProp->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE),makeAny(nNewType));
-
- sSql += ::dbtools::createStandardColumnPart(xProp,getConnection());
- executeStatement(sSql);
-}
-// -----------------------------------------------------------------------------
-void OHSQLTable::alterDefaultValue(const ::rtl::OUString& _sNewDefault,const ::rtl::OUString& _rColName)
-{
- ::rtl::OUString sSql = getAlterTableColumnPart();
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ALTER COLUMN "));
-
- const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- sSql += ::dbtools::quoteName(sQuote,_rColName);
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" SET DEFAULT '")) + _sNewDefault;
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
-
- executeStatement(sSql);
-}
-// -----------------------------------------------------------------------------
-void OHSQLTable::dropDefaultValue(const ::rtl::OUString& _rColName)
-{
- ::rtl::OUString sSql = getAlterTableColumnPart();
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ALTER COLUMN "));
-
- const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- sSql += ::dbtools::quoteName(sQuote,_rColName);
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP DEFAULT"));
-
- executeStatement(sSql);
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OHSQLTable::getAlterTableColumnPart()
-{
- ::rtl::OUString sSql( RTL_CONSTASCII_USTRINGPARAM( "ALTER TABLE " ));
- const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
-
- ::rtl::OUString sComposedName( ::dbtools::composeTableName( getMetaData(), m_CatalogName, m_SchemaName, m_Name, sal_True, ::dbtools::eInTableDefinitions ) );
- sSql += sComposedName;
-
- return sSql;
-}
-// -----------------------------------------------------------------------------
-void OHSQLTable::executeStatement(const ::rtl::OUString& _rStatement )
-{
- ::rtl::OUString sSQL = _rStatement;
- if(sSQL.lastIndexOf(',') == (sSQL.getLength()-1))
- sSQL = sSQL.replaceAt(sSQL.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
-
- Reference< XStatement > xStmt = getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- try { xStmt->execute(sSQL); }
- catch( const Exception& )
- {
- ::comphelper::disposeComponent(xStmt);
- throw;
- }
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OHSQLTable::getTypes( ) throw(RuntimeException)
-{
- if ( ! m_Type.compareToAscii("VIEW") )
- {
- Sequence< Type > aTypes = OTableHelper::getTypes();
- ::std::vector<Type> aOwnTypes;
- aOwnTypes.reserve(aTypes.getLength());
- const Type* pIter = aTypes.getConstArray();
- const Type* pEnd = pIter + aTypes.getLength();
- for(;pIter != pEnd;++pIter)
- {
- if( *pIter != ::getCppuType((const Reference<XRename>*)0) )
- {
- aOwnTypes.push_back(*pIter);
- }
- }
- Type *pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
- }
- return OTableHelper::getTypes();
-}
-// -------------------------------------------------------------------------
-// XRename
-void SAL_CALL OHSQLTable::rename( const ::rtl::OUString& newName ) throw(SQLException, ElementExistException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(
-#ifdef GCC
- ::connectivity::sdbcx::OTableDescriptor_BASE::rBHelper.bDisposed
-#else
- rBHelper.bDisposed
-#endif
- );
-
- if(!isNew())
- {
- ::rtl::OUString sSql = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER "));
- if ( m_Type == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW")) )
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" VIEW "));
- else
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" TABLE "));
-
- ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
-
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
-
- ::rtl::OUString sComposedName(
- ::dbtools::composeTableName( getMetaData(), m_CatalogName, m_SchemaName, m_Name, sal_True, ::dbtools::eInDataManipulation ) );
- sSql += sComposedName
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" RENAME TO "));
- sSql += ::dbtools::composeTableName( getMetaData(), sCatalog, sSchema, sTable, sal_True, ::dbtools::eInDataManipulation );
-
- executeStatement(sSql);
-
- ::connectivity::OTable_TYPEDEF::rename(newName);
- }
- else
- ::dbtools::qualifiedNameComponents(getMetaData(),newName,m_CatalogName,m_SchemaName,m_Name,::dbtools::eInTableDefinitions);
-}
-
-// -------------------------------------------------------------------------
-Any SAL_CALL OHSQLTable::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- if( !m_Type.compareToAscii("VIEW") && rType == ::getCppuType((const Reference<XRename>*)0) )
- return Any();
-
- return OTableHelper::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HTables.cxx b/connectivity/source/drivers/hsqldb/HTables.cxx
deleted file mode 100644
index 0e0725af27..0000000000
--- a/connectivity/source/drivers/hsqldb/HTables.cxx
+++ /dev/null
@@ -1,202 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "hsqldb/HTables.hxx"
-#include "hsqldb/HViews.hxx"
-#include "hsqldb/HTable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include "hsqldb/HCatalog.hxx"
-#include <comphelper/extract.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include <cppuhelper/interfacecontainer.h>
-#include <comphelper/types.hxx>
-#include "TConnection.hxx"
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace ::cppu;
-using namespace connectivity::hsqldb;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace dbtools;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OTables::createObject(const ::rtl::OUString& _rName)
-{
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(m_xMetaData,_rName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
-
- static const ::rtl::OUString s_sTableTypeView(RTL_CONSTASCII_USTRINGPARAM("VIEW"));
- static const ::rtl::OUString s_sTableTypeTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
- static const ::rtl::OUString s_sAll(RTL_CONSTASCII_USTRINGPARAM("%"));
-
- Sequence< ::rtl::OUString > sTableTypes(3);
- sTableTypes[0] = s_sTableTypeView;
- sTableTypes[1] = s_sTableTypeTable;
- sTableTypes[2] = s_sAll; // just to be sure to include anything else ....
-
- Any aCatalog;
- if ( sCatalog.getLength() )
- aCatalog <<= sCatalog;
- Reference< XResultSet > xResult = m_xMetaData->getTables(aCatalog,sSchema,sTable,sTableTypes);
-
- sdbcx::ObjectType xRet = NULL;
- if ( xResult.is() )
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- if ( xResult->next() ) // there can be only one table with this name
- {
- sal_Int32 nPrivileges = ::dbtools::getTablePrivileges( m_xMetaData, sCatalog, sSchema, sTable );
- if ( m_xMetaData->isReadOnly() )
- nPrivileges &= ~( Privilege::INSERT | Privilege::UPDATE | Privilege::DELETE | Privilege::CREATE | Privilege::ALTER | Privilege::DROP );
-
- // obtain privileges
- OHSQLTable* pRet = new OHSQLTable( this
- ,static_cast<OHCatalog&>(m_rParent).getConnection()
- ,sTable
- ,xRow->getString(4)
- ,xRow->getString(5)
- ,sSchema
- ,sCatalog
- ,nPrivileges);
- xRet = pRet;
- }
- ::comphelper::disposeComponent(xResult);
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void OTables::impl_refresh( ) throw(RuntimeException)
-{
- static_cast<OHCatalog&>(m_rParent).refreshTables();
-}
-// -------------------------------------------------------------------------
-void OTables::disposing(void)
-{
-m_xMetaData.clear();
- OCollection::disposing();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OTables::createDescriptor()
-{
- return new OHSQLTable(this,static_cast<OHCatalog&>(m_rParent).getConnection());
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OTables::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- createTable(descriptor);
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OTables::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName)
-{
- Reference< XInterface > xObject( getObject( _nPos ) );
- sal_Bool bIsNew = connectivity::sdbcx::ODescriptor::isNew( xObject );
- if (!bIsNew)
- {
- Reference< XConnection > xConnection = static_cast<OHCatalog&>(m_rParent).getConnection();
-
-
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(m_xMetaData,_sElementName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
-
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "DROP " ));
-
- Reference<XPropertySet> xProp(xObject,UNO_QUERY);
- sal_Bool bIsView;
- if((bIsView = (xProp.is() && ::comphelper::getString(xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))) == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW"))))) // here we have a view
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW "));
- else
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE "));
-
- ::rtl::OUString sComposedName(
- ::dbtools::composeTableName( m_xMetaData, sCatalog, sSchema, sTable, sal_True, ::dbtools::eInDataManipulation ) );
- aSql += sComposedName;
- Reference< XStatement > xStmt = xConnection->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
- // if no exception was thrown we must delete it from the views
- if ( bIsView )
- {
- HViews* pViews = static_cast<HViews*>(static_cast<OHCatalog&>(m_rParent).getPrivateViews());
- if ( pViews && pViews->hasByName(_sElementName) )
- pViews->dropByNameImpl(_sElementName);
- }
- }
-}
-// -------------------------------------------------------------------------
-void OTables::createTable( const Reference< XPropertySet >& descriptor )
-{
- Reference< XConnection > xConnection = static_cast<OHCatalog&>(m_rParent).getConnection();
- ::rtl::OUString aSql = ::dbtools::createSqlCreateTableStatement(descriptor,xConnection);
-
- Reference< XStatement > xStmt = xConnection->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-void OTables::appendNew(const ::rtl::OUString& _rsNewTable)
-{
- insertElement(_rsNewTable,NULL);
-
- // notify our container listeners
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rsNewTable), Any(), Any());
- OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
- while (aListenerLoop.hasMoreElements())
- static_cast<XContainerListener*>(aListenerLoop.next())->elementInserted(aEvent);
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OTables::getNameForObject(const sdbcx::ObjectType& _xObject)
-{
- OSL_ENSURE(_xObject.is(),"OTables::getNameForObject: Object is NULL!");
- return ::dbtools::composeTableName( m_xMetaData, _xObject, ::dbtools::eInDataManipulation, false, false, false );
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HTerminateListener.cxx b/connectivity/source/drivers/hsqldb/HTerminateListener.cxx
deleted file mode 100644
index 3b0bd52bba..0000000000
--- a/connectivity/source/drivers/hsqldb/HTerminateListener.cxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "HTerminateListener.hxx"
-#include "hsqldb/HDriver.hxx"
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
- using namespace hsqldb;
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::frame;
- using namespace ::com::sun::star::lang;
- using namespace ::rtl;
-
-// XEventListener
-void SAL_CALL OConnectionController::disposing( const EventObject& /*Source*/ )
-throw( RuntimeException )
-{
-}
-
-// XTerminateListener
-void SAL_CALL OConnectionController::queryTermination( const EventObject& /*aEvent*/ )
-throw( TerminationVetoException, RuntimeException )
-{
- m_pDriver->flushConnections();
-}
-
-void SAL_CALL OConnectionController::notifyTermination( const EventObject& /*aEvent*/ )
-throw( RuntimeException )
-{
- m_pDriver->shutdownConnections();
-}
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HTerminateListener.hxx b/connectivity/source/drivers/hsqldb/HTerminateListener.hxx
deleted file mode 100644
index 681985951e..0000000000
--- a/connectivity/source/drivers/hsqldb/HTerminateListener.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_HSQLDB_TERMINATELISTENER_HXX
-#define CONNECTIVITY_HSQLDB_TERMINATELISTENER_HXX
-
-#include <cppuhelper/compbase1.hxx>
-#include <com/sun/star/frame/XTerminateListener.hpp>
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- namespace hsqldb
- {
- class ODriverDelegator;
- class OConnectionController : public ::cppu::WeakImplHelper1<
- ::com::sun::star::frame::XTerminateListener >
- {
- ODriverDelegator* m_pDriver;
- protected:
- virtual ~OConnectionController() {m_pDriver = NULL;}
- public:
- OConnectionController(ODriverDelegator* _pDriver) : m_pDriver(_pDriver){}
-
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
- throw( ::com::sun::star::uno::RuntimeException );
-
- // XTerminateListener
- virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& aEvent )
- throw( ::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent )
- throw( ::com::sun::star::uno::RuntimeException );
- };
- }
-//........................................................................
-} // namespace connectivity
-//........................................................................
-#endif // CONNECTIVITY_HSQLDB_TERMINATELISTENER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HTools.cxx b/connectivity/source/drivers/hsqldb/HTools.cxx
deleted file mode 100644
index 8f35c9246a..0000000000
--- a/connectivity/source/drivers/hsqldb/HTools.cxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "hsqldb/HTools.hxx"
-
-/** === begin UNO includes === **/
-/** === end UNO includes === **/
-
-//........................................................................
-namespace connectivity { namespace hsqldb
-{
-//........................................................................
-
- /** === begin UNO using === **/
- /** === end UNO using === **/
-
- //====================================================================
- //= HTools
- //====================================================================
- //--------------------------------------------------------------------
- void HTools::appendTableFilterCrit( ::rtl::OUStringBuffer& _inout_rBuffer, const ::rtl::OUString& _rCatalog,
- const ::rtl::OUString _rSchema, const ::rtl::OUString _rName, bool _bShortForm )
- {
- _inout_rBuffer.appendAscii( " WHERE " );
- if ( _rCatalog.getLength() )
- {
- _inout_rBuffer.appendAscii( _bShortForm ? "TABLE_CAT" : "TABLE_CATALOG" );
- _inout_rBuffer.appendAscii( " = '" );
- _inout_rBuffer.append ( _rCatalog );
- _inout_rBuffer.appendAscii( "' AND " );
- }
- if ( _rSchema.getLength() )
- {
- _inout_rBuffer.appendAscii( _bShortForm ? "TABLE_SCHEM" : "TABLE_SCHEMA" );
- _inout_rBuffer.appendAscii( " = '" );
- _inout_rBuffer.append ( _rSchema );
- _inout_rBuffer.appendAscii( "' AND " );
- }
- _inout_rBuffer.appendAscii( "TABLE_NAME = '" );
- _inout_rBuffer.append ( _rName );
- _inout_rBuffer.appendAscii( "'" );
- }
-
-//........................................................................
-} } // namespace connectivity::hsqldb
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HUser.cxx b/connectivity/source/drivers/hsqldb/HUser.cxx
deleted file mode 100644
index a968a0ca0d..0000000000
--- a/connectivity/source/drivers/hsqldb/HUser.cxx
+++ /dev/null
@@ -1,353 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "hsqldb/HUser.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbcx/PrivilegeObject.hpp>
-#include "TConnection.hxx"
-#include "resource/hsqldb_res.hrc"
-
-using namespace connectivity;
-using namespace connectivity::hsqldb;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -------------------------------------------------------------------------
-OHSQLUser::OHSQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection) : connectivity::sdbcx::OUser(sal_True)
- ,m_xConnection(_xConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-OHSQLUser::OHSQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
- const ::rtl::OUString& _Name
- ) : connectivity::sdbcx::OUser(_Name,sal_True)
- ,m_xConnection(_xConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-void OHSQLUser::refreshGroups()
-{
-}
-// -------------------------------------------------------------------------
-OUserExtend::OUserExtend( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection) : OHSQLUser(_xConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-typedef connectivity::sdbcx::OUser OUser_TYPEDEF;
-void OUserExtend::construct()
-{
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD), PROPERTY_ID_PASSWORD,0,&m_Password,::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
-}
-// -----------------------------------------------------------------------------
-cppu::IPropertyArrayHelper* OUserExtend::createArrayHelper() const
-{
- Sequence< Property > aProps;
- describeProperties(aProps);
- return new cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-cppu::IPropertyArrayHelper & OUserExtend::getInfoHelper()
-{
- return *OUserExtend_PROP::getArrayHelper();
-}
-typedef connectivity::sdbcx::OUser_BASE OUser_BASE_RBHELPER;
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OHSQLUser::getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
-
- sal_Int32 nRights,nRightsWithGrant;
- findPrivilegesAndGrantPrivileges(objName,objType,nRights,nRightsWithGrant);
- return nRights;
-}
-// -----------------------------------------------------------------------------
-void OHSQLUser::findPrivilegesAndGrantPrivileges(const ::rtl::OUString& objName, sal_Int32 objType,sal_Int32& nRights,sal_Int32& nRightsWithGrant) throw(SQLException, RuntimeException)
-{
- nRightsWithGrant = nRights = 0;
- // first we need to create the sql stmt to select the privs
- Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(xMeta,objName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
- Reference<XResultSet> xRes;
- switch(objType)
- {
- case PrivilegeObject::TABLE:
- case PrivilegeObject::VIEW:
- {
- Any aCatalog;
- if ( sCatalog.getLength() )
- aCatalog <<= sCatalog;
- xRes = xMeta->getTablePrivileges(aCatalog,sSchema,sTable);
- }
- break;
-
- case PrivilegeObject::COLUMN:
- {
- Any aCatalog;
- if ( sCatalog.getLength() )
- aCatalog <<= sCatalog;
- xRes = xMeta->getColumnPrivileges(aCatalog,sSchema,sTable,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")));
- }
- break;
- }
-
- if ( xRes.is() )
- {
- static const ::rtl::OUString sSELECT( RTL_CONSTASCII_USTRINGPARAM( "SELECT" ));
- static const ::rtl::OUString sINSERT( RTL_CONSTASCII_USTRINGPARAM( "INSERT" ));
- static const ::rtl::OUString sUPDATE( RTL_CONSTASCII_USTRINGPARAM( "UPDATE" ));
- static const ::rtl::OUString sDELETE( RTL_CONSTASCII_USTRINGPARAM( "DELETE" ));
- static const ::rtl::OUString sREAD( RTL_CONSTASCII_USTRINGPARAM( "READ" ));
- static const ::rtl::OUString sCREATE( RTL_CONSTASCII_USTRINGPARAM( "CREATE" ));
- static const ::rtl::OUString sALTER( RTL_CONSTASCII_USTRINGPARAM( "ALTER" ));
- static const ::rtl::OUString sREFERENCE( RTL_CONSTASCII_USTRINGPARAM( "REFERENCE" ));
- static const ::rtl::OUString sDROP( RTL_CONSTASCII_USTRINGPARAM( "DROP" ));
- static const ::rtl::OUString sYes( RTL_CONSTASCII_USTRINGPARAM( "YES" ));
-
- nRightsWithGrant = nRights = 0;
-
- Reference<XRow> xCurrentRow(xRes,UNO_QUERY);
- while( xCurrentRow.is() && xRes->next() )
- {
- ::rtl::OUString sGrantee = xCurrentRow->getString(5);
- ::rtl::OUString sPrivilege = xCurrentRow->getString(6);
- ::rtl::OUString sGrantable = xCurrentRow->getString(7);
-
- if (!m_Name.equalsIgnoreAsciiCase(sGrantee))
- continue;
-
- if (sPrivilege.equalsIgnoreAsciiCase(sSELECT))
- {
- nRights |= Privilege::SELECT;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::SELECT;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sINSERT))
- {
- nRights |= Privilege::INSERT;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::INSERT;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sUPDATE))
- {
- nRights |= Privilege::UPDATE;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::UPDATE;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sDELETE))
- {
- nRights |= Privilege::DELETE;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::DELETE;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sREAD))
- {
- nRights |= Privilege::READ;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::READ;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sCREATE))
- {
- nRights |= Privilege::CREATE;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::CREATE;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sALTER))
- {
- nRights |= Privilege::ALTER;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::ALTER;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sREFERENCE))
- {
- nRights |= Privilege::REFERENCE;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::REFERENCE;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sDROP))
- {
- nRights |= Privilege::DROP;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::DROP;
- }
- }
- ::comphelper::disposeComponent(xRes);
- }
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OHSQLUser::getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
-
- sal_Int32 nRights,nRightsWithGrant;
- findPrivilegesAndGrantPrivileges(objName,objType,nRights,nRightsWithGrant);
- return nRightsWithGrant;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OHSQLUser::grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(SQLException, RuntimeException)
-{
- if ( objType != PrivilegeObject::TABLE )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(STR_PRIVILEGE_NOT_GRANTED));
- ::dbtools::throwGenericSQLException(sError,*this);
- } // if ( objType != PrivilegeObject::TABLE )
-
-
- ::osl::MutexGuard aGuard(m_aMutex);
-
- ::rtl::OUString sPrivs = getPrivilegeString(objPrivileges);
- if(sPrivs.getLength())
- {
- ::rtl::OUString sGrant;
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GRANT "));
- sGrant += sPrivs;
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "));
- Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- sGrant += ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation);
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" TO "));
- sGrant += m_Name;
-
- Reference<XStatement> xStmt = m_xConnection->createStatement();
- if(xStmt.is())
- xStmt->execute(sGrant);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OHSQLUser::revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(SQLException, RuntimeException)
-{
- if ( objType != PrivilegeObject::TABLE )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(STR_PRIVILEGE_NOT_REVOKED));
- ::dbtools::throwGenericSQLException(sError,*this);
- } // if ( objType != PrivilegeObject::TABLE )
-
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
- ::rtl::OUString sPrivs = getPrivilegeString(objPrivileges);
- if(sPrivs.getLength())
- {
- ::rtl::OUString sGrant;
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REVOKE "));
- sGrant += sPrivs;
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "));
- Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- sGrant += ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation);
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FROM "));
- sGrant += m_Name;
-
- Reference<XStatement> xStmt = m_xConnection->createStatement();
- if(xStmt.is())
- xStmt->execute(sGrant);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-// XUser
-void SAL_CALL OHSQLUser::changePassword( const ::rtl::OUString& /*oldPassword*/, const ::rtl::OUString& newPassword ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
- ::rtl::OUString sAlterPwd;
- sAlterPwd = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SET PASSWORD FOR "));
- sAlterPwd += m_Name;
- sAlterPwd += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("@\"%\" = PASSWORD('")) ;
- sAlterPwd += newPassword;
- sAlterPwd += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("')")) ;
-
-
- Reference<XStatement> xStmt = m_xConnection->createStatement();
- if ( xStmt.is() )
- {
- xStmt->execute(sAlterPwd);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OHSQLUser::getPrivilegeString(sal_Int32 nRights) const
-{
- ::rtl::OUString sPrivs;
- if((nRights & Privilege::INSERT) == Privilege::INSERT)
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INSERT"));
-
- if((nRights & Privilege::DELETE) == Privilege::DELETE)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DELETE"));
- }
-
- if((nRights & Privilege::UPDATE) == Privilege::UPDATE)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UPDATE"));
- }
-
- if((nRights & Privilege::ALTER) == Privilege::ALTER)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER"));
- }
-
- if((nRights & Privilege::SELECT) == Privilege::SELECT)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT"));
- }
-
- if((nRights & Privilege::REFERENCE) == Privilege::REFERENCE)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REFERENCES"));
- }
-
- return sPrivs;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HUsers.cxx b/connectivity/source/drivers/hsqldb/HUsers.cxx
deleted file mode 100644
index 9816e56c4f..0000000000
--- a/connectivity/source/drivers/hsqldb/HUsers.cxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "hsqldb/HUsers.hxx"
-#include "hsqldb/HUser.hxx"
-#include "hsqldb/HTable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "connectivity/sdbcx/IRefreshable.hxx"
-#include <comphelper/types.hxx>
-#include "connectivity/dbexception.hxx"
-#include "connectivity/dbtools.hxx"
-#include "TConnection.hxx"
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::hsqldb;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-OUsers::OUsers( ::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
- connectivity::sdbcx::IRefreshableUsers* _pParent)
- : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector)
- ,m_xConnection(_xConnection)
- ,m_pParent(_pParent)
-{
-}
-// -----------------------------------------------------------------------------
-
-sdbcx::ObjectType OUsers::createObject(const ::rtl::OUString& _rName)
-{
- return new OHSQLUser(m_xConnection,_rName);
-}
-// -------------------------------------------------------------------------
-void OUsers::impl_refresh() throw(RuntimeException)
-{
- m_pParent->refreshUsers();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OUsers::createDescriptor()
-{
- OUserExtend* pNew = new OUserExtend(m_xConnection);
- return pNew;
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OUsers::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "GRANT USAGE ON * TO " ));
- ::rtl::OUString aQuote = m_xConnection->getMetaData()->getIdentifierQuoteString( );
- ::rtl::OUString sUserName( _rForName );
- aSql += ::dbtools::quoteName(aQuote,sUserName)
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" @\"%\" "));
- ::rtl::OUString sPassword;
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD)) >>= sPassword;
- if ( sPassword.getLength() )
- {
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" IDENTIFIED BY '"));
- aSql += sPassword;
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- }
-
- Reference< XStatement > xStmt = m_xConnection->createStatement( );
- if(xStmt.is())
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
-
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OUsers::dropObject(sal_Int32 /*nPos*/,const ::rtl::OUString _sElementName)
-{
- {
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "REVOKE ALL ON * FROM " ));
- ::rtl::OUString aQuote = m_xConnection->getMetaData()->getIdentifierQuoteString( );
- aSql += ::dbtools::quoteName(aQuote,_sElementName);
-
- Reference< XStatement > xStmt = m_xConnection->createStatement( );
- if(xStmt.is())
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HView.cxx b/connectivity/source/drivers/hsqldb/HView.cxx
deleted file mode 100644
index 1596ee7025..0000000000
--- a/connectivity/source/drivers/hsqldb/HView.cxx
+++ /dev/null
@@ -1,216 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "hsqldb/HView.hxx"
-#include "hsqldb/HTools.hxx"
-
-#include "propertyids.hxx"
-
-#include "connectivity/dbexception.hxx"
-#include "connectivity/dbtools.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-/** === end UNO includes === **/
-
-#include <cppuhelper/exc_hlp.hxx>
-#include <tools/diagnose_ex.h>
-#include <unotools/sharedunocomponent.hxx>
-
-//........................................................................
-namespace connectivity { namespace hsqldb
-{
-//........................................................................
-
- /** === begin UNO using === **/
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::UNO_QUERY;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
- using ::com::sun::star::uno::Exception;
- using ::com::sun::star::uno::RuntimeException;
- using ::com::sun::star::uno::Any;
- using ::com::sun::star::uno::makeAny;
- using ::com::sun::star::sdbc::XDatabaseMetaData;
- using ::com::sun::star::sdbc::SQLException;
- using ::com::sun::star::sdbc::XConnection;
- using ::com::sun::star::lang::WrappedTargetException;
- using ::com::sun::star::sdbc::XResultSet;
- using ::com::sun::star::sdbc::XStatement;
- using ::com::sun::star::lang::DisposedException;
- using ::com::sun::star::sdbc::XRow;
- /** === end UNO using === **/
-
- //====================================================================
- //= HView
- //====================================================================
- //--------------------------------------------------------------------
- HView::HView( const Reference< XConnection >& _rxConnection, sal_Bool _bCaseSensitive,
- const ::rtl::OUString& _rSchemaName, const ::rtl::OUString& _rName )
- :HView_Base( _bCaseSensitive, _rName, _rxConnection->getMetaData(), 0, ::rtl::OUString(), _rSchemaName, ::rtl::OUString() )
- ,m_xConnection( _rxConnection )
- {
- }
-
- //--------------------------------------------------------------------
- HView::~HView()
- {
- }
-
- //--------------------------------------------------------------------
- IMPLEMENT_FORWARD_XINTERFACE2( HView, HView_Base, HView_IBASE )
- IMPLEMENT_FORWARD_XTYPEPROVIDER2( HView, HView_Base, HView_IBASE )
-
- //--------------------------------------------------------------------
- void SAL_CALL HView::alterCommand( const ::rtl::OUString& _rNewCommand ) throw (SQLException, RuntimeException)
- {
- // not really atomic ... as long as we do not have something like
- // ALTER VIEW <name> TO <command>
- // in HSQL, we need to do it this way ...
- //
- // I can imagine scenarios where this fails, e.g. when dropping the view
- // succeedes, re-creating it fails, some other thread alters a table which
- // the view was based on, and then we try to restore the view with the
- // original command, which then fails, too.
- //
- // However, there's not much chance to prevent this kind of errors without
- // backend support.
-
- ::rtl::OUString sQualifiedName( ::dbtools::composeTableName(
- m_xMetaData, m_CatalogName, m_SchemaName, m_Name, true, ::dbtools::eInDataManipulation ) );
-
- ::utl::SharedUNOComponent< XStatement > xStatement; xStatement.set( m_xConnection->createStatement(), UNO_QUERY_THROW );
-
- // create a statement which can be used to re-create the original view, in case
- // dropping it succeeds, but creating it with a new statement fails
- ::rtl::OUStringBuffer aRestoreCommand;
- aRestoreCommand.appendAscii( "CREATE VIEW " );
- aRestoreCommand.append ( sQualifiedName );
- aRestoreCommand.appendAscii( " AS " );
- aRestoreCommand.append ( impl_getCommand_throw( true ) );
- ::rtl::OUString sRestoreCommand( aRestoreCommand.makeStringAndClear() );
-
- bool bDropSucceeded( false );
- try
- {
- // drop the existing view
- ::rtl::OUStringBuffer aCommand;
- aCommand.appendAscii( "DROP VIEW " );
- aCommand.append ( sQualifiedName );
- xStatement->execute( aCommand.makeStringAndClear() );
- bDropSucceeded = true;
-
- // create a new one with the same name
- aCommand.appendAscii( "CREATE VIEW " );
- aCommand.append ( sQualifiedName );
- aCommand.appendAscii( " AS " );
- aCommand.append ( _rNewCommand );
- xStatement->execute( aCommand.makeStringAndClear() );
- }
- catch( const SQLException& )
- {
- if ( bDropSucceeded )
- // drop succeeded, but creation failed -> re-create the view with the original
- // statemnet
- xStatement->execute( sRestoreCommand );
- throw;
- }
- catch( const RuntimeException& )
- {
- if ( bDropSucceeded )
- xStatement->execute( sRestoreCommand );
- throw;
- }
- catch( const Exception& )
- {
- if ( bDropSucceeded )
- xStatement->execute( sRestoreCommand );
- DBG_UNHANDLED_EXCEPTION();
- }
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL HView::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const
- {
- if ( _nHandle == PROPERTY_ID_COMMAND )
- {
- // retrieve the very current command, don't rely on the base classes cached value
- // (which we initialized empty, anyway)
- _rValue <<= impl_getCommand_throw( false );
- return;
- }
-
- HView_Base::getFastPropertyValue( _rValue, _nHandle );
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString HView::impl_getCommand_throw( bool _bAllowSQLException ) const
- {
- ::rtl::OUString sCommand;
-
- try
- {
- ::rtl::OUStringBuffer aCommand;
- aCommand.appendAscii( "SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.SYSTEM_VIEWS " );
- HTools::appendTableFilterCrit( aCommand, m_CatalogName, m_SchemaName, m_Name, false );
- ::utl::SharedUNOComponent< XStatement > xStatement; xStatement.set( m_xConnection->createStatement(), UNO_QUERY_THROW );
- Reference< XResultSet > xResult( xStatement->executeQuery( aCommand.makeStringAndClear() ), UNO_QUERY_THROW );
- if ( !xResult->next() )
- {
- // hmm. There is no view view the name as we know it. Can only mean some other instance
- // dropped this view meanwhile ...
- throw DisposedException();
- }
-
- Reference< XRow > xRow( xResult, UNO_QUERY_THROW );
- sCommand = xRow->getString( 1 );
- }
- catch( const RuntimeException& ) { throw; }
- catch( const SQLException& e )
- {
- if ( _bAllowSQLException )
- throw;
- throw WrappedTargetException( e.Message, static_cast< XAlterView* >( const_cast< HView* >( this ) ), ::cppu::getCaughtException() );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- return sCommand;
- }
-
-//........................................................................
-} } // namespace connectivity::hsqldb
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/HViews.cxx b/connectivity/source/drivers/hsqldb/HViews.cxx
deleted file mode 100644
index 55b51f66fc..0000000000
--- a/connectivity/source/drivers/hsqldb/HViews.cxx
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "hsqldb/HTables.hxx"
-#include "hsqldb/HViews.hxx"
-#include "hsqldb/HView.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbcx/CheckOption.hpp>
-#include "hsqldb/HCatalog.hxx"
-#include <comphelper/extract.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include <cppuhelper/interfacecontainer.h>
-#include <comphelper/types.hxx>
-#include "TConnection.hxx"
-
-using namespace ::comphelper;
-
-using namespace ::cppu;
-using namespace connectivity;
-using namespace connectivity::hsqldb;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace dbtools;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-// -------------------------------------------------------------------------
-HViews::HViews( const Reference< XConnection >& _rxConnection, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector )
- :sdbcx::OCollection( _rParent, sal_True, _rMutex, _rVector )
- ,m_xConnection( _rxConnection )
- ,m_xMetaData( _rxConnection->getMetaData() )
- ,m_bInDrop( sal_False )
-{
-}
-
-// -------------------------------------------------------------------------
-sdbcx::ObjectType HViews::createObject(const ::rtl::OUString& _rName)
-{
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(m_xMetaData,
- _rName,
- sCatalog,
- sSchema,
- sTable,
- ::dbtools::eInDataManipulation);
- return new HView( m_xConnection, isCaseSensitive(), sSchema, sTable );
-}
-
-// -------------------------------------------------------------------------
-void HViews::impl_refresh( ) throw(RuntimeException)
-{
- static_cast<OHCatalog&>(m_rParent).refreshTables();
-}
-// -------------------------------------------------------------------------
-void HViews::disposing(void)
-{
-m_xMetaData.clear();
- OCollection::disposing();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > HViews::createDescriptor()
-{
- Reference<XConnection> xConnection = static_cast<OHCatalog&>(m_rParent).getConnection();
- connectivity::sdbcx::OView* pNew = new connectivity::sdbcx::OView(sal_True,xConnection->getMetaData());
- return pNew;
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType HViews::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- createView(descriptor);
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void HViews::dropObject(sal_Int32 _nPos,const ::rtl::OUString /*_sElementName*/)
-{
- if ( m_bInDrop )
- return;
-
- Reference< XInterface > xObject( getObject( _nPos ) );
- sal_Bool bIsNew = connectivity::sdbcx::ODescriptor::isNew( xObject );
- if (!bIsNew)
- {
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "DROP VIEW" ));
-
- Reference<XPropertySet> xProp(xObject,UNO_QUERY);
- aSql += ::dbtools::composeTableName( m_xMetaData, xProp, ::dbtools::eInTableDefinitions, false, false, true );
-
- Reference<XConnection> xConnection = static_cast<OHCatalog&>(m_rParent).getConnection();
- Reference< XStatement > xStmt = xConnection->createStatement( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-void HViews::dropByNameImpl(const ::rtl::OUString& elementName)
-{
- m_bInDrop = sal_True;
- OCollection_TYPE::dropByName(elementName);
- m_bInDrop = sal_False;
-}
-// -----------------------------------------------------------------------------
-void HViews::createView( const Reference< XPropertySet >& descriptor )
-{
- Reference<XConnection> xConnection = static_cast<OHCatalog&>(m_rParent).getConnection();
-
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "CREATE VIEW " ));
- ::rtl::OUString aQuote = xConnection->getMetaData()->getIdentifierQuoteString( );
- ::rtl::OUString sSchema,sCommand;
-
- aSql += ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::eInTableDefinitions, false, false, true );
-
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" AS "));
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_COMMAND)) >>= sCommand;
- aSql += sCommand;
-
- Reference< XStatement > xStmt = xConnection->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
-
- // insert the new view also in the tables collection
- OTables* pTables = static_cast<OTables*>(static_cast<OHCatalog&>(m_rParent).getPrivateTables());
- if ( pTables )
- {
- ::rtl::OUString sName = ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::eInDataManipulation, false, false, false );
- pTables->appendNew(sName);
- }
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/Hservices.cxx b/connectivity/source/drivers/hsqldb/Hservices.cxx
deleted file mode 100644
index d6399f36cc..0000000000
--- a/connectivity/source/drivers/hsqldb/Hservices.cxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "hsqldb/HDriver.hxx"
-#include <cppuhelper/factory.hxx>
-
-using namespace connectivity::hsqldb;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pT
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- ODriverDelegator::getImplementationName_Static(),
- ODriverDelegator::getSupportedServiceNames_Static(),
- ODriverDelegator_CreateInstance, ::cppu::createSingleFactory)
- ;
-
- if(aReq.xRet.is())
- aReq.xRet->acquire();
-
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx
deleted file mode 100644
index 7bfca0847f..0000000000
--- a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx
+++ /dev/null
@@ -1,183 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/embed/XStorage.hpp>
-#include "hsqldb/StorageFileAccess.h"
-#include "hsqldb/HStorageMap.hxx"
-
-#include <rtl/logfile.hxx>
-
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::embed;
-using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::lang;
-using namespace ::connectivity::hsqldb;
-
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
-/*****************************************************************************/
-/* exception macros */
-
-#define ThrowException(env, type, msg) { \
- env->ThrowNew(env->FindClass(type), msg); }
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess
- * Method: isStreamElement
- * Signature: (Ljava/lang/String;Ljava/lang/String;)Z
- */
-SAL_DLLPUBLIC_EXPORT jboolean JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_isStreamElement
- (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring name)
-{
- TStorages::mapped_type aStoragePair = StorageContainer::getRegisteredStorage(StorageContainer::jstring2ustring(env,key));
- if ( aStoragePair.first.first.is() )
- {
- try
- {
- ::rtl::OUString sName = StorageContainer::jstring2ustring(env,name);
- try
- {
- ::rtl::OUString sOldName = StorageContainer::removeOldURLPrefix(sName);
- if ( aStoragePair.first.first->isStreamElement(sOldName) )
- {
- try
- {
- aStoragePair.first.first->renameElement(sOldName,StorageContainer::removeURLPrefix(sName,aStoragePair.first.second));
- }
- catch(const Exception&)
- {
- }
- }
- }
- catch(const NoSuchElementException&)
- {
- }
- return aStoragePair.first.first->isStreamElement(StorageContainer::removeURLPrefix(sName,aStoragePair.first.second));
- }
- catch(const NoSuchElementException&)
- {
- }
- catch(const Exception& e)
- {
- OSL_FAIL("Exception caught! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_isStreamElement");
- if (JNI_FALSE != env->ExceptionCheck())
- env->ExceptionClear();
- ::rtl::OString cstr( ::rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_JAVA_UTF8 ) );
- OSL_TRACE( __FILE__": forwarding Exception: %s", cstr.getStr() );
- }
- }
- return JNI_FALSE;
-}
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess
- * Method: removeElement
- * Signature: (Ljava/lang/String;Ljava/lang/String;)V
- */
-SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_removeElement
- (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring name)
-{
-#ifdef HSQLDB_DBG
- {
- ::rtl::OUString sKey = StorageContainer::jstring2ustring(env,key);
- ::rtl::OUString sName = StorageContainer::jstring2ustring(env,name);
- }
-#endif
- TStorages::mapped_type aStoragePair = StorageContainer::getRegisteredStorage(StorageContainer::jstring2ustring(env,key));
- if ( aStoragePair.first.first.is() )
- {
- try
- {
- aStoragePair.first.first->removeElement(StorageContainer::removeURLPrefix(StorageContainer::jstring2ustring(env,name),aStoragePair.first.second));
- }
- catch(const NoSuchElementException&)
- {
- if (JNI_FALSE != env->ExceptionCheck())
- env->ExceptionClear();
- }
- catch(const Exception& e)
- {
- OSL_FAIL("Exception caught! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_removeElement");
- StorageContainer::throwJavaException(e,env);
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess
- * Method: renameElement
- * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
- */
-SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_renameElement
- (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring oldname, jstring newname)
-{
-#ifdef HSQLDB_DBG
- {
- ::rtl::OUString sKey = StorageContainer::jstring2ustring(env,key);
- ::rtl::OUString sNewName = StorageContainer::jstring2ustring(env,newname);
- ::rtl::OUString sOldName = StorageContainer::jstring2ustring(env,oldname);
- }
-#endif
- TStorages::mapped_type aStoragePair = StorageContainer::getRegisteredStorage(StorageContainer::jstring2ustring(env,key));
- if ( aStoragePair.first.first.is() )
- {
- try
- {
- aStoragePair.first.first->renameElement(
- StorageContainer::removeURLPrefix(StorageContainer::jstring2ustring(env,oldname),aStoragePair.first.second),
- StorageContainer::removeURLPrefix(StorageContainer::jstring2ustring(env,newname),aStoragePair.first.second)
- );
-#ifdef HSQLDB_DBG
- {
- ::rtl::OUString sNewName = StorageContainer::removeURLPrefix(StorageContainer::jstring2ustring(env,newname),aStoragePair.first.second);
- OSL_ENSURE(aStoragePair.first.first->isStreamElement(sNewName),"Stream could not be renamed");
- }
-#endif
- }
- catch(const NoSuchElementException&)
- {
- }
- catch(const Exception& e)
- {
- OSL_FAIL("Exception caught! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_renameElement");
- StorageContainer::throwJavaException(e,env);
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx
deleted file mode 100644
index 471ceea237..0000000000
--- a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx
+++ /dev/null
@@ -1,309 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <com/sun/star/io/XStream.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
-#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-#include <comphelper/stl_types.hxx>
-#include <comphelper/types.hxx>
-#include "hsqldb/HStorageAccess.hxx"
-#include "hsqldb/HStorageMap.hxx"
-#include "hsqldb/StorageNativeInputStream.h"
-
-#include "jvmaccess/virtualmachine.hxx"
-#include <com/sun/star/lang/XSingleComponentFactory.hpp>
-#include "accesslog.hxx"
-
-#include <limits>
-
-
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::embed;
-using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::lang;
-using namespace ::connectivity::hsqldb;
-
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
-/*****************************************************************************/
-/* exception macros */
-
-#define ThrowException(env, type, msg) { \
- env->ThrowNew(env->FindClass(type), msg); }
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: openStream
- * Signature: (Ljava/lang/String;Ljava/lang/String;I)V
- */
-SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_openStream
- (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring name, jint mode)
-{
-#ifdef HSQLDB_DBG
- {
- OperationLogFile( env, name, "input" ).logOperation( "openStream" );
- LogFile( env, name, "input" ).create();
- }
-#endif
- StorageContainer::registerStream(env,name,key,mode);
-}
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: read
- * Signature: (Ljava/lang/String;Ljava/lang/String;)I
- */
-SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2
- (JNIEnv * env, jobject obj_this,jstring key, jstring name)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile( env, name, "input" ).logOperation( "read()" );
-
- DataLogFile aDataLog( env, name, "input" );
- return read_from_storage_stream( env, obj_this, name, key, &aDataLog );
-#else
- return read_from_storage_stream( env, obj_this, name, key );
-#endif
-}
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: read
- * Signature: (Ljava/lang/String;Ljava/lang/String;[BII)I
- */
-SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3BII
- (JNIEnv * env, jobject obj_this,jstring key, jstring name, jbyteArray buffer, jint off, jint len)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile( env, name, "input" ).logOperation( "read( byte[], int, int )" );
-
- DataLogFile aDataLog( env, name, "input" );
- return read_from_storage_stream_into_buffer( env, obj_this, name, key, buffer, off, len, &aDataLog );
-#else
- return read_from_storage_stream_into_buffer(env,obj_this,name,key,buffer,off,len);
-#endif
-}
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: close
- * Signature: (Ljava/lang/String;Ljava/lang/String;)V
- */
-SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_close
- (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring name)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile aOpLog( env, name, "input" );
- aOpLog.logOperation( "close" );
- aOpLog.close();
-
- LogFile aDataLog( env, name, "input" );
- aDataLog.close();
-#endif
- StorageContainer::revokeStream(env,name,key);
-}
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: skip
- * Signature: (Ljava/lang/String;Ljava/lang/String;J)J
- */
-SAL_DLLPUBLIC_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_skip
- (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring name, jlong n)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile( env, name, "input" ).logOperation( "skip()" );
-#endif
-
- if ( n < 0 )
- ThrowException( env,
- "java/io/IOException",
- "n < 0");
-
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- OSL_ENSURE(pHelper.get(),"No stream helper!");
- if ( pHelper.get() )
- {
- Reference<XInputStream> xIn = pHelper->getInputStream();
- if ( xIn.is() )
- {
- try
- {
- sal_Int64 tmpLongVal = n;
- sal_Int32 tmpIntVal;
-
- try
- {
- do {
- if (tmpLongVal >= ::std::numeric_limits<sal_Int64>::max() )
- tmpIntVal = ::std::numeric_limits<sal_Int32>::max();
- else // Casting is safe here.
- tmpIntVal = static_cast<sal_Int32>(tmpLongVal);
-
- tmpLongVal -= tmpIntVal;
-
- xIn->skipBytes(tmpIntVal);
-
- } while (tmpLongVal > 0);
- }
- catch(const Exception&)
- {
- }
-
- return n - tmpLongVal;
- }
- catch(const Exception& e)
- {
- OSL_FAIL("Exception caught! : skip();");
- StorageContainer::throwJavaException(e,env);
- }
- }
- }
- else
- {
- ThrowException( env,
- "java/io/IOException",
- "Stream is not valid");
- }
- return 0;
-}
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: available
- * Signature: (Ljava/lang/String;Ljava/lang/String;)I
- */
-SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_available
- (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring name)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile aOpLog( env, name, "input" );
- aOpLog.logOperation( "available" );
-#endif
-
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- OSL_ENSURE(pHelper.get(),"No stream helper!");
- Reference<XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference<XInputStream>();
- if ( xIn.is() )
- {
- try
- {
- jint nAvailable = xIn->available();
-#ifdef HSQLDB_DBG
- aOpLog.logReturn( nAvailable );
-#endif
- return nAvailable;
- }
- catch(const Exception& e)
- {
- OSL_FAIL("Exception caught! : available();");
- StorageContainer::throwJavaException(e,env);
- }
- }
- else
- {
- ThrowException( env,
- "java/io/IOException",
- "Stream is not valid");
- }
- return 0;
-}
-// -----------------------------------------------------------------------------
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: read
- * Signature: (Ljava/lang/String;Ljava/lang/String;[B)I
- */
-SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3B
- (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring name, jbyteArray buffer)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile aOpLog( env, name, "input" );
- aOpLog.logOperation( "read( byte[] )" );
-
- DataLogFile aDataLog( env, name, "input" );
-#endif
-
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- Reference< XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference< XInputStream>();
- OSL_ENSURE(xIn.is(),"Input stream is NULL!");
- jint nBytesRead = 0;
- if ( xIn.is() )
- {
- jsize nLen = env->GetArrayLength(buffer);
- Sequence< ::sal_Int8 > aData(nLen);
-
- try
- {
- nBytesRead = xIn->readBytes(aData,nLen);
- }
- catch(const Exception& e)
- {
- OSL_FAIL("Exception caught! : skip();");
- StorageContainer::throwJavaException(e,env);
- }
-
- // Casting bytesRead to an int is okay, since the user can
- // only pass in an integer length to read, so the bytesRead
- // must <= len.
- //
- if (nBytesRead <= 0) {
-#ifdef HSQLDB_DBG
- aOpLog.logReturn( (jint)-1 );
-#endif
- return -1;
- }
- OSL_ENSURE(nLen >= nBytesRead,"Buffer is too small!");
- OSL_ENSURE(aData.getLength() >= nBytesRead,"Buffer is too small!");
- env->SetByteArrayRegion(buffer,0,nBytesRead,(const jbyte*) &aData[0]);
-#ifdef HSQLDB_DBG
- aDataLog.write( &aData[0], nBytesRead );
-#endif
- }
-#ifdef HSQLDB_DBG
- aOpLog.logReturn( nBytesRead );
-#endif
- return nBytesRead;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx
deleted file mode 100644
index 17b7fd89db..0000000000
--- a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx
+++ /dev/null
@@ -1,222 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "uno/mapping.hxx"
-#include "uno/environment.hxx"
-#include "cppuhelper/bootstrap.hxx"
-#include "cppuhelper/compbase1.hxx"
-#include "cppuhelper/component_context.hxx"
-#include "accesslog.hxx"
-#include <com/sun/star/embed/XTransactedObject.hpp>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/io/XStream.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
-#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-#include <comphelper/stl_types.hxx>
-#include <comphelper/types.hxx>
-#include "hsqldb/HStorageAccess.hxx"
-#include "hsqldb/HStorageMap.hxx"
-
-#include "jvmaccess/virtualmachine.hxx"
-#include "com/sun/star/lang/XSingleComponentFactory.hpp"
-#include "diagnose_ex.h"
-
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::embed;
-using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::lang;
-using namespace ::connectivity::hsqldb;
-
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
-/*****************************************************************************/
-/* exception macros */
-
-#define ThrowException(env, type, msg) { \
- env->ThrowNew(env->FindClass(type), msg); }
-
-// -----------------------------------------------------------------------------
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream
- * Method: openStream
- * Signature: (Ljava/lang/String;Ljava/lang/String;I)V
- */
-extern "C" SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_openStream
- (JNIEnv * env, jobject /*obj_this*/, jstring name, jstring key, jint mode)
-{
-#ifdef HSQLDB_DBG
- {
- OperationLogFile( env, name, "output" ).logOperation( "openStream" );
- LogFile( env, name, "output" ).create();
- }
-#endif
- StorageContainer::registerStream(env,name,key,mode);
-}
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream
- * Method: write
- * Signature: (Ljava/lang/String;Ljava/lang/String;[BII)V
- */
-extern "C" SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3BII
- (JNIEnv * env, jobject obj_this, jstring key, jstring name, jbyteArray buffer, jint off, jint len)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile( env, name, "output" ).logOperation( "write( byte[], int, int )" );
-
- DataLogFile aDataLog( env, name, "output" );
- write_to_storage_stream_from_buffer( env, obj_this, name, key, buffer, off, len, &aDataLog );
-#else
- write_to_storage_stream_from_buffer( env, obj_this, name, key, buffer, off, len );
-#endif
-}
-// -----------------------------------------------------------------------------
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream
- * Method: write
- * Signature: (Ljava/lang/String;Ljava/lang/String;[B)V
- */
-extern "C" SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3B
- (JNIEnv * env, jobject obj_this, jstring key, jstring name, jbyteArray buffer)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile( env, name, "output" ).logOperation( "write( byte[] )" );
-
- DataLogFile aDataLog( env, name, "output" );
- write_to_storage_stream_from_buffer( env, obj_this, name, key, buffer, 0, env->GetArrayLength( buffer ), &aDataLog );
-#else
- write_to_storage_stream_from_buffer( env, obj_this, name, key, buffer, 0, env->GetArrayLength( buffer ) );
-#endif
-}
-// -----------------------------------------------------------------------------
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream
- * Method: close
- * Signature: (Ljava/lang/String;Ljava/lang/String;)V
- */
-extern "C" SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_close
- (JNIEnv * env, jobject /*obj_this*/, jstring key, jstring name)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile aOpLog( env, name, "output" );
- aOpLog.logOperation( "close" );
-
- LogFile aDataLog( env, name, "output" );
-#endif
-
- ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
- Reference< XOutputStream> xFlush = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>();
- if ( xFlush.is() )
- try
- {
- xFlush->flush();
- }
- catch(Exception&)
- {}
-
-#ifdef HSQLDB_DBG
- aDataLog.close();
- aOpLog.close();
-#endif
- StorageContainer::revokeStream(env,name,key);
-}
-// -----------------------------------------------------------------------------
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream
- * Method: write
- * Signature: (Ljava/lang/String;Ljava/lang/String;I)V
- */
-extern "C" SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2I
- (JNIEnv * env, jobject obj_this, jstring key, jstring name,jint b)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile( env, name, "output" ).logOperation( "write( int )" );
-
- DataLogFile aDataLog( env, name, "output" );
- write_to_storage_stream( env, obj_this, name, key, b, &aDataLog );
-#else
- write_to_storage_stream( env, obj_this, name, key, b );
-#endif
-}
-// -----------------------------------------------------------------------------
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream
- * Method: flush
- * Signature: (Ljava/lang/String;Ljava/lang/String;)V
- */
-extern "C" SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_flush
- (JNIEnv * env, jobject /*obj_this*/, jstring key, jstring name)
-{
- OSL_UNUSED( env );
- OSL_UNUSED( key );
- OSL_UNUSED( name );
-#ifdef HSQLDB_DBG
- OperationLogFile( env, name, "output" ).logOperation( "flush" );
-
- ::rtl::OUString sKey = StorageContainer::jstring2ustring(env,key);
- ::rtl::OUString sName = StorageContainer::jstring2ustring(env,name);
-#endif
-}
-// -----------------------------------------------------------------------------
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream
- * Method: sync
- * Signature: (Ljava/lang/String;Ljava/lang/String;)V
- */
-extern "C" SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_sync
- (JNIEnv * env, jobject /*obj_this*/, jstring key, jstring name)
-{
-#ifdef HSQLDB_DBG
- OperationLogFile( env, name, "output" ).logOperation( "sync" );
-#endif
- ::boost::shared_ptr< StreamHelper > pStream = StorageContainer::getRegisteredStream( env, name, key );
- Reference< XOutputStream > xFlush = pStream.get() ? pStream->getOutputStream() : Reference< XOutputStream>();
- OSL_ENSURE( xFlush.is(), "StorageNativeOutputStream::sync: could not retrieve an output stream!" );
- if ( xFlush.is() )
- {
- try
- {
- xFlush->flush();
- }
- catch(Exception&)
- {
- OSL_FAIL( "StorageNativeOutputStream::sync: could not flush output stream!" );
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/accesslog.cxx b/connectivity/source/drivers/hsqldb/accesslog.cxx
deleted file mode 100644
index 111e1da186..0000000000
--- a/connectivity/source/drivers/hsqldb/accesslog.cxx
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#ifdef HSQLDB_DBG
-#include "accesslog.hxx"
-#include "hsqldb/HStorageMap.hxx"
-
-#include <osl/thread.h>
-
-namespace connectivity { namespace hsqldb
-{
- DECLARE_STL_USTRINGACCESS_MAP(FILE *,TDebugStreamMap);
- TDebugStreamMap& getStreams()
- {
- static TDebugStreamMap streams;
- return streams;
- }
-
- //---------------------------------------------------------------------
- LogFile::LogFile( JNIEnv* env, jstring streamName, const sal_Char* _pAsciiSuffix )
- {
- m_sFileName = StorageContainer::jstring2ustring(env,streamName);
- m_sFileName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."));
- m_sFileName += ::rtl::OUString::createFromAscii( _pAsciiSuffix );
- }
-
- //---------------------------------------------------------------------
- FILE*& LogFile::getLogFile()
- {
- FILE*& pLogFile = getStreams()[m_sFileName];
- if ( !pLogFile )
- {
- ::rtl::OString sByteLogName = ::rtl::OUStringToOString(m_sFileName,osl_getThreadTextEncoding());
- pLogFile = fopen( sByteLogName.getStr(), "a+" );
- }
- return pLogFile;
- }
-
- //---------------------------------------------------------------------
- void LogFile::writeString( const sal_Char* _pString, bool _bEndLine )
- {
- FILE* pLogFile = getLogFile();
- fwrite( _pString, sizeof( *_pString ), strlen( _pString ), pLogFile );
- if ( _bEndLine )
- fwrite( "\n", sizeof( *_pString ), strlen( "\n" ), pLogFile );
- fflush( pLogFile );
- }
-
- //---------------------------------------------------------------------
- void LogFile::close()
- {
- fclose( getLogFile() );
- getLogFile() = NULL;
- }
-} }
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/accesslog.hxx b/connectivity/source/drivers/hsqldb/accesslog.hxx
deleted file mode 100644
index f10ae77d4e..0000000000
--- a/connectivity/source/drivers/hsqldb/accesslog.hxx
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_HSQLDB_ACCESSLOG_HXX
-#define CONNECTIVITY_HSQLDB_ACCESSLOG_HXX
-
-#ifdef HSQLDB_DBG
-
-#include <stdio.h>
-#include <jni.h>
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-
-namespace connectivity { namespace hsqldb
-{
- class LogFile
- {
- private:
- ::rtl::OUString m_sFileName;
-
- public:
- LogFile( JNIEnv* env, jstring streamName, const sal_Char* _pAsciiSuffix );
-
- public:
- void writeString( const sal_Char* _pString, bool _bEndLine = true );
- void create() { getLogFile(); }
- virtual void close();
-
- protected:
- FILE*& getLogFile();
- };
-
- class OperationLogFile : public LogFile
- {
- public:
- OperationLogFile( JNIEnv* env, jstring streamName, const sal_Char* _pAsciiSuffix )
- :LogFile( env, streamName, ( ::rtl::OString( _pAsciiSuffix ) += ".op" ).getStr() )
- {
- }
-
- void logOperation( const sal_Char* _pOp )
- {
- writeString( _pOp, true );
- }
-
- void logOperation( const sal_Char* _pOp, jlong _nLongArg )
- {
- ::rtl::OString sLine( _pOp );
- sLine += "( ";
- sLine += ::rtl::OString::valueOf( _nLongArg );
- sLine += " )";
- writeString( sLine.getStr(), true );
- }
-
- void logReturn( jlong _nRetVal )
- {
- ::rtl::OString sLine( " -> " );
- sLine += ::rtl::OString::valueOf( _nRetVal );
- writeString( sLine.getStr(), true );
- }
-
- void logReturn( jint _nRetVal )
- {
- ::rtl::OString sLine( " -> " );
- sLine += ::rtl::OString::valueOf( _nRetVal );
- writeString( sLine.getStr(), true );
- }
-
- virtual void close()
- {
- writeString( "-------------------------------", true );
- writeString( "", true );
- LogFile::close();
- }
- };
-
- class DataLogFile : public LogFile
- {
- public:
- DataLogFile( JNIEnv* env, jstring streamName, const sal_Char* _pAsciiSuffix )
- :LogFile( env, streamName, _pAsciiSuffix )
- {
- }
-
- void write( jint value )
- {
- fputc( value, getLogFile() );
- fflush( getLogFile() );
- }
-
- void write( const sal_Int8* buffer, sal_Int32 bytesRead )
- {
- fwrite( buffer, sizeof(sal_Int8), bytesRead, getLogFile() );
- fflush( getLogFile() );
- }
-
- sal_Int64 seek( sal_Int64 pos )
- {
- FILE* pFile = getLogFile();
- fseek( pFile, 0, SEEK_END );
- if ( ftell( pFile ) < pos )
- {
- sal_Int8 filler( 0 );
- while ( ftell( pFile ) < pos )
- fwrite( &filler, sizeof( sal_Int8 ), 1, pFile );
- fflush( pFile );
- }
- fseek( pFile, pos, SEEK_SET );
- return ftell( pFile );
- }
-
- sal_Int64 tell()
- {
- return ftell( getLogFile() );
- }
- };
-
-} }
-#endif
-
-#endif // CONNECTIVITY_HSQLDB_ACCESSLOG_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/hsqldb/exports.dxp b/connectivity/source/drivers/hsqldb/exports.dxp
deleted file mode 100755
index de2bf561d4..0000000000
--- a/connectivity/source/drivers/hsqldb/exports.dxp
+++ /dev/null
@@ -1,28 +0,0 @@
-component_getFactory
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_openStream
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3BII
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3B
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_close
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2I
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_flush
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_sync
-Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_openStream
-Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_close
-Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_getFilePointer
-Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_length
-Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_read__Ljava_lang_String_2Ljava_lang_String_2
-Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_read__Ljava_lang_String_2Ljava_lang_String_2_3BII
-Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_readInt
-Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_seek
-Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_write
-Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_writeInt
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_openStream
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3BII
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_close
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_skip
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_available
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3B
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_isStreamElement
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_removeElement
-Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_renameElement
diff --git a/connectivity/source/drivers/hsqldb/hsqldb.component b/connectivity/source/drivers/hsqldb/hsqldb.component
deleted file mode 100755
index eb8ae477e7..0000000000
--- a/connectivity/source/drivers/hsqldb/hsqldb.component
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.sdbcx.comp.hsqldb.Driver">
- <service name="com.sun.star.sdbc.Driver"/>
- <service name="com.sun.star.sdbcx.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/hsqldb/hsqldb.map b/connectivity/source/drivers/hsqldb/hsqldb.map
deleted file mode 100755
index 2ffbabaac1..0000000000
--- a/connectivity/source/drivers/hsqldb/hsqldb.map
+++ /dev/null
@@ -1,33 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getFactory;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_openStream;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3BII;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3B;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_close;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2I;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_flush;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_sync;
- Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_openStream;
- Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_close;
- Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_getFilePointer;
- Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_length;
- Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_read__Ljava_lang_String_2Ljava_lang_String_2;
- Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_read__Ljava_lang_String_2Ljava_lang_String_2_3BII;
- Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_readInt;
- Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_seek;
- Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_write;
- Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_writeInt;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_openStream;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3BII;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_close;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_skip;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_available;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3B;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_isStreamElement;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_removeElement;
- Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_renameElement;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/hsqldb/hsqldb.xcu b/connectivity/source/drivers/hsqldb/hsqldb.xcu
deleted file mode 100644
index af9c348242..0000000000
--- a/connectivity/source/drivers/hsqldb/hsqldb.xcu
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:embedded:hsqldb" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.sdbcx.comp.hsqldb.Driver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">HSQL database engine</value>
- </prop>
- <node oor:name="Features">
- <node oor:name="UseDOSLineEnds" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FormsCheckRequiredFields" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="AddIndexAppendix" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsTableCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseJava" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="AutoIncrementIsPrimaryKey" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/hsqldb/hsqldb.xml b/connectivity/source/drivers/hsqldb/hsqldb.xml
deleted file mode 100755
index f8e5c61af6..0000000000
--- a/connectivity/source/drivers/hsqldb/hsqldb.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>hsqldb</module-name>
- <component-description>
- <author>Ocke Janssen</author>
- <name>com.sun.star.sdbcx.comp.hsqldb.Driver</name>
- <description>
- This is the implementation of the HSQLDB driver.
- </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service>com.sun.star.sdbcx.Driver</supported-service>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>dbtools</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
-
-
diff --git a/connectivity/source/drivers/hsqldb/hsqlui.hrc b/connectivity/source/drivers/hsqldb/hsqlui.hrc
deleted file mode 100755
index e17ffb5e99..0000000000
--- a/connectivity/source/drivers/hsqldb/hsqlui.hrc
+++ /dev/null
@@ -1,35 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_HSQLUI_HRC
-#define CONNECTIVITY_HSQLUI_HRC
-
-#define LINKED_TEXT_TABLE_IMAGE_RESOURCE "linked_text_table.png"
-
-#endif // CONNECTIVITY_HSQLUI_HRC
-
-
diff --git a/connectivity/source/drivers/hsqldb/hsqlui.src b/connectivity/source/drivers/hsqldb/hsqlui.src
deleted file mode 100644
index 27166edf26..0000000000
--- a/connectivity/source/drivers/hsqldb/hsqlui.src
+++ /dev/null
@@ -1,48 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_HSQLUI_HRC
-#include "hsqlui.hrc"
-#endif
-
-/* Note:
- The resource file built here (hsqldb.res, finally) is *not* included
- in the final OOo installation. Instead, it is only built to ensure that
- the image below is included in the application-wide image repository
- (images.zip). This way, they can be accessed at runtime, but without the
- indirection via a resource file - the GraphicProvider service supports
- a "private:imagerepository/*" protocol meanwhile, which allows this.
-
- If there were another possibility to ensure that the images are
- put into the repository, instead of creating a resource file for them,
- then we would use this other way ...
-*/
-
-Image 1000
-{
- ImageBitmap = Bitmap { File = LINKED_TEXT_TABLE_IMAGE_RESOURCE; };
-};
diff --git a/connectivity/source/drivers/hsqldb/makefile.mk b/connectivity/source/drivers/hsqldb/makefile.mk
deleted file mode 100755
index 6e400696fa..0000000000
--- a/connectivity/source/drivers/hsqldb/makefile.mk
+++ /dev/null
@@ -1,126 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=hsqldb
-
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-USE_DEFFILE=TRUE
-
-# --- Settings ----------------------------------
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-.IF "$(SOLAR_JAVA)"==""
-nojava:
- @echo "Not building jurt because Java is disabled"
-.ENDIF
-
-.IF "$(SYSTEM_HSQLDB)" == "YES"
-CDEFS+=-DSYSTEM_HSQLDB -DHSQLDB_JAR=\""file://$(HSQLDB_JAR)"\"
-.ENDIF
-# --- Resources ---------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES = \
- hsqlui.src
-
-RES1FILELIST=\
- $(SRS)$/$(TARGET).srs
-
-RESLIB1NAME=$(TARGET)
-RESLIB1IMAGES=$(SOLARDEFIMG)$/database
-RESLIB1SRSFILES=$(RES1FILELIST)
-
-# Note that the resource file built here is currently *not* included
-# in installation sets. See hsqlui.src for an explanation
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/HStorageMap.obj \
- $(SLO)$/HStorageAccess.obj \
- $(SLO)$/HDriver.obj \
- $(SLO)$/HConnection.obj \
- $(SLO)$/HTerminateListener.obj \
- $(SLO)$/StorageNativeOutputStream.obj \
- $(SLO)$/StorageNativeInputStream.obj \
- $(SLO)$/StorageFileAccess.obj \
- $(SLO)$/HTables.obj \
- $(SLO)$/HTable.obj \
- $(SLO)$/HView.obj \
- $(SLO)$/HViews.obj \
- $(SLO)$/HCatalog.obj \
- $(SLO)$/HColumns.obj \
- $(SLO)$/HUser.obj \
- $(SLO)$/HUsers.obj \
- $(SLO)$/Hservices.obj \
- $(SLO)$/HTools.obj \
- $(SLO)$/accesslog.obj
-
-SHL1VERSIONMAP=$(HSQLDB_TARGET).map
-
-# --- Library -----------------------------------
-# NO $(DLLPOSTFIX) otherwise we have to find on which plattform we are for the java files
-SHL1TARGET= $(HSQLDB_TARGET)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB) \
- $(DBTOOLSLIB) \
- $(JVMFWKLIB) \
- $(COMPHELPERLIB) \
- $(TOOLSLIB) \
- $(UNOTOOLSLIB)
-
-
-SHL1DEPN=
-SHL1CREATEJNILIB=TRUE
-SHL1IMPLIB= i$(HSQLDB_TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-# --- Targets ----------------------------------
-
-.INCLUDE : $(PRJ)$/target.pmk
-
-
-
-ALLTAR : $(MISC)/hsqldb.component
-
-$(MISC)/hsqldb.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- hsqldb.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt hsqldb.component
diff --git a/connectivity/source/drivers/jdbc/Array.cxx b/connectivity/source/drivers/jdbc/Array.cxx
deleted file mode 100644
index 77b2492b9f..0000000000
--- a/connectivity/source/drivers/jdbc/Array.cxx
+++ /dev/null
@@ -1,144 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/Array.hxx"
-#include "java/tools.hxx"
-#include "java/sql/ResultSet.hxx"
-
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.sql.Array
-//**************************************************************
-
-jclass java_sql_Array::theClass = 0;
-
-java_sql_Array::~java_sql_Array()
-{}
-
-jclass java_sql_Array::getMyClass() const
-{
- // the class must be fetched once, therefore its static
- if( !theClass )
- theClass = findMyClass("java/sql/Array");
-
- return theClass;
-}
-
-::rtl::OUString SAL_CALL java_sql_Array::getBaseTypeName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- static jmethodID mID(NULL);
- return callStringMethod("getBaseTypeName",mID);
-}
-
-sal_Int32 SAL_CALL java_sql_Array::getBaseType( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- static jmethodID mID(NULL);
- return callIntMethod("getBaseType",mID);
-}
-
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL java_sql_Array::getArray( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- jobject obj = convertTypeMapToJavaMap(t.pEnv,typeMap);
- static const char * cSignature = "(Ljava/util/Map;)[Ljava/lang/Object;";
- static const char * cMethodName = "getArray";
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- // submit Java-Call
- (jobjectArray)t.pEnv->CallObjectMethod( object, mID, obj);
- ThrowSQLException(t.pEnv,*this);
- // and clean up
- t.pEnv->DeleteLocalRef(obj);
- } //t.pEnv
- return ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >();
-}
-
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL java_sql_Array::getArrayAtIndex( sal_Int32 index, sal_Int32 count, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- jobject obj = convertTypeMapToJavaMap(t.pEnv,typeMap);
- static const char * cSignature = "(IILjava/util/Map;)[Ljava/lang/Object;";
- static const char * cMethodName = "getArray";
- // submit Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- (jobjectArray)t.pEnv->CallObjectMethod( object, mID, index,count,obj);
- ThrowSQLException(t.pEnv,*this);
- // and clean up
- t.pEnv->DeleteLocalRef(obj);
- }
- return ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >();
-}
-
-::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL java_sql_Array::getResultSet( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- // convert Parameter
- jobject obj = convertTypeMapToJavaMap(t.pEnv,typeMap);
- // initialize temporary variable
- static const char * cSignature = "(Ljava/util/Map;)Ljava/sql/ResultSet;";
- static const char * cMethodName = "getResultSet";
- // submit Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- t.pEnv->CallObjectMethod( object, mID, obj);
- ThrowSQLException(t.pEnv,*this);
- // and cleanup
- t.pEnv->DeleteLocalRef(obj);
- }
- return NULL;
-}
-
-::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL java_sql_Array::getResultSetAtIndex( sal_Int32 index, sal_Int32 count, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- // convert parameter
- jobject obj = convertTypeMapToJavaMap(t.pEnv,typeMap);
- // initialize temporary variable
- static const char * cSignature = "(Ljava/util/Map;)Ljava/sql/ResultSet;";
- static const char * cMethodName = "getResultSetAtIndex";
- // Java-Call absetzen
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- t.pEnv->CallObjectMethod( object, mID, index,count,obj);
- ThrowSQLException(t.pEnv,*this);
- // and cleanup
- t.pEnv->DeleteLocalRef(obj);
- }
- return NULL;
-}
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/Blob.cxx b/connectivity/source/drivers/jdbc/Blob.cxx
deleted file mode 100644
index a0d9fd73a8..0000000000
--- a/connectivity/source/drivers/jdbc/Blob.cxx
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/Blob.hxx"
-#include "java/tools.hxx"
-#include "java/io/InputStream.hxx"
-#include <connectivity/dbexception.hxx>
-
-#include <string.h>
-
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.sql.Blob
-//**************************************************************
-
-jclass java_sql_Blob::theClass = 0;
-java_sql_Blob::java_sql_Blob( JNIEnv * pEnv, jobject myObj )
- : java_lang_Object( pEnv, myObj )
-{
- SDBThreadAttach::addRef();
-}
-java_sql_Blob::~java_sql_Blob()
-{
- SDBThreadAttach::releaseRef();
-}
-
-jclass java_sql_Blob::getMyClass() const
-{
- // the class must be fetched only once, therefore it's static
- if( !theClass )
- theClass = findMyClass("java/sql/Blob");
- return theClass;
-}
-
-sal_Int64 SAL_CALL java_sql_Blob::length( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- jlong out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- // initialize temporary variable
- static const char * cSignature = "()J";
- static const char * cMethodName = "length";
- // submit Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- out = t.pEnv->CallLongMethod( object, mID );
- ThrowSQLException(t.pEnv,*this);
- } //t.pEnv
- return (sal_Int64)out;
-}
-::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL java_sql_Blob::getBytes( sal_Int64 pos, sal_Int32 count ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- ::com::sun::star::uno::Sequence< sal_Int8 > aSeq;
- {
- // initialize temporary variable
- static const char * cSignature = "(JI)[B";
- static const char * cMethodName = "getBytes";
- // submit Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- jbyteArray out = (jbyteArray)t.pEnv->CallObjectMethod( object, mID,pos,count);
- ThrowSQLException(t.pEnv,*this);
- if(out)
- {
- jboolean p = sal_False;
- aSeq.realloc(t.pEnv->GetArrayLength(out));
- memcpy(aSeq.getArray(),t.pEnv->GetByteArrayElements(out,&p),aSeq.getLength());
- t.pEnv->DeleteLocalRef(out);
- }
- } //t.pEnv
- // WARNING: the caller becomes the owner of the returned pointer
- return aSeq;
-}
-
-::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL java_sql_Blob::getBinaryStream( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jobject out = callObjectMethod(t.pEnv,"getBinaryStream","()Ljava/io/InputStream;", mID);
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_io_InputStream( t.pEnv, out );
-}
-
-sal_Int64 SAL_CALL java_sql_Blob::position( const ::com::sun::star::uno::Sequence< sal_Int8 >& pattern, sal_Int64 start ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- jlong out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- // initialize temporary variable
- static const char * cSignature = "([BI)J";
- static const char * cMethodName = "position";
- // submit Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- // convert Parameter
- jbyteArray pByteArray = t.pEnv->NewByteArray(pattern.getLength());
- t.pEnv->SetByteArrayRegion(pByteArray,0,pattern.getLength(),(jbyte*)pattern.getConstArray());
- out = t.pEnv->CallLongMethod( object, mID, pByteArray,start );
- t.pEnv->DeleteLocalRef(pByteArray);
- ThrowSQLException(t.pEnv,*this);
- } //t.pEnv
- return (sal_Int64)out;
-}
-
-sal_Int64 SAL_CALL java_sql_Blob::positionOfBlob( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& /*pattern*/, sal_Int64 /*start*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XBlob::positionOfBlob", *this );
- // this was put here in CWS warnings01. The previous implementation was defective, as it did ignore
- // the pattern parameter. Since the effort for proper implementation is rather high - we would need
- // to translated patter into a byte[] -, we defer this functionality for the moment (hey, it was
- // unusable, anyway)
- // #i57457#
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/Boolean.cxx b/connectivity/source/drivers/jdbc/Boolean.cxx
deleted file mode 100644
index cc41160b28..0000000000
--- a/connectivity/source/drivers/jdbc/Boolean.cxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/lang/Boolean.hxx"
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.lang.Boolean
-//**************************************************************
-
-jclass java_lang_Boolean::theClass = 0;
-
-java_lang_Boolean::~java_lang_Boolean()
-{}
-jclass java_lang_Boolean::st_getMyClass()
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/lang/Boolean");
- return theClass;
-}
-
-jclass java_lang_Boolean::getMyClass() const
-{
- return st_getMyClass();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/CallableStatement.cxx b/connectivity/source/drivers/jdbc/CallableStatement.cxx
deleted file mode 100644
index 910b64347d..0000000000
--- a/connectivity/source/drivers/jdbc/CallableStatement.cxx
+++ /dev/null
@@ -1,360 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/CallableStatement.hxx"
-#include "java/tools.hxx"
-#include "java/sql/Array.hxx"
-#include "java/sql/Clob.hxx"
-#include "java/sql/Blob.hxx"
-#include "java/sql/Connection.hxx"
-#include "java/sql/Ref.hxx"
-#include "java/sql/Timestamp.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-
-#include <string.h>
-
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-
-IMPLEMENT_SERVICE_INFO(java_sql_CallableStatement,"com.sun.star.sdbcx.ACallableStatement","com.sun.star.sdbc.CallableStatement");
-
-//**************************************************************
-//************ Class: java.sql.CallableStatement
-//**************************************************************
-java_sql_CallableStatement::java_sql_CallableStatement( JNIEnv * pEnv, java_sql_Connection& _rCon,const ::rtl::OUString& sql )
- : java_sql_PreparedStatement( pEnv, _rCon, sql )
-{
-}
-// -----------------------------------------------------------------------------
-java_sql_CallableStatement::~java_sql_CallableStatement()
-{
-}
-// -----------------------------------------------------------------------------
-
-Any SAL_CALL java_sql_CallableStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = java_sql_PreparedStatement::queryInterface(rType);
- return aRet.hasValue() ? aRet : ::cppu::queryInterface(rType,static_cast< starsdbc::XRow*>(this),static_cast< starsdbc::XOutParameters*>(this));
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL java_sql_CallableStatement::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const ::com::sun::star::uno::Reference< starsdbc::XRow > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< starsdbc::XOutParameters > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),java_sql_PreparedStatement::getTypes());
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_CallableStatement::wasNull( ) throw(starsdbc::SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return callBooleanMethod( "wasNull", mID );
-}
-
-sal_Bool SAL_CALL java_sql_CallableStatement::getBoolean( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return callBooleanMethodWithIntArg( "getBoolean", mID,columnIndex );
-}
-sal_Int8 SAL_CALL java_sql_CallableStatement::getByte( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jbyte (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallByteMethod;
- return callMethodWithIntArg<jbyte>(pCallMethod,"getByte","(I)B",mID,columnIndex);
-}
-Sequence< sal_Int8 > SAL_CALL java_sql_CallableStatement::getBytes( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- Sequence< sal_Int8 > aSeq;
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jbyteArray out = (jbyteArray)callObjectMethodWithIntArg(t.pEnv,"getBytes","(I)[B", mID, columnIndex);
- if (out)
- {
- jboolean p = sal_False;
- aSeq.realloc(t.pEnv->GetArrayLength(out));
- memcpy(aSeq.getArray(),t.pEnv->GetByteArrayElements(out,&p),aSeq.getLength());
- t.pEnv->DeleteLocalRef(out);
- }
- return aSeq;
-}
-::com::sun::star::util::Date SAL_CALL java_sql_CallableStatement::getDate( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getDate","(I)Ljava/sql/Date;", mID, columnIndex);
- return out ? static_cast <com::sun::star::util::Date>(java_sql_Date( t.pEnv, out )) : ::com::sun::star::util::Date();
-}
-double SAL_CALL java_sql_CallableStatement::getDouble( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- double (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallDoubleMethod;
- return callMethodWithIntArg<double>(pCallMethod,"getDouble","(I)D",mID,columnIndex);
-}
-
-float SAL_CALL java_sql_CallableStatement::getFloat( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jfloat (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallFloatMethod;
- return callMethodWithIntArg<jfloat>(pCallMethod,"getFloat","(I)F",mID,columnIndex);
-}
-
-sal_Int32 SAL_CALL java_sql_CallableStatement::getInt( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- return callIntMethodWithIntArg("getInt",mID,columnIndex);
-}
-
-sal_Int64 SAL_CALL java_sql_CallableStatement::getLong( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jlong (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallLongMethod;
- return callMethodWithIntArg<jlong>(pCallMethod,"getLong","(I)J",mID,columnIndex);
-}
-
-Any SAL_CALL java_sql_CallableStatement::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callObjectMethodWithIntArg(t.pEnv,"getObject","(I)Ljava/lang/Object;", mID, columnIndex);
- // WARNING: the caller becomes the owner of the returned pointer
- return Any();
-}
-
-sal_Int16 SAL_CALL java_sql_CallableStatement::getShort( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jshort (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallShortMethod;
- return callMethodWithIntArg<jshort>(pCallMethod,"getShort","(I)S",mID,columnIndex);
-}
-
-::rtl::OUString SAL_CALL java_sql_CallableStatement::getString( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- return callStringMethodWithIntArg("getString",mID,columnIndex);
-}
-
- ::com::sun::star::util::Time SAL_CALL java_sql_CallableStatement::getTime( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getTime","(I)Ljava/sql/Time;", mID, columnIndex);
- // WARNING: the caller becomes the owner of the returned pointer
- return out ? static_cast <com::sun::star::util::Time> (java_sql_Time( t.pEnv, out )) : ::com::sun::star::util::Time();
-}
-
- ::com::sun::star::util::DateTime SAL_CALL java_sql_CallableStatement::getTimestamp( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getTimestamp","(I)Ljava/sql/Timestamp;", mID, columnIndex);
- // WARNING: the caller becomes the owner of the returned pointer
- return out ? static_cast <com::sun::star::util::DateTime> (java_sql_Timestamp( t.pEnv, out )) : ::com::sun::star::util::DateTime();
-}
-
-void SAL_CALL java_sql_CallableStatement::registerOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(starsdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- createStatement(t.pEnv);
-
- // initialize temporary variable
- static const char * cSignature = "(IILjava/lang/String;)V";
- static const char * cMethodName = "registerOutParameter";
- // execute Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- // Convert Parameter
- jdbc::LocalRef< jstring > str( t.env(),convertwchar_tToJavaString(t.pEnv,typeName));
- t.pEnv->CallVoidMethod( object, mID, parameterIndex,sqlType,str.get());
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
-}
-void SAL_CALL java_sql_CallableStatement::registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- createStatement(t.pEnv);
- // initialize temporary variable
- static const char * cSignature = "(III)V";
- static const char * cMethodName = "registerOutParameter";
- // execute Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- t.pEnv->CallVoidMethod( object, mID, parameterIndex,sqlType,scale);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
-}
-
-jclass java_sql_CallableStatement::theClass = 0;
-
-jclass java_sql_CallableStatement::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/sql/CallableStatement");
- return theClass;
-}
-
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL java_sql_CallableStatement::getBinaryStream( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- Reference< starsdbc::XBlob > xBlob = getBlob(columnIndex);
- return xBlob.is() ? xBlob->getBinaryStream() : Reference< ::com::sun::star::io::XInputStream >();
-}
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL java_sql_CallableStatement::getCharacterStream( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- Reference< starsdbc::XClob > xClob = getClob(columnIndex);
- return xClob.is() ? xClob->getCharacterStream() : Reference< ::com::sun::star::io::XInputStream >();
-}
-
-Reference< starsdbc::XArray > SAL_CALL java_sql_CallableStatement::getArray( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getArray","(I)Ljava/sql/Array;", mID, columnIndex);
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_sql_Array( t.pEnv, out );
-}
-
-Reference< starsdbc::XClob > SAL_CALL java_sql_CallableStatement::getClob( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getClob","(I)Ljava/sql/Clob;", mID, columnIndex);
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_sql_Clob( t.pEnv, out );
-}
-Reference< starsdbc::XBlob > SAL_CALL java_sql_CallableStatement::getBlob( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getBlob","(I)Ljava/sql/Blob;", mID, columnIndex);
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_sql_Blob( t.pEnv, out );
-}
-
-Reference< starsdbc::XRef > SAL_CALL java_sql_CallableStatement::getRef( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getRef","(I)Ljava/sql/Ref;", mID, columnIndex);
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_sql_Ref( t.pEnv, out );
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL java_sql_CallableStatement::acquire() throw()
-{
- java_sql_PreparedStatement::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL java_sql_CallableStatement::release() throw()
-{
- java_sql_PreparedStatement::release();
-}
-// -----------------------------------------------------------------------------
-void java_sql_CallableStatement::createStatement(JNIEnv* /*_pEnv*/)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- if( t.pEnv && !object ){
- // initialize temporary variable
- static const char * cSignature = "(Ljava/lang/String;II)Ljava/sql/CallableStatement;";
- static const char * cMethodName = "prepareCall";
- // execute Java-Call
- jobject out = NULL;
- // convert Parameter
- jdbc::LocalRef< jstring > str( t.env(),convertwchar_tToJavaString(t.pEnv,m_sSqlStatement));
-
- static jmethodID mID(NULL);
- if ( !mID )
- mID = t.pEnv->GetMethodID( m_pConnection->getMyClass(), cMethodName, cSignature );
- if( mID ){
- out = t.pEnv->CallObjectMethod( m_pConnection->getJavaObject(), mID, str.get() ,m_nResultSetType,m_nResultSetConcurrency);
- } //mID
- else
- {
- static const char * cSignature2 = "(Ljava/lang/String;)Ljava/sql/CallableStatement;";
- static jmethodID mID2 = t.pEnv->GetMethodID( m_pConnection->getMyClass(), cMethodName, cSignature2 );OSL_ENSURE(mID2,"Unknown method id!");
- if( mID2 ){
- out = t.pEnv->CallObjectMethod( m_pConnection->getJavaObject(), mID2, str.get() );
- } //mID
- }
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
-
- if ( out )
- object = t.pEnv->NewGlobalRef( out );
- } //t.pEnv
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/Class.cxx b/connectivity/source/drivers/jdbc/Class.cxx
deleted file mode 100644
index b122ad593d..0000000000
--- a/connectivity/source/drivers/jdbc/Class.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/lang/Class.hxx"
-#include "java/tools.hxx"
-#include <rtl/ustring.hxx>
-
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.lang.Class
-//**************************************************************
-
-jclass java_lang_Class::theClass = 0;
-
-java_lang_Class::~java_lang_Class()
-{}
-
-jclass java_lang_Class::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/lang/Class");
- return theClass;
-}
-
-java_lang_Class * java_lang_Class::forName( const ::rtl::OUString& _par0 )
-{
- jobject out(NULL);
- SDBThreadAttach t;
-
- {
- ::rtl::OString sClassName = ::rtl::OUStringToOString(_par0, RTL_TEXTENCODING_JAVA_UTF8);
- sClassName = sClassName.replace('.','/');
- out = t.pEnv->FindClass(sClassName.getStr());
- ThrowSQLException(t.pEnv,0);
- } //t.pEnv
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? NULL : new java_lang_Class( t.pEnv, out );
-}
-
-jobject java_lang_Class::newInstanceObject()
-{
- SDBThreadAttach t;
- static jmethodID mID(NULL);
- return callObjectMethod(t.pEnv,"newInstance","()Ljava/lang/Object;", mID);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/Clob.cxx b/connectivity/source/drivers/jdbc/Clob.cxx
deleted file mode 100644
index 6cc5a4573f..0000000000
--- a/connectivity/source/drivers/jdbc/Clob.cxx
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/Clob.hxx"
-#include "java/tools.hxx"
-#include "java/io/Reader.hxx"
-#include <connectivity/dbexception.hxx>
-#include <rtl/logfile.hxx>
-
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.sql.Clob
-//**************************************************************
-
-jclass java_sql_Clob::theClass = 0;
-
-java_sql_Clob::java_sql_Clob( JNIEnv * pEnv, jobject myObj )
- : java_lang_Object( pEnv, myObj )
-{
- SDBThreadAttach::addRef();
-}
-java_sql_Clob::~java_sql_Clob()
-{
- SDBThreadAttach::releaseRef();
-}
-
-jclass java_sql_Clob::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/sql/Clob");
- return theClass;
-}
-
-sal_Int64 SAL_CALL java_sql_Clob::length( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_Clob::length" );
- jlong out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- // initialize temporary variable
- static const char * cSignature = "()J";
- static const char * cMethodName = "length";
- // execute Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- out = t.pEnv->CallLongMethod( object, mID );
- ThrowSQLException(t.pEnv,*this);
- } //t.pEnv
- return (sal_Int64)out;
-}
-
-::rtl::OUString SAL_CALL java_sql_Clob::getSubString( sal_Int64 pos, sal_Int32 subStringLength ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_Clob::getSubString" );
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- ::rtl::OUString aStr;
- {
- // initialize temporary variable
- static const char * cSignature = "(JI)Ljava/lang/String;";
- static const char * cMethodName = "getSubString";
- // execute Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID,pos,subStringLength);
- ThrowSQLException(t.pEnv,*this);
- aStr = JavaString2String(t.pEnv,out);
- } //t.pEnv
- // WARNING: the caller becomes the owner of the returned pointer
- return aStr;
-}
-
-::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL java_sql_Clob::getCharacterStream( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_Clob::getCharacterStream" );
- SDBThreadAttach t;
- static jmethodID mID(NULL);
- jobject out = callObjectMethod(t.pEnv,"getCharacterStream","()Ljava/io/Reader;", mID);
-
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_io_Reader( t.pEnv, out );
-}
-
-sal_Int64 SAL_CALL java_sql_Clob::position( const ::rtl::OUString& searchstr, sal_Int32 start ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_Clob::position" );
- jlong out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- jvalue args[1];
- // convert Parameter
- args[0].l = convertwchar_tToJavaString(t.pEnv,searchstr);
- // initialize temporary Variable
- static const char * cSignature = "(Ljava/lang/String;I)J";
- static const char * cMethodName = "position";
- // execute Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- out = t.pEnv->CallLongMethod( object, mID, args[0].l,start );
- ThrowSQLException(t.pEnv,*this);
- t.pEnv->DeleteLocalRef((jstring)args[0].l);
- } //t.pEnv
- return (sal_Int64)out;
-}
-
-sal_Int64 SAL_CALL java_sql_Clob::positionOfClob( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& /*pattern*/, sal_Int64 /*start*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_Clob::positionOfClob" );
- ::dbtools::throwFeatureNotImplementedException( "XClob::positionOfClob", *this );
- // this was put here in CWS warnings01. The previous implementation was defective, as it did ignore
- // the pattern parameter. Since the effort for proper implementation is rather high - we would need
- // to translated patter into a byte[] -, we defer this functionality for the moment (hey, it was
- // unusable, anyway)
- // 2005-11-15 / #i57457# / frank.schoenheit@sun.com
- return 0;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/ConnectionLog.cxx b/connectivity/source/drivers/jdbc/ConnectionLog.cxx
deleted file mode 100644
index c50d4bdc9e..0000000000
--- a/connectivity/source/drivers/jdbc/ConnectionLog.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "java/sql/ConnectionLog.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/util/Date.hpp>
-#include <com/sun/star/util/Time.hpp>
-#include <com/sun/star/util/DateTime.hpp>
-/** === end UNO includes === **/
-
-#include <stdio.h>
-
-//........................................................................
-namespace connectivity { namespace java { namespace sql {
-//........................................................................
-
- /** === begin UNO using === **/
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::XComponentContext;
- /** === end UNO using === **/
-
- //--------------------------------------------------------------------
- namespace
- {
- sal_Int32 lcl_getFreeID( ConnectionLog::ObjectType _eType )
- {
- static oslInterlockedCount s_nCounts[ ConnectionLog::ObjectTypeCount ] = { 0, 0 };
- return osl_incrementInterlockedCount( s_nCounts + _eType );
- }
- }
-
- //====================================================================
- //= ConnectionLog
- //====================================================================
- //--------------------------------------------------------------------
- ConnectionLog::ConnectionLog( const ::comphelper::ResourceBasedEventLogger& _rDriverLog )
- :ConnectionLog_Base( _rDriverLog )
- ,m_nObjectID( lcl_getFreeID( CONNECTION ) )
- {
- }
-
- //--------------------------------------------------------------------
- ConnectionLog::ConnectionLog( const ConnectionLog& _rSourceLog )
- :ConnectionLog_Base( _rSourceLog )
- ,m_nObjectID( _rSourceLog.m_nObjectID )
- {
- }
-
- //--------------------------------------------------------------------
- ConnectionLog::ConnectionLog( const ConnectionLog& _rSourceLog, ConnectionLog::ObjectType _eType )
- :ConnectionLog_Base( _rSourceLog )
- ,m_nObjectID( lcl_getFreeID( _eType ) )
- {
- }
-
-//........................................................................
-} } } // namespace connectivity::java::sql
-//........................................................................
-
-//........................................................................
-namespace comphelper { namespace log { namespace convert
-{
-//........................................................................
-
- /** === begin UNO using === **/
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::XComponentContext;
- using ::com::sun::star::util::Date;
- using ::com::sun::star::util::Time;
- using ::com::sun::star::util::DateTime;
- /** === end UNO using === **/
-
- //--------------------------------------------------------------------
- ::rtl::OUString convertLogArgToString( const Date& _rDate )
- {
- char buffer[ 30 ];
- const size_t buffer_size = sizeof( buffer );
- snprintf( buffer, buffer_size, "%04i-%02i-%02i",
- (int)_rDate.Year, (int)_rDate.Month, (int)_rDate.Day );
- return ::rtl::OUString::createFromAscii( buffer );
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString convertLogArgToString( const Time& _rTime )
- {
- char buffer[ 30 ];
- const size_t buffer_size = sizeof( buffer );
- snprintf( buffer, buffer_size, "%02i:%02i:%02i.%02i",
- (int)_rTime.Hours, (int)_rTime.Minutes, (int)_rTime.Seconds, (int)_rTime.HundredthSeconds );
- return ::rtl::OUString::createFromAscii( buffer );
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString convertLogArgToString( const DateTime& _rDateTime )
- {
- char buffer[ 30 ];
- const size_t buffer_size = sizeof( buffer );
- snprintf( buffer, buffer_size, "%04i-%02i-%02i %02i:%02i:%02i.%02i",
- (int)_rDateTime.Year, (int)_rDateTime.Month, (int)_rDateTime.Day,
- (int)_rDateTime.Hours, (int)_rDateTime.Minutes, (int)_rDateTime.Seconds, (int)_rDateTime.HundredthSeconds );
- return ::rtl::OUString::createFromAscii( buffer );
- }
-
-//........................................................................
-} } } // comphelper::log::convert
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/ContextClassLoader.cxx b/connectivity/source/drivers/jdbc/ContextClassLoader.cxx
deleted file mode 100644
index da1802f710..0000000000
--- a/connectivity/source/drivers/jdbc/ContextClassLoader.cxx
+++ /dev/null
@@ -1,134 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "java/ContextClassLoader.hxx"
-#include "java/lang/Object.hxx"
-
-/** === begin UNO includes === **/
-/** === end UNO includes === **/
-
-//........................................................................
-namespace connectivity { namespace jdbc
-{
-//........................................................................
-
- /** === begin UNO using === **/
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::XInterface;
- /** === end UNO using === **/
-
- using ::connectivity::java_lang_Object;
-
- //====================================================================
- //= ContextClassLoaderScope
- //====================================================================
- //--------------------------------------------------------------------
- ContextClassLoaderScope::ContextClassLoaderScope( JNIEnv& environment, const GlobalRef< jobject >& newClassLoader,
- const ::comphelper::ResourceBasedEventLogger& _rLoggerForErrors, const Reference< XInterface >& _rxErrorContext )
- :m_environment( environment )
- ,m_currentThread( environment )
- ,m_oldContextClassLoader( environment )
- {
- if ( !newClassLoader.is() )
- return;
-
- do // artificial loop for easier flow control
- {
-
- LocalRef< jclass > threadClass( m_environment );
- threadClass.set( m_environment.FindClass( "java/lang/Thread" ) );
- if ( !threadClass.is() )
- break;
-
- jmethodID currentThreadMethod( m_environment.GetStaticMethodID(
- threadClass.get(), "currentThread", "()Ljava/lang/Thread;" ) );
- if ( currentThreadMethod == NULL )
- break;
-
- m_currentThread.set( m_environment.CallStaticObjectMethod( threadClass.get(), currentThreadMethod ) );
- if ( !m_currentThread.is() )
- break;
-
- jmethodID getContextClassLoaderMethod( m_environment.GetMethodID(
- threadClass.get(), "getContextClassLoader", "()Ljava/lang/ClassLoader;" ) );
- if ( getContextClassLoaderMethod == NULL )
- break;
- m_oldContextClassLoader.set( m_environment.CallObjectMethod( m_currentThread.get(), getContextClassLoaderMethod ) );
- LocalRef< jthrowable > throwable( m_environment, m_environment.ExceptionOccurred() );
- if ( throwable.is() )
- break;
-
- m_setContextClassLoaderMethod = m_environment.GetMethodID(
- threadClass.get(), "setContextClassLoader", "(Ljava/lang/ClassLoader;)V" );
- if ( m_setContextClassLoaderMethod == NULL )
- break;
-
- }
- while ( false );
-
- if ( !isActive() )
- {
- java_lang_Object::ThrowLoggedSQLException( _rLoggerForErrors, &environment, _rxErrorContext );
- return;
- }
-
- // set the new class loader
- m_environment.CallObjectMethod( m_currentThread.get(), m_setContextClassLoaderMethod, newClassLoader.get() );
- LocalRef< jthrowable > throwable( m_environment, m_environment.ExceptionOccurred() );
- if ( throwable.is() )
- {
- m_currentThread.reset();
- m_setContextClassLoaderMethod = NULL;
- java_lang_Object::ThrowLoggedSQLException( _rLoggerForErrors, &environment, _rxErrorContext );
- }
- }
-
- //--------------------------------------------------------------------
- void ContextClassLoaderScope::pop( bool clearExceptions )
- {
- if ( isActive() )
- {
- LocalRef< jobject > currentThread( m_currentThread.env(), m_currentThread.release() );
- jmethodID setContextClassLoaderMethod( m_setContextClassLoaderMethod );
- m_setContextClassLoaderMethod = NULL;
-
- m_environment.CallObjectMethod( currentThread.get(), setContextClassLoaderMethod, m_oldContextClassLoader.get() );
- if ( clearExceptions )
- {
- m_environment.ExceptionClear();
- }
- }
- }
-//........................................................................
-} } // namespace connectivity::jdbc
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
deleted file mode 100644
index 256c08fd36..0000000000
--- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
+++ /dev/null
@@ -1,1465 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <sal/macros.h>
-#include "java/sql/DatabaseMetaData.hxx"
-#include "java/sql/Connection.hxx"
-#include "java/sql/ResultSet.hxx"
-#include "java/tools.hxx"
-#include "java/lang/String.hxx"
-#include "connectivity/CommonTools.hxx"
-#include "FDatabaseMetaDataResultSet.hxx"
-#include <comphelper/types.hxx>
-#include "TPrivilegesResultSet.hxx"
-#include "diagnose_ex.h"
-#include "resource/jdbc_log.hrc"
-
-using namespace ::comphelper;
-
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-//**************************************************************
-//************ Class: java.sql.DatabaseMetaData
-//**************************************************************
-
-jclass java_sql_DatabaseMetaData::theClass = 0;
-
-java_sql_DatabaseMetaData::~java_sql_DatabaseMetaData()
-{
- SDBThreadAttach::releaseRef();
-}
-
-jclass java_sql_DatabaseMetaData::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/sql/DatabaseMetaData");
- return theClass;
-}
-// -----------------------------------------------------------------------------
-java_sql_DatabaseMetaData::java_sql_DatabaseMetaData( JNIEnv * pEnv, jobject myObj, java_sql_Connection& _rConnection )
- :ODatabaseMetaDataBase( &_rConnection,_rConnection.getConnectionInfo() )
- ,java_lang_Object( pEnv, myObj )
- ,m_pConnection( &_rConnection )
- ,m_aLogger( _rConnection.getLogger() )
-{
- SDBThreadAttach::addRef();
-}
-
-// -------------------------------------------------------------------------
-Reference< XResultSet > java_sql_DatabaseMetaData::impl_getTypeInfo_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callResultSetMethod( "getTypeInfo", mID );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getCatalogs( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callResultSetMethod( "getCatalogs", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString java_sql_DatabaseMetaData::impl_getCatalogSeparator_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getCatalogSeparator", mID );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getSchemas( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callResultSetMethod( "getSchemas", mID );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getColumnPrivileges(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callResultSetMethodWithStrings( "getColumnPrivileges", mID, catalog, schema, table, &columnNamePattern );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getColumns(
- const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callResultSetMethodWithStrings( "getColumns", mID, catalog, schemaPattern, tableNamePattern, &columnNamePattern );
-}
-
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables(
- const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& _types ) throw(SQLException, RuntimeException)
-{
- static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Ljava/sql/ResultSet;";
- static const char * cMethodName = "getTables";
-
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
-
- jobject out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- // execute Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- OSL_VERIFY_RES( !isExceptionOccurred(t.pEnv,sal_True),"Exception occurred!");
- jvalue args[4];
-
- args[3].l = 0;
- sal_Int32 typeFilterCount = _types.getLength();
- if ( typeFilterCount )
- {
- jobjectArray pObjArray = static_cast< jobjectArray >( t.pEnv->NewObjectArray( (jsize)typeFilterCount, java_lang_String::st_getMyClass(), 0 ) );
- OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, sal_True ), "Exception occurred!" );
- const ::rtl::OUString* typeFilter = _types.getConstArray();
- bool bIncludeAllTypes = false;
- for ( sal_Int32 i=0; i<typeFilterCount; ++i, ++typeFilter )
- {
- if ( typeFilter->equalsAsciiL( "%", 1 ) )
- {
- bIncludeAllTypes = true;
- break;
- }
- jstring aT = convertwchar_tToJavaString( t.pEnv, *typeFilter );
- t.pEnv->SetObjectArrayElement( pObjArray, (jsize)i, aT );
- OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, sal_True ), "Exception occurred!" );
- }
-
- if ( bIncludeAllTypes )
- {
- // the SDBC API allows to pass "%" as table type filter, but in JDBC, "all table types"
- // is represented by the table type being <null/>
- t.pEnv->DeleteLocalRef( pObjArray );
- OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, sal_True ), "Exception occurred!" );
- }
- else
- {
- args[3].l = pObjArray;
- }
- }
- // if we are to display "all catalogs", then respect m_aCatalogRestriction
- Any aCatalogFilter( catalog );
- if ( !aCatalogFilter.hasValue() )
- aCatalogFilter = m_pConnection->getCatalogRestriction();
- // similar for schema
- Any aSchemaFilter;
- if ( schemaPattern.equalsAsciiL( "%", 1 ) )
- aSchemaFilter = m_pConnection->getSchemaRestriction();
- else
- aSchemaFilter <<= schemaPattern;
-
- args[0].l = aCatalogFilter.hasValue() ? convertwchar_tToJavaString( t.pEnv, ::comphelper::getString( aCatalogFilter ) ) : NULL;
- args[1].l = aSchemaFilter.hasValue() ? convertwchar_tToJavaString( t.pEnv, ::comphelper::getString( aSchemaFilter ) ) : NULL;
- args[2].l = convertwchar_tToJavaString(t.pEnv,tableNamePattern);
- out = t.pEnv->CallObjectMethod( object, mID, args[0].l, args[1].l,args[2].l,args[3].l);
- jthrowable jThrow = t.pEnv->ExceptionOccurred();
- if ( jThrow )
- t.pEnv->ExceptionClear();// we have to clear the exception here because we want to handle it below
- if ( aCatalogFilter.hasValue() )
- {
- t.pEnv->DeleteLocalRef((jstring)args[0].l);
- OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, sal_True ), "Exception occurred!" );
- }
- if(args[1].l)
- {
- t.pEnv->DeleteLocalRef((jstring)args[1].l);
- OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, sal_True ), "Exception occurred!" );
- }
- if(tableNamePattern.getLength())
- {
- t.pEnv->DeleteLocalRef((jstring)args[2].l);
- OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, sal_True ), "Exception occurred!" );
- }
- //for(INT16 i=0;i<len;i++)
- if ( args[3].l )
- {
- t.pEnv->DeleteLocalRef( (jobjectArray)args[3].l );
- OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, sal_True ), "Exception occurred!" );
- }
-
- if ( jThrow )
- {
- if ( t.pEnv->IsInstanceOf( jThrow,java_sql_SQLException_BASE::st_getMyClass() ) )
- {
- java_sql_SQLException_BASE* pException = new java_sql_SQLException_BASE( t.pEnv, jThrow );
- SQLException e( pException->getMessage(),
- *this,
- pException->getSQLState(),
- pException->getErrorCode(),
- Any()
- );
- delete pException;
- throw e;
- }
- }
- }
-
- if ( !out )
- return NULL;
-
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
- return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getProcedureColumns(
- const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callResultSetMethodWithStrings( "getProcedureColumns", mID, catalog, schemaPattern, procedureNamePattern, &columnNamePattern );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getProcedures( const Any&
- catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callResultSetMethodWithStrings( "getProcedures", mID, catalog, schemaPattern, procedureNamePattern );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getVersionColumns(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callResultSetMethodWithStrings( "getVersionColumns", mID, catalog, schema, table );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxBinaryLiteralLength", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxRowSize", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxCatalogNameLength", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxCharLiteralLength", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxColumnNameLength", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxColumnsInIndex", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxCursorNameLength", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxConnections", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxColumnsInTable", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxStatementLength", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxTableNameLength", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 java_sql_DatabaseMetaData::impl_getMaxTablesInSelect_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxTablesInSelect", mID );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getExportedKeys(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callResultSetMethodWithStrings( "getExportedKeys", mID, catalog, schema, table );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getImportedKeys(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callResultSetMethodWithStrings( "getImportedKeys", mID, catalog, schema, table );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getPrimaryKeys(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callResultSetMethodWithStrings( "getPrimaryKeys", mID, catalog, schema, table );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getIndexInfo(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
- sal_Bool unique, sal_Bool approximate ) throw(SQLException, RuntimeException)
-{
- static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ)Ljava/sql/ResultSet;";
- static const char * cMethodName = "getIndexInfo";
-
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
-
- jobject out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- // execute Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- jvalue args[5];
- // convert Parameter
- args[0].l = catalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(catalog)) : 0;
- args[1].l = schema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,schema);
- args[2].l = convertwchar_tToJavaString(t.pEnv,table);
- args[3].z = unique;
- args[4].z = approximate;
- out = t.pEnv->CallObjectMethod( object, mID, args[0].l,args[1].l,args[2].l,args[3].z,args[4].z );
-
- // and clean up
- if(catalog.hasValue())
- t.pEnv->DeleteLocalRef((jstring)args[0].l);
- if(args[1].l)
- t.pEnv->DeleteLocalRef((jstring)args[1].l);
- if(table.getLength())
- t.pEnv->DeleteLocalRef((jstring)args[2].l);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
- if ( !out )
- return NULL;
-
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
- return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getBestRowIdentifier(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope,
- sal_Bool nullable ) throw(SQLException, RuntimeException)
-{
- static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZ)Ljava/sql/ResultSet;";
- static const char * cMethodName = "getBestRowIdentifier";
-
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
-
- jobject out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- // execute Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- jvalue args[3];
- // convert Parameter
- args[0].l = catalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(catalog)) : 0;
- args[1].l = schema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,schema);
- args[2].l = convertwchar_tToJavaString(t.pEnv,table);
- out = t.pEnv->CallObjectMethod( object, mID, args[0].l,args[1].l,args[2].l,scope,nullable);
-
- // and cleanup
- if(catalog.hasValue())
- t.pEnv->DeleteLocalRef((jstring)args[0].l);
- if(args[1].l)
- t.pEnv->DeleteLocalRef((jstring)args[1].l);
- if(table.getLength())
- t.pEnv->DeleteLocalRef((jstring)args[2].l);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
-
- if ( !out )
- return NULL;
-
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
- return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTablePrivileges(
- const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException)
-{
- if ( m_pConnection->isIgnoreDriverPrivilegesEnabled() )
- return new OResultSetPrivileges(this,catalog,schemaPattern,tableNamePattern);
-
- static jmethodID mID(NULL);
- Reference< XResultSet > xReturn( impl_callResultSetMethodWithStrings( "getTablePrivileges", mID, catalog, schemaPattern, tableNamePattern ) );
-
- if ( xReturn.is() )
- {
- // we have to check the result columns for the tables privleges
- Reference< XResultSetMetaDataSupplier > xMetaSup(xReturn,UNO_QUERY);
- if ( xMetaSup.is() )
- {
- Reference< XResultSetMetaData> xMeta = xMetaSup->getMetaData();
- if ( xMeta.is() && xMeta->getColumnCount() != 7 )
- {
- // here we know that the count of column doesn't match
- ::std::map<sal_Int32,sal_Int32> aColumnMatching;
- static const ::rtl::OUString sPrivs[] = {
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_CAT")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_SCHEM")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_NAME")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GRANTOR")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GRANTEE")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRIVILEGE")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IS_GRANTABLE"))
- };
-
- ::rtl::OUString sColumnName;
- sal_Int32 nCount = xMeta->getColumnCount();
- for (sal_Int32 i = 1 ; i <= nCount ; ++i)
- {
- sColumnName = xMeta->getColumnName(i);
- for (sal_uInt32 j = 0 ; j < SAL_N_ELEMENTS(sPrivs); ++j)
- {
- if ( sPrivs[j] == sColumnName )
- {
- aColumnMatching.insert( ::std::map<sal_Int32,sal_Int32>::value_type(i,j+1) );
- break;
- }
- }
-
- }
- // fill our own resultset
- ODatabaseMetaDataResultSet* pNewPrivRes = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges );
- Reference< XResultSet > xTemp = xReturn;
- xReturn = pNewPrivRes;
- ODatabaseMetaDataResultSet::ORows aRows;
- Reference< XRow > xRow(xTemp,UNO_QUERY);
- ::rtl::OUString sValue;
-
- ODatabaseMetaDataResultSet::ORow aRow(8);
- while ( xRow.is() && xTemp->next() )
- {
- ::std::map<sal_Int32,sal_Int32>::iterator aIter = aColumnMatching.begin();
- ::std::map<sal_Int32,sal_Int32>::iterator aEnd = aColumnMatching.end();
- for (;aIter != aEnd ; ++aIter)
- {
- sValue = xRow->getString(aIter->first);
- if ( xRow->wasNull() )
- aRow[aIter->second] = ODatabaseMetaDataResultSet::getEmptyValue();
- else
- aRow[aIter->second] = new ORowSetValueDecorator(sValue);
- }
-
- aRows.push_back(aRow);
- }
- pNewPrivRes->setRows(aRows);
- }
- }
- }
- return xReturn;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getCrossReference(
- const Any& primaryCatalog, const ::rtl::OUString& primarySchema,
- const ::rtl::OUString& primaryTable, const Any& foreignCatalog,
- const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(SQLException, RuntimeException)
-{
- static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;";
- static const char * cMethodName = "getCrossReference";
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
-
- jobject out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
-
- // execute Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- jvalue args[6];
- // convert Parameter
- args[0].l = primaryCatalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(primaryCatalog)) : 0;
- args[1].l = primarySchema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,primarySchema);
- args[2].l = convertwchar_tToJavaString(t.pEnv,primaryTable);
- args[3].l = foreignCatalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(foreignCatalog)) : 0;
- args[4].l = foreignSchema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,foreignSchema);
- args[5].l = convertwchar_tToJavaString(t.pEnv,foreignTable);
- out = t.pEnv->CallObjectMethod( object, mID, args[0].l,args[2].l,args[2].l,args[3].l,args[4].l,args[5].l );
-
- // and clean up
- if(primaryCatalog.hasValue())
- t.pEnv->DeleteLocalRef((jstring)args[0].l);
- if(args[1].l)
- t.pEnv->DeleteLocalRef((jstring)args[1].l);
- if(primaryTable.getLength())
- t.pEnv->DeleteLocalRef((jstring)args[2].l);
- if(foreignCatalog.hasValue())
- t.pEnv->DeleteLocalRef((jstring)args[3].l);
- if(args[4].l)
- t.pEnv->DeleteLocalRef((jstring)args[4].l);
- if(foreignTable.getLength())
- t.pEnv->DeleteLocalRef((jstring)args[5].l);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
-
- if ( !out )
- return NULL;
-
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
- return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
-}
-
-// -------------------------------------------------------------------------
-sal_Bool java_sql_DatabaseMetaData::impl_callBooleanMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
-{
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
- jboolean out( java_lang_Object::callBooleanMethod(_pMethodName,_inout_MethodID) );
- m_aLogger.log< const sal_Char*, sal_Int16>( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, out );
- return out;
-}
-
-// -------------------------------------------------------------------------
-::rtl::OUString java_sql_DatabaseMetaData::impl_callStringMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
-{
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
-
- const ::rtl::OUString sReturn( callStringMethod(_pMethodName,_inout_MethodID) );
- if ( m_aLogger.isLoggable( LogLevel::FINEST ) )
- {
- ::rtl::OUString sLoggedResult( sReturn );
- if ( !sLoggedResult.getLength() )
- sLoggedResult = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "<empty string>" ) );
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, sLoggedResult );
- }
-
- return sReturn;
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 java_sql_DatabaseMetaData::impl_callIntMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
-{
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
- sal_Int32 out( (sal_Int32)callIntMethod(_pMethodName,_inout_MethodID) );
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, (sal_Int32)out );
- return out;
-}
-
-// -------------------------------------------------------------------------
-sal_Bool java_sql_DatabaseMetaData::impl_callBooleanMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument )
-{
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG1, _pMethodName, _nArgument );
-
- jboolean out( callBooleanMethodWithIntArg(_pMethodName,_inout_MethodID,_nArgument) );
-
- m_aLogger.log< const sal_Char*, sal_Int16 >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, out );
- return out;
-}
-
-// -------------------------------------------------------------------------
-Reference< XResultSet > java_sql_DatabaseMetaData::impl_callResultSetMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
-{
- SDBThreadAttach t;
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
- jobject out(callResultSetMethod(t.env(),_pMethodName,_inout_MethodID));
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, _pMethodName );
- return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
-}
-
-// -------------------------------------------------------------------------
-Reference< XResultSet > java_sql_DatabaseMetaData::impl_callResultSetMethodWithStrings( const char* _pMethodName, jmethodID& _inout_MethodID,
- const Any& _rCatalog, const ::rtl::OUString& _rSchemaPattern, const ::rtl::OUString& _rLeastPattern,
- const ::rtl::OUString* _pOptionalAdditionalString )
-{
- bool bCatalog = _rCatalog.hasValue();
- ::rtl::OUString sCatalog;
- _rCatalog >>= sCatalog;
-
- bool bSchema = _rSchemaPattern.toChar() != '%';
-
- // log the call
- if ( m_aLogger.isLoggable( LogLevel::FINEST ) )
- {
- ::rtl::OUString sCatalogLog = bCatalog ? sCatalog : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "null" ) );
- ::rtl::OUString sSchemaLog = bSchema ? _rSchemaPattern : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "null" ) );
- if ( _pOptionalAdditionalString )
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG4, _pMethodName, sCatalogLog, sSchemaLog, _rLeastPattern, *_pOptionalAdditionalString );
- else
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG3, _pMethodName, sCatalogLog, sSchemaLog, _rLeastPattern );
- }
-
- jobject out(0);
-
- SDBThreadAttach t;
- OSL_ENSURE( t.pEnv, "java_sql_DatabaseMetaData::impl_callResultSetMethodWithStrings: no Java enviroment anymore!" );
-
- {
- const char* pSignature = _pOptionalAdditionalString
- ? "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;"
- : "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;";
- // obtain method ID
- obtainMethodId(t.pEnv, _pMethodName,pSignature, _inout_MethodID);
-
- // call method
-
- {
- jvalue args[4];
- // convert parameters
- args[0].l = bCatalog ? convertwchar_tToJavaString( t.pEnv, sCatalog ) : NULL;
- args[1].l = bSchema ? convertwchar_tToJavaString( t.pEnv, _rSchemaPattern ) : NULL;
- args[2].l = convertwchar_tToJavaString( t.pEnv, _rLeastPattern );
- args[3].l = _pOptionalAdditionalString ? convertwchar_tToJavaString( t.pEnv, *_pOptionalAdditionalString ) : NULL;
-
- // actually do the call
- if ( _pOptionalAdditionalString )
- out = t.pEnv->CallObjectMethod( object, _inout_MethodID, args[0].l, args[1].l, args[2].l, args[3].l );
- else
- out = t.pEnv->CallObjectMethod( object, _inout_MethodID, args[0].l, args[1].l, args[2].l );
-
- // clean up
- if ( args[0].l )
- t.pEnv->DeleteLocalRef( (jstring)args[0].l );
- if ( args[1].l )
- t.pEnv->DeleteLocalRef( (jstring)args[1].l );
- if ( args[2].l )
- t.pEnv->DeleteLocalRef( (jstring)args[2].l );
- if ( args[3].l )
- t.pEnv->DeleteLocalRef( (jstring)args[3].l );
-
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
- }
-
- if ( !out )
- return NULL;
-
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, _pMethodName );
- return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
-}
-
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "doesMaxRowSizeIncludeBlobs", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "storesLowerCaseQuotedIdentifiers", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "storesLowerCaseIdentifiers", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool java_sql_DatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "storesMixedCaseQuotedIdentifiers", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "storesMixedCaseIdentifiers", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "storesUpperCaseQuotedIdentifiers", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "storesUpperCaseIdentifiers", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool java_sql_DatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsAlterTableWithAddColumn", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool java_sql_DatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsAlterTableWithDropColumn", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxIndexLength", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsNonNullableColumns", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getCatalogTerm", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString java_sql_DatabaseMetaData::impl_getIdentifierQuoteString_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getIdentifierQuoteString", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getExtraNameCharacters", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsDifferentTableCorrelationNames", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool java_sql_DatabaseMetaData::impl_isCatalogAtStart_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "isCatalogAtStart", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "dataDefinitionIgnoredInTransactions", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "dataDefinitionCausesTransactionCommit", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsDataManipulationTransactionsOnly", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsDataDefinitionAndDataManipulationTransactions", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsPositionedDelete", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsPositionedUpdate", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsOpenStatementsAcrossRollback", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsOpenStatementsAcrossCommit", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsOpenCursorsAcrossCommit", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsOpenCursorsAcrossRollback", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethodWithIntArg( "supportsTransactionIsolationLevel", mID, level );
-}
-// -------------------------------------------------------------------------
-sal_Bool java_sql_DatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsSchemasInDataManipulation", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsANSI92FullSQL", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsANSI92EntryLevelSQL", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsIntegrityEnhancementFacility", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsSchemasInIndexDefinitions", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool java_sql_DatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsSchemasInTableDefinitions", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool java_sql_DatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsCatalogsInTableDefinitions", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsCatalogsInIndexDefinitions", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool java_sql_DatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsCatalogsInDataManipulation", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsOuterJoins", mID );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callResultSetMethod( "getTableTypes", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 java_sql_DatabaseMetaData::impl_getMaxStatements_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxStatements", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxProcedureNameLength", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxSchemaNameLength", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsTransactions", mID );
-}
-
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "allProceduresAreCallable", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsStoredProcedures", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsSelectForUpdate", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "allTablesAreSelectable", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "isReadOnly", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "usesLocalFiles", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "usesLocalFilePerTable", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsTypeConversion", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "nullPlusNonNullIsNull", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsColumnAliasing", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsTableCorrelationNames", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(SQLException, RuntimeException)
-{
- static const char* pMethodName = "supportsConvert";
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG2, pMethodName, fromType, toType );
-
- jboolean out( sal_False );
- SDBThreadAttach t;
-
- {
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, pMethodName,"(II)Z", mID);
- out = t.pEnv->CallBooleanMethod( object, mID, fromType, toType );
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
-
- m_aLogger.log< const sal_Char*, sal_Int16 >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, pMethodName, out );
- return out;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsExpressionsInOrderBy", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsGroupBy", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsGroupByBeyondSelect", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsGroupByUnrelated", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsMultipleTransactions", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsMultipleResultSets", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsLikeEscapeClause", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsOrderByUnrelated", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsUnion", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsUnionAll", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsMixedCaseIdentifiers", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool java_sql_DatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsMixedCaseQuotedIdentifiers", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "nullsAreSortedAtEnd", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "nullsAreSortedAtStart", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "nullsAreSortedHigh", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "nullsAreSortedLow", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsSchemasInProcedureCalls", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsSchemasInPrivilegeDefinitions", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsCatalogsInProcedureCalls", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsCatalogsInPrivilegeDefinitions", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsCorrelatedSubqueries", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsSubqueriesInComparisons", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsSubqueriesInExists", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsSubqueriesInIns", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsSubqueriesInQuantifieds", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsANSI92IntermediateSQL", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString sURL = m_pConnection->getURL();
- if ( !sURL.getLength() )
- {
- static jmethodID mID(NULL);
- sURL = impl_callStringMethod( "getURL", mID );
- }
- return sURL;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getUserName", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getDriverName", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getDriverVersion( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getDriverVersion", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getDatabaseProductVersion", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getDatabaseProductName", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getProcedureTerm", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getSchemaTerm", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getDriverMajorVersion", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getDefaultTransactionIsolation", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getDriverMinorVersion", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getSQLKeywords", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getSearchStringEscape", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getStringFunctions", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getTimeDateFunctions", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getSystemFunctions", mID );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callStringMethod( "getNumericFunctions", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsExtendedSQLGrammar", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsCoreSQLGrammar", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsMinimumSQLGrammar", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsFullOuterJoins", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsLimitedOuterJoins", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxColumnsInGroupBy", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxColumnsInOrderBy", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxColumnsInSelect", mID );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callIntMethod( "getMaxUserNameLength", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethodWithIntArg( "supportsResultSetType", mID, setType );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(SQLException, RuntimeException)
-{
- static const char* pMethodName = "supportsResultSetConcurrency";
- m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG2, pMethodName, setType, concurrency );
-
- jboolean out( sal_False );
- SDBThreadAttach t;
-
- {
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, pMethodName,"(II)Z", mID);
- out = t.pEnv->CallBooleanMethod( object, mID, setType, concurrency);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
-
- m_aLogger.log< const sal_Char*, sal_Int16 >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, pMethodName, out );
- return out;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethodWithIntArg( "ownUpdatesAreVisible", mID, setType );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethodWithIntArg( "ownDeletesAreVisible", mID, setType );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethodWithIntArg( "ownInsertsAreVisible", mID, setType );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::othersUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethodWithIntArg( "othersUpdatesAreVisible", mID, setType );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::othersDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethodWithIntArg( "othersDeletesAreVisible", mID, setType );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::othersInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethodWithIntArg( "othersInsertsAreVisible", mID, setType );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::updatesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethodWithIntArg( "updatesAreDetected", mID, setType );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::deletesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethodWithIntArg( "deletesAreDetected", mID, setType );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::insertsAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethodWithIntArg( "insertsAreDetected", mID, setType );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_callBooleanMethod( "supportsBatchUpdates", mID );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getUDTs(
- const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern,
- const Sequence< sal_Int32 >& types ) throw(SQLException, RuntimeException)
-{
- jobject out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
-
-
- static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[I)Ljava/sql/ResultSet;";
- static const char * cMethodName = "getUDTs";
- // dismiss Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- {
- jvalue args[4];
- // initialize temporary Variable
- args[0].l = catalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(catalog)) : 0;
- args[1].l = schemaPattern.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,schemaPattern);
- args[2].l = convertwchar_tToJavaString(t.pEnv,typeNamePattern);
- jintArray pArray = t.pEnv->NewIntArray(types.getLength());
- t.pEnv->SetIntArrayRegion(pArray,0,types.getLength(),(jint*)types.getConstArray());
- args[3].l = pArray;
-
- out = t.pEnv->CallObjectMethod( object, mID, args[0].l, args[1].l,args[2].l,args[3].l);
-
- if(catalog.hasValue())
- t.pEnv->DeleteLocalRef((jstring)args[0].l);
- if(schemaPattern.getLength())
- t.pEnv->DeleteLocalRef((jstring)args[1].l);
- if(typeNamePattern.getLength())
- t.pEnv->DeleteLocalRef((jstring)args[2].l);
- if(args[3].l)
- t.pEnv->DeleteLocalRef((jintArray)args[3].l);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
- }
-
- return out ? new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection ) : 0;
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/Date.cxx b/connectivity/source/drivers/jdbc/Date.cxx
deleted file mode 100644
index a2c05a67bf..0000000000
--- a/connectivity/source/drivers/jdbc/Date.cxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/util/Date.hxx"
-#include "java/tools.hxx"
-#include "connectivity/dbconversion.hxx"
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.util.Date
-//**************************************************************
-
-jclass java_util_Date::theClass = 0;
-
-java_util_Date::~java_util_Date()
-{}
-
-jclass java_util_Date::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/util/Date");
- return theClass;
-}
-
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/DriverPropertyInfo.cxx b/connectivity/source/drivers/jdbc/DriverPropertyInfo.cxx
deleted file mode 100644
index f64e9cc4f7..0000000000
--- a/connectivity/source/drivers/jdbc/DriverPropertyInfo.cxx
+++ /dev/null
@@ -1,143 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/DriverPropertyInfo.hxx"
-#include "java/lang/Boolean.hxx"
-#include "java/tools.hxx"
-#include "java/lang/String.hxx"
-
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-
-//**************************************************************
-//************ Class: java.sql.Driver
-//**************************************************************
-
-jclass java_sql_DriverPropertyInfo::theClass = 0;
-// --------------------------------------------------------------------------------
-java_sql_DriverPropertyInfo::~java_sql_DriverPropertyInfo()
-{}
-// --------------------------------------------------------------------------------
-jclass java_sql_DriverPropertyInfo::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/sql/DriverPropertyInfo");
- return theClass;
-}
-
-// --------------------------------------------------------------------------------
-java_sql_DriverPropertyInfo::operator starsdbc::DriverPropertyInfo()
-{
- starsdbc::DriverPropertyInfo aInfo;
- aInfo.Name = name();
- aInfo.Description = description();
- aInfo.IsRequired = required();
- aInfo.Value = value();
- aInfo.Choices = choices();
-
- return aInfo;
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString java_sql_DriverPropertyInfo::name()
-{
- ::rtl::OUString aStr;
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- jfieldID id = t.pEnv->GetFieldID(getMyClass(),"name","Ljava/lang/String;");
- if(id)
- aStr = JavaString2String(t.pEnv,(jstring)t.pEnv->GetObjectField( object, id));
- } //t.pEnv
- return aStr;
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString java_sql_DriverPropertyInfo::description()
-{
- ::rtl::OUString aStr;
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- jfieldID id = t.pEnv->GetFieldID(getMyClass(),"description","Ljava/lang/String;");
- if(id)
- aStr = JavaString2String(t.pEnv,(jstring)t.pEnv->GetObjectField( object, id));
- } //t.pEnv
- return aStr;
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString java_sql_DriverPropertyInfo::value()
-{
- ::rtl::OUString aStr;
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- jfieldID id = t.pEnv->GetFieldID(getMyClass(),"value","Ljava/lang/String;");
- if(id)
- aStr = JavaString2String(t.pEnv,(jstring)t.pEnv->GetObjectField( object, id));
- } //t.pEnv
- return aStr;
-}
-// --------------------------------------------------------------------------------
-sal_Bool java_sql_DriverPropertyInfo::required()
-{
- jboolean out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- jfieldID id = t.pEnv->GetFieldID(getMyClass(),"required","Z");
- if(id)
- out = t.pEnv->GetBooleanField( object, id);
- } //t.pEnv
- return out;
-}
-// --------------------------------------------------------------------------------
-Sequence< ::rtl::OUString> java_sql_DriverPropertyInfo::choices()
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- jfieldID id = t.pEnv->GetFieldID(getMyClass(),"choices","[Ljava/lang/String;");
- if(id)
- {
- const java_lang_String * pEmpty = NULL;
- const ::rtl::OUString * pEmpty2 = NULL;
- return copyArrayAndDelete(t.pEnv,(jobjectArray)t.pEnv->GetObjectField( object, id), pEmpty2, pEmpty);
- }
- } //t.pEnv
- return Sequence< ::rtl::OUString>();
-}
-// --------------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/Exception.cxx b/connectivity/source/drivers/jdbc/Exception.cxx
deleted file mode 100644
index 09e0624d54..0000000000
--- a/connectivity/source/drivers/jdbc/Exception.cxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/lang/Exception.hxx"
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.lang.Exception
-//**************************************************************
-
-jclass java_lang_Exception::theClass = 0;
-
-java_lang_Exception::~java_lang_Exception()
-{}
-
-jclass java_lang_Exception::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/lang/Exception");
- return theClass;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/InputStream.cxx b/connectivity/source/drivers/jdbc/InputStream.cxx
deleted file mode 100644
index 33e8acc3a4..0000000000
--- a/connectivity/source/drivers/jdbc/InputStream.cxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/io/InputStream.hxx"
-#include "java/tools.hxx"
-
-#include <string.h>
-
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.io.InputStream
-//**************************************************************
-
-jclass java_io_InputStream::theClass = 0;
-java_io_InputStream::java_io_InputStream( JNIEnv * pEnv, jobject myObj )
- : java_lang_Object( pEnv, myObj )
-{
- SDBThreadAttach::addRef();
-}
-java_io_InputStream::~java_io_InputStream()
-{
- SDBThreadAttach::releaseRef();
-}
-
-jclass java_io_InputStream::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/io/InputStream");
- return theClass;
-}
-
-
-sal_Int32 SAL_CALL java_io_InputStream::readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- return readBytes(aData,nMaxBytesToRead);
-}
-
-void SAL_CALL java_io_InputStream::skipBytes( sal_Int32 nBytesToSkip ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- static jmethodID mID(NULL);
- callIntMethodWithIntArg("skip",mID,nBytesToSkip);
-}
-
-sal_Int32 SAL_CALL java_io_InputStream::available( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- static jmethodID mID(NULL);
- return callIntMethod("available",mID);
-}
-void SAL_CALL java_io_InputStream::closeInput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- static jmethodID mID(NULL);
- callVoidMethod("close",mID);
-}
-// -----------------------------------------------------
-sal_Int32 SAL_CALL java_io_InputStream::readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- if (nBytesToRead < 0)
- throw ::com::sun::star::io::BufferSizeExceededException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), *this );
-
- jint out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- jbyteArray pByteArray = t.pEnv->NewByteArray(nBytesToRead);
- static const char * cSignature = "([BII)I";
- static const char * cMethodName = "read";
- // execute Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- out = t.pEnv->CallIntMethod( object, mID, pByteArray, 0, nBytesToRead );
- if ( !out )
- ThrowSQLException(t.pEnv,*this);
- if(out > 0)
- {
- jboolean p = sal_False;
- aData.realloc ( out );
- rtl_copyMemory(aData.getArray(),t.pEnv->GetByteArrayElements(pByteArray,&p),out);
- }
- t.pEnv->DeleteLocalRef((jbyteArray)pByteArray);
- } //t.pEnv
- return out;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/JBigDecimal.cxx b/connectivity/source/drivers/jdbc/JBigDecimal.cxx
deleted file mode 100644
index a724a07de1..0000000000
--- a/connectivity/source/drivers/jdbc/JBigDecimal.cxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/math/BigDecimal.hxx"
-#include "java/tools.hxx"
-#include "resource/jdbc_log.hrc"
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.lang.Boolean
-//**************************************************************
-
-jclass java_math_BigDecimal::theClass = 0;
-
-java_math_BigDecimal::~java_math_BigDecimal()
-{}
-
-jclass java_math_BigDecimal::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/math/BigDecimal");
- return theClass;
-}
-
-java_math_BigDecimal::java_math_BigDecimal( const ::rtl::OUString& _par0 ): java_lang_Object( NULL, (jobject)NULL )
-{
- SDBThreadAttach t;
- if( !t.pEnv )
- return;
- // Java-Call for the Constructor
- // initialize temporary Variable
- static const char * cSignature = "(Ljava/lang/String;)V";
- jobject tempObj;
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, "<init>",cSignature, mID);
-
- jstring str = convertwchar_tToJavaString(t.pEnv,_par0.replace(',','.'));
- tempObj = t.pEnv->NewObject( getMyClass(), mID, str );
- t.pEnv->DeleteLocalRef(str);
- saveRef( t.pEnv, tempObj );
- t.pEnv->DeleteLocalRef( tempObj );
- ThrowSQLException( t.pEnv, NULL );
- // and cleanup
-}
-
-java_math_BigDecimal::java_math_BigDecimal( const double& _par0 ): java_lang_Object( NULL, (jobject)NULL )
-{
- SDBThreadAttach t;
- if( !t.pEnv )
- return;
- // Java-Call for the Constructor
- // initialize temporary Variable
- static const char * cSignature = "(D)V";
- jobject tempObj;
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, "<init>",cSignature, mID);
- tempObj = t.pEnv->NewObject( getMyClass(), mID, _par0 );
- saveRef( t.pEnv, tempObj );
- t.pEnv->DeleteLocalRef( tempObj );
- ThrowSQLException( t.pEnv, NULL );
- // and cleanup
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx
deleted file mode 100644
index 3b3648ef8c..0000000000
--- a/connectivity/source/drivers/jdbc/JConnection.cxx
+++ /dev/null
@@ -1,876 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "java/sql/Connection.hxx"
-#include "java/lang/Class.hxx"
-#include "java/tools.hxx"
-#include "java/ContextClassLoader.hxx"
-#include "java/sql/DatabaseMetaData.hxx"
-#include "java/sql/JStatement.hxx"
-#include "java/sql/Driver.hxx"
-#include "java/sql/PreparedStatement.hxx"
-#include "java/sql/CallableStatement.hxx"
-#include "java/sql/SQLWarning.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include "connectivity/sqlparse.hxx"
-#include "connectivity/dbexception.hxx"
-#include "java/util/Property.hxx"
-#include "java/LocalRef.hxx"
-#include "resource/jdbc_log.hrc"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "jvmaccess/classpath.hxx"
-#include <comphelper/namedvaluecollection.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <jni.h>
-#include "resource/common_res.hrc"
-#include <unotools/confignode.hxx>
-
-#include <list>
-#include <memory>
-
-using namespace connectivity;
-using namespace connectivity::jdbc;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-namespace {
-
-struct ClassMapEntry {
- ClassMapEntry(
- rtl::OUString const & theClassPath, rtl::OUString const & theClassName):
- classPath(theClassPath), className(theClassName), classLoader(NULL),
- classObject(NULL) {}
-
- rtl::OUString classPath;
- rtl::OUString className;
- jweak classLoader;
- jweak classObject;
-};
-
-typedef std::list< ClassMapEntry > ClassMap;
-
-struct ClassMapData {
- osl::Mutex mutex;
-
- ClassMap map;
-};
-
-struct ClassMapDataInit {
- ClassMapData * operator()() {
- static ClassMapData instance;
- return &instance;
- }
-};
-
-template < typename T >
-bool getLocalFromWeakRef( jweak& _weak, LocalRef< T >& _inout_local )
-{
- _inout_local.set( static_cast< T >( _inout_local.env().NewLocalRef( _weak ) ) );
-
- if ( !_inout_local.is() )
- {
- if ( _inout_local.env().ExceptionCheck())
- {
- return false;
- }
- else if ( _weak != NULL )
- {
- _inout_local.env().DeleteWeakGlobalRef( _weak );
- _weak = NULL;
- }
- }
- return true;
-}
-
-// Load a class. A map from pairs of (classPath, name) to pairs of weak Java
-// references to (ClassLoader, Class) is maintained, so that a class is only
-// loaded once.
-//
-// It may happen that the weak reference to the ClassLoader becomes null while
-// the reference to the Class remains non-null (in case the Class was actually
-// loaded by some parent of the ClassLoader), in which case the ClassLoader is
-// resurrected (which cannot cause any classes to be loaded multiple times, as
-// the ClassLoader is no longer reachable, so no classes it has ever loaded are
-// still reachable).
-//
-// Similarly, it may happen that the weak reference to the Class becomes null
-// while the reference to the ClassLoader remains non-null, in which case the
-// Class is simply re-loaded.
-//
-// This code is close to the implementation of jvmaccess::ClassPath::loadClass
-// in jvmaccess/classpath.hxx, but not close enough to avoid the duplication.
-//
-// If false is returned, a (still pending) JNI exception occurred.
-bool loadClass(
- Reference< XComponentContext > const & context, JNIEnv& environment,
- rtl::OUString const & classPath, rtl::OUString const & name,
- LocalRef< jobject > * classLoaderPtr, LocalRef< jclass > * classPtr)
-{
- OSL_ASSERT(classLoaderPtr != NULL);
- // For any jweak entries still present in the map upon destruction,
- // DeleteWeakGlobalRef is not called (which is a leak):
- ClassMapData * d =
- rtl_Instance< ClassMapData, ClassMapDataInit, osl::MutexGuard,
- osl::GetGlobalMutex >::create(
- ClassMapDataInit(), osl::GetGlobalMutex());
- osl::MutexGuard g(d->mutex);
- ClassMap::iterator i(d->map.begin());
- LocalRef< jobject > cloader(environment);
- LocalRef< jclass > cl(environment);
- // Prune dangling weak references from the list while searching for a match,
- // so that the list cannot grow unbounded:
- for (; i != d->map.end();)
- {
- LocalRef< jobject > classLoader( environment );
- if ( !getLocalFromWeakRef( i->classLoader, classLoader ) )
- return false;
-
- LocalRef< jclass > classObject( environment );
- if ( !getLocalFromWeakRef( i->classObject, classObject ) )
- return false;
-
- if ( !classLoader.is() && !classObject.is() )
- {
- i = d->map.erase(i);
- }
- else if ( i->classPath == classPath && i->className == name )
- {
- cloader.set( classLoader.release() );
- cl.set( classObject.release() );
- break;
- }
- else
- {
- ++i;
- }
- }
- if ( !cloader.is() || !cl.is() )
- {
- if ( i == d->map.end() )
- {
- // Push a new ClassMapEntry (which can potentially fail) before
- // loading the class, so that it never happens that a class is
- // loaded but not added to the map (which could have effects on the
- // JVM that are not easily undone). If the pushed ClassMapEntry is
- // not used after all (return false, etc.) it will be pruned on next
- // call because its classLoader/classObject are null:
- d->map.push_front( ClassMapEntry( classPath, name ) );
- i = d->map.begin();
- }
-
- LocalRef< jclass > clClass( environment );
- clClass.set( environment.FindClass( "java/net/URLClassLoader" ) );
- if ( !clClass.is() )
- return false;
-
- jweak wcloader = NULL;
- if (!cloader.is())
- {
- jmethodID ctorLoader( environment.GetMethodID( clClass.get(), "<init>", "([Ljava/net/URL;)V" ) );
- if (ctorLoader == NULL)
- return false;
-
- LocalRef< jobjectArray > arr( environment );
- arr.set( jvmaccess::ClassPath::translateToUrls( context, &environment, classPath ) );
- if ( !arr.is() )
- return false;
-
- jvalue arg;
- arg.l = arr.get();
- cloader.set( environment.NewObjectA( clClass.get(), ctorLoader, &arg ) );
- if ( !cloader.is() )
- return false;
-
- wcloader = environment.NewWeakGlobalRef( cloader.get() );
- if ( wcloader == NULL )
- return false;
- }
-
- jweak wcl = NULL;
- if ( !cl.is() )
- {
- jmethodID methLoadClass( environment.GetMethodID( clClass.get(), "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;" ) );
- if ( methLoadClass == NULL )
- return false;
-
- LocalRef< jstring > str( environment );
- str.set( convertwchar_tToJavaString( &environment, name ) );
- if ( !str.is() )
- return false;
-
- jvalue arg;
- arg.l = str.get();
- cl.set( static_cast< jclass >( environment.CallObjectMethodA( cloader.get(), methLoadClass, &arg ) ) );
- if ( !cl.is() )
- return false;
-
- wcl = environment.NewWeakGlobalRef( cl.get() );
- if ( wcl == NULL )
- return false;
- }
-
- if ( wcloader != NULL)
- {
- i->classLoader = wcloader;
- }
- if ( wcl != NULL )
- {
- i->classObject = wcl;
- }
- }
-
- classLoaderPtr->set( cloader.release() );
- classPtr->set( cl.release() );
- return true;
-}
-
-}
-
-//------------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(java_sql_Connection,"com.sun.star.sdbcx.JConnection","com.sun.star.sdbc.Connection");
-//------------------------------------------------------------------------------
-//**************************************************************
-//************ Class: java.sql.Connection
-//**************************************************************
-jclass java_sql_Connection::theClass = 0;
-
-java_sql_Connection::java_sql_Connection( const java_sql_Driver& _rDriver )
- :java_lang_Object( _rDriver.getContext().getLegacyServiceFactory() )
- ,OSubComponent<java_sql_Connection, java_sql_Connection_BASE>((::cppu::OWeakObject*)(&_rDriver), this)
- ,m_pDriver( &_rDriver )
- ,m_pDriverobject(NULL)
- ,m_pDriverClassLoader()
- ,m_Driver_theClass(NULL)
- ,m_aLogger( _rDriver.getLogger() )
- ,m_bParameterSubstitution(sal_False)
- ,m_bIgnoreDriverPrivileges(sal_True)
- ,m_bIgnoreCurrency(sal_False)
-{
-}
-// -----------------------------------------------------------------------------
-java_sql_Connection::~java_sql_Connection()
-{
- ::rtl::Reference< jvmaccess::VirtualMachine > xTest = java_lang_Object::getVM();
- if ( xTest.is() )
- {
- SDBThreadAttach t;
- clearObject(*t.pEnv);
-
- {
- if ( m_pDriverobject )
- t.pEnv->DeleteGlobalRef( m_pDriverobject );
- m_pDriverobject = NULL;
- if ( m_Driver_theClass )
- t.pEnv->DeleteGlobalRef( m_Driver_theClass );
- m_Driver_theClass = NULL;
- }
- t.releaseRef();
- }
-}
-//-----------------------------------------------------------------------------
-void SAL_CALL java_sql_Connection::release() throw()
-{
- relase_ChildImpl();
-}
-//------------------------------------------------------------------------------
-void java_sql_Connection::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- m_aLogger.log( LogLevel::INFO, STR_LOG_SHUTDOWN_CONNECTION );
-
- dispose_ChildImpl();
- java_sql_Connection_BASE::disposing();
-
- if ( object )
- {
- static jmethodID mID(NULL);
- callVoidMethod("close",mID);
- }
-}
-// -------------------------------------------------------------------------
-jclass java_sql_Connection::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/sql/Connection");
- return theClass;
-}
-
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_Connection::getCatalog( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed);
-
- static jmethodID mID(NULL);
- return callStringMethod("getCatalog",mID);
-}
-// -------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL java_sql_Connection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed);
-
-
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if(!xMetaData.is())
- {
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jobject out = callObjectMethod(t.pEnv,"getMetaData","()Ljava/sql/DatabaseMetaData;", mID);
- if(out)
- {
- xMetaData = new java_sql_DatabaseMetaData( t.pEnv, out, *this );
- m_xMetaData = xMetaData;
- }
- }
-
- return xMetaData;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_Connection::close( ) throw(SQLException, RuntimeException)
-{
- dispose();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_Connection::commit( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- callVoidMethod("commit",mID);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_Connection::isClosed( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- static jmethodID mID(NULL);
- return callBooleanMethod( "isClosed", mID ) && java_sql_Connection_BASE::rBHelper.bDisposed;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_Connection::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed);
- static jmethodID mID(NULL);
- return callBooleanMethod( "isReadOnly", mID );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_Connection::setCatalog( const ::rtl::OUString& catalog ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- callVoidMethodWithStringArg("setCatalog",mID,catalog);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_Connection::rollback( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- callVoidMethod("rollback",mID);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_Connection::getAutoCommit( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return callBooleanMethod( "getAutoCommit", mID );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_Connection::setReadOnly( sal_Bool readOnly ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- callVoidMethodWithBoolArg("setReadOnly",mID,readOnly);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_Connection::setAutoCommit( sal_Bool autoCommit ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- callVoidMethodWithBoolArg("setAutoCommit",mID,autoCommit);
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::container::XNameAccess > SAL_CALL java_sql_Connection::getTypeMap( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- callObjectMethod(t.pEnv,"getTypeMap","()Ljava/util/Map;", mID);
- // WARNING: the caller becomes the owner of the returned pointer
- return 0;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_Connection::setTypeMap( const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed);
-
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setTypeMap", *this );
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_Connection::getTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed);
-
- static jmethodID mID(NULL);
- return callIntMethod("getTransactionIsolation",mID);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_Connection::setTransactionIsolation( sal_Int32 level ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed);
-
- static jmethodID mID(NULL);
- callVoidMethodWithIntArg("setTransactionIsolation",mID,level);
-}
-// -------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL java_sql_Connection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed);
- m_aLogger.log( LogLevel::FINE, STR_LOG_CREATE_STATEMENT );
-
- SDBThreadAttach t;
- java_sql_Statement* pStatement = new java_sql_Statement( t.pEnv, *this );
- Reference< XStatement > xStmt = pStatement;
- m_aStatements.push_back( WeakReferenceHelper( xStmt ) );
-
- m_aLogger.log( LogLevel::FINE, STR_LOG_CREATED_STATEMENT_ID, pStatement->getStatementObjectID() );
- return xStmt;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString java_sql_Connection::transFormPreparedStatement(const ::rtl::OUString& _sSQL)
-{
- ::rtl::OUString sSqlStatement = _sSQL;
- if ( m_bParameterSubstitution )
- {
- try
- {
- OSQLParser aParser( m_pDriver->getContext().getLegacyServiceFactory() );
- ::rtl::OUString sErrorMessage;
- ::rtl::OUString sNewSql;
- OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_sSQL);
- if(pNode)
- { // special handling for parameters
- OSQLParseNode::substituteParameterNames(pNode);
- pNode->parseNodeToStr( sNewSql, this );
- delete pNode;
- sSqlStatement = sNewSql;
- }
- }
- catch(const Exception&)
- {
- }
- }
- return sSqlStatement;
-}
-// -------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL java_sql_Connection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed);
- m_aLogger.log( LogLevel::FINE, STR_LOG_PREPARE_STATEMENT, sql );
-
- SDBThreadAttach t;
- ::rtl::OUString sSqlStatement = sql;
- sSqlStatement = transFormPreparedStatement( sSqlStatement );
-
- java_sql_PreparedStatement* pStatement = new java_sql_PreparedStatement( t.pEnv, *this, sSqlStatement );
- Reference< XPreparedStatement > xReturn( pStatement );
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
-
- m_aLogger.log( LogLevel::FINE, STR_LOG_PREPARED_STATEMENT_ID, pStatement->getStatementObjectID() );
- return xReturn;
-}
-// -------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL java_sql_Connection::prepareCall( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed);
- m_aLogger.log( LogLevel::FINE, STR_LOG_PREPARE_CALL, sql );
-
- SDBThreadAttach t;
- ::rtl::OUString sSqlStatement = sql;
- sSqlStatement = transFormPreparedStatement( sSqlStatement );
-
- java_sql_CallableStatement* pStatement = new java_sql_CallableStatement( t.pEnv, *this, sSqlStatement );
- Reference< XPreparedStatement > xStmt( pStatement );
- m_aStatements.push_back(WeakReferenceHelper(xStmt));
-
- m_aLogger.log( LogLevel::FINE, STR_LOG_PREPARED_CALL_ID, pStatement->getStatementObjectID() );
- return xStmt;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_Connection::nativeSQL( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed);
-
- ::rtl::OUString aStr;
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
-
- // initialize temporary Variable
- static const char * cSignature = "(Ljava/lang/String;)Ljava/lang/String;";
- static const char * cMethodName = "nativeSQL";
- // Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- // Convert Parameter
- jdbc::LocalRef< jstring > str( t.env(),convertwchar_tToJavaString(t.pEnv,sql));
-
- jobject out = t.pEnv->CallObjectMethod( object, mID, str.get() );
- aStr = JavaString2String(t.pEnv, (jstring)out );
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //t.pEnv
-
- m_aLogger.log( LogLevel::FINER, STR_LOG_NATIVE_SQL, sql, aStr );
-
- return aStr;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_Connection::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- callVoidMethod("clearWarnings",mID);
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL java_sql_Connection::getWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Connection_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t;
- static jmethodID mID(NULL);
- jobject out = callObjectMethod(t.pEnv,"getWarnings","()Ljava/sql/SQLWarning;", mID);
- // WARNING: the caller becomes the owner of the returned pointer
- if( out )
- {
- java_sql_SQLWarning_BASE warn_base(t.pEnv, out);
- SQLException aAsException( static_cast< starsdbc::SQLException >( java_sql_SQLWarning( warn_base, *this ) ) );
-
- // translate to warning
- SQLWarning aWarning;
- aWarning.Context = aAsException.Context;
- aWarning.Message = aAsException.Message;
- aWarning.SQLState = aAsException.SQLState;
- aWarning.ErrorCode = aAsException.ErrorCode;
- aWarning.NextException = aAsException.NextException;
-
- return makeAny( aWarning );
- }
-
- return Any();
-}
-
-// -----------------------------------------------------------------------------
-namespace
-{
- ::rtl::OUString lcl_getDriverLoadErrorMessage( const ::connectivity::SharedResources& _aResource,const ::rtl::OUString& _rDriverClass, const ::rtl::OUString& _rDriverClassPath )
- {
- ::rtl::OUString sError1( _aResource.getResourceStringWithSubstitution(
- STR_NO_CLASSNAME,
- "$classname$", _rDriverClass
- ) );
- if ( _rDriverClassPath.getLength() )
- {
- const ::rtl::OUString sError2( _aResource.getResourceStringWithSubstitution(
- STR_NO_CLASSNAME_PATH,
- "$classpath$", _rDriverClassPath
- ) );
- sError1 += sError2;
- } // if ( _rDriverClassPath.getLength() )
- return sError1;
- }
-}
-
-// -----------------------------------------------------------------------------
-namespace
-{
- bool lcl_setSystemProperties_nothrow( const java::sql::ConnectionLog& _rLogger,
- JNIEnv& _rEnv, const Sequence< NamedValue >& _rSystemProperties )
- {
- if ( _rSystemProperties.getLength() == 0 )
- // nothing to do
- return true;
-
- LocalRef< jclass > systemClass( _rEnv );
- jmethodID nSetPropertyMethodID = 0;
- // retrieve the java.lang.System class
- systemClass.set( _rEnv.FindClass( "java/lang/System" ) );
- if ( systemClass.is() )
- {
- nSetPropertyMethodID = _rEnv.GetStaticMethodID(
- systemClass.get(), "setProperty", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;" );
- }
-
- if ( nSetPropertyMethodID == 0 )
- return false;
-
- for ( const NamedValue* pSystemProp = _rSystemProperties.getConstArray();
- pSystemProp != _rSystemProperties.getConstArray() + _rSystemProperties.getLength();
- ++pSystemProp
- )
- {
- ::rtl::OUString sValue;
- OSL_VERIFY( pSystemProp->Value >>= sValue );
-
- _rLogger.log( LogLevel::FINER, STR_LOG_SETTING_SYSTEM_PROPERTY, pSystemProp->Name, sValue );
-
- LocalRef< jstring > jName( _rEnv, convertwchar_tToJavaString( &_rEnv, pSystemProp->Name ) );
- LocalRef< jstring > jValue( _rEnv, convertwchar_tToJavaString( &_rEnv, sValue ) );
-
- _rEnv.CallStaticObjectMethod( systemClass.get(), nSetPropertyMethodID, jName.get(), jValue.get() );
- LocalRef< jthrowable > throwable( _rEnv, _rEnv.ExceptionOccurred() );
- if ( throwable.is() )
- return false;
- }
-
- return true;
- }
-}
-
-// -----------------------------------------------------------------------------
-void java_sql_Connection::loadDriverFromProperties( const ::rtl::OUString& _sDriverClass, const ::rtl::OUString& _sDriverClassPath,
- const Sequence< NamedValue >& _rSystemProperties )
-{
- // contains the statement which should be used when query for automatically generated values
- ::rtl::OUString sGeneratedValueStatement;
- // set to <TRUE/> when we should allow to query for generated values
- sal_Bool bAutoRetrievingEnabled = sal_False;
-
- // first try if the jdbc driver is alraedy registered at the driver manager
- SDBThreadAttach t;
- try
- {
- if ( !object )
- {
- if ( !lcl_setSystemProperties_nothrow( getLogger(), *t.pEnv, _rSystemProperties ) )
- ThrowLoggedSQLException( getLogger(), t.pEnv, *this );
-
- m_pDriverClassLoader.reset();
-
- // here I try to find the class for jdbc driver
- java_sql_SQLException_BASE::st_getMyClass();
- java_lang_Throwable::st_getMyClass();
-
- if ( !_sDriverClass.getLength() )
- {
- m_aLogger.log( LogLevel::SEVERE, STR_LOG_NO_DRIVER_CLASS );
- ::dbtools::throwGenericSQLException(
- lcl_getDriverLoadErrorMessage( getResources(),_sDriverClass, _sDriverClassPath ),
- *this
- );
- }
- else
- {
- m_aLogger.log( LogLevel::INFO, STR_LOG_LOADING_DRIVER, _sDriverClass );
- // the driver manager holds the class of the driver for later use
- ::std::auto_ptr< java_lang_Class > pDrvClass;
- if ( !_sDriverClassPath.getLength() )
- {
- // if forName didn't find the class it will throw an exception
- pDrvClass = ::std::auto_ptr< java_lang_Class >(java_lang_Class::forName(_sDriverClass));
- }
- else
- {
- LocalRef< jclass > driverClass(t.env());
- LocalRef< jobject > driverClassLoader(t.env());
-
- loadClass(
- m_pDriver->getContext().getUNOContext(),
- t.env(), _sDriverClassPath, _sDriverClass, &driverClassLoader, &driverClass );
-
- m_pDriverClassLoader.set( driverClassLoader );
- pDrvClass.reset( new java_lang_Class( t.pEnv, driverClass.release() ) );
-
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
- if ( pDrvClass.get() )
- {
- LocalRef< jobject > driverObject( t.env() );
- driverObject.set( pDrvClass->newInstanceObject() );
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- m_pDriverobject = driverObject.release();
-
- if( t.pEnv && m_pDriverobject )
- m_pDriverobject = t.pEnv->NewGlobalRef( m_pDriverobject );
-
- {
- jclass tempClass = t.pEnv->GetObjectClass(m_pDriverobject);
- if ( m_pDriverobject )
- {
- m_Driver_theClass = (jclass)t.pEnv->NewGlobalRef( tempClass );
- t.pEnv->DeleteLocalRef( tempClass );
- }
- }
- }
- m_aLogger.log( LogLevel::INFO, STR_LOG_CONN_SUCCESS );
- }
- }
- }
- catch( const SQLException& e )
- {
- throw SQLException(
- lcl_getDriverLoadErrorMessage( getResources(),_sDriverClass, _sDriverClassPath ),
- *this,
- ::rtl::OUString(),
- 1000,
- makeAny(e)
- );
- }
- catch( Exception& )
- {
- ::dbtools::throwGenericSQLException(
- lcl_getDriverLoadErrorMessage( getResources(),_sDriverClass, _sDriverClassPath ),
- *this
- );
- }
-
- enableAutoRetrievingEnabled( bAutoRetrievingEnabled );
- setAutoRetrievingStatement( sGeneratedValueStatement );
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString java_sql_Connection::impl_getJavaDriverClassPath_nothrow(const ::rtl::OUString& _sDriverClass)
-{
- static const ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess/JDBC/DriverClassPaths"));
- ::utl::OConfigurationTreeRoot aNamesRoot = ::utl::OConfigurationTreeRoot::createWithServiceFactory(
- m_pDriver->getContext().getLegacyServiceFactory(), s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY);
- ::rtl::OUString sURL;
- if ( aNamesRoot.isValid() && aNamesRoot.hasByName( _sDriverClass ) )
- {
- ::utl::OConfigurationNode aRegisterObj = aNamesRoot.openNode( _sDriverClass );
- OSL_VERIFY( aRegisterObj.getNodeValue( "Path" ) >>= sURL );
- }
- return sURL;
-}
-// -----------------------------------------------------------------------------
-sal_Bool java_sql_Connection::construct(const ::rtl::OUString& url,
- const Sequence< PropertyValue >& info)
-{
- { // initialize the java vm
- ::rtl::Reference< jvmaccess::VirtualMachine > xTest = java_lang_Object::getVM(getORB());
- if ( !xTest.is() )
- throwGenericSQLException(STR_NO_JAVA,*this);
- }
- SDBThreadAttach t;
- t.addRef(); // will be released in dtor
- if ( !t.pEnv )
- throwGenericSQLException(STR_NO_JAVA,*this);
-
- ::rtl::OUString sGeneratedValueStatement; // contains the statement which should be used when query for automatically generated values
- sal_Bool bAutoRetrievingEnabled = sal_False; // set to <TRUE/> when we should allow to query for generated values
- ::rtl::OUString sDriverClassPath,sDriverClass;
- Sequence< NamedValue > aSystemProperties;
-
- ::comphelper::NamedValueCollection aSettings( info );
- sDriverClass = aSettings.getOrDefault( "JavaDriverClass", sDriverClass );
- sDriverClassPath = aSettings.getOrDefault( "JavaDriverClassPath", sDriverClassPath);
- if ( !sDriverClassPath.getLength() )
- sDriverClassPath = impl_getJavaDriverClassPath_nothrow(sDriverClass);
- bAutoRetrievingEnabled = aSettings.getOrDefault( "IsAutoRetrievingEnabled", bAutoRetrievingEnabled );
- sGeneratedValueStatement = aSettings.getOrDefault( "AutoRetrievingStatement", sGeneratedValueStatement );
- m_bParameterSubstitution = aSettings.getOrDefault( "ParameterNameSubstitution", m_bParameterSubstitution );
- m_bIgnoreDriverPrivileges = aSettings.getOrDefault( "IgnoreDriverPrivileges", m_bIgnoreDriverPrivileges );
- m_bIgnoreCurrency = aSettings.getOrDefault( "IgnoreCurrency", m_bIgnoreCurrency );
- aSystemProperties = aSettings.getOrDefault( "SystemProperties", aSystemProperties );
- m_aCatalogRestriction = aSettings.getOrDefault( "ImplicitCatalogRestriction", Any() );
- m_aSchemaRestriction = aSettings.getOrDefault( "ImplicitSchemaRestriction", Any() );
-
- loadDriverFromProperties( sDriverClass, sDriverClassPath, aSystemProperties );
-
- enableAutoRetrievingEnabled(bAutoRetrievingEnabled);
- setAutoRetrievingStatement(sGeneratedValueStatement);
-
- if ( t.pEnv && m_Driver_theClass && m_pDriverobject )
- {
- // initialize temporary Variable
- static const char * cSignature = "(Ljava/lang/String;Ljava/util/Properties;)Ljava/sql/Connection;";
- static const char * cMethodName = "connect";
- // Java-Call
- jmethodID mID = NULL;
- if ( !mID )
- mID = t.pEnv->GetMethodID( m_Driver_theClass, cMethodName, cSignature );
- if ( mID )
- {
- jvalue args[2];
- // convert Parameter
- args[0].l = convertwchar_tToJavaString(t.pEnv,url);
- java_util_Properties* pProps = createStringPropertyArray(info);
- args[1].l = pProps->getJavaObject();
-
- LocalRef< jobject > ensureDelete( t.env(), args[0].l );
-
- jobject out = NULL;
- // In some cases (e.g.,
- // connectivity/source/drivers/hsqldb/HDriver.cxx:1.24
- // l. 249) the JavaDriverClassPath contains multiple jars,
- // as creating the JavaDriverClass instance requires
- // (reflective) access to those other jars. Now, if the
- // JavaDriverClass is actually loaded by some parent class
- // loader (e.g., because its jar is also on the global
- // class path), it would still not have access to the
- // additional jars on the JavaDriverClassPath. Hence, the
- // JavaDriverClassPath class loader is pushed as context
- // class loader around the JavaDriverClass instance
- // creation:
- // #i82222# / 2007-10-15
- {
- ContextClassLoaderScope ccl( t.env(), getDriverClassLoader(), getLogger(), *this );
- out = t.pEnv->CallObjectMethod( m_pDriverobject, mID, args[0].l,args[1].l );
- delete pProps, pProps = NULL;
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
-
- if ( !out )
- m_aLogger.log( LogLevel::SEVERE, STR_LOG_NO_SYSTEM_CONNECTION );
-
- if ( out )
- object = t.pEnv->NewGlobalRef( out );
-
- if ( object )
- m_aLogger.log( LogLevel::INFO, STR_LOG_GOT_JDBC_CONNECTION, url );
-
- m_aConnectionInfo = info;
- } //mID
- } //t.pEnv
- return object != NULL;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/JDriver.cxx b/connectivity/source/drivers/jdbc/JDriver.cxx
deleted file mode 100644
index 8decaa3751..0000000000
--- a/connectivity/source/drivers/jdbc/JDriver.cxx
+++ /dev/null
@@ -1,258 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/Driver.hxx"
-#include "java/lang/Object.hxx"
-#include "java/lang/Class.hxx"
-#include "java/sql/DriverPropertyInfo.hxx"
-#include "java/sql/Connection.hxx"
-#include "java/util/Property.hxx"
-#include "java/tools.hxx"
-#include "connectivity/dbexception.hxx"
-#include <jvmfwk/framework.h>
-#include "diagnose_ex.h"
-#include "resource/jdbc_log.hrc"
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-#include <comphelper/componentcontext.hxx>
-
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -------------------------------------------------------------------------
-java_sql_Driver::java_sql_Driver(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory)
- :m_aContext( _rxFactory )
- ,m_aLogger( m_aContext.getUNOContext(), "sdbcl", "org.openoffice.sdbc.jdbcBridge" )
-{
-}
-// --------------------------------------------------------------------------------
-java_sql_Driver::~java_sql_Driver()
-{
-}
-
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString java_sql_Driver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdbc.JDBCDriver"));
- // this name is referenced in the configuration and in the jdbc.xml
- // Please take care when changing it.
-}
-//------------------------------------------------------------------------------
-Sequence< ::rtl::OUString > java_sql_Driver::getSupportedServiceNames_Static( ) throw (RuntimeException)
-{
- Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"));
- return aSNS;
-}
-//------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL connectivity::java_sql_Driver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
-{
- return *(new java_sql_Driver(_rxFactory));
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_Driver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_Driver::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-
-// --------------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL java_sql_Driver::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-// -------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL java_sql_Driver::connect( const ::rtl::OUString& url, const
- Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- m_aLogger.log( LogLevel::INFO, STR_LOG_DRIVER_CONNECTING_URL, url );
-
- Reference< XConnection > xOut;
- if ( acceptsURL(url ) )
- {
- java_sql_Connection* pConnection = new java_sql_Connection( *this );
- xOut = pConnection;
- if ( !pConnection->construct(url,info) )
- xOut.clear(); // an error occurred and the java driver didn't throw an exception
- else
- m_aLogger.log( LogLevel::INFO, STR_LOG_DRIVER_SUCCESS );
- }
- return xOut;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_Driver::acceptsURL( const ::rtl::OUString& url ) throw(SQLException, RuntimeException)
-{
- // don't ask the real driver for the url
- // I feel responsible for all jdbc url's
- sal_Bool bEnabled = sal_False;
- OSL_VERIFY_EQUALS( jfw_getEnabled( &bEnabled ), JFW_E_NONE, "error in jfw_getEnabled" );
- static const ::rtl::OUString s_sJdbcPrefix( RTL_CONSTASCII_USTRINGPARAM( "jdbc:" ));
- return bEnabled && 0 == url.compareTo(s_sJdbcPrefix, 5);
-}
-// -------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL java_sql_Driver::getPropertyInfo( const ::rtl::OUString& url,
- const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException)
-{
- if ( acceptsURL(url) )
- {
- ::std::vector< DriverPropertyInfo > aDriverInfo;
-
- Sequence< ::rtl::OUString > aBooleanValues(2);
- aBooleanValues[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) );
- aBooleanValues[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) );
-
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClass"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The JDBC driver class name."))
- ,sal_True
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClassPath"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The class path where to look for the JDBC driver."))
- ,sal_True
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" ) )
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SystemProperties"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Additional properties to set at java.lang.System before loading the driver."))
- ,sal_True
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" ) )
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParameterNameSubstitution"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Change named parameters with '?'."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IgnoreDriverPrivileges"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Ignore the privileges from the database driver."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsAutoRetrievingEnabled"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Retrieve generated values."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoRetrievingStatement"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Auto-increment statement."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GenerateASBeforeCorrelationName"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Generate AS before table correlation names."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IgnoreCurrency"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Ignore the currency field from the ResultsetMetaData."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EscapeDateTime"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Escape date time format."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TypeInfoSettings"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Defines how the type info of the database metadata should be manipulated."))
- ,sal_False
- ,::rtl::OUString( )
- ,Sequence< ::rtl::OUString > ())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ImplicitCatalogRestriction"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The catalog which should be used in getTables calls, when the caller passed NULL."))
- ,sal_False
- ,::rtl::OUString( )
- ,Sequence< ::rtl::OUString > ())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ImplicitSchemaRestriction"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The schema which should be used in getTables calls, when the caller passed NULL."))
- ,sal_False
- ,::rtl::OUString( )
- ,Sequence< ::rtl::OUString > ())
- );
- return Sequence< DriverPropertyInfo >(&aDriverInfo[0],aDriverInfo.size());
- }
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- return Sequence< DriverPropertyInfo >();
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_Driver::getMajorVersion( ) throw(RuntimeException)
-{
- return 1;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_Driver::getMinorVersion( ) throw(RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx
deleted file mode 100644
index b5847ba21e..0000000000
--- a/connectivity/source/drivers/jdbc/JStatement.cxx
+++ /dev/null
@@ -1,831 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "java/sql/JStatement.hxx"
-#include "java/sql/ResultSet.hxx"
-#include "java/sql/Connection.hxx"
-#include "java/sql/SQLWarning.hxx"
-#include "java/tools.hxx"
-#include "java/ContextClassLoader.hxx"
-#include <comphelper/property.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include "TConnection.hxx"
-#include <comphelper/types.hxx>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-
-#include "resource/jdbc_log.hrc"
-
-#include <algorithm>
-#include <string.h>
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace ::cppu;
-//------------------------------------------------------------------------------
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-//------------------------------------------------------------------------------
-//**************************************************************
-//************ Class: java.sql.Statement
-//**************************************************************
-
-jclass java_sql_Statement_Base::theClass = 0;
-
-// -------------------------------------------------------------------------
-java_sql_Statement_Base::java_sql_Statement_Base( JNIEnv * pEnv, java_sql_Connection& _rCon )
- :java_sql_Statement_BASE(m_aMutex)
- ,java_lang_Object( pEnv, NULL )
- ,OPropertySetHelper(java_sql_Statement_BASE::rBHelper)
- ,m_pConnection( &_rCon )
- ,m_aLogger( _rCon.getLogger(), java::sql::ConnectionLog::STATEMENT )
- ,m_nResultSetConcurrency(ResultSetConcurrency::READ_ONLY)
- ,m_nResultSetType(ResultSetType::FORWARD_ONLY)
- ,m_bEscapeProcessing(sal_True)
- ,rBHelper(java_sql_Statement_BASE::rBHelper)
-{
- m_pConnection->acquire();
-}
-
-//------------------------------------------------------------------------------
-java_sql_Statement_Base::~java_sql_Statement_Base()
-{
-}
-
-//------------------------------------------------------------------------------
-void SAL_CALL OStatement_BASE2::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- if ( object )
- {
- static jmethodID mID(NULL);
- callVoidMethod("close",mID);
- }
-
- ::comphelper::disposeComponent(m_xGeneratedStatement);
- if (m_pConnection)
- m_pConnection->release();
- m_pConnection = NULL;
-
- dispose_ChildImpl();
- java_sql_Statement_Base::disposing();
-}
-// -------------------------------------------------------------------------
-jclass java_sql_Statement_Base::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/sql/Statement");
- return theClass;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL java_sql_Statement_Base::disposing(void)
-{
- m_aLogger.log( LogLevel::FINE, STR_LOG_CLOSING_STATEMENT );
- java_sql_Statement_BASE::disposing();
- clearObject();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OStatement_BASE2::release() throw()
-{
- relase_ChildImpl();
-}
-
-// -------------------------------------------------------------------------
-Any SAL_CALL java_sql_Statement_Base::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- if ( m_pConnection && !m_pConnection->isAutoRetrievingEnabled() && rType == ::getCppuType( (const Reference< XGeneratedResultSet > *)0 ) )
- return Any();
- Any aRet( java_sql_Statement_BASE::queryInterface(rType) );
- return aRet.hasValue() ? aRet : OPropertySetHelper::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL java_sql_Statement_Base::getTypes( ) throw(RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const Reference< ::com::sun::star::beans::XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XFastPropertySet > *)0 ),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XPropertySet > *)0 ));
-
- Sequence< Type > aOldTypes = java_sql_Statement_BASE::getTypes();
- if ( m_pConnection && !m_pConnection->isAutoRetrievingEnabled() )
- {
- ::std::remove(aOldTypes.getArray(),aOldTypes.getArray() + aOldTypes.getLength(),
- ::getCppuType( (const Reference< XGeneratedResultSet > *)0 ));
- aOldTypes.realloc(aOldTypes.getLength() - 1);
- }
-
- return ::comphelper::concatSequences(aTypes.getTypes(),aOldTypes);
-}
-// -----------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL java_sql_Statement_Base::getGeneratedValues( ) throw (SQLException, RuntimeException)
-{
- m_aLogger.log( LogLevel::FINE, STR_LOG_GENERATED_VALUES );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- jobject out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- // initialize temporary Variable
- try
- {
- static jmethodID mID(NULL);
- out = callResultSetMethod(t.env(),"getGeneratedKeys",mID);
- }
- catch(const SQLException&)
- {
- // ignore
- }
-
- Reference< XResultSet > xRes;
- if ( !out )
- {
- OSL_ENSURE( m_pConnection && m_pConnection->isAutoRetrievingEnabled(),"Illegal call here. isAutoRetrievingEnabled is false!");
- if ( m_pConnection )
- {
- ::rtl::OUString sStmt = m_pConnection->getTransformedGeneratedStatement(m_sSqlStatement);
- if ( sStmt.getLength() )
- {
- m_aLogger.log( LogLevel::FINER, STR_LOG_GENERATED_VALUES_FALLBACK, sStmt );
- ::comphelper::disposeComponent(m_xGeneratedStatement);
- m_xGeneratedStatement = m_pConnection->createStatement();
- xRes = m_xGeneratedStatement->executeQuery(sStmt);
- }
- }
- }
- else
- xRes = new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection, this );
- return xRes;
-}
-
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_Statement_Base::cancel( ) throw(RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("cancel",mID);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_Statement_Base::close( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- if (java_sql_Statement_BASE::rBHelper.bDisposed)
- throw DisposedException();
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_Statement::clearBatch( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
-
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("clearBatch",mID);
- } //t.pEnv
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_Statement_Base::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTE_STATEMENT, sql );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- jboolean out(sal_False);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- createStatement(t.pEnv);
- m_sSqlStatement = sql;
- // initialize temporary Variable
- static const char * cSignature = "(Ljava/lang/String;)Z";
- static const char * cMethodName = "execute";
- // Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- // convert Parameter
- jdbc::LocalRef< jstring > str( t.env(), convertwchar_tToJavaString( t.pEnv, sql ) );
- {
- jdbc::ContextClassLoaderScope ccl( t.env(),
- m_pConnection ? m_pConnection->getDriverClassLoader() : jdbc::GlobalRef< jobject >(),
- m_aLogger,
- *this
- );
-
- out = t.pEnv->CallBooleanMethod( object, mID, str.get() );
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
- } //t.pEnv
- return out;
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL java_sql_Statement_Base::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTE_QUERY, sql );
-
- jobject out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- createStatement(t.pEnv);
- m_sSqlStatement = sql;
- // initialize temporary variable
- static const char * cSignature = "(Ljava/lang/String;)Ljava/sql/ResultSet;";
- static const char * cMethodName = "executeQuery";
- // Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- // convert Parameter
- jdbc::LocalRef< jstring > str( t.env(), convertwchar_tToJavaString( t.pEnv, sql ) );
- {
- jdbc::ContextClassLoaderScope ccl( t.env(),
- m_pConnection ? m_pConnection->getDriverClassLoader() : jdbc::GlobalRef< jobject >(),
- m_aLogger,
- *this
- );
-
- out = t.pEnv->CallObjectMethod( object, mID, str.get() );
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
- } //t.pEnv
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_sql_ResultSet( t.pEnv, out, m_aLogger, *m_pConnection,this );
-}
-// -------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL java_sql_Statement_Base::getConnection( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- return (Reference< XConnection >)m_pConnection;
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL java_sql_Statement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ::cppu::queryInterface(rType,static_cast< XBatchExecution*> (this));
- return aRet.hasValue() ? aRet : java_sql_Statement_Base::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_Statement::addBatch( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethodWithStringArg("addBatch",mID,sql);
- } //t.pEnv
-}
-// -------------------------------------------------------------------------
-
-Sequence< sal_Int32 > SAL_CALL java_sql_Statement::executeBatch( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- Sequence< sal_Int32 > aSeq;
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jintArray out = (jintArray)callObjectMethod(t.pEnv,"executeBatch","()[I", mID);
- if (out)
- {
- jboolean p = sal_False;
- aSeq.realloc(t.pEnv->GetArrayLength(out));
- memcpy(aSeq.getArray(),t.pEnv->GetIntArrayElements(out,&p),aSeq.getLength());
- t.pEnv->DeleteLocalRef(out);
- }
- return aSeq;
-}
-// -------------------------------------------------------------------------
-
-
-sal_Int32 SAL_CALL java_sql_Statement_Base::executeUpdate( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTE_UPDATE, sql );
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- m_sSqlStatement = sql;
- static jmethodID mID(NULL);
- return callIntMethodWithStringArg("executeUpdate",mID,sql);
-}
-// -------------------------------------------------------------------------
-
-Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL java_sql_Statement_Base::getResultSet( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jobject out = callResultSetMethod(t.env(),"getResultSet",mID);
-
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_sql_ResultSet( t.pEnv, out, m_aLogger, *m_pConnection,this );
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL java_sql_Statement_Base::getUpdateCount( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- sal_Int32 out = callIntMethod("getUpdateCount",mID);
- m_aLogger.log( LogLevel::FINER, STR_LOG_UPDATE_COUNT, (sal_Int32)out );
- return out;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_Statement_Base::getMoreResults( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return callBooleanMethod( "getMoreResults", mID );
-}
-// -------------------------------------------------------------------------
-
-// -------------------------------------------------------------------------
-Any SAL_CALL java_sql_Statement_Base::getWarnings( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- SDBThreadAttach t;
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jobject out = callObjectMethod(t.pEnv,"getWarnings","()Ljava/sql/SQLWarning;", mID);
- // WARNING: the caller becomes the owner of the returned pointer
- if( out )
- {
- java_sql_SQLWarning_BASE warn_base( t.pEnv, out );
- return makeAny(
- static_cast< starsdbc::SQLException >(
- java_sql_SQLWarning(warn_base,*(::cppu::OWeakObject*)this)));
- }
-
- return Any();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_Statement_Base::clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t;
-
- {
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("clearWarnings",mID);
- }
-}
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_Statement_Base::getQueryTimeOut() throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_getProperty("getQueryTimeOut",mID);
-}
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_Statement_Base::getMaxRows() throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_getProperty("getMaxRows",mID);
-}
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_Statement_Base::getResultSetConcurrency() throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_getProperty("getResultSetConcurrency",mID,m_nResultSetConcurrency);
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_Statement_Base::getResultSetType() throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_getProperty("getResultSetType",mID,m_nResultSetType);
-}
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_Statement_Base::impl_getProperty(const char* _pMethodName, jmethodID& _inout_MethodID,sal_Int32 _nDefault)
-{
- sal_Int32 out = _nDefault;
- if ( object )
- out = callIntMethod(_pMethodName,_inout_MethodID,true);
-
- return out;
-}
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_Statement_Base::impl_getProperty(const char* _pMethodName, jmethodID& _inout_MethodID)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- return callIntMethod(_pMethodName,_inout_MethodID,true);
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_Statement_Base::getFetchDirection() throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_getProperty("getFetchDirection",mID);
-}
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_Statement_Base::getFetchSize() throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_getProperty("getFetchSize",mID);
-}
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_Statement_Base::getMaxFieldSize() throw(SQLException, RuntimeException)
-{
- static jmethodID mID(NULL);
- return impl_getProperty("getMaxFieldSize",mID);
-}
-//------------------------------------------------------------------------------
-::rtl::OUString java_sql_Statement_Base::getCursorName() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- try
- {
- return callStringMethod("getCursorName",mID);
- }
- catch(const SQLException&)
- {
- }
- return ::rtl::OUString();
-}
-//------------------------------------------------------------------------------
-void java_sql_Statement_Base::setQueryTimeOut(sal_Int32 _par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethodWithIntArg("setQueryTimeOut",mID,_par0,true);
-}
-
-//------------------------------------------------------------------------------
-void java_sql_Statement_Base::setEscapeProcessing(sal_Bool _par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- m_aLogger.log( LogLevel::FINE, STR_LOG_SET_ESCAPE_PROCESSING, _par0 );
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- m_bEscapeProcessing = _par0;
- createStatement( t.pEnv );
- static jmethodID mID(NULL);
- callVoidMethodWithBoolArg("setEscapeProcessing",mID,_par0,true);
-}
-
-//------------------------------------------------------------------------------
-void java_sql_Statement_Base::setMaxRows(sal_Int32 _par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethodWithIntArg("setMaxRows",mID,_par0,true);
-}
-//------------------------------------------------------------------------------
-void java_sql_Statement_Base::setResultSetConcurrency(sal_Int32 _par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- m_aLogger.log( LogLevel::FINE, STR_LOG_RESULT_SET_CONCURRENCY, (sal_Int32)_par0 );
- m_nResultSetConcurrency = _par0;
-
- clearObject();
-}
-//------------------------------------------------------------------------------
-void java_sql_Statement_Base::setResultSetType(sal_Int32 _par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- m_aLogger.log( LogLevel::FINE, STR_LOG_RESULT_SET_TYPE, (sal_Int32)_par0 );
- m_nResultSetType = _par0;
-
- clearObject();
-}
-//------------------------------------------------------------------------------
-void java_sql_Statement_Base::setFetchDirection(sal_Int32 _par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- m_aLogger.log( LogLevel::FINER, STR_LOG_FETCH_DIRECTION, (sal_Int32)_par0 );
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethodWithIntArg("setFetchDirection",mID,_par0,true);
-}
-//------------------------------------------------------------------------------
-void java_sql_Statement_Base::setFetchSize(sal_Int32 _par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- m_aLogger.log( LogLevel::FINER, STR_LOG_FETCH_SIZE, (sal_Int32)_par0 );
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethodWithIntArg("setFetchSize",mID,_par0,true);
-}
-//------------------------------------------------------------------------------
-void java_sql_Statement_Base::setMaxFieldSize(sal_Int32 _par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethodWithIntArg("setMaxFieldSize",mID,_par0,true);
-}
-//------------------------------------------------------------------------------
-void java_sql_Statement_Base::setCursorName(const ::rtl::OUString &_par0) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethodWithStringArg("setCursorName",mID,_par0);
- } //t.pEnv
-}
-
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* java_sql_Statement_Base::createArrayHelper( ) const
-{
- Sequence< Property > aProps(10);
- Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP0(CURSORNAME, ::rtl::OUString);
- DECL_BOOL_PROP0(ESCAPEPROCESSING);
- DECL_PROP0(FETCHDIRECTION,sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_PROP0(MAXFIELDSIZE,sal_Int32);
- DECL_PROP0(MAXROWS, sal_Int32);
- DECL_PROP0(QUERYTIMEOUT,sal_Int32);
- DECL_PROP0(RESULTSETCONCURRENCY,sal_Int32);
- DECL_PROP0(RESULTSETTYPE,sal_Int32);
- DECL_BOOL_PROP0(USEBOOKMARKS);
-
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & java_sql_Statement_Base::getInfoHelper()
-
-{
- return *const_cast<java_sql_Statement_Base*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool java_sql_Statement_Base::convertFastPropertyValue(
- Any & rConvertedValue,
- Any & rOldValue,
- sal_Int32 nHandle,
- const Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException)
-{
- switch(nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getQueryTimeOut());
- case PROPERTY_ID_MAXFIELDSIZE:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getMaxFieldSize());
- case PROPERTY_ID_MAXROWS:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getMaxRows());
- case PROPERTY_ID_CURSORNAME:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getCursorName());
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getResultSetConcurrency());
- case PROPERTY_ID_RESULTSETTYPE:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getResultSetType());
- case PROPERTY_ID_FETCHDIRECTION:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchDirection());
- case PROPERTY_ID_FETCHSIZE:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchSize());
- case PROPERTY_ID_ESCAPEPROCESSING:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bEscapeProcessing );
- case PROPERTY_ID_USEBOOKMARKS:
- // return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bAsLink);
- default:
- ;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void java_sql_Statement_Base::setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const Any& rValue
- )
- throw (Exception)
-{
- switch(nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- setQueryTimeOut(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_MAXFIELDSIZE:
- setMaxFieldSize(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_MAXROWS:
- setMaxRows(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_CURSORNAME:
- setCursorName(comphelper::getString(rValue));
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- setResultSetConcurrency(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- setResultSetType(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- setFetchDirection(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_FETCHSIZE:
- setFetchSize(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_ESCAPEPROCESSING:
- setEscapeProcessing( ::comphelper::getBOOL( rValue ) );
- break;
- case PROPERTY_ID_USEBOOKMARKS:
- // return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bAsLink);
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-void java_sql_Statement_Base::getFastPropertyValue(
- Any& rValue,
- sal_Int32 nHandle
- ) const
-{
- java_sql_Statement_Base* THIS = const_cast<java_sql_Statement_Base*>(this);
- try
- {
- switch(nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- rValue <<= THIS->getQueryTimeOut();
- break;
- case PROPERTY_ID_MAXFIELDSIZE:
- rValue <<= THIS->getMaxFieldSize();
- break;
- case PROPERTY_ID_MAXROWS:
- rValue <<= THIS->getMaxRows();
- break;
- case PROPERTY_ID_CURSORNAME:
- rValue <<= THIS->getCursorName();
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- rValue <<= THIS->getResultSetConcurrency();
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- rValue <<= THIS->getResultSetType();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- rValue <<= THIS->getFetchDirection();
- break;
- case PROPERTY_ID_FETCHSIZE:
- rValue <<= THIS->getFetchSize();
- break;
- case PROPERTY_ID_ESCAPEPROCESSING:
- rValue <<= (sal_Bool)m_bEscapeProcessing;
- break;
- case PROPERTY_ID_USEBOOKMARKS:
- default:
- ;
- }
- }
- catch(const Exception&)
- {
- }
-}
-// -------------------------------------------------------------------------
-jclass java_sql_Statement::theClass = 0;
-
-java_sql_Statement::~java_sql_Statement()
-{}
-
-jclass java_sql_Statement::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/sql/Statement");
- return theClass;
-}
-
-// -----------------------------------------------------------------------------
-void java_sql_Statement::createStatement(JNIEnv* _pEnv)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- if( _pEnv && !object ){
- // initialize temporary variable
- static const char * cSignature = "(II)Ljava/sql/Statement;";
- static const char * cMethodName = "createStatement";
- // Java-Call
- jobject out = NULL;
- static jmethodID mID(NULL);
- if ( !mID )
- mID = _pEnv->GetMethodID( m_pConnection->getMyClass(), cMethodName, cSignature );
- if( mID ){
- out = _pEnv->CallObjectMethod( m_pConnection->getJavaObject(), mID,m_nResultSetType,m_nResultSetConcurrency );
- } //mID
- else
- {
- static const char * cSignature2 = "()Ljava/sql/Statement;";
- static jmethodID mID2 = _pEnv->GetMethodID( m_pConnection->getMyClass(), cMethodName, cSignature2 );OSL_ENSURE(mID2,"Unknown method id!");
- if( mID2 ){
- out = _pEnv->CallObjectMethod( m_pConnection->getJavaObject(), mID2);
- } //mID
- }
- ThrowLoggedSQLException( m_aLogger, _pEnv, *this );
-
- if ( out )
- object = _pEnv->NewGlobalRef( out );
- } //_pEnv
-}
-// -----------------------------------------------------------------------------
-
-
-IMPLEMENT_SERVICE_INFO(java_sql_Statement,"com.sun.star.sdbcx.JStatement","com.sun.star.sdbc.Statement");
-// -----------------------------------------------------------------------------
-void SAL_CALL java_sql_Statement_Base::acquire() throw()
-{
- java_sql_Statement_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL java_sql_Statement_Base::release() throw()
-{
- java_sql_Statement_BASE::release();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL java_sql_Statement::acquire() throw()
-{
- OStatement_BASE2::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL java_sql_Statement::release() throw()
-{
- OStatement_BASE2::release();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL java_sql_Statement_Base::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx
deleted file mode 100644
index a78d8fe3de..0000000000
--- a/connectivity/source/drivers/jdbc/Object.cxx
+++ /dev/null
@@ -1,428 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include "java/lang/Class.hxx"
-#include "connectivity/CommonTools.hxx"
-#include <com/sun/star/uno/Exception.hpp>
-#include "java/tools.hxx"
-#include "java/sql/SQLException.hxx"
-#include <osl/mutex.hxx>
-#include <osl/thread.h>
-#include <com/sun/star/uno/Sequence.hxx>
-#include "java/LocalRef.hxx"
-#include "resource/jdbc_log.hrc"
-#include <rtl/logfile.hxx>
-#include <comphelper/logging.hxx>
-
-#include <memory>
-
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-
-// -----------------------------------------------------------------------------
-::rtl::Reference< jvmaccess::VirtualMachine > getJavaVM2(const ::rtl::Reference< jvmaccess::VirtualMachine >& _rVM = ::rtl::Reference< jvmaccess::VirtualMachine >(),
- sal_Bool _bSet = sal_False)
-{
- static ::rtl::Reference< jvmaccess::VirtualMachine > s_VM;
- if ( _rVM.is() || _bSet )
- s_VM = _rVM;
- return s_VM;
-}
-// -----------------------------------------------------------------------------
-::rtl::Reference< jvmaccess::VirtualMachine > java_lang_Object::getVM(const Reference<XMultiServiceFactory >& _rxFactory)
-{
- ::rtl::Reference< jvmaccess::VirtualMachine > xVM = getJavaVM2();
- if ( !xVM.is() && _rxFactory.is() )
- xVM = getJavaVM2(::connectivity::getJavaVM(_rxFactory));
-
- return xVM;
-}
-// -----------------------------------------------------------------------------
-SDBThreadAttach::SDBThreadAttach()
- : m_aGuard(java_lang_Object::getVM())
- , pEnv(NULL)
-{
- pEnv = m_aGuard.getEnvironment();
- OSL_ENSURE(pEnv,"Environment is nULL!");
-}
-// -----------------------------------------------------------------------------
-SDBThreadAttach::~SDBThreadAttach()
-{
-}
-// -----------------------------------------------------------------------------
-oslInterlockedCount& getJavaVMRefCount()
-{
- static oslInterlockedCount s_nRefCount = 0;
- return s_nRefCount;
-}
-// -----------------------------------------------------------------------------
-void SDBThreadAttach::addRef()
-{
- osl_incrementInterlockedCount(&getJavaVMRefCount());
-}
-// -----------------------------------------------------------------------------
-void SDBThreadAttach::releaseRef()
-{
- osl_decrementInterlockedCount(&getJavaVMRefCount());
- if ( getJavaVMRefCount() == 0 )
- {
- getJavaVM2(::rtl::Reference< jvmaccess::VirtualMachine >(),sal_True);
- }
-}
-// -----------------------------------------------------------------------------
-// static variables of the class
-jclass java_lang_Object::theClass = 0;
-
-jclass java_lang_Object::getMyClass() const
-{
- if( !theClass )
- theClass = findMyClass("java/lang/Object");
- return theClass;
-}
-// the actual constructor
-java_lang_Object::java_lang_Object(const Reference<XMultiServiceFactory >& _rxFactory)
- : m_xFactory(_rxFactory),object( 0 )
-{
- SDBThreadAttach::addRef();
-}
-
-// the protected-constructor for the derived classes
-java_lang_Object::java_lang_Object( JNIEnv * pXEnv, jobject myObj )
- : object( NULL )
-{
- SDBThreadAttach::addRef();
- if( pXEnv && myObj )
- object = pXEnv->NewGlobalRef( myObj );
-}
-
-java_lang_Object::~java_lang_Object()
-{
- if( object )
- {
- SDBThreadAttach t;
- clearObject(*t.pEnv);
- }
- SDBThreadAttach::releaseRef();
-}
-void java_lang_Object::clearObject(JNIEnv& rEnv)
-{
- if( object )
- {
- rEnv.DeleteGlobalRef( object );
- object = NULL;
- }
-}
-
-void java_lang_Object::clearObject()
-{
- if( object )
- {
- SDBThreadAttach t;
- clearObject(*t.pEnv);
- }
-}
-// the protected-constructor for the derived classes
-void java_lang_Object::saveRef( JNIEnv * pXEnv, jobject myObj )
-{
- OSL_ENSURE( myObj, "object in c++ -> Java Wrapper" );
- if( myObj )
- object = pXEnv->NewGlobalRef( myObj );
-}
-
-
-::rtl::OUString java_lang_Object::toString() const
-{
- static jmethodID mID(NULL);
- return callStringMethod("toString",mID);
-}
-
-// --------------------------------------------------------------------------------
-namespace
-{
- bool lcl_translateJNIExceptionToUNOException(
- JNIEnv* _pEnvironment, const Reference< XInterface >& _rxContext, SQLException& _out_rException )
- {
- jthrowable jThrow = _pEnvironment ? _pEnvironment->ExceptionOccurred() : NULL;
- if ( !jThrow )
- return false;
-
- _pEnvironment->ExceptionClear();
- // we have to clear the exception here because we want to handle it itself
-
- if ( _pEnvironment->IsInstanceOf( jThrow, java_sql_SQLException_BASE::st_getMyClass() ) )
- {
- ::std::auto_ptr< java_sql_SQLException_BASE > pException( new java_sql_SQLException_BASE( _pEnvironment, jThrow ) );
- _out_rException = SQLException( pException->getMessage(), _rxContext,
- pException->getSQLState(), pException->getErrorCode(), Any() );
- return true;
- }
- else if ( _pEnvironment->IsInstanceOf( jThrow, java_lang_Throwable::st_getMyClass() ) )
- {
- ::std::auto_ptr< java_lang_Throwable > pThrow( new java_lang_Throwable( _pEnvironment, jThrow ) );
- ::rtl::OUString sMessage = pThrow->getMessage();
- if ( !sMessage.getLength() )
- sMessage = pThrow->getLocalizedMessage();
- if( !sMessage.getLength() )
- sMessage = pThrow->toString();
- _out_rException = SQLException( sMessage, _rxContext, ::rtl::OUString(), -1, Any() );
- return true;
- }
- else
- _pEnvironment->DeleteLocalRef( jThrow );
- return false;
- }
-}
-
-// --------------------------------------------------------------------------------
-void java_lang_Object::ThrowLoggedSQLException( const ::comphelper::ResourceBasedEventLogger& _rLogger, JNIEnv* _pEnvironment,
- const Reference< XInterface >& _rxContext )
-{
- SQLException aException;
- if ( lcl_translateJNIExceptionToUNOException( _pEnvironment, _rxContext, aException ) )
- {
- _rLogger.log( ::com::sun::star::logging::LogLevel::SEVERE, STR_LOG_THROWING_EXCEPTION, aException.Message, aException.SQLState, aException.ErrorCode );
- throw aException;
- }
-}
-
-// --------------------------------------------------------------------------------
-void java_lang_Object::ThrowSQLException( JNIEnv* _pEnvironment, const Reference< XInterface>& _rxContext )
-{
- SQLException aException;
- if ( lcl_translateJNIExceptionToUNOException( _pEnvironment, _rxContext, aException ) )
- throw aException;
-}
-// -----------------------------------------------------------------------------
-void java_lang_Object::obtainMethodId(JNIEnv* _pEnv,const char* _pMethodName, const char* _pSignature,jmethodID& _inout_MethodID) const
-{
- if ( !_inout_MethodID )
- {
- _inout_MethodID = _pEnv->GetMethodID( getMyClass(), _pMethodName, _pSignature );
- OSL_ENSURE( _inout_MethodID, _pSignature );
- if ( !_inout_MethodID )
- throw SQLException();
- } // if ( !_inout_MethodID )
-}
-// -----------------------------------------------------------------------------
-sal_Bool java_lang_Object::callBooleanMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) const
-{
- jboolean out( sal_False );
-
- SDBThreadAttach t;
- OSL_ENSURE( t.pEnv, "java_lang_Object::callBooleanMethod: no Java enviroment anymore!" );
- obtainMethodId(t.pEnv, _pMethodName,"()Z", _inout_MethodID);
- // call method
- out = t.pEnv->CallBooleanMethod( object, _inout_MethodID );
- ThrowSQLException( t.pEnv, NULL );
-
- return out;
-}
-// -----------------------------------------------------------------------------
-sal_Bool java_lang_Object::callBooleanMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const
-{
- jboolean out( sal_False );
- SDBThreadAttach t;
- OSL_ENSURE( t.pEnv, "java_lang_Object::callBooleanMethodWithIntArg: no Java enviroment anymore!" );
- obtainMethodId(t.pEnv, _pMethodName,"(I)Z", _inout_MethodID);
- // call method
- out = t.pEnv->CallBooleanMethod( object, _inout_MethodID, _nArgument );
- ThrowSQLException( t.pEnv, NULL );
-
- return out;
-}
-// -------------------------------------------------------------------------
-jobject java_lang_Object::callResultSetMethod( JNIEnv& _rEnv,const char* _pMethodName, jmethodID& _inout_MethodID ) const
-{
- // call method
- jobject out = callObjectMethod(&_rEnv,_pMethodName,"()Ljava/sql/ResultSet;", _inout_MethodID);
- return out;
-}
-// -------------------------------------------------------------------------
-sal_Int32 java_lang_Object::callIntMethod( const char* _pMethodName, jmethodID& _inout_MethodID,bool _bIgnoreException ) const
-{
- SDBThreadAttach t;
- OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java enviroment anymore!" );
- obtainMethodId(t.pEnv, _pMethodName,"()I", _inout_MethodID);
-
- // call method
- jint out( t.pEnv->CallIntMethod( object, _inout_MethodID ) );
- if ( _bIgnoreException )
- isExceptionOccurred(t.pEnv,sal_True);
- else
- ThrowSQLException( t.pEnv, NULL );
-
- return (sal_Int32)out;
-}
-// -------------------------------------------------------------------------
-sal_Int32 java_lang_Object::callIntMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID,sal_Int32 _nArgument ) const
-{
- SDBThreadAttach t;
- OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java enviroment anymore!" );
- obtainMethodId(t.pEnv, _pMethodName,"(I)I", _inout_MethodID);
- // call method
- jint out( t.pEnv->CallIntMethod( object, _inout_MethodID , _nArgument) );
- ThrowSQLException( t.pEnv, NULL );
-
- return (sal_Int32)out;
-}
-// -------------------------------------------------------------------------
-void java_lang_Object::callVoidMethod( const char* _pMethodName, jmethodID& _inout_MethodID) const
-{
- SDBThreadAttach t;
- OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java enviroment anymore!" );
- obtainMethodId(t.pEnv, _pMethodName,"()V", _inout_MethodID);
-
- // call method
- t.pEnv->CallVoidMethod( object, _inout_MethodID );
- ThrowSQLException( t.pEnv, NULL );
-}
-// -------------------------------------------------------------------------
-void java_lang_Object::callVoidMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument,bool _bIgnoreException ) const
-{
- SDBThreadAttach t;
- OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java enviroment anymore!" );
- obtainMethodId(t.pEnv, _pMethodName,"(I)V", _inout_MethodID);
-
- // call method
- t.pEnv->CallVoidMethod( object, _inout_MethodID,_nArgument );
- if ( _bIgnoreException )
- isExceptionOccurred(t.pEnv,sal_True);
- else
- ThrowSQLException( t.pEnv, NULL );
-}
-// -------------------------------------------------------------------------
-void java_lang_Object::callVoidMethodWithBoolArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument,bool _bIgnoreException ) const
-{
- SDBThreadAttach t;
- OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java enviroment anymore!" );
- obtainMethodId(t.pEnv, _pMethodName,"(Z)V", _inout_MethodID);
- // call method
- t.pEnv->CallVoidMethod( object, _inout_MethodID,_nArgument );
- if ( _bIgnoreException )
- isExceptionOccurred(t.pEnv,sal_True);
- else
- ThrowSQLException( t.pEnv, NULL );
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString java_lang_Object::callStringMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) const
-{
- SDBThreadAttach t;
- OSL_ENSURE( t.pEnv, "java_lang_Object::callStringMethod: no Java enviroment anymore!" );
-
- // call method
- jstring out = (jstring)callObjectMethod(t.pEnv,_pMethodName,"()Ljava/lang/String;", _inout_MethodID);
- return JavaString2String( t.pEnv, out );
-}
-// -----------------------------------------------------------------------------
-jobject java_lang_Object::callObjectMethod( JNIEnv * _pEnv,const char* _pMethodName,const char* _pSignature, jmethodID& _inout_MethodID ) const
-{
- // obtain method ID
- obtainMethodId(_pEnv, _pMethodName,_pSignature, _inout_MethodID);
- // call method
- jobject out = _pEnv->CallObjectMethod( object, _inout_MethodID);
- ThrowSQLException( _pEnv, NULL );
- return out;
-}
-
-// -----------------------------------------------------------------------------
-jobject java_lang_Object::callObjectMethodWithIntArg( JNIEnv * _pEnv,const char* _pMethodName,const char* _pSignature, jmethodID& _inout_MethodID , sal_Int32 _nArgument) const
-{
- obtainMethodId(_pEnv, _pMethodName,_pSignature, _inout_MethodID);
- // call method
- jobject out = _pEnv->CallObjectMethod( object, _inout_MethodID,_nArgument );
- ThrowSQLException( _pEnv, NULL );
- return out;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString java_lang_Object::callStringMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID , sal_Int32 _nArgument) const
-{
- SDBThreadAttach t;
- OSL_ENSURE( t.pEnv, "java_lang_Object::callStringMethod: no Java enviroment anymore!" );
- jstring out = (jstring)callObjectMethodWithIntArg(t.pEnv,_pMethodName,"(I)Ljava/lang/String;",_inout_MethodID,_nArgument);
- return JavaString2String( t.pEnv, out );
-}
-// -------------------------------------------------------------------------
-void java_lang_Object::callVoidMethodWithStringArg( const char* _pMethodName, jmethodID& _inout_MethodID,const ::rtl::OUString& _nArgument ) const
-{
- SDBThreadAttach t;
- OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java enviroment anymore!" );
- obtainMethodId(t.pEnv, _pMethodName,"(Ljava/lang/String;)V", _inout_MethodID);
-
- jdbc::LocalRef< jstring > str( t.env(),convertwchar_tToJavaString(t.pEnv,_nArgument));
- // call method
- t.pEnv->CallVoidMethod( object, _inout_MethodID , str.get());
- ThrowSQLException( t.pEnv, NULL );
-}
-// -------------------------------------------------------------------------
-sal_Int32 java_lang_Object::callIntMethodWithStringArg( const char* _pMethodName, jmethodID& _inout_MethodID,const ::rtl::OUString& _nArgument ) const
-{
- SDBThreadAttach t;
- OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethodWithStringArg: no Java enviroment anymore!" );
- obtainMethodId(t.pEnv, _pMethodName,"(Ljava/lang/String;)I", _inout_MethodID);
-
- //TODO: Check if the code below is needed
- //jdbc::LocalRef< jstring > str( t.env(), convertwchar_tToJavaString( t.pEnv, sql ) );
- //{
- // jdbc::ContextClassLoaderScope ccl( t.env(),
- // m_pConnection ? m_pConnection->getDriverClassLoader() : jdbc::GlobalRef< jobject >(),
- // m_aLogger,
- // *this
- // );
-
- jdbc::LocalRef< jstring > str( t.env(),convertwchar_tToJavaString(t.pEnv,_nArgument));
- // call method
- jint out = t.pEnv->CallIntMethod( object, _inout_MethodID , str.get());
- ThrowSQLException( t.pEnv, NULL );
- return (sal_Int32)out;
-}
-// -----------------------------------------------------------------------------
-jclass java_lang_Object::findMyClass(const char* _pClassName)
-{
- // the class must be fetched only once, therefore static
- SDBThreadAttach t;
- jclass tempClass = t.pEnv->FindClass(_pClassName); OSL_ENSURE(tempClass,"Java : FindClass nicht erfolgreich!");
- if(!tempClass)
- {
- t.pEnv->ExceptionDescribe();
- t.pEnv->ExceptionClear();
- }
- jclass globClass = (jclass)t.pEnv->NewGlobalRef( tempClass );
- t.pEnv->DeleteLocalRef( tempClass );
- return globClass;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/PreparedStatement.cxx b/connectivity/source/drivers/jdbc/PreparedStatement.cxx
deleted file mode 100644
index 5c112dd70e..0000000000
--- a/connectivity/source/drivers/jdbc/PreparedStatement.cxx
+++ /dev/null
@@ -1,668 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/PreparedStatement.hxx"
-#include "java/sql/ResultSet.hxx"
-#include "java/sql/ResultSetMetaData.hxx"
-#include "java/sql/Connection.hxx"
-#include "java/sql/Timestamp.hxx"
-#include "java/math/BigDecimal.hxx"
-#include "java/tools.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/FValue.hxx"
-#include "connectivity/dbexception.hxx"
-#include "resource/jdbc_log.hrc"
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-#include "java/LocalRef.hxx"
-#include <string.h>
-
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-//**************************************************************
-//************ Class: java.sql.PreparedStatement
-//**************************************************************
-IMPLEMENT_SERVICE_INFO(java_sql_PreparedStatement,"com.sun.star.sdbcx.JPreparedStatement","com.sun.star.sdbc.PreparedStatement");
-
-java_sql_PreparedStatement::java_sql_PreparedStatement( JNIEnv * pEnv, java_sql_Connection& _rCon, const ::rtl::OUString& sql )
- : OStatement_BASE2( pEnv, _rCon )
-{
- m_sSqlStatement = sql;
-}
-// -----------------------------------------------------------------------------
-jclass java_sql_PreparedStatement::theClass = 0;
-
-java_sql_PreparedStatement::~java_sql_PreparedStatement()
-{
-}
-// -----------------------------------------------------------------------------
-
-jclass java_sql_PreparedStatement::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/sql/PreparedStatement");
- return theClass;
-}
-// -------------------------------------------------------------------------
-
-::com::sun::star::uno::Any SAL_CALL java_sql_PreparedStatement::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Any aRet = OStatement_BASE2::queryInterface(rType);
- return aRet.hasValue() ? aRet : ::cppu::queryInterface( rType,
- static_cast< XPreparedStatement*>(this),
- static_cast< XParameters*>(this),
- static_cast< XResultSetMetaDataSupplier*>(this),
- static_cast< XPreparedBatchExecution*>(this));
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL java_sql_PreparedStatement::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const ::com::sun::star::uno::Reference< XPreparedStatement > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< XParameters > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< XResultSetMetaDataSupplier > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< XPreparedBatchExecution > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_BASE2::getTypes());
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_PreparedStatement::execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTING_PREPARED );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- static jmethodID mID(NULL);
- return callBooleanMethod( "execute", mID );
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL java_sql_PreparedStatement::executeUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTING_PREPARED_UPDATE );
- static jmethodID mID(NULL);
- return callIntMethod("executeUpdate",mID);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- m_aLogger.log( LogLevel::FINER, STR_LOG_STRING_PARAMETER, parameterIndex, x );
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- { // initialize temporary Variable
- createStatement(t.pEnv);
- static const char * cSignature = "(ILjava/lang/String;)V";
- static const char * cMethodName = "setString";
- // Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- jdbc::LocalRef< jstring > str( t.env(),convertwchar_tToJavaString(t.pEnv,x));
- t.pEnv->CallVoidMethod( object, mID, parameterIndex,str.get());
- // and clean up
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //t.pEnv
-}
-// -------------------------------------------------------------------------
-
-::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL java_sql_PreparedStatement::getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return (Reference< XConnection >)m_pConnection;
-}
-// -------------------------------------------------------------------------
-
-::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL java_sql_PreparedStatement::executeQuery( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTING_PREPARED_QUERY );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jobject out = callResultSetMethod(t.env(),"executeQuery",mID);
-
- return out==0 ? 0 : new java_sql_ResultSet( t.pEnv, out, m_aLogger, *m_pConnection,this);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_BOOLEAN_PARAMETER, parameterIndex, x );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("setBoolean", "(IZ)V", mID, parameterIndex, x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_BYTE_PARAMETER, parameterIndex, (sal_Int32)x );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("setByte", "(IB)V", mID, parameterIndex, x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_DATE_PARAMETER, parameterIndex, x );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- java_sql_Date aT(x);
- static jmethodID mID(NULL);
- callVoidMethod("setDate", "(ILjava/sql/Date;)V", mID, parameterIndex, aT.getJavaObject());
-}
-// -------------------------------------------------------------------------
-
-
-void SAL_CALL java_sql_PreparedStatement::setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_TIME_PARAMETER, parameterIndex, x );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- java_sql_Time aT(x);
- static jmethodID mID(NULL);
- callVoidMethod("setTime", "(ILjava/sql/Time;)V", mID, parameterIndex, aT.getJavaObject());
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_TIMESTAMP_PARAMETER, parameterIndex, x );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- java_sql_Timestamp aD(x);
- callVoidMethod("setTimestamp", "(ILjava/sql/Timestamp;)V", mID, parameterIndex, aD.getJavaObject());
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_PreparedStatement::setDouble( sal_Int32 parameterIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_DOUBLE_PARAMETER, parameterIndex, x );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("setDouble", "(ID)V", mID, parameterIndex, x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_FLOAT_PARAMETER, parameterIndex, x );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("setFloat", "(IF)V", mID, parameterIndex, x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_INT_PARAMETER, parameterIndex, x );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("setInt", "(II)V", mID, parameterIndex, x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_LONG_PARAMETER, parameterIndex, x );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("setLong", "(IJ)V", mID, parameterIndex, x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_NULL_PARAMETER, parameterIndex, sqlType );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("setNull", "(II)V", mID, parameterIndex, sqlType);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setClob( sal_Int32 /*parameterIndex*/, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& /*x*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setClob", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setBlob( sal_Int32 /*parameterIndex*/, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& /*x*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setBlob", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setArray( sal_Int32 /*parameterIndex*/, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& /*x*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setArray", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setRef( sal_Int32 /*parameterIndex*/, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef >& /*x*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setRef", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_OBJECT_NULL_PARAMETER, parameterIndex );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- createStatement(t.pEnv);
-
- // initialize temporary Variable
- static const char * cSignature = "(ILjava/lang/Object;II)V";
- static const char * cMethodName = "setObject";
- // Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- {
- jobject obj = NULL;
- double nTemp = 0.0;
- switch(targetSqlType)
- {
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- {
- ::std::auto_ptr<java_math_BigDecimal> pBigDecimal;
- if ( x >>= nTemp)
- {
- pBigDecimal.reset(new java_math_BigDecimal(nTemp));
- //setDouble(parameterIndex,nTemp);
- //return;
- }
- else
- {
- ORowSetValue aValue;
- aValue.fill(x);
- const ::rtl::OUString sValue = aValue;
- if ( sValue.getLength() )
- pBigDecimal.reset(new java_math_BigDecimal(sValue));
- else
- pBigDecimal.reset(new java_math_BigDecimal(0.0));
- }
- //obj = convertwchar_tToJavaString(t.pEnv,::comphelper::getString(x));
- t.pEnv->CallVoidMethod( object, mID, parameterIndex,pBigDecimal->getJavaObject(),targetSqlType,scale);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- return;
- }
- default:
- obj = convertwchar_tToJavaString(t.pEnv,::comphelper::getString(x));
- break;
- }
- t.pEnv->CallVoidMethod( object, mID, parameterIndex,obj,targetSqlType,scale);
- t.pEnv->DeleteLocalRef(obj);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- // and clean up
- } //mID
- } //t.pEnv
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/, const ::rtl::OUString& /*typeName*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_OBJECT_NULL_PARAMETER, parameterIndex );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod<jobject>("setObject", "(ILjava/lang/Object;)V", mID, parameterIndex, NULL);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setObject( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- if(!::dbtools::implSetObject(this,parameterIndex,x))
- {
- const ::rtl::OUString sError( m_pConnection->getResources().getResourceStringWithSubstitution(
- STR_UNKNOWN_PARA_TYPE,
- "$position$", ::rtl::OUString::valueOf(parameterIndex)
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_SHORT_PARAMETER, parameterIndex, x );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("setShort", "(IS)V", mID, parameterIndex, x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setBytes( sal_Int32 parameterIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_BYTES_PARAMETER, parameterIndex );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- createStatement(t.pEnv);
-
- // initialize temporary Variable
- static const char * cSignature = "(I[B)V";
- static const char * cMethodName = "setBytes";
- // Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- jbyteArray pByteArray = t.pEnv->NewByteArray(x.getLength());
- t.pEnv->SetByteArrayRegion(pByteArray,0,x.getLength(),(jbyte*)x.getConstArray());
- t.pEnv->CallVoidMethod( object, mID, parameterIndex,pByteArray);
- t.pEnv->DeleteLocalRef(pByteArray);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //t.pEnv
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setCharacterStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_CHARSTREAM_PARAMETER, parameterIndex );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- createStatement(t.pEnv);
-
- // initialize temporary variable
- static const char * cSignature = "(ILjava/io/InputStream;I)V";
- static const char * cMethodName = "setCharacterStream";
- // Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- Sequence< sal_Int8 > aSeq;
- if ( x.is() )
- x->readBytes( aSeq, length );
- sal_Int32 actualLength = aSeq.getLength();
-
- jvalue args2[3];
- jbyteArray pByteArray = t.pEnv->NewByteArray( actualLength );
- t.pEnv->SetByteArrayRegion(pByteArray,0,actualLength,(jbyte*)aSeq.getConstArray());
- args2[0].l = pByteArray;
- args2[1].i = 0;
- args2[2].i = actualLength;
- // initialize temporary variable
- const char * cSignatureStream = "([BII)V";
- // Java-Call
- jclass aClass = t.pEnv->FindClass("java/io/CharArrayInputStream");
- static jmethodID mID2 = NULL;
- if ( !mID2 )
- mID2 = t.pEnv->GetMethodID( aClass, "<init>", cSignatureStream );
- jobject tempObj = NULL;
- if(mID2)
- tempObj = t.pEnv->NewObjectA( aClass, mID2, args2 );
-
- t.pEnv->CallVoidMethod( object, mID, parameterIndex,tempObj,actualLength);
- // and clean up
- t.pEnv->DeleteLocalRef(pByteArray);
- t.pEnv->DeleteLocalRef(tempObj);
- t.pEnv->DeleteLocalRef(aClass);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //t.pEnv
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::setBinaryStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_BINARYSTREAM_PARAMETER, parameterIndex );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- createStatement(t.pEnv);
- // initialize temporary variable
- static const char * cSignature = "(ILjava/io/InputStream;I)V";
- static const char * cMethodName = "setBinaryStream";
- // Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- {
- Sequence< sal_Int8 > aSeq;
- if ( x.is() )
- x->readBytes( aSeq, length );
- sal_Int32 actualLength = aSeq.getLength();
-
- jvalue args2[3];
- jbyteArray pByteArray = t.pEnv->NewByteArray(actualLength);
- t.pEnv->SetByteArrayRegion(pByteArray,0,actualLength,(jbyte*)aSeq.getConstArray());
- args2[0].l = pByteArray;
- args2[1].i = 0;
- args2[2].i = (sal_Int32)actualLength;
-
- // initialize temporary variable
- const char * cSignatureStream = "([BII)V";
- // Java-Call
- jclass aClass = t.pEnv->FindClass("java/io/ByteArrayInputStream");
- static jmethodID mID2 = NULL;
- if ( !mID2 )
- mID2 = t.pEnv->GetMethodID( aClass, "<init>", cSignatureStream );
- jobject tempObj = NULL;
- if(mID2)
- tempObj = t.pEnv->NewObjectA( aClass, mID2, args2 );
- t.pEnv->CallVoidMethod( object, mID, parameterIndex,tempObj,(sal_Int32)actualLength);
- // and clean up
- t.pEnv->DeleteLocalRef(pByteArray);
- t.pEnv->DeleteLocalRef(tempObj);
- t.pEnv->DeleteLocalRef(aClass);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
- } //t.pEnv
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::clearParameters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- m_aLogger.log( LogLevel::FINER, STR_LOG_CLEAR_PARAMETERS );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- SDBThreadAttach t;
- {
- createStatement(t.pEnv);
-
- static jmethodID mID(NULL);
- callVoidMethod("clearParameters",mID);
- } //t.pEnv
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_PreparedStatement::clearBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("clearBatch",mID);
- } //t.pEnv
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_PreparedStatement::addBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- callVoidMethod("addBatch",mID);
- } //t.pEnv
-}
-// -------------------------------------------------------------------------
-
-::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL java_sql_PreparedStatement::executeBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- ::com::sun::star::uno::Sequence< sal_Int32 > aSeq;
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jintArray out = (jintArray)callObjectMethod(t.pEnv,"executeBatch","()[I", mID);
- if(out)
- {
- jboolean p = sal_False;
- aSeq.realloc(t.pEnv->GetArrayLength(out));
- memcpy(aSeq.getArray(),t.pEnv->GetIntArrayElements(out,&p),aSeq.getLength());
- t.pEnv->DeleteLocalRef(out);
- }
- return aSeq;
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL java_sql_PreparedStatement::getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- createStatement(t.pEnv);
- static jmethodID mID(NULL);
- jobject out = callObjectMethod(t.pEnv,"getMetaData","()Ljava/sql/ResultSetMetaData;", mID);
-
- return out==0 ? 0 : new java_sql_ResultSetMetaData( t.pEnv, out, m_aLogger,*m_pConnection );
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL java_sql_PreparedStatement::acquire() throw()
-{
- OStatement_BASE2::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL java_sql_PreparedStatement::release() throw()
-{
- OStatement_BASE2::release();
-}
-// -----------------------------------------------------------------------------
-void java_sql_PreparedStatement::createStatement(JNIEnv* _pEnv)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
-
- if( !object && _pEnv ){
- // initialize temporary variable
- static const char * cSignature = "(Ljava/lang/String;II)Ljava/sql/PreparedStatement;";
- static const char * cMethodName = "prepareStatement";
-
- jvalue args[1];
- // convert Parameter
- args[0].l = convertwchar_tToJavaString(_pEnv,m_sSqlStatement);
- // Java-Call
- jobject out = NULL;
- static jmethodID mID(NULL);
- if ( !mID )
- mID = _pEnv->GetMethodID( m_pConnection->getMyClass(), cMethodName, cSignature );
- if( mID )
- {
- out = _pEnv->CallObjectMethod( m_pConnection->getJavaObject(), mID, args[0].l ,m_nResultSetType,m_nResultSetConcurrency);
- }
- else
- {
- static const char * cSignature2 = "(Ljava/lang/String;)Ljava/sql/PreparedStatement;";
- static jmethodID mID2 = NULL;
- if ( !mID2)
- mID2 = _pEnv->GetMethodID( m_pConnection->getMyClass(), cMethodName, cSignature2 );OSL_ENSURE(mID,"Unknown method id!");
- if ( mID2 )
- out = _pEnv->CallObjectMethod( m_pConnection->getJavaObject(), mID2, args[0].l );
- }
- _pEnv->DeleteLocalRef((jstring)args[0].l);
- ThrowLoggedSQLException( m_aLogger, _pEnv, *this );
- if ( out )
- object = _pEnv->NewGlobalRef( out );
- } //t.pEnv
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/Reader.cxx b/connectivity/source/drivers/jdbc/Reader.cxx
deleted file mode 100644
index 9998b6c87d..0000000000
--- a/connectivity/source/drivers/jdbc/Reader.cxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/io/Reader.hxx"
-#include <string.h>
-using namespace connectivity;
-
-//**************************************************************
-//************ Class: java.io.Reader
-//**************************************************************
-
-jclass java_io_Reader::theClass = 0;
-java_io_Reader::java_io_Reader( JNIEnv * pEnv, jobject myObj )
- : java_lang_Object( pEnv, myObj )
-{
- SDBThreadAttach::addRef();
-}
-java_io_Reader::~java_io_Reader()
-{
- SDBThreadAttach::releaseRef();
-}
-
-jclass java_io_Reader::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/io/Reader");
- return theClass;
-}
-
-sal_Int32 SAL_CALL java_io_Reader::readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- return readBytes(aData,nMaxBytesToRead);
-}
-
-void SAL_CALL java_io_Reader::skipBytes( sal_Int32 nBytesToSkip ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- static jmethodID mID(NULL);
- callIntMethodWithIntArg("skip",mID,nBytesToSkip);
-}
-
-sal_Int32 SAL_CALL java_io_Reader::available( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- jboolean out(sal_False);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- static const char * cSignature = "()Z";
- static const char * cMethodName = "available";
- // Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- out = t.pEnv->CallBooleanMethod( object, mID);
- ThrowSQLException(t.pEnv,*this);
- } //t.pEnv
- return out;
-}
-
-void SAL_CALL java_io_Reader::closeInput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- static jmethodID mID(NULL);
- callVoidMethod("close",mID);
-}
-// -----------------------------------------------------
-sal_Int32 SAL_CALL java_io_Reader::readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- OSL_ENSURE(aData.getLength() < nBytesToRead," Sequence is smaller than BytesToRead");
- jint out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
-
- {
- jcharArray pCharArray = t.pEnv->NewCharArray(nBytesToRead);
- static const char * cSignature = "([CII)I";
- static const char * cMethodName = "read";
- // Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- out = t.pEnv->CallIntMethod( object, mID, pCharArray, 0, nBytesToRead );
- if ( !out )
- ThrowSQLException(t.pEnv,*this);
- if(out > 0)
- {
- jboolean p = sal_False;
- if(aData.getLength() < out)
- aData.realloc(out-aData.getLength());
-
- memcpy(aData.getArray(),t.pEnv->GetCharArrayElements(pCharArray,&p),out);
- }
- t.pEnv->DeleteLocalRef((jcharArray)pCharArray);
- } //t.pEnv
- return out;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/Ref.cxx b/connectivity/source/drivers/jdbc/Ref.cxx
deleted file mode 100644
index ad49a24f76..0000000000
--- a/connectivity/source/drivers/jdbc/Ref.cxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/Ref.hxx"
-#include "java/tools.hxx"
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.sql.Ref
-//**************************************************************
-
-jclass java_sql_Ref::theClass = 0;
-java_sql_Ref::java_sql_Ref( JNIEnv * pEnv, jobject myObj )
-: java_lang_Object( pEnv, myObj )
-{
- SDBThreadAttach::addRef();
-}
-java_sql_Ref::~java_sql_Ref()
-{
- SDBThreadAttach::releaseRef();
-}
-
-jclass java_sql_Ref::getMyClass() const
-{
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/sql/Ref");
- return theClass;
-}
-
-::rtl::OUString SAL_CALL java_sql_Ref::getBaseTypeName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- static jmethodID mID(NULL);
- return callStringMethod("getBaseTypeName",mID);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx
deleted file mode 100644
index 64a17ad1ca..0000000000
--- a/connectivity/source/drivers/jdbc/ResultSet.cxx
+++ /dev/null
@@ -1,1088 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/lang/String.hxx"
-#include "java/lang/Boolean.hxx"
-#include "java/sql/ResultSet.hxx"
-#include "java/math/BigDecimal.hxx"
-#include "java/sql/JStatement.hxx"
-#include "java/sql/SQLWarning.hxx"
-#include "java/sql/Timestamp.hxx"
-#include "java/sql/Array.hxx"
-#include "java/sql/Ref.hxx"
-#include "java/sql/Clob.hxx"
-#include "java/sql/Timestamp.hxx"
-#include "java/sql/Blob.hxx"
-#include "java/sql/ResultSetMetaData.hxx"
-#include "java/io/InputStream.hxx"
-#include "java/io/Reader.hxx"
-#include "java/tools.hxx"
-#include <comphelper/property.hxx>
-#include "connectivity/CommonTools.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include "TConnection.hxx"
-#include <comphelper/types.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-#include "java/LocalRef.hxx"
-
-#include <rtl/logfile.hxx>
-#include <string.h>
-
-using namespace ::comphelper;
-
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-IMPLEMENT_SERVICE_INFO(java_sql_ResultSet,"com.sun.star.sdbcx.JResultSet","com.sun.star.sdbc.ResultSet");
-//**************************************************************
-//************ Class: java.sql.ResultSet
-//**************************************************************
-
-jclass java_sql_ResultSet::theClass = 0;
-java_sql_ResultSet::java_sql_ResultSet( JNIEnv * pEnv, jobject myObj, const java::sql::ConnectionLog& _rParentLogger,java_sql_Connection& _rConnection, java_sql_Statement_Base* pStmt)
- :java_sql_ResultSet_BASE(m_aMutex)
- ,java_lang_Object( pEnv, myObj )
- ,OPropertySetHelper(java_sql_ResultSet_BASE::rBHelper)
- ,m_aLogger( _rParentLogger, java::sql::ConnectionLog::RESULTSET )
- ,m_pConnection(&_rConnection)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::java_sql_ResultSet" );
- SDBThreadAttach::addRef();
- osl_incrementInterlockedCount(&m_refCount);
- if ( pStmt )
- m_xStatement = *pStmt;
-
- osl_decrementInterlockedCount(&m_refCount);
-}
-// -----------------------------------------------------------------------------
-java_sql_ResultSet::~java_sql_ResultSet()
-{
- if ( !java_sql_ResultSet_BASE::rBHelper.bDisposed && !java_sql_ResultSet_BASE::rBHelper.bInDispose )
- {
- // increment ref count to prevent double call of Dtor
- osl_incrementInterlockedCount( &m_refCount );
- dispose();
- }
-}
-
-jclass java_sql_ResultSet::getMyClass() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getMyClass" );
- // the class must be fetched only once, therefore static
- if( !theClass )
- theClass = findMyClass("java/sql/ResultSet");
- return theClass;
-}
-
-// -------------------------------------------------------------------------
-void java_sql_ResultSet::disposing(void)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::disposing" );
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
-m_xMetaData.clear();
- if( object )
- {
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- callVoidMethod("close",mID);
- clearObject(*t.pEnv);
- }
-
- SDBThreadAttach::releaseRef();
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Any SAL_CALL java_sql_ResultSet::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::queryInterface" );
- ::com::sun::star::uno::Any aRet = OPropertySetHelper::queryInterface(rType);
- return aRet.hasValue() ? aRet : java_sql_ResultSet_BASE::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL java_sql_ResultSet::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getTypes" );
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > *)0 ),
- ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),java_sql_ResultSet_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL java_sql_ResultSet::findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::findColumn" );
- static jmethodID mID(NULL);
- return callIntMethodWithStringArg("findColumn",mID,columnName);
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL java_sql_ResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getBinaryStream" );
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getBinaryStream","(I)Ljava/io/InputStream;", mID, columnIndex);
-
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_io_InputStream( t.pEnv, out );
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL java_sql_ResultSet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getCharacterStream" );
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getCharacterStream","(I)Ljava/io/Reader;", mID, columnIndex);
-
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_io_Reader( t.pEnv, out );
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getBoolean" );
- static jmethodID mID(NULL);
- return callBooleanMethodWithIntArg( "getBoolean", mID,columnIndex );
-}
-// -------------------------------------------------------------------------
-
-sal_Int8 SAL_CALL java_sql_ResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getByte" );
- static jmethodID mID(NULL);
- jbyte (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallByteMethod;
- return callMethodWithIntArg<jbyte>(pCallMethod,"getByte","(I)B",mID,columnIndex);
-}
-// -------------------------------------------------------------------------
-
-Sequence< sal_Int8 > SAL_CALL java_sql_ResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getBytes" );
- Sequence< sal_Int8 > aSeq;
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jbyteArray out = (jbyteArray)callObjectMethodWithIntArg(t.pEnv,"getBytes","(I)[B", mID, columnIndex);
- if (out)
- {
- jboolean p = sal_False;
- aSeq.realloc(t.pEnv->GetArrayLength(out));
- memcpy(aSeq.getArray(),t.pEnv->GetByteArrayElements(out,&p),aSeq.getLength());
- t.pEnv->DeleteLocalRef(out);
- }
- return aSeq;
-}
-// -------------------------------------------------------------------------
-
-::com::sun::star::util::Date SAL_CALL java_sql_ResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getDate" );
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getDate","(I)Ljava/sql/Date;", mID, columnIndex);
- // WARNING: the caller becomes the owner of the returned pointer
- return out ? static_cast <com::sun::star::util::Date> (java_sql_Date( t.pEnv, out )) : ::com::sun::star::util::Date();
-}
-// -------------------------------------------------------------------------
-
-double SAL_CALL java_sql_ResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getDouble" );
- static jmethodID mID(NULL);
- jdouble (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallDoubleMethod;
- return callMethodWithIntArg<double>(pCallMethod,"getDouble","(I)D",mID,columnIndex);
-}
-// -------------------------------------------------------------------------
-
-float SAL_CALL java_sql_ResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getFloat" );
- static jmethodID mID(NULL);
- jfloat (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallFloatMethod;
- return callMethodWithIntArg<jfloat>(pCallMethod,"getFloat","(I)F",mID,columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL java_sql_ResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getInt" );
- static jmethodID mID(NULL);
- return callIntMethodWithIntArg("getInt",mID,columnIndex);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL java_sql_ResultSet::getRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getRow" );
- static jmethodID mID(NULL);
- return callIntMethod("getRow",mID);
-}
-// -------------------------------------------------------------------------
-
-sal_Int64 SAL_CALL java_sql_ResultSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getLong" );
- static jmethodID mID(NULL);
- jlong (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallLongMethod;
- return callMethodWithIntArg<jlong>(pCallMethod,"getLong","(I)J",mID,columnIndex);
-}
-// -------------------------------------------------------------------------
-
-::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL java_sql_ResultSet::getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getMetaData" );
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jobject out = callObjectMethod(t.pEnv,"getMetaData","()Ljava/sql/ResultSetMetaData;", mID);
-
- return out==0 ? 0 : new java_sql_ResultSetMetaData( t.pEnv, out, m_aLogger,*m_pConnection );
-}
-// -------------------------------------------------------------------------
-Reference< XArray > SAL_CALL java_sql_ResultSet::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getArray" );
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getArray","(I)Ljava/sql/Array;", mID, columnIndex);
-
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_sql_Array( t.pEnv, out );
-}
-// -------------------------------------------------------------------------
-
-Reference< XClob > SAL_CALL java_sql_ResultSet::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getClob" );
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getClob","(I)Ljava/sql/Clob;", mID, columnIndex);
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_sql_Clob( t.pEnv, out );
-}
-// -------------------------------------------------------------------------
-Reference< XBlob > SAL_CALL java_sql_ResultSet::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getBlob" );
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getBlob","(I)Ljava/sql/Blob;", mID, columnIndex);
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_sql_Blob( t.pEnv, out );
-}
-// -------------------------------------------------------------------------
-
-Reference< XRef > SAL_CALL java_sql_ResultSet::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getRef" );
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getRef","(I)Ljava/sql/Ref;", mID, columnIndex);
-
- // WARNING: the caller becomes the owner of the returned pointer
- return out==0 ? 0 : new java_sql_Ref( t.pEnv, out );
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL java_sql_ResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getObject" );
- jobject out(0);
- Any aRet;
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- {
- jvalue args[2];
- // convert parameter
- args[0].i = (sal_Int32)columnIndex;
- args[1].l = convertTypeMapToJavaMap(t.pEnv,typeMap);
- // initialize temporary Variable
- // Java-Call
- static jmethodID mID(NULL);
- if ( !mID )
- {
- static const char * cSignature = "(I)Ljava/lang/Object;";
- static const char * cMethodName = "getObject";
-
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- }
-
- out = t.pEnv->CallObjectMethodA( object, mID, args);
- t.pEnv->DeleteLocalRef((jstring)args[1].l);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- // and clean up
- if ( out )
- {
- if ( t.pEnv->IsInstanceOf(out,java_lang_String::st_getMyClass()) )
- {
- java_lang_String aVal(t.pEnv,out);
- aRet <<= (::rtl::OUString)aVal;
- }
- else if ( t.pEnv->IsInstanceOf(out,java_lang_Boolean::st_getMyClass()) )
- {
- java_lang_Boolean aVal(t.pEnv,out);
- static jmethodID methodID = NULL;
- aRet <<= aVal.callBooleanMethod("booleanValue",methodID);
- }
- else if ( t.pEnv->IsInstanceOf(out,java_sql_Date::st_getMyClass()) )
- {
- java_sql_Date aVal(t.pEnv,out);
- aRet <<= (::com::sun::star::util::Date)aVal;
- }
- else if ( t.pEnv->IsInstanceOf(out,java_sql_Time::st_getMyClass()) )
- {
- java_sql_Time aVal(t.pEnv,out);
- aRet <<= (::com::sun::star::util::Time)aVal;
- }
- else if ( t.pEnv->IsInstanceOf(out,java_sql_Timestamp::st_getMyClass()) )
- {
- java_sql_Timestamp aVal(t.pEnv,out);
- aRet <<= (::com::sun::star::util::DateTime)aVal;
- }
- else
- t.pEnv->DeleteLocalRef(out);
- }
- } //t.pEnv
- return aRet;
-}
-// -------------------------------------------------------------------------
-
-sal_Int16 SAL_CALL java_sql_ResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getShort" );
- static jmethodID mID(NULL);
- jshort (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallShortMethod;
- return callMethodWithIntArg<jshort>(pCallMethod,"getShort","(I)S",mID,columnIndex);
-}
-// -------------------------------------------------------------------------
-
-
-::rtl::OUString SAL_CALL java_sql_ResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getString" );
- static jmethodID mID(NULL);
- return callStringMethodWithIntArg("getString",mID,columnIndex);
-}
-// -------------------------------------------------------------------------
-
-
-::com::sun::star::util::Time SAL_CALL java_sql_ResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getTime" );
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getTime","(I)Ljava/sql/Time;", mID, columnIndex);
- // WARNING: the caller becomes the owner of the returned pointer
- return out ? static_cast <com::sun::star::util::Time> (java_sql_Time( t.pEnv, out )) : ::com::sun::star::util::Time();
-}
-// -------------------------------------------------------------------------
-
-
-::com::sun::star::util::DateTime SAL_CALL java_sql_ResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getTimestamp" );
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- static jmethodID mID(NULL);
- jobject out = callObjectMethodWithIntArg(t.pEnv,"getTimestamp","(I)Ljava/sql/Timestamp;", mID, columnIndex);
- // WARNING: the caller becomes the owner of the returned pointer
- return out ? static_cast <com::sun::star::util::DateTime> (java_sql_Timestamp( t.pEnv, out )) : ::com::sun::star::util::DateTime();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSet::isAfterLast( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::isAfterLast" );
- static jmethodID mID(NULL);
- return callBooleanMethod( "isAfterLast", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_ResultSet::isFirst( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::isFirst" );
- static jmethodID mID(NULL);
- return callBooleanMethod( "isFirst", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_ResultSet::isLast( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::isLast" );
- static jmethodID mID(NULL);
- return callBooleanMethod( "isLast", mID );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::beforeFirst" );
- static jmethodID mID(NULL);
- callVoidMethod("beforeFirst",mID);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::afterLast( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::afterLast" );
- static jmethodID mID(NULL);
- callVoidMethod("afterLast",mID);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::close" );
- dispose();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSet::first( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::first" );
- static jmethodID mID(NULL);
- return callBooleanMethod( "first", mID );
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSet::last( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::last" );
- static jmethodID mID(NULL);
- return callBooleanMethod( "last", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_ResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::absolute" );
- static jmethodID mID(NULL);
- return callBooleanMethodWithIntArg( "absolute", mID,row );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_ResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::relative" );
- static jmethodID mID(NULL);
- return callBooleanMethodWithIntArg( "relative", mID,row );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_ResultSet::previous( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::previous" );
- static jmethodID mID(NULL);
- return callBooleanMethod( "previous", mID );
-}
-// -------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL java_sql_ResultSet::getStatement( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getStatement" );
- return m_xStatement;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSet::rowDeleted( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::rowDeleted" );
- static jmethodID mID(NULL);
- return callBooleanMethod( "rowDeleted", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_ResultSet::rowInserted( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::rowInserted" );
- static jmethodID mID(NULL);
- return callBooleanMethod( "rowInserted", mID );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_ResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::rowUpdated" );
- static jmethodID mID(NULL);
- return callBooleanMethod( "rowUpdated", mID );
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::isBeforeFirst" );
- static jmethodID mID(NULL);
- return callBooleanMethod( "isBeforeFirst", mID );
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSet::next( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::next" );
- static jmethodID mID(NULL);
- return callBooleanMethod( "next", mID );
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSet::wasNull( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::wasNull" );
- static jmethodID mID(NULL);
- return callBooleanMethod( "wasNull", mID );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::cancel( ) throw(::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::cancel" );
- static jmethodID mID(NULL);
- callVoidMethod("cancel",mID);
-}
-// -------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::clearWarnings" );
- static jmethodID mID(NULL);
- callVoidMethod("clearWarnings",mID);
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Any SAL_CALL java_sql_ResultSet::getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getWarnings" );
- SDBThreadAttach t;
- static jmethodID mID(NULL);
- jobject out = callObjectMethod(t.pEnv,"getWarnings","()Ljava/sql/SQLWarning;", mID);
- // WARNING: the caller becomes the owner of the returned pointer
- if( out )
- {
- java_sql_SQLWarning_BASE warn_base( t.pEnv, out );
- return makeAny(
- static_cast< starsdbc::SQLException >(
- java_sql_SQLWarning(warn_base,*this)));
- }
-
- return ::com::sun::star::uno::Any();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::insertRow" );
- static jmethodID mID(NULL);
- callVoidMethod("insertRow",mID);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateRow" );
- static jmethodID mID(NULL);
- callVoidMethod("updateRow",mID);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::deleteRow" );
- static jmethodID mID(NULL);
- callVoidMethod("deleteRow",mID);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::cancelRowUpdates" );
- static jmethodID mID(NULL);
- callVoidMethod("cancelRowUpdates",mID);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::moveToInsertRow" );
- static jmethodID mID(NULL);
- callVoidMethod("moveToInsertRow",mID);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::moveToCurrentRow" );
- static jmethodID mID(NULL);
- callVoidMethod("moveToCurrentRow",mID);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateNull" );
- static jmethodID mID(NULL);
- callVoidMethodWithIntArg("updateNull",mID,columnIndex);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateBoolean" );
- static jmethodID mID(NULL);
- callVoidMethod("updateBoolean", "(IZ)V", mID, columnIndex, x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateByte" );
- static jmethodID mID(NULL);
- callVoidMethod("updateByte", "(IB)V", mID, columnIndex, x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateShort" );
- static jmethodID mID(NULL);
- callVoidMethod("updateShort", "(IS)V", mID, columnIndex, x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateInt" );
- static jmethodID mID(NULL);
- callVoidMethod("updateInt", "(II)V", mID, columnIndex, x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateLong" );
- static jmethodID mID(NULL);
- callVoidMethod("updateLong", "(IJ)V", mID, columnIndex, x);
-}
-// -------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateFloat" );
- static jmethodID mID(NULL);
- callVoidMethod("updateFloat", "(IF)V", mID, columnIndex, x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateDouble" );
- static jmethodID mID(NULL);
- callVoidMethod("updateDouble", "(ID)V", mID, columnIndex, x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateString" );
- SDBThreadAttach t;
-
- {
-
- // initialize temporary variable
- // Java-Call
- static jmethodID mID(NULL);
- if ( !mID )
- {
- static const char * cSignature = "(ILjava/lang/String;)V";
- static const char * cMethodName = "updateString";
-
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- }
-
- {
- // convert parameter
- jdbc::LocalRef< jstring > str( t.env(),convertwchar_tToJavaString(t.pEnv,x));
- t.pEnv->CallVoidMethod( object, mID,columnIndex,str.get());
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::updateBytes( sal_Int32 columnIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateBytes" );
- SDBThreadAttach t;
-
- {
- // initialize temporary variable
- // Java-Call
- static jmethodID mID(NULL);
- if ( !mID )
- {
- static const char * cSignature = "(I[B)V";
- static const char * cMethodName = "updateBytes";
-
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- }
-
- {
- jbyteArray aArray = t.pEnv->NewByteArray(x.getLength());
- t.pEnv->SetByteArrayRegion(aArray,0,x.getLength(),(jbyte*)x.getConstArray());
- // convert parameter
- t.pEnv->CallVoidMethod( object, mID,columnIndex,aArray);
- t.pEnv->DeleteLocalRef(aArray);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateDate" );
- java_sql_Date aD(x);
- static jmethodID mID(NULL);
- callVoidMethod("updateDate", "(ILjava/sql/Date;)V", mID, columnIndex, aD.getJavaObject());
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateTime" );
- java_sql_Time aD(x);
- static jmethodID mID(NULL);
- callVoidMethod("updateTime", "(ILjava/sql/Time;)V", mID, columnIndex, aD.getJavaObject());
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateTimestamp" );
- java_sql_Timestamp aD(x);
- static jmethodID mID(NULL);
- callVoidMethod("updateTimestamp", "(ILjava/sql/Timestamp;)V", mID, columnIndex, aD.getJavaObject());
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::updateBinaryStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateBinaryStream" );
- try
- {
- SDBThreadAttach t;
- {
-
- // initialize temporary variable
- // Java-Call
- static jmethodID mID(NULL);
- if ( !mID )
- {
- static const char * cSignature = "(ILjava/io/InputStream;I)V";
- static const char * cMethodName = "updateBinaryStream";
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- }
-
- {
- // convert Parameter
- jobject obj = createByteInputStream(x,length);
- t.pEnv->CallVoidMethod( object, mID, columnIndex,obj,length);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
- }
- }
- catch(const Exception&)
- {
- ::dbtools::throwFeatureNotImplementedException( "XRowUpdate::updateBinaryStream", *this );
- }
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::updateCharacterStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateCharacterStream" );
- try
- {
- SDBThreadAttach t;
- {
-
- // initialize temporary variable
- // Java-Call
- static jmethodID mID(NULL);
- if ( !mID )
- {
- static const char * cSignature = "(ILjava/io/Reader;I)V";
- static const char * cMethodName = "updateCharacterStream";
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- }
-
- {
- // convert Parameter
- jobject obj = createCharArrayReader(x,length);
- t.pEnv->CallVoidMethod( object, mID, columnIndex,obj,length);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
- }
- }
- catch(const Exception&)
- {
- ::dbtools::throwFeatureNotImplementedException( "XRowUpdate::updateCharacterStream", *this );
- }
-}
-// -------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::updateObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateObject" );
- if(!::dbtools::implUpdateObject(this,columnIndex,x))
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_UNKNOWN_COLUMN_TYPE,
- "$position$", ::rtl::OUString::valueOf(columnIndex)
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL java_sql_ResultSet::updateNumericObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateNumericObject" );
- // OSL_FAIL("java_sql_ResultSet::updateNumericObject: NYI");
- try
- {
- SDBThreadAttach t;
-
- {
-
- // initialize temporary variable
- // Java-Call
- static jmethodID mID(NULL);
- if ( !mID )
- {
- static const char * cSignature = "(ILjava/lang/Object;I)V";
- static const char * cMethodName = "updateObject";
-
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- }
-
- {
- // convert parameter
- double nTemp = 0.0;
- ::std::auto_ptr<java_math_BigDecimal> pBigDecimal;
- if ( x >>= nTemp)
- {
- pBigDecimal.reset(new java_math_BigDecimal(nTemp));
- }
- else
- pBigDecimal.reset(new java_math_BigDecimal(::comphelper::getString(x)));
-
- t.pEnv->CallVoidMethod( object, mID, columnIndex,pBigDecimal->getJavaObject(),scale);
- ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
- }
- }
- catch(const Exception&)
- {
- updateObject( columnIndex,x);
- }
-}
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_ResultSet::getResultSetConcurrency() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getResultSetConcurrency" );
- static jmethodID mID(NULL);
- return callIntMethod("getConcurrency",mID,true);
-}
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_ResultSet::getResultSetType() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getResultSetType" );
- static jmethodID mID(NULL);
- return callIntMethod("getType",mID,true);
-}
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_ResultSet::getFetchDirection() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getFetchDirection" );
- static jmethodID mID(NULL);
- return callIntMethod("getFetchDirection",mID,true);
-}
-//------------------------------------------------------------------------------
-sal_Int32 java_sql_ResultSet::getFetchSize() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getFetchSize" );
- static jmethodID mID(NULL);
- return callIntMethod("getFetchSize",mID,true);
-}
-//------------------------------------------------------------------------------
-::rtl::OUString java_sql_ResultSet::getCursorName() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getCursorName" );
- static jmethodID mID(NULL);
- return callStringMethod("getCursorName",mID);
-}
-
-//------------------------------------------------------------------------------
-void java_sql_ResultSet::setFetchDirection(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::setFetchDirection" );
- static jmethodID mID(NULL);
- callVoidMethodWithIntArg("setFetchDirection",mID,_par0,true);
-}
-//------------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::refreshRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::refreshRow" );
- static jmethodID mID(NULL);
- callVoidMethod("refreshRow",mID);
-}
-//------------------------------------------------------------------------------
-void java_sql_ResultSet::setFetchSize(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::setFetchSize" );
- static jmethodID mID(NULL);
- callVoidMethodWithIntArg("setFetchSize",mID,_par0,true);
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* java_sql_ResultSet::createArrayHelper( ) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::createArrayHelper" );
- Sequence< Property > aProps(5);
- Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP1IMPL(CURSORNAME, ::rtl::OUString) PropertyAttribute::READONLY);
- DECL_PROP0(FETCHDIRECTION, sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
- DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
-
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & java_sql_ResultSet::getInfoHelper()
-{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getInfoHelper" );
- return *const_cast<java_sql_ResultSet*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool java_sql_ResultSet::convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::convertFastPropertyValue" );
- sal_Bool bRet = sal_False;
- switch(nHandle)
- {
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw ::com::sun::star::lang::IllegalArgumentException();
- case PROPERTY_ID_FETCHDIRECTION:
- bRet = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchDirection());
- break;
- case PROPERTY_ID_FETCHSIZE:
- bRet = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchSize());
- default:
- ;
- }
- return bRet;
-}
-
-// -------------------------------------------------------------------------
-void java_sql_ResultSet::setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- )
- throw (::com::sun::star::uno::Exception)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::setFastPropertyValue_NoBroadcast" );
- switch(nHandle)
- {
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw ::com::sun::star::uno::Exception();
- case PROPERTY_ID_FETCHDIRECTION:
- setFetchDirection(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_FETCHSIZE:
- setFetchSize(comphelper::getINT32(rValue));
- break;
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-void java_sql_ResultSet::getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle
- ) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getFastPropertyValue" );
- try
- {
- switch(nHandle)
- {
- case PROPERTY_ID_CURSORNAME:
- rValue <<= getCursorName();
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- rValue <<= getResultSetConcurrency();
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- rValue <<= getResultSetType();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- rValue <<= getFetchDirection();
- break;
- case PROPERTY_ID_FETCHSIZE:
- rValue <<= getFetchSize();
- break;
- }
- }
- catch(const Exception&)
- {
- }
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::acquire() throw()
-{
- java_sql_ResultSet_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL java_sql_ResultSet::release() throw()
-{
- java_sql_ResultSet_BASE::release();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL java_sql_ResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getPropertySetInfo" );
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx b/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx
deleted file mode 100644
index a6da0676a2..0000000000
--- a/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx
+++ /dev/null
@@ -1,239 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/ResultSetMetaData.hxx"
-#include "java/sql/Connection.hxx"
-#include "java/tools.hxx"
-#include <rtl/logfile.hxx>
-
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-#define NULLABLE_UNDEFINED 99
-//**************************************************************
-//************ Class: java.sql.ResultSetMetaData
-//**************************************************************
-
-jclass java_sql_ResultSetMetaData::theClass = 0;
-java_sql_ResultSetMetaData::java_sql_ResultSetMetaData( JNIEnv * pEnv, jobject myObj, const java::sql::ConnectionLog& _rResultSetLogger, java_sql_Connection& _rCon )
- :java_lang_Object( pEnv, myObj )
- ,m_aLogger( _rResultSetLogger )
- ,m_pConnection( &_rCon )
- ,m_nColumnCount(-1)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::java_sql_ResultSetMetaData" );
- SDBThreadAttach::addRef();
-}
-java_sql_ResultSetMetaData::~java_sql_ResultSetMetaData()
-{
- SDBThreadAttach::releaseRef();
-}
-
-jclass java_sql_ResultSetMetaData::getMyClass() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getMyClass" );
- // The class needs to be fetched just once, that is why it is static
- if( !theClass )
- theClass = findMyClass("java/sql/ResultSetMetaData");
- return theClass;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnDisplaySize" );
- static jmethodID mID(NULL);
- return callIntMethodWithIntArg("getColumnDisplaySize",mID,column);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnType" );
- static jmethodID mID(NULL);
- return callIntMethodWithIntArg("getColumnType",mID,column);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnCount( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnCount" );
- if ( m_nColumnCount == -1 )
- {
- static jmethodID mID(NULL);
- m_nColumnCount = callIntMethod("getColumnCount",mID);
- } // if ( m_nColumnCount == -1 )
- return m_nColumnCount;
-
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isCaseSensitive" );
- static jmethodID mID(NULL);
- return callBooleanMethodWithIntArg( "isCaseSensitive", mID,column );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getSchemaName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getSchemaName" );
- static jmethodID mID(NULL);
- return callStringMethodWithIntArg("getSchemaName",mID,column);
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getColumnName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnName" );
- static jmethodID mID(NULL);
- return callStringMethodWithIntArg("getColumnName",mID,column);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getTableName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getTableName" );
- static jmethodID mID(NULL);
- return callStringMethodWithIntArg("getTableName",mID,column);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getCatalogName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getCatalogName" );
- static jmethodID mID(NULL);
- return callStringMethodWithIntArg("getCatalogName",mID,column);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getColumnTypeName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnTypeName" );
- static jmethodID mID(NULL);
- return callStringMethodWithIntArg("getColumnTypeName",mID,column);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getColumnLabel( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnLabel" );
- static jmethodID mID(NULL);
- return callStringMethodWithIntArg("getColumnLabel",mID,column);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getColumnServiceName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnServiceName" );
- static jmethodID mID(NULL);
- return callStringMethodWithIntArg("getColumnClassName",mID,column);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCurrency( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isCurrency" );
- if ( m_pConnection->isIgnoreCurrencyEnabled() )
- return sal_False;
- static jmethodID mID(NULL);
- return callBooleanMethodWithIntArg( "isCurrency", mID,column );
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSetMetaData::isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isAutoIncrement" );
- static jmethodID mID(NULL);
- return callBooleanMethodWithIntArg( "isAutoIncrement", mID,column );
-}
-// -------------------------------------------------------------------------
-
-
-sal_Bool SAL_CALL java_sql_ResultSetMetaData::isSigned( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isSigned" );
- static jmethodID mID(NULL);
- return callBooleanMethodWithIntArg( "isSigned", mID,column );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getPrecision( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getPrecision" );
- static jmethodID mID(NULL);
- return callIntMethodWithIntArg("getPrecision",mID,column);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getScale" );
- static jmethodID mID(NULL);
- return callIntMethodWithIntArg("getScale",mID,column);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL java_sql_ResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isNullable" );
- static jmethodID mID(NULL);
- return callIntMethodWithIntArg("isNullable",mID,column);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isSearchable" );
- static jmethodID mID(NULL);
- return callBooleanMethodWithIntArg( "isSearchable", mID,column );
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSetMetaData::isReadOnly( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isReadOnly" );
- static jmethodID mID(NULL);
- return callBooleanMethodWithIntArg( "isReadOnly", mID,column );
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL java_sql_ResultSetMetaData::isDefinitelyWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isDefinitelyWritable" );
- static jmethodID mID(NULL);
- return callBooleanMethodWithIntArg( "isDefinitelyWritable", mID,column );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL java_sql_ResultSetMetaData::isWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isWritable" );
- static jmethodID mID(NULL);
- return callBooleanMethodWithIntArg( "isWritable", mID,column );
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/SQLException.cxx b/connectivity/source/drivers/jdbc/SQLException.cxx
deleted file mode 100644
index a0ebe17938..0000000000
--- a/connectivity/source/drivers/jdbc/SQLException.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/SQLException.hxx"
-#include "java/tools.hxx"
-
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-//**************************************************************
-//************ Class: java.sql.SQLException
-//**************************************************************
-java_sql_SQLException::java_sql_SQLException( const java_sql_SQLException_BASE& _rException,const Reference< XInterface> & _rContext)
- : starsdbc::SQLException( _rException.getMessage(),
- _rContext,
- _rException.getSQLState(),
- _rException.getErrorCode(),
- makeAny(_rException.getNextException())
- )
-{
-}
-
-java_sql_SQLException_BASE::java_sql_SQLException_BASE( JNIEnv * pEnv, jobject myObj ) : java_lang_Exception( pEnv, myObj )
-{
-}
-
-jclass java_sql_SQLException_BASE::theClass = 0;
-
-java_sql_SQLException_BASE::~java_sql_SQLException_BASE()
-{}
-
-
-jclass java_sql_SQLException_BASE::getMyClass() const
-{
- return st_getMyClass();
-}
-jclass java_sql_SQLException_BASE::st_getMyClass()
-{
- // The class needs to be fetched just once, that is why it is static
- if( !theClass )
- theClass = findMyClass("java/sql/SQLException");
- return theClass;
-}
-
-starsdbc::SQLException java_sql_SQLException_BASE::getNextException() const
-{
- SDBThreadAttach t;
- static jmethodID mID(NULL);
- jobject out = callObjectMethod(t.pEnv,"getNextException","()Ljava/sql/SQLException;", mID);
- // WARNING: the caller will become the owner of the returned pointers !!!
- if( out )
- {
- java_sql_SQLException_BASE warn_base(t.pEnv,out);
- return (starsdbc::SQLException)java_sql_SQLException(warn_base,0);
- }
-
- return starsdbc::SQLException();
-}
-
-::rtl::OUString java_sql_SQLException_BASE::getSQLState() const
-{
- static jmethodID mID(NULL);
- return callStringMethod("getSQLState",mID);
-}
-sal_Int32 java_sql_SQLException_BASE::getErrorCode() const
-{
- static jmethodID mID(NULL);
- return callIntMethod("getErrorCode",mID);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/SQLWarning.cxx b/connectivity/source/drivers/jdbc/SQLWarning.cxx
deleted file mode 100644
index aa5c8fe456..0000000000
--- a/connectivity/source/drivers/jdbc/SQLWarning.cxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/SQLWarning.hxx"
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.sql.SQLWarning
-//**************************************************************
-
-jclass java_sql_SQLWarning_BASE::theClass = 0;
-
-java_sql_SQLWarning_BASE::~java_sql_SQLWarning_BASE()
-{}
-
-jclass java_sql_SQLWarning_BASE::getMyClass() const
-{
- // the class needs to be fetched only once, that is why it is static
- if( !theClass )
- theClass = findMyClass("java/sql/SQLWarning");
- return theClass;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/String.cxx b/connectivity/source/drivers/jdbc/String.cxx
deleted file mode 100644
index a85a3fd6b2..0000000000
--- a/connectivity/source/drivers/jdbc/String.cxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/lang/String.hxx"
-#include "java/tools.hxx"
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.lang.String
-//**************************************************************
-
-jclass java_lang_String::theClass = 0;
-
-java_lang_String::~java_lang_String()
-{}
-
-jclass java_lang_String::getMyClass() const
-{
- return st_getMyClass();
-}
-jclass java_lang_String::st_getMyClass()
-{
- // the class needs to be fetched only once, that is why it is static
- if( !theClass )
- theClass = findMyClass("java/lang/String");
- return theClass;
-}
-
-//--------------------------------------------------------------------------
-java_lang_String::operator ::rtl::OUString()
-{
- SDBThreadAttach t;
- if(!t.pEnv)
- return ::rtl::OUString();
- return JavaString2String(t.pEnv,(jstring)object);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/Throwable.cxx b/connectivity/source/drivers/jdbc/Throwable.cxx
deleted file mode 100644
index 50302bcb7c..0000000000
--- a/connectivity/source/drivers/jdbc/Throwable.cxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/lang/Throwable.hxx"
-#include "java/tools.hxx"
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.lang.Throwable
-//**************************************************************
-
-jclass java_lang_Throwable::theClass = 0;
-
-java_lang_Throwable::~java_lang_Throwable()
-{}
-
-jclass java_lang_Throwable::getMyClass() const
-{
- return st_getMyClass();
-}
-jclass java_lang_Throwable::st_getMyClass()
-{
- // the class needs to be fetched only once, that is why it is static
- if( !theClass )
- theClass = findMyClass("java/lang/Throwable");
- return theClass;
-}
-// -----------------------------------------------------------------------------
-
-::rtl::OUString java_lang_Throwable::getMessage() const
-{
- static jmethodID mID(NULL);
- return callStringMethod("getMessage",mID);
-}
-// -----------------------------------------------------------------------------
-
-::rtl::OUString java_lang_Throwable::getLocalizedMessage() const
-{
- static jmethodID mID(NULL);
- return callStringMethod("getLocalizedMessage",mID);
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/Timestamp.cxx b/connectivity/source/drivers/jdbc/Timestamp.cxx
deleted file mode 100644
index f38a1a610b..0000000000
--- a/connectivity/source/drivers/jdbc/Timestamp.cxx
+++ /dev/null
@@ -1,194 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/Timestamp.hxx"
-#include "java/tools.hxx"
-#include <comphelper/types.hxx>
-#include "connectivity/dbconversion.hxx"
-
-using namespace ::comphelper;
-using namespace connectivity;
-//**************************************************************
-//************ Class: java.sql.Date
-//**************************************************************
-const double fMilliSecondsPerDay = 86400000.0;
-jclass java_sql_Date::theClass = 0;
-java_sql_Date::java_sql_Date( const ::com::sun::star::util::Date& _rOut ) : java_util_Date( NULL, (jobject)NULL )
-{
- SDBThreadAttach t;
- if( !t.pEnv )
- return;
- jvalue args[1];
- // Convert parameters
- ::rtl::OUString sDateStr;
- sDateStr = ::dbtools::DBTypeConversion::toDateString(_rOut);
- args[0].l = convertwchar_tToJavaString(t.pEnv,sDateStr);
-
- // Turn of Java-Call for the constructor
- // initialise temporary variables
- static const char * cSignature = "(Ljava/lang/String;)Ljava/sql/Date;";
- jobject tempObj;
- static jmethodID mID(NULL);
- if ( !mID )
- mID = t.pEnv->GetStaticMethodID( getMyClass(), "valueOf", cSignature );OSL_ENSURE(mID,"Unknown method id!");
- tempObj = t.pEnv->CallStaticObjectMethod( getMyClass(), mID, args[0].l );
- saveRef( t.pEnv, tempObj );
- t.pEnv->DeleteLocalRef( tempObj );
- // and clean
-}
-
-java_sql_Date::~java_sql_Date()
-{}
-
-jclass java_sql_Date::getMyClass() const
-{
- return st_getMyClass();
-}
-jclass java_sql_Date::st_getMyClass()
-{
- // the class needs only be fetched once, that is why it is static
- if( !theClass )
- theClass = findMyClass("java/sql/Date");
- return theClass;
-}
-// -----------------------------------------------------------------------------
-
-java_sql_Date::operator ::com::sun::star::util::Date()
-{
- return ::dbtools::DBTypeConversion::toDate(toString());
-}
-
-//**************************************************************
-//************ Class: java.sql.Time
-//**************************************************************
-
-jclass java_sql_Time::theClass = 0;
-
-java_sql_Time::~java_sql_Time()
-{}
-
-jclass java_sql_Time::getMyClass() const
-{
- return st_getMyClass();
-}
-jclass java_sql_Time::st_getMyClass()
-{
- // the class needs only be fetched once, that is why it is static
- if( !theClass )
- theClass = findMyClass("java/sql/Time");
- return theClass;
-}
-java_sql_Time::java_sql_Time( const ::com::sun::star::util::Time& _rOut ): java_util_Date( NULL, (jobject)NULL )
-{
- SDBThreadAttach t;
- if( !t.pEnv )
- return;
- jvalue args[1];
- // Convert parameters
- ::rtl::OUString sDateStr;
- sDateStr = ::dbtools::DBTypeConversion::toTimeString(_rOut);
- args[0].l = convertwchar_tToJavaString(t.pEnv,sDateStr);
-
- // Turn off Java-Call for the constructor
- // intialise temporary variables
- static const char * cSignature = "(Ljava/lang/String;)Ljava/sql/Time;";
- jobject tempObj;
- static jmethodID mID(NULL);
- if ( !mID )
- mID = t.pEnv->GetStaticMethodID( getMyClass(), "valueOf", cSignature );OSL_ENSURE(mID,"Unknown method id!");
- tempObj = t.pEnv->CallStaticObjectMethod( getMyClass(), mID, args[0].l );
- t.pEnv->DeleteLocalRef((jstring)args[0].l);
- saveRef( t.pEnv, tempObj );
- t.pEnv->DeleteLocalRef( tempObj );
- // and clean
-}
-// -----------------------------------------------------------------------------
-java_sql_Time::operator ::com::sun::star::util::Time()
-{
- return ::dbtools::DBTypeConversion::toTime(toString());
-}
-//**************************************************************
-//************ Class: java.sql.Timestamp
-//**************************************************************
-
-jclass java_sql_Timestamp::theClass = 0;
-
-java_sql_Timestamp::~java_sql_Timestamp()
-{}
-
-jclass java_sql_Timestamp::getMyClass() const
-{
- return st_getMyClass();
-}
-
-jclass java_sql_Timestamp::st_getMyClass()
-{
- // the class needs only be fetched once, that is why it is static
- if( !theClass )
- theClass = findMyClass("java/sql/Timestamp");
- return theClass;
-}
-
-java_sql_Timestamp::java_sql_Timestamp(const ::com::sun::star::util::DateTime& _rOut)
- :java_util_Date( NULL, (jobject)NULL )
-{
- SDBThreadAttach t;
- if( !t.pEnv )
- return;
- jvalue args[1];
- // Convert parameters
- ::rtl::OUString sDateStr;
- sDateStr = ::dbtools::DBTypeConversion::toDateTimeString(_rOut);
-
- args[0].l = convertwchar_tToJavaString(t.pEnv,sDateStr);
-
- // Turn off Java-Call for the constructor
- // initialise temporary variables
- static const char * cSignature = "(Ljava/lang/String;)Ljava/sql/Timestamp;";
- jobject tempObj;
- static jmethodID mID(NULL);
- if ( !mID )
- mID = t.pEnv->GetStaticMethodID( getMyClass(), "valueOf", cSignature );OSL_ENSURE(mID,"Unknown method id!");
- tempObj = t.pEnv->CallStaticObjectMethod( getMyClass(), mID, args[0].l );
-
- saveRef( t.pEnv, tempObj );
- t.pEnv->DeleteLocalRef( tempObj );
- // and clean
-}
-
-// -----------------------------------------------------------------------------
-java_sql_Timestamp::operator ::com::sun::star::util::DateTime()
-{
- return ::dbtools::DBTypeConversion::toDateTime(toString());
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/exports.dxp b/connectivity/source/drivers/jdbc/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/drivers/jdbc/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/drivers/jdbc/jdbc.component b/connectivity/source/drivers/jdbc/jdbc.component
deleted file mode 100755
index 5d7db4690b..0000000000
--- a/connectivity/source/drivers/jdbc/jdbc.component
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.sdbc.JDBCDriver">
- <service name="com.sun.star.sdbc.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/jdbc/jdbc.mxp.map b/connectivity/source/drivers/jdbc/jdbc.mxp.map
deleted file mode 100755
index 2437d90ec8..0000000000
--- a/connectivity/source/drivers/jdbc/jdbc.mxp.map
+++ /dev/null
@@ -1,152 +0,0 @@
-component_getFactory
-__mh_dylib_header
-___builtin_delete
-___check_eh_spec
-___cp_pop_exception
-___get_eh_context
-___pure_virtual
-___rtti_class
-___rtti_si
-___rtti_user
-___sjthrow
-___start_cp_handler
-___terminate
-dyld_stub_binding_helper
-rest_world
-save_world
-___builtin_new
-___builtin_vec_delete
-___builtin_vec_new
-___cp_push_exception
-___eh_alloc
-_terminate__Fv
-___eh_rtime_match
-__._10bad_typeid
-__._8bad_cast
-___get_eh_info
-___is_pointer__FPv
-___throw_type_match_rtti
-___vt_10bad_typeid
-___vt_8bad_cast
-__keymgr_get_per_thread_data
-__keymgr_set_per_thread_data
-___tf9exception
-___ti9exception
-___vt_9exception
-_what__C9exception
-__._9bad_alloc
-___tf9bad_alloc
-___vt_9bad_alloc
-__._9type_info
-___eq__C9type_infoRCB0
-___tf16__user_type_info
-___tf9type_info
-___ti9type_info
-___vt_9type_info
-_getMyClass__Q212connectivity14java_sql_Array
-_saveClassRef__Q212connectivity14java_sql_ArrayP7_jclass
-_getMyClass__Q212connectivity13java_sql_Blob
-_saveClassRef__Q212connectivity13java_sql_BlobP7_jclass
-_saveClassRef__Q212connectivity17java_lang_BooleanP7_jclass
-__._Q212connectivity26java_sql_CallableStatement
-_release__Q212connectivity26java_sql_CallableStatement
-_acquire__Q212connectivity26java_sql_CallableStatement
-_saveClassRef__Q212connectivity26java_sql_CallableStatementP7_jclass
-_getMyClass__Q212connectivity26java_sql_CallableStatement
-_getMyClass__Q212connectivity15java_lang_Class
-_saveClassRef__Q212connectivity15java_lang_ClassP7_jclass
-_getMyClass__Q212connectivity13java_sql_Clob
-_saveClassRef__Q212connectivity13java_sql_ClobP7_jclass
-_getMyClass__Q212connectivity19java_sql_Connection
-_saveClassRef__Q212connectivity19java_sql_ConnectionP7_jclass
-_getMyClass__Q212connectivity25java_sql_DatabaseMetaData
-_saveClassRef__Q212connectivity25java_sql_DatabaseMetaDataP7_jclass
-_saveClassRef__Q212connectivity14java_util_DateP7_jclass
-_getMyClass__Q212connectivity14java_util_Date
-_getMyClass__Q212connectivity22java_sql_DriverManager
-_saveClassRef__Q212connectivity22java_sql_DriverManagerP7_jclass
-_choices__CQ212connectivity27java_sql_DriverPropertyInfo
-_value__CQ212connectivity27java_sql_DriverPropertyInfo
-_required__CQ212connectivity27java_sql_DriverPropertyInfo
-_description__CQ212connectivity27java_sql_DriverPropertyInfo
-_name__CQ212connectivity27java_sql_DriverPropertyInfo
-_saveClassRef__Q212connectivity27java_sql_DriverPropertyInfoP7_jclass
-_saveClassRef__Q212connectivity19java_lang_ExceptionP7_jclass
-_getMyClass__Q212connectivity19java_io_InputStream
-_saveClassRef__Q212connectivity19java_io_InputStreamP7_jclass
-_getMyClass__Q212connectivity15java_sql_Driver
-_saveClassRef__Q212connectivity15java_sql_DriverP7_jclass
-___Q212connectivity15java_sql_DriverRCQ53com3sun4star3unot9Reference1ZQ53com3sun4star4lang20XMultiServiceFactory
-_getMyClass__Q212connectivity16java_lang_Object
-_setError__Q212connectivity15SDBThreadAttach
-_StartJava__Q212connectivity15SDBThreadAttachRCQ53com3sun4star3unot9Reference1ZQ53com3sun4star4lang20XMultiServiceFactory
-_xInit__Q212connectivity15SDBThreadAttachRCQ53com3sun4star3unot9Reference1ZQ53com3sun4star4lang20XMultiServiceFactory
-_detachThread__Q212connectivity15SDBThreadAttach
-_attachThread__Q212connectivity15SDBThreadAttachRP7JNIEnv_RCQ53com3sun4star3unot9Reference1ZQ53com3sun4star4lang20XMultiServiceFactory
-_release__Q212connectivity26java_sql_PreparedStatement
-_acquire__Q212connectivity26java_sql_PreparedStatement
-_getMyClass__Q212connectivity26java_sql_PreparedStatement
-_saveClassRef__Q212connectivity26java_sql_PreparedStatementP7_jclass
-_getMyClass__Q212connectivity14java_io_Reader
-_saveClassRef__Q212connectivity14java_io_ReaderP7_jclass
-_getMyClass__Q212connectivity12java_sql_Ref
-_saveClassRef__Q212connectivity12java_sql_RefP7_jclass
-__._Q312connectivity4jdbc18UStringDescription
-___Q312connectivity4jdbc18UStringDescriptionPFv_PCc
-_getPropertySetInfo__Q212connectivity18java_sql_ResultSet
-_release__Q212connectivity18java_sql_ResultSet
-_acquire__Q212connectivity18java_sql_ResultSet
-_getResultSetType__CQ212connectivity18java_sql_ResultSet
-_getResultSetConcurrency__CQ212connectivity18java_sql_ResultSet
-_getCursorName__CQ212connectivity18java_sql_ResultSet
-_setFetchSize__Q212connectivity18java_sql_ResultSetl
-_setFetchDirection__Q212connectivity18java_sql_ResultSetl
-_getFetchSize__CQ212connectivity18java_sql_ResultSet
-_getFetchDirection__CQ212connectivity18java_sql_ResultSet
-_saveClassRef__Q212connectivity18java_sql_ResultSetP7_jclass
-_getMyClass__Q212connectivity18java_sql_ResultSet
-_getMyClass__Q212connectivity26java_sql_ResultSetMetaData
-_saveClassRef__Q212connectivity26java_sql_ResultSetMetaDataP7_jclass
-_saveClassRef__Q212connectivity26java_sql_SQLException_BASEP7_jclass
-_getNextException__CQ212connectivity26java_sql_SQLException_BASE
-_getErrorCode__CQ212connectivity26java_sql_SQLException_BASE
-_getSQLState__CQ212connectivity26java_sql_SQLException_BASE
-_saveClassRef__Q212connectivity24java_sql_SQLWarning_BASEP7_jclass
-_disposing__Q212connectivity23java_sql_Statement_Base
-_release__Q212connectivity23java_sql_Statement_Base
-_acquire__Q212connectivity23java_sql_Statement_Base
-__._Q212connectivity16OStatement_BASE2
-_release__Q212connectivity18java_sql_Statement
-_acquire__Q212connectivity18java_sql_Statement
-_saveClassRef__Q212connectivity18java_sql_StatementP7_jclass
-_setFetchSize__Q212connectivity23java_sql_Statement_Basel
-_setFetchDirection__Q212connectivity23java_sql_Statement_Basel
-_setResultSetType__Q212connectivity23java_sql_Statement_Basel
-_setResultSetConcurrency__Q212connectivity23java_sql_Statement_Basel
-_setCursorName__Q212connectivity23java_sql_Statement_BaseRCQ23rtl8OUString
-_setMaxRows__Q212connectivity23java_sql_Statement_Basel
-_setMaxFieldSize__Q212connectivity23java_sql_Statement_Basel
-_setQueryTimeOut__Q212connectivity23java_sql_Statement_Basel
-_getFetchSize__CQ212connectivity23java_sql_Statement_Base
-_getFetchDirection__CQ212connectivity23java_sql_Statement_Base
-_getResultSetType__CQ212connectivity23java_sql_Statement_Base
-_getResultSetConcurrency__CQ212connectivity23java_sql_Statement_Base
-_getCursorName__CQ212connectivity23java_sql_Statement_Base
-_getMaxRows__CQ212connectivity23java_sql_Statement_Base
-_getMaxFieldSize__CQ212connectivity23java_sql_Statement_Base
-_getQueryTimeOut__CQ212connectivity23java_sql_Statement_Base
-_getMyClass__Q212connectivity18java_sql_Statement
-_saveClassRef__Q212connectivity23java_sql_Statement_BaseP7_jclass
-_getMyClass__Q212connectivity23java_sql_Statement_Base
-_saveClassRef__Q212connectivity16java_lang_StringP7_jclass
-_saveClassRef__Q212connectivity19java_lang_ThrowableP7_jclass
-_getMyClass__Q212connectivity18java_sql_Timestamp
-_saveClassRef__Q212connectivity18java_sql_TimestampP7_jclass
-_getMyClass__Q212connectivity13java_sql_Time
-_saveClassRef__Q212connectivity13java_sql_TimeP7_jclass
-_saveClassRef__Q212connectivity13java_sql_DateP7_jclass
-___tf13bad_exception
-___uncatch_exception
-___eh_free
-___tfv
-___dynamic_cast
diff --git a/connectivity/source/drivers/jdbc/jdbc.xcu b/connectivity/source/drivers/jdbc/jdbc.xcu
deleted file mode 100644
index dd0da5df4d..0000000000
--- a/connectivity/source/drivers/jdbc/jdbc.xcu
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="jdbc:*" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.JDBCDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">JDBC</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="JavaDriverClass" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="JavaDriverClassPath" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="AutoIncrementCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="AutoRetrievingStatement" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="IsAutoRetrievingEnabled" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="AddIndexAppendix" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="Features">
- <node oor:name="GeneratedValues" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="AppendTableAliasInSelect" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseBracketedOuterJoinSyntax" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="IgnoreDriverPrivileges" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="ParameterNameSubstitution" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="DisplayVersionColumns" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseCatalogInSelect" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseSchemaInSelect" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseIndexDirectionKeyword" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseDOSLineEnds" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="BooleanComparisonMode" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FormsCheckRequiredFields" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="PrimaryKeySupport" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="RespectDriverResultSetType" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsTableCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseJava" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="Authentication" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>UserPassword</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="jdbc:oracle:thin:*" oor:op="replace">
- <prop oor:name="ParentURLPattern">
- <value>jdbc:*</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Oracle JDBC</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="IgnoreCurrency" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="TypeInfoSettings" oor:op="replace">
- <prop oor:name="Value" oor:type="oor:string-list">
- <value oor:separator=",">Column(2) = -5,Column(6) = PRECISION,Column(2) = -4,Column(6) = PRECISION,Column(2) = -3,Column(6) = PRECISION,Column(2) = -2,Column(6) = PRECISION,Column(2) = -1,Column(6) = PRECISION,Column(2) = -1,Column(6) = PRECISION,Column(2) = 2,Column(6) = PRECISION,Column(2) = 12,Column(6) = PRECISION</value>
- </prop>
- </node>
- <node oor:name="JavaDriverClass" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>oracle.jdbc.driver.OracleDriver</value>
- </prop>
- </node>
- <node oor:name="AddIndexAppendix" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- </node>
- <node oor:name="Features">
- <node oor:name="IgnoreCurrency" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="Authentication" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>UserPassword</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/jdbc/jdbc.xml b/connectivity/source/drivers/jdbc/jdbc.xml
deleted file mode 100755
index 8fe04eb8a5..0000000000
--- a/connectivity/source/drivers/jdbc/jdbc.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name> jdbc </module-name>
- <component-description>
- <author>Ocke Janssen</author>
- <name>com.sun.star.comp.sdbc.JDBCDriver</name>
- <description>
- This is the implementation of the sdbc-jdbc bridge.
- </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service> com.sun.star.sdbc.Driver </supported-service>
- <service-dependency> ... </service-dependency>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>osl</runtime-module-dependency>
- <runtime-module-dependency>dbtools</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
-
-
diff --git a/connectivity/source/drivers/jdbc/jservices.cxx b/connectivity/source/drivers/jdbc/jservices.cxx
deleted file mode 100644
index cf4d8cdc20..0000000000
--- a/connectivity/source/drivers/jdbc/jservices.cxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "java/sql/Driver.hxx"
-#include <cppuhelper/factory.hxx>
-
-using namespace connectivity;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pModCount
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- java_sql_Driver::getImplementationName_Static(),
- java_sql_Driver::getSupportedServiceNames_Static(),
- java_sql_Driver_CreateInstance,
- ::cppu::createSingleFactory);
-
- if(aReq.xRet.is())
- aReq.xRet->acquire();
- pRet = aReq.getProvider();
- }
-
- return pRet;
-}
-
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/jdbc/makefile.mk b/connectivity/source/drivers/jdbc/makefile.mk
deleted file mode 100755
index befdc73d7b..0000000000
--- a/connectivity/source/drivers/jdbc/makefile.mk
+++ /dev/null
@@ -1,120 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=jdbc
-
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-
-.IF "$(SOLAR_JAVA)" != ""
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/Array.obj \
- $(SLO)$/Blob.obj \
- $(SLO)$/Boolean.obj \
- $(SLO)$/CallableStatement.obj \
- $(SLO)$/Class.obj \
- $(SLO)$/Clob.obj \
- $(SLO)$/ConnectionLog.obj \
- $(SLO)$/DatabaseMetaData.obj \
- $(SLO)$/Date.obj \
- $(SLO)$/DriverPropertyInfo.obj \
- $(SLO)$/Exception.obj \
- $(SLO)$/InputStream.obj \
- $(SLO)$/JConnection.obj \
- $(SLO)$/JDriver.obj \
- $(SLO)$/JStatement.obj \
- $(SLO)$/Object.obj \
- $(SLO)$/PreparedStatement.obj \
- $(SLO)$/Reader.obj \
- $(SLO)$/Ref.obj \
- $(SLO)$/ResultSet.obj \
- $(SLO)$/ResultSetMetaData.obj \
- $(SLO)$/SQLException.obj \
- $(SLO)$/SQLWarning.obj \
- $(SLO)$/String.obj \
- $(SLO)$/Throwable.obj \
- $(SLO)$/Timestamp.obj \
- $(SLO)$/jservices.obj \
- $(SLO)$/JBigDecimal.obj \
- $(SLO)$/tools.obj \
- $(SLO)$/ContextClassLoader.obj
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-
-# --- Library -----------------------------------
-
-SHL1TARGET= $(JDBC_TARGET)$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(JVMACCESSLIB) \
- $(DBTOOLSLIB) \
- $(UNOTOOLSLIB) \
- $(JVMFWKLIB) \
- $(COMPHELPERLIB)
-
-SHL1DEPN=
-SHL1IMPLIB= i$(JDBC_TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-.ENDIF # SOLAR_JAVA
-
-# --- Targets ----------------------------------
-
-.INCLUDE : $(PRJ)$/target.pmk
-
-
-
-ALLTAR : $(MISC)/jdbc.component
-
-$(MISC)/jdbc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- jdbc.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt jdbc.component
diff --git a/connectivity/source/drivers/jdbc/tools.cxx b/connectivity/source/drivers/jdbc/tools.cxx
deleted file mode 100644
index 4e938585c1..0000000000
--- a/connectivity/source/drivers/jdbc/tools.cxx
+++ /dev/null
@@ -1,277 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <cstdarg>
-#include "java/tools.hxx"
-#include "java/lang/String.hxx"
-#include "java/lang/Class.hxx"
-#include "java/util/Property.hxx"
-#include <com/sun/star/sdbc/DriverPropertyInfo.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <connectivity/dbexception.hxx>
-
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-void java_util_Properties::setProperty(const ::rtl::OUString key, const ::rtl::OUString& value)
-{
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- jobject out(0);
-
- {
- jvalue args[2];
- // Convert Parameter
- args[0].l = convertwchar_tToJavaString(t.pEnv,key);
- args[1].l = convertwchar_tToJavaString(t.pEnv,value);
- // Initialize temporary Variables
- static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;";
- static const char * cMethodName = "setProperty";
- // Turn off Java-Call
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
- out = t.pEnv->CallObjectMethod(object, mID, args[0].l,args[1].l);
- ThrowSQLException(t.pEnv,NULL);
- t.pEnv->DeleteLocalRef((jstring)args[1].l);
- t.pEnv->DeleteLocalRef((jstring)args[0].l);
- ThrowSQLException(t.pEnv,0);
- if(out)
- t.pEnv->DeleteLocalRef(out);
- } //t.pEnv
- // WARNING: The caller will be owner of the returned pointers!!!
-}
-jclass java_util_Properties::theClass = 0;
-
-java_util_Properties::~java_util_Properties()
-{}
-
-jclass java_util_Properties::getMyClass() const
-{
- // the class needs only be called once, that is why it is static
- if( !theClass )
- theClass = findMyClass("java/util/Properties");
- return theClass;
-}
-
-//--------------------------------------------------------------------------
-java_util_Properties::java_util_Properties( ): java_lang_Object( NULL, (jobject)NULL )
-{
- SDBThreadAttach t;
- if( !t.pEnv )
- return;
- // Turn off Java-Call for the constructor
- // Initialize temperary Variables
- static const char * cSignature = "()V";
- jobject tempObj;
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, "<init>",cSignature, mID);
- tempObj = t.pEnv->NewObject( getMyClass(), mID);
- saveRef( t.pEnv, tempObj );
- t.pEnv->DeleteLocalRef( tempObj );
-}
-
-// --------------------------------------------------------------------------------
-jstring connectivity::convertwchar_tToJavaString(JNIEnv *pEnv,const ::rtl::OUString& _rTemp)
-{
- OSL_ENSURE(pEnv,"Environment is NULL!");
- jstring pStr = pEnv->NewString(_rTemp.getStr(), _rTemp.getLength());
- pEnv->ExceptionClear();
- OSL_ENSURE(pStr,"Could not create a jsstring object!");
- return pStr;
-}
-
-// --------------------------------------------------------------------------------
-java_util_Properties* connectivity::createStringPropertyArray(const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- java_util_Properties* pProps = new java_util_Properties();
- const PropertyValue* pBegin = info.getConstArray();
- const PropertyValue* pEnd = pBegin + info.getLength();
-
- for(;pBegin != pEnd;++pBegin)
- {
- // this is a special property to find the jdbc driver
- if ( pBegin->Name.compareToAscii( "JavaDriverClass" )
- && pBegin->Name.compareToAscii( "JavaDriverClassPath" )
- && pBegin->Name.compareToAscii( "SystemProperties" )
- && pBegin->Name.compareToAscii( "CharSet" )
- && pBegin->Name.compareToAscii( "AppendTableAliasName" )
- && pBegin->Name.compareToAscii( "AddIndexAppendix" )
- && pBegin->Name.compareToAscii( "FormsCheckRequiredFields" )
- && pBegin->Name.compareToAscii( "GenerateASBeforeCorrelationName" )
- && pBegin->Name.compareToAscii( "EscapeDateTime" )
- && pBegin->Name.compareToAscii( "ParameterNameSubstitution" )
- && pBegin->Name.compareToAscii( "IsPasswordRequired" )
- && pBegin->Name.compareToAscii( "IsAutoRetrievingEnabled" )
- && pBegin->Name.compareToAscii( "AutoRetrievingStatement" )
- && pBegin->Name.compareToAscii( "UseCatalogInSelect" )
- && pBegin->Name.compareToAscii( "UseSchemaInSelect" )
- && pBegin->Name.compareToAscii( "AutoIncrementCreation" )
- && pBegin->Name.compareToAscii( "Extension" )
- && pBegin->Name.compareToAscii( "NoNameLengthLimit" )
- && pBegin->Name.compareToAscii( "EnableSQL92Check" )
- && pBegin->Name.compareToAscii( "EnableOuterJoinEscape" )
- && pBegin->Name.compareToAscii( "BooleanComparisonMode" )
- && pBegin->Name.compareToAscii( "IgnoreCurrency" )
- && pBegin->Name.compareToAscii( "TypeInfoSettings" )
- && pBegin->Name.compareToAscii( "IgnoreDriverPrivileges" )
- && pBegin->Name.compareToAscii( "ImplicitCatalogRestriction" )
- && pBegin->Name.compareToAscii( "ImplicitSchemaRestriction" )
- && pBegin->Name.compareToAscii( "SupportsTableCreation" )
- && pBegin->Name.compareToAscii( "UseJava" )
- && pBegin->Name.compareToAscii( "Authentication" )
- && pBegin->Name.compareToAscii( "PreferDosLikeLineEnds" )
- && pBegin->Name.compareToAscii( "PrimaryKeySupport" )
- && pBegin->Name.compareToAscii( "RespectDriverResultSetType" )
- )
- {
- ::rtl::OUString aStr;
- OSL_VERIFY( pBegin->Value >>= aStr );
- pProps->setProperty(pBegin->Name,aStr);
- }
- }
- return pProps;
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString connectivity::JavaString2String(JNIEnv *pEnv,jstring _Str)
-{
- ::rtl::OUString aStr;
- if(_Str)
- {
- jboolean bCopy(sal_True);
- const jchar* pChar = pEnv->GetStringChars(_Str,&bCopy);
- jsize len = pEnv->GetStringLength(_Str);
- aStr = ::rtl::OUString(pChar,len);
-
- if(bCopy)
- pEnv->ReleaseStringChars(_Str,pChar);
- pEnv->DeleteLocalRef(_Str);
- }
- return aStr;
-}
-// --------------------------------------------------------------------------------
-jobject connectivity::convertTypeMapToJavaMap(JNIEnv* /*pEnv*/,const Reference< ::com::sun::star::container::XNameAccess > & _rMap)
-{
- if ( _rMap.is() )
- {
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames = _rMap->getElementNames();
- if ( aNames.getLength() > 0 )
- ::dbtools::throwFeatureNotImplementedException( "Type maps", NULL );
- }
- return 0;
-}
-// -----------------------------------------------------------------------------
-sal_Bool connectivity::isExceptionOccurred(JNIEnv *pEnv,sal_Bool _bClear)
-{
- if ( !pEnv )
- return sal_False;
-
- jthrowable pThrowable = pEnv->ExceptionOccurred();
- sal_Bool bRet = pThrowable != NULL;
- if ( pThrowable )
- {
- if ( _bClear )
- pEnv->ExceptionClear();
-#if OSL_DEBUG_LEVEL > 1
- if(pEnv->IsInstanceOf(pThrowable,java_sql_SQLException_BASE::st_getMyClass()))
- {
-
- java_sql_SQLException_BASE* pException = new java_sql_SQLException_BASE(pEnv,pThrowable);
- ::rtl::OUString sError = pException->getMessage();
- delete pException;
- }
-#else
- pEnv->DeleteLocalRef(pThrowable);
-#endif
-
- }
-
- return bRet;
-}
-// -----------------------------------------------------------------------------
-jobject connectivity::createByteInputStream(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x,sal_Int32 length)
-{
- SDBThreadAttach t;
- if( !t.pEnv || !x.is() )
- return NULL;
- // Turn off Java-Call for the constructor
- // Initialize temperary variables
- jclass clazz = java_lang_Object::findMyClass("java/io/ByteArrayInputStream");
- static jmethodID mID(NULL);
- if ( !mID )
- {
- static const char * cSignature = "([B)V";
- mID = t.pEnv->GetMethodID( clazz, "<init>", cSignature );
- OSL_ENSURE( mID, cSignature );
- if ( !mID )
- throw SQLException();
- } // if ( !_inout_MethodID )
- jbyteArray pByteArray = t.pEnv->NewByteArray(length);
- Sequence< sal_Int8 > aData;
- x->readBytes(aData,length);
- jboolean p = sal_False;
- rtl_copyMemory(t.pEnv->GetByteArrayElements(pByteArray,&p),aData.getArray(),aData.getLength());
- jobject out = t.pEnv->NewObject( clazz, mID,pByteArray);
- t.pEnv->DeleteLocalRef((jbyteArray)pByteArray);
- return out;
-}
-// -----------------------------------------------------------------------------
-jobject connectivity::createCharArrayReader(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x,sal_Int32 length)
-{
- SDBThreadAttach t;
- if( !t.pEnv || !x.is() )
- return NULL;
- // Turn off Java-Call for the constructor
- // Initialize temperary Variables
- jclass clazz = java_lang_Object::findMyClass("java/io/CharArrayReader");
- static jmethodID mID(NULL);
- if ( !mID )
- {
- static const char * cSignature = "([C)V";
- mID = t.pEnv->GetMethodID( clazz, "<init>", cSignature );
- OSL_ENSURE( mID, cSignature );
- if ( !mID )
- throw SQLException();
- } // if ( !_inout_MethodID )
- jcharArray pCharArray = t.pEnv->NewCharArray(length);
- Sequence< sal_Int8 > aData;
- x->readBytes(aData,length);
- jboolean p = sal_False;
- rtl_copyMemory(t.pEnv->GetCharArrayElements(pCharArray,&p),aData.getArray(),aData.getLength());
- jobject out = t.pEnv->NewObject( clazz, mID,pCharArray);
- t.pEnv->DeleteLocalRef((jcharArray)pCharArray);
- return out;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KCatalog.cxx b/connectivity/source/drivers/kab/KCatalog.cxx
deleted file mode 100644
index 44d95d1e85..0000000000
--- a/connectivity/source/drivers/kab/KCatalog.cxx
+++ /dev/null
@@ -1,127 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "KCatalog.hxx"
-#include "KConnection.hxx"
-#include "KTables.hxx"
-
-using namespace connectivity::kab;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::cppu;
-
-// -------------------------------------------------------------------------
-KabCatalog::KabCatalog(KabConnection* _pCon)
- : connectivity::sdbcx::OCatalog(_pCon),
- m_pConnection(_pCon),
- m_xMetaData(m_pConnection->getMetaData())
-{
-}
-// -------------------------------------------------------------------------
-void KabCatalog::refreshTables()
-{
- TStringVector aVector;
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%"));
- Reference< XResultSet > xResult = m_xMetaData->getTables(
- Any(),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%")),
- aTypes);
-
- if (xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- ::rtl::OUString aName;
- // const ::rtl::OUString& sDot = KabCatalog::getDot();
-
- while (xResult->next())
- {
- // aName = xRow->getString(2);
- // aName += sDot;
- aName = xRow->getString(3);
- aVector.push_back(aName);
- }
- }
- if (m_pTables)
- m_pTables->reFill(aVector);
- else
- m_pTables = new KabTables(m_xMetaData,*this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void KabCatalog::refreshViews()
-{
-}
-// -------------------------------------------------------------------------
-void KabCatalog::refreshGroups()
-{
-}
-// -------------------------------------------------------------------------
-void KabCatalog::refreshUsers()
-{
-}
-// -------------------------------------------------------------------------
-const ::rtl::OUString& KabCatalog::getDot()
-{
- static const ::rtl::OUString sDot = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("."));
- return sDot;
-}
-// -----------------------------------------------------------------------------
-
-// XTablesSupplier
-Reference< XNameAccess > SAL_CALL KabCatalog::getTables( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(rBHelper.bDisposed);
-
- try
- {
- if (!m_pTables)
- refreshTables();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return m_pTables;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KCatalog.hxx b/connectivity/source/drivers/kab/KCatalog.hxx
deleted file mode 100644
index b24a0a92db..0000000000
--- a/connectivity/source/drivers/kab/KCatalog.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_CATALOG_HXX_
-#define _CONNECTIVITY_KAB_CATALOG_HXX_
-
-#include "connectivity/sdbcx/VCatalog.hxx"
-
-namespace connectivity
-{
- namespace kab
- {
- class KabConnection;
-
- class KabCatalog : public connectivity::sdbcx::OCatalog
- {
- KabConnection* m_pConnection; // used to get the metadata
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData; // just to make things easier
-
- public:
- KabCatalog(KabConnection* _pCon);
-
- inline KabConnection* getConnection() const { return m_pConnection; }
-
- static const ::rtl::OUString& getDot();
-
- // implementation of the pure virtual methods
- virtual void refreshTables();
- virtual void refreshViews();
- virtual void refreshGroups();
- virtual void refreshUsers();
-
- // XTablesSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTables(
- ) throw(::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // _CONNECTIVITY_KAB_CATALOG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KColumns.cxx b/connectivity/source/drivers/kab/KColumns.cxx
deleted file mode 100644
index 4fd9ca7cb9..0000000000
--- a/connectivity/source/drivers/kab/KColumns.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "KColumns.hxx"
-#include "KTable.hxx"
-#include "KTables.hxx"
-#include "KCatalog.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-
-using namespace connectivity::kab;
-using namespace connectivity::sdbcx;
-using namespace connectivity;
-using namespace ::comphelper;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -------------------------------------------------------------------------
-sdbcx::ObjectType KabColumns::createObject(const ::rtl::OUString& _rName)
-{
- Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns(
- Any(),
- m_pTable->getSchema(),
- m_pTable->getTableName(),
- _rName);
-
- sdbcx::ObjectType xRet = NULL;
- if (xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
-
- while (xResult->next())
- {
- if (xRow->getString(4) == _rName)
- {
- OColumn* pRet = new OColumn(
- _rName,
- xRow->getString(6),
- xRow->getString(13),
- xRow->getString(12),
- xRow->getInt(11),
- xRow->getInt(7),
- xRow->getInt(9),
- xRow->getInt(5),
- sal_False,
- sal_False,
- sal_False,
- sal_True);
- xRet = pRet;
- break;
- }
- }
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void KabColumns::impl_refresh() throw(RuntimeException)
-{
- m_pTable->refreshColumns();
-}
-// -------------------------------------------------------------------------
-KabColumns::KabColumns( KabTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector)
- : sdbcx::OCollection(*_pTable, sal_True, _rMutex, _rVector),
- m_pTable(_pTable)
-{
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KColumns.hxx b/connectivity/source/drivers/kab/KColumns.hxx
deleted file mode 100644
index c31f0e1659..0000000000
--- a/connectivity/source/drivers/kab/KColumns.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_COLUMNS_HXX_
-#define _CONNECTIVITY_KAB_COLUMNS_HXX_
-
-#include "KTable.hxx"
-#include "connectivity/sdbcx/VCollection.hxx"
-
-namespace connectivity
-{
- namespace kab
- {
- class KabColumns : public sdbcx::OCollection
- {
- protected:
- KabTable* m_pTable;
-
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
-
- public:
- KabColumns( KabTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector);
- };
- }
-}
-
-#endif // _CONNECTIVITY_KAB_COLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KConnection.cxx b/connectivity/source/drivers/kab/KConnection.cxx
deleted file mode 100644
index d612eed46a..0000000000
--- a/connectivity/source/drivers/kab/KConnection.cxx
+++ /dev/null
@@ -1,331 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "KConnection.hxx"
-#include "KDatabaseMetaData.hxx"
-#include "KStatement.hxx"
-#include "KPreparedStatement.hxx"
-#include "KDriver.hxx"
-#include "KCatalog.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/TransactionIsolation.hpp>
-#include <shell/kde_headers.h>
-
-using namespace connectivity::kab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-
-IMPLEMENT_SERVICE_INFO(KabConnection, "com.sun.star.sdbc.drivers.KabConnection", "com.sun.star.sdbc.Connection")
-//-----------------------------------------------------------------------------
-KabConnection::KabConnection(KabDriver* _pDriver)
- : OMetaConnection_BASE(m_aMutex),
- OSubComponent<KabConnection, KabConnection_BASE>((::cppu::OWeakObject*)_pDriver, this),
- m_xMetaData(NULL),
- m_pAddressBook(NULL),
- m_pDriver(_pDriver)
-{
- m_pDriver->acquire();
-}
-//-----------------------------------------------------------------------------
-KabConnection::~KabConnection()
-{
- if (!isClosed())
- close();
-
- m_pDriver->release();
- m_pDriver = NULL;
-}
-//-----------------------------------------------------------------------------
-void SAL_CALL KabConnection::release() throw()
-{
- relase_ChildImpl();
-}
-// -----------------------------------------------------------------------------
-void KabConnection::construct(const ::rtl::OUString&, const Sequence< PropertyValue >&) throw(SQLException)
-{
- osl_incrementInterlockedCount( &m_refCount );
-
- // create a KDE address book object
- m_pAddressBook = KABC::StdAddressBook::self();
- m_pAddressBook->setAutomaticSave(false);
-// perharps we should analyze the URL to know whether the addressbook is local, over LDAP, etc...
-// perharps we should get some user and password information from "info" properties
-
- osl_decrementInterlockedCount( &m_refCount );
-}
-// XServiceInfo
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL KabConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
- // create a statement
- // the statement can only be executed once
- Reference< XStatement > xReturn = new KabStatement(this);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL KabConnection::prepareStatement( const ::rtl::OUString& _sSql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
- // create a statement
- // the statement can only be executed more than once
- Reference< XPreparedStatement > xReturn = new KabPreparedStatement(this, _sSql);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL KabConnection::prepareCall( const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
- // not implemented yet :-) a task to do
- return NULL;
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabConnection::nativeSQL( const ::rtl::OUString& _sSql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- // when you need to transform SQL92 to you driver specific you can do it here
-
- return _sSql;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL KabConnection::setAutoCommit( sal_Bool ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
- // here you have to set your commit mode please have a look at the jdbc documentation to get a clear explanation
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL KabConnection::getAutoCommit( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
- // you have to distinguish which if you are in autocommit mode or not
- // at normal case true should be fine here
-
- return sal_True;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL KabConnection::commit( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
- // when you database does support transactions you should commit here
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL KabConnection::rollback( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
- // same as commit but for the other case
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL KabConnection::isClosed( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- // just simple -> we are closed when we are disposed, that means someone called dispose(); (XComponent)
- return KabConnection_BASE::rBHelper.bDisposed;
-}
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL KabConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
- // here we have to create the class with biggest interface
- // The answer is 42 :-)
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if (!xMetaData.is())
- {
- xMetaData = new KabDatabaseMetaData(this); // need the connection because it can return it
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL KabConnection::setReadOnly( sal_Bool ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
- // set you connection to readonly
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL KabConnection::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
- // return if your connection to readonly
- return sal_False;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL KabConnection::setCatalog( const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
- // if your database doesn't work with catalogs you go to next method otherwise you kjnow what to do
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabConnection::getCatalog( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
-
- // return your current catalog
- return ::rtl::OUString();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL KabConnection::setTransactionIsolation( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
- // set your isolation level
- // please have a look at @see com.sun.star.sdbc.TransactionIsolation
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabConnection::getTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
-
- // please have a look at @see com.sun.star.sdbc.TransactionIsolation
- return TransactionIsolation::NONE;
-}
-// --------------------------------------------------------------------------------
-Reference< ::com::sun::star::container::XNameAccess > SAL_CALL KabConnection::getTypeMap( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
-
- // if your driver has special database types you can return it here
-
- return NULL;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL KabConnection::setTypeMap( const Reference< ::com::sun::star::container::XNameAccess >& ) throw(SQLException, RuntimeException)
-{
- // the other way around
-}
-// --------------------------------------------------------------------------------
-// XCloseable
-void SAL_CALL KabConnection::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabConnection_BASE::rBHelper.bDisposed);
- }
- dispose();
-}
-// --------------------------------------------------------------------------------
-// XWarningsSupplier
-Any SAL_CALL KabConnection::getWarnings( ) throw(SQLException, RuntimeException)
-{
- // when you collected some warnings -> return it
- return Any();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL KabConnection::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- // you should clear your collected warnings here
-}
-//------------------------------------------------------------------------------
-void KabConnection::disposing()
-{
- // we noticed that we should be destroied in near future so we have to dispose our statements
- ::osl::MutexGuard aGuard(m_aMutex);
-
- for (OWeakRefArray::iterator i = m_aStatements.begin(); m_aStatements.end() != i; ++i)
- {
- Reference< XComponent > xComp(i->get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- }
- m_aStatements.clear();
-
- if (m_pAddressBook != NULL)
- {
- m_pAddressBook->close();
- m_pAddressBook = NULL;
- }
-
- m_xMetaData = ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDatabaseMetaData>();
-
- dispose_ChildImpl();
- KabConnection_BASE::disposing();
-}
-// -----------------------------------------------------------------------------
-Reference< XTablesSupplier > SAL_CALL KabConnection::createCatalog()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- Reference< XTablesSupplier > xTab = m_xCatalog;
- if (!m_xCatalog.is())
- {
- KabCatalog *pCat = new KabCatalog(this);
- xTab = pCat;
- m_xCatalog = xTab;
- }
- return xTab;
-}
-// -----------------------------------------------------------------------------
-::KABC::AddressBook* KabConnection::getAddressBook() const
-{
- return m_pAddressBook;
-}
-// -----------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL createKabConnection( void* _pDriver )
-{
- KabConnection* pConnection = new KabConnection( static_cast< KabDriver* >( _pDriver ) );
- // by definition, the pointer crossing library boundaries as void ptr is acquired once
- pConnection->acquire();
- return pConnection;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KConnection.hxx b/connectivity/source/drivers/kab/KConnection.hxx
deleted file mode 100644
index df49547820..0000000000
--- a/connectivity/source/drivers/kab/KConnection.hxx
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_CONNECTION_HXX_
-#define _CONNECTIVITY_KAB_CONNECTION_HXX_
-
-#include <map>
-#include "OSubComponent.hxx"
-#include "connectivity/CommonTools.hxx"
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#include <comphelper/broadcasthelper.hxx>
-#include <cppuhelper/compbase3.hxx>
-
-namespace KABC
-{
- class StdAddressBook;
- class AddressBook;
-}
-
-namespace connectivity
-{
- namespace kab
- {
-
- typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbc::XConnection,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::lang::XServiceInfo
- > OMetaConnection_BASE;
-
- class KabStatement_Base;
- class KabDriver;
- class KabDatabaseMetaData;
-
- typedef OMetaConnection_BASE KabConnection_BASE; // implements basics and text encoding
- typedef std::vector< ::com::sun::star::uno::WeakReferenceHelper > OWeakRefArray;
-
- class KabConnection : public comphelper::OBaseMutex,
- public KabConnection_BASE,
- public OSubComponent<KabConnection, KabConnection_BASE>
- {
- friend class OSubComponent<KabConnection, KabConnection_BASE>;
-
- protected:
- //====================================================================
- // Data attributes
- //====================================================================
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
-
- OWeakRefArray m_aStatements; // vector containing a list of all the Statement objects
- // for this Connection
-
- ::KABC::StdAddressBook* m_pAddressBook; // the address book
- KabDriver* m_pDriver; // pointer to the owning driver object
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier>
- m_xCatalog; // needed for the SQL interpreter
-
- public:
- virtual void construct( const ::rtl::OUString& url,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info) throw(::com::sun::star::sdbc::SQLException);
-
- KabConnection(KabDriver* _pDriver);
- virtual ~KabConnection();
-
- void closeAllStatements () throw( ::com::sun::star::sdbc::SQLException);
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- // XInterface
- virtual void SAL_CALL release() throw();
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
-
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL nativeSQL( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getAutoCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL commit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL rollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isClosed( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCatalog( const ::rtl::OUString& catalog ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalog( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // needed for the SQL interpreter
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL createCatalog();
-
- // accessors
- inline KabDriver* getDriver() const { return m_pDriver;}
- ::KABC::AddressBook* getAddressBook() const;
- };
- }
-}
-
-#endif // _CONNECTIVITY_KAB_CONNECTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KDEInit.cxx b/connectivity/source/drivers/kab/KDEInit.cxx
deleted file mode 100644
index 7264f60862..0000000000
--- a/connectivity/source/drivers/kab/KDEInit.cxx
+++ /dev/null
@@ -1,158 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "KDEInit.h"
-#include <osl/diagnose.h>
-#include <osl/process.h>
-#include <shell/kde_headers.h>
-
-namespace connectivity
-{
- namespace kab
- {
- // ===============================================================
- // = KDEInit
- // ===============================================================
- class KDEInit
- {
- private:
- /// KDE application if we own it
- static KApplication* s_pKApplication;
- static bool s_bDidInsertCatalogue;
-
- public:
- static void Init();
- static void Shutdown();
- };
-
- // ---------------------------------------------------------------
- KApplication* KDEInit::s_pKApplication = NULL;
- bool KDEInit::s_bDidInsertCatalogue = false;
-
- // ---------------------------------------------------------------
- void KDEInit::Init()
- {
- // TODO: All this is not thread-safe
-
- // we create a KDE application only if it is not already done
- if (KApplication::kApplication() == NULL)
- {
- OSL_ENSURE(s_pKApplication == NULL, "KDEInit::Init: inconsistency in the application pointers!");
-
- char *kabargs[1] = {(char*)"libkab1"};
- KCmdLineArgs::init(1, kabargs, "KAddressBook", *kabargs, "Address Book driver", KAB_DRIVER_VERSION);
-
- s_pKApplication = new KApplication(false, false);
- }
-
- // set language
- rtl_Locale *pProcessLocale;
- osl_getProcessLocale(&pProcessLocale);
- // sal_Unicode and QChar are (currently) both 16 bits characters
- QString aLanguage(
- (const QChar *) pProcessLocale->Language->buffer,
- (int) pProcessLocale->Language->length);
- KGlobal::locale()->setLanguage(aLanguage);
-
- // load KDE address book's localized messages
- KGlobal::locale()->insertCatalogue("kaddressbook");
- s_bDidInsertCatalogue = true;
- }
-
- // ---------------------------------------------------------------
- void KDEInit::Shutdown()
- {
- if ( s_bDidInsertCatalogue )
- // this guard is necessary, since KDE 3.3 seems to crash if we remove a catalogue
- // which we did not previously insert
- KGlobal::locale()->removeCatalogue("kaddressbook");
-
- if ( s_pKApplication != NULL )
- {
- delete s_pKApplication;
- s_pKApplication = NULL;
- }
- }
- }
-}
-
-// =======================================================================
-namespace
-{
- double normalizeVersion( unsigned int major, unsigned int minor )
- {
- return major + 1.0 * minor / 1000;
- }
-}
-
-// -----------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL initKApplication()
-{
- ::connectivity::kab::KDEInit::Init();
-}
-
-// -----------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL shutdownKApplication()
-{
- ::connectivity::kab::KDEInit::Shutdown();
-}
-// -----------------------------------------------------------------------
-/** checks whether the KDE version on the system we're running at is supported
- by the driver
-
- Has to be called before any other code from this library, in particular,
- it has to be called before initKApplication()
-
- If this function returns <code>0</code>, then no other code from this library
- has to be called, else the results are unpredictable.
-
- @return
- <ul><li><code>0</code> if the KDE version is supportednon</li>
- <li>a negative value if the version is too old</li>
- <li>a positive value if the version is too new to know whether it works with this driver</li>
- </ul>
-
- #i60062# / 2006-01-06 / frank.schoenheit@sun.com
-*/
-extern "C" SAL_DLLPUBLIC_EXPORT int SAL_CALL matchKDEVersion()
-{
- double nMinVersion = normalizeVersion( MIN_KDE_VERSION_MAJOR, MIN_KDE_VERSION_MINOR );
- double nCurVersion = normalizeVersion( ::KDE::versionMajor(), ::KDE::versionMinor() );
- double nMaxVersion = normalizeVersion( MAX_KDE_VERSION_MAJOR, MAX_KDE_VERSION_MINOR );
-
- if ( nCurVersion < nMinVersion )
- return -1;
- if ( nCurVersion > nMaxVersion )
- return 1;
-
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KDEInit.h b/connectivity/source/drivers/kab/KDEInit.h
deleted file mode 100755
index c1f3963561..0000000000
--- a/connectivity/source/drivers/kab/KDEInit.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_KAB_KDEINIT_H
-#define CONNECTIVITY_KAB_KDEINIT_H
-
-// the address book driver's version
-#define KAB_DRIVER_VERSION "0.2"
-#define KAB_DRIVER_VERSION_MAJOR 0
-#define KAB_DRIVER_VERSION_MINOR 2
-
-// the minimum KDE version which is required at runtime
-#define MIN_KDE_VERSION_MAJOR 3
-#define MIN_KDE_VERSION_MINOR 2
-
-#define MAX_KDE_VERSION_MAJOR 3
-#define MAX_KDE_VERSION_MINOR 6
-
-
-#endif // CONNECTIVITY_KAB_KDEINIT_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KDatabaseMetaData.cxx b/connectivity/source/drivers/kab/KDatabaseMetaData.cxx
deleted file mode 100644
index 18c8915dec..0000000000
--- a/connectivity/source/drivers/kab/KDatabaseMetaData.cxx
+++ /dev/null
@@ -1,1083 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "KDatabaseMetaData.hxx"
-#include "kfields.hxx"
-#include "KDEInit.h"
-#include <shell/kde_headers.h>
-#include "FDatabaseMetaDataResultSet.hxx"
-#include "OTypeInfo.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/TransactionIsolation.hpp>
-
-using namespace connectivity::kab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-
-KabDatabaseMetaData::KabDatabaseMetaData(KabConnection* _pCon)
- : m_xConnection(_pCon),
- m_bUseCatalog(sal_True)
-{
- OSL_ENSURE(_pCon,"KabDatabaseMetaData::KabDatabaseMetaData: No connection set!");
-
- osl_incrementInterlockedCount( &m_refCount );
- m_bUseCatalog = !(usesLocalFiles() || usesLocalFilePerTable());
- osl_decrementInterlockedCount( &m_refCount );
-}
-// -------------------------------------------------------------------------
-KabDatabaseMetaData::~KabDatabaseMetaData()
-{
-}
-// -------------------------------------------------------------------------
-const ::rtl::OUString & KabDatabaseMetaData::getAddressBookTableName()
-{
- static const ::rtl::OUString aAddressBookTableName
- (::rtl::OUString::createFromAscii( i18n("Address Book") ));
-
- return aAddressBookTableName;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getCatalogSeparator( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- if (m_bUseCatalog)
- { // do some special here for you database
- }
-
- return aVal;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxTablesInSelect( ) throw(SQLException, RuntimeException)
-{
- // MaxTablesInSelect describes how many tables can participate in the FROM part of a given SELECT statement,
- // currently, the resultset/statement implementations can cope with one table only
- sal_Int32 nValue = 1;
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::storesMixedCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsAlterTableWithAddColumn( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsAlterTableWithDropColumn( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- if (m_bUseCatalog)
- {
- }
- return aVal;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getIdentifierQuoteString( ) throw(SQLException, RuntimeException)
-{
- // normally this is "
- ::rtl::OUString aVal(RTL_CONSTASCII_USTRINGPARAM("\""));
- return aVal;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- return aVal;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::isCatalogAtStart( ) throw(SQLException, RuntimeException)
-{
- sal_Bool bValue = sal_False;
- if (m_bUseCatalog)
- {
- }
- return bValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsSchemasInDataManipulation( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException)
-{
- return sal_True; // should be supported at least
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsSchemasInTableDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsCatalogsInTableDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsCatalogsInDataManipulation( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxStatements( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- // for the moment, we have read-only addresses, but this might change in the future
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsConvert( sal_Int32, sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsMixedCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- // if someday we support more than the default address book,
- // this method should return the URL which was used to create it
- ::rtl::OUString aValue( RTL_CONSTASCII_USTRINGPARAM( "sdbc:address:kab:" ));
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue( RTL_CONSTASCII_USTRINGPARAM( "kab" ));
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getDriverVersion() throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue(RTL_CONSTASCII_USTRINGPARAM(KAB_DRIVER_VERSION));
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException)
-{
- return KAB_DRIVER_VERSION_MAJOR;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- return TransactionIsolation::NONE;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException)
-{
- return KAB_DRIVER_VERSION_MINOR;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- switch (setType)
- {
- case ResultSetType::FORWARD_ONLY:
- case ResultSetType::SCROLL_INSENSITIVE:
- return sal_True;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 ) throw(SQLException, RuntimeException)
-{
- switch (setType)
- {
- case ResultSetType::FORWARD_ONLY:
- case ResultSetType::SCROLL_INSENSITIVE:
- return sal_True;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::ownUpdatesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::ownDeletesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::ownInsertsAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::othersUpdatesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::othersDeletesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::othersInsertsAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::updatesAreDetected( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::deletesAreDetected( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::insertsAreDetected( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL KabDatabaseMetaData::getConnection( ) throw(SQLException, RuntimeException)
-{
- return (Reference< XConnection >) m_xConnection.get();
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException)
-{
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTableTypes);
- Reference< XResultSet > xRef = pResult;
-
- static ODatabaseMetaDataResultSet::ORows aRows;
- static const ::rtl::OUString aTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
-
- if (aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow(2);
- aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[1] = new ORowSetValueDecorator(aTable);
- aRows.push_back(aRow);
- }
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getTypeInfo( ) throw(SQLException, RuntimeException)
-{
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
- Reference< XResultSet > xRef = pResult;
-
- static ODatabaseMetaDataResultSet::ORows aRows;
- if (aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow(19);
-
- aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CHAR")));
- aRow[2] = new ORowSetValueDecorator(DataType::CHAR);
- aRow[3] = new ORowSetValueDecorator((sal_Int32) 254);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[6] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[7] = new ORowSetValueDecorator((sal_Int32) ColumnValue::NULLABLE);
- aRow[8] = ODatabaseMetaDataResultSet::get1Value();
- aRow[9] = new ORowSetValueDecorator((sal_Int32) ColumnSearch::CHAR);
- aRow[10] = ODatabaseMetaDataResultSet::get1Value();
- aRow[11] = ODatabaseMetaDataResultSet::get0Value();
- aRow[12] = ODatabaseMetaDataResultSet::get0Value();
- aRow[13] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[14] = ODatabaseMetaDataResultSet::get0Value();
- aRow[15] = ODatabaseMetaDataResultSet::get0Value();
- aRow[16] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[17] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[18] = new ORowSetValueDecorator((sal_Int32) 10);
- aRows.push_back(aRow);
-// Much more types might appear in KDE address books
-// To be completed
- }
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getCatalogs( ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eCatalogs );
-}
-// -----------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getSchemas( ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eSchemas );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getColumnPrivileges(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString&,
- const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eColumnPrivileges );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getColumns(
- const Any&,
- const ::rtl::OUString&,
- const ::rtl::OUString& tableNamePattern,
- const ::rtl::OUString& columnNamePattern) throw(SQLException, RuntimeException)
-{
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns);
- Reference< XResultSet > xRef = pResult;
-
- ODatabaseMetaDataResultSet::ORows aRows;
-
- if (match(tableNamePattern, getAddressBookTableName(), '\0'))
- {
- ODatabaseMetaDataResultSet::ORow aRow(19);
-
- aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[1] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[2] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[3] = new ORowSetValueDecorator(getAddressBookTableName());
- aRow[8] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[9] = ODatabaseMetaDataResultSet::get0Value();
- aRow[10] = new ORowSetValueDecorator((sal_Int32) 10);
- aRow[11] = ODatabaseMetaDataResultSet::get1Value();
- aRow[12] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[13] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[14] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[15] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[16] = new ORowSetValueDecorator((sal_Int32) 254);
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("YES")));
-
- sal_Int32 nPosition = 1;
- QString aQtName;
- ::rtl::OUString sName;
-
- aQtName = ::KABC::Addressee::revisionLabel();
- sName = (const sal_Unicode *) aQtName.ucs2();
- if (match(columnNamePattern, sName, '\0'))
- {
- aRow[4] = new ORowSetValueDecorator(sName);
- aRow[5] = new ORowSetValueDecorator(DataType::TIMESTAMP);
- aRow[6] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP")));
- aRow[17] = new ORowSetValueDecorator(nPosition++);
- aRows.push_back(aRow);
- }
-
- ::KABC::Field::List aFields = ::KABC::Field::allFields();
- ::KABC::Field::List::iterator aField;
-
- for ( aField = aFields.begin();
- aField != aFields.end();
- ++aField, ++nPosition)
- {
- aQtName = (*aField)->label();
- sName = (const sal_Unicode *) aQtName.ucs2();
- if (match(columnNamePattern, sName, '\0'))
- {
- aRow[4] = new ORowSetValueDecorator(sName);
- aRow[5] = new ORowSetValueDecorator(DataType::CHAR);
- aRow[6] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CHAR")));
- aRow[7] = new ORowSetValueDecorator((sal_Int32) 256);
-// Might be VARCHAR and not CHAR[256]...
- aRow[17] = new ORowSetValueDecorator(nPosition);
- aRows.push_back(aRow);
- }
- }
- }
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getTables(
- const Any&,
- const ::rtl::OUString&,
- const ::rtl::OUString&,
- const Sequence< ::rtl::OUString >& types) throw(SQLException, RuntimeException)
-{
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTables);
- Reference< XResultSet > xRef = pResult;
-
- // check whether we have tables in the requested types
- // for the moment, we answer only the "TABLE" table type
- // when no types are given at all, we return all the tables
- static const ::rtl::OUString aTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
- sal_Bool bTableFound = sal_False;
- const ::rtl::OUString* p = types.getConstArray(),
- * pEnd = p + types.getLength();
-
- if (p == pEnd)
- {
- bTableFound = sal_True;
- }
- else while (p < pEnd)
- {
- if (match(*p, aTable, '\0'))
- {
- bTableFound = sal_True;
- break;
- }
- p++;
- }
- if (!bTableFound)
- return xRef;
-
- static ODatabaseMetaDataResultSet::ORows aRows;
-
- if (aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow(6);
-
- aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[1] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[2] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[3] = new ORowSetValueDecorator(getAddressBookTableName());
- aRow[4] = new ORowSetValueDecorator(aTable);
- aRow[5] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRows.push_back(aRow);
- }
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getProcedureColumns(
- const Any&, const ::rtl::OUString&,
- const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eProcedureColumns );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getProcedures(
- const Any&, const ::rtl::OUString&,
- const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eProcedures );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getVersionColumns(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eVersionColumns);
-
- Reference< XResultSet > xRef = pResult;
-
- ODatabaseMetaDataResultSet::ORows aRows;
-
- if (table == getAddressBookTableName())
- {
- ODatabaseMetaDataResultSet::ORow aRow( 9 );
- QString aQtName = ::KABC::Addressee::revisionLabel();
- ::rtl::OUString sName = (const sal_Unicode *) aQtName.ucs2();
-
- aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[1] = ODatabaseMetaDataResultSet::getEmptyValue();
-
- aRow[2] = new ORowSetValueDecorator(sName);
- aRow[3] = new ORowSetValueDecorator(DataType::TIMESTAMP);
- aRow[4] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP")));
-
- aRow[5] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[6] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[7] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[8] = ODatabaseMetaDataResultSet::getEmptyValue();
-
- aRows.push_back(aRow);
- }
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getExportedKeys(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eExportedKeys );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getImportedKeys(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eImportedKeys );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getPrimaryKeys(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::ePrimaryKeys );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getIndexInfo(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString&,
- sal_Bool, sal_Bool ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eIndexInfo );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getBestRowIdentifier(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString&, sal_Int32,
- sal_Bool ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eBestRowIdentifier );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getTablePrivileges(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getCrossReference(
- const Any&, const ::rtl::OUString&,
- const ::rtl::OUString&, const Any&,
- const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eCrossReference );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getUDTs( const Any&, const ::rtl::OUString&, const ::rtl::OUString&, const Sequence< sal_Int32 >& ) throw(SQLException, RuntimeException)
-{
- OSL_FAIL("Not implemented yet!");
- throw SQLException();
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KDatabaseMetaData.hxx b/connectivity/source/drivers/kab/KDatabaseMetaData.hxx
deleted file mode 100644
index 00b0bb6414..0000000000
--- a/connectivity/source/drivers/kab/KDatabaseMetaData.hxx
+++ /dev/null
@@ -1,216 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_DATABASEMETADATA_HXX_
-#define _CONNECTIVITY_KAB_DATABASEMETADATA_HXX_
-
-#include "KConnection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace connectivity
-{
- namespace kab
- {
- //**************************************************************
- //************ Class: KabDatabaseMetaData
- //**************************************************************
-
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XDatabaseMetaData> KabDatabaseMetaData_BASE;
-
- class KabDatabaseMetaData : public KabDatabaseMetaData_BASE
- {
- ::com::sun::star::uno::Reference< KabConnection > m_xConnection;
- sal_Bool m_bUseCatalog;
-
- public:
-
- inline KabConnection* getOwnConnection() const { return m_xConnection.get(); }
-
- KabDatabaseMetaData(KabConnection* _pCon);
- static const ::rtl::OUString & getAddressBookTableName();
- virtual ~KabDatabaseMetaData();
-
- // this interface is really BIG
- // XDatabaseMetaData
- virtual sal_Bool SAL_CALL allProceduresAreCallable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL allTablesAreSelectable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getUserName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedLow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFiles( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMixedCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesMixedCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getIdentifierQuoteString( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSQLKeywords( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getNumericFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getStringFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSystemFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTimeDateFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSearchStringEscape( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getExtraNameCharacters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsAlterTableWithAddColumn( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsAlterTableWithDropColumn( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsColumnAliasing( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTypeConversion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getProcedureTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCatalogAtStart( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogSeparator( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInDataManipulation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInTableDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInDataManipulation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInTableDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedDelete( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsStoredProcedures( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnionAll( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxConnections( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxIndexLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxRowSize( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxStatementLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxStatements( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxTablesInSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getProcedures( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getProcedureColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTables( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getSchemas( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getCatalogs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTableTypes( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTablePrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getBestRowIdentifier( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope, sal_Bool nullable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getVersionColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getImportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getExportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getCrossReference( const ::com::sun::star::uno::Any& primaryCatalog, const ::rtl::OUString& primarySchema, const ::rtl::OUString& primaryTable, const ::com::sun::star::uno::Any& foreignCatalog, const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTypeInfo( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getIndexInfo( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Bool unique, sal_Bool approximate ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsBatchUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getUDTs( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern, const ::com::sun::star::uno::Sequence< sal_Int32 >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // _CONNECTIVITY_KAB_DATABASEMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KDriver.cxx b/connectivity/source/drivers/kab/KDriver.cxx
deleted file mode 100644
index 549d8aa745..0000000000
--- a/connectivity/source/drivers/kab/KDriver.cxx
+++ /dev/null
@@ -1,475 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "KDriver.hxx"
-#include "KDEInit.h"
-#include "KConnection.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/sdb/SQLContext.hpp>
-#include <com/sun/star/lang/NullPointerException.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-/** === end UNO includes === **/
-#include <rtl/ustrbuf.hxx>
-#include <tools/diagnose_ex.h>
-#include "resource/kab_res.hrc"
-#include "resource/sharedresources.hxx"
-
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdb;
-using namespace com::sun::star::frame;
-using namespace connectivity::kab;
-
-// =======================================================================
-// = KabImplModule
-// =======================================================================
-// --------------------------------------------------------------------------------
-KabImplModule::KabImplModule( const Reference< XMultiServiceFactory >& _rxFactory )
- :m_xORB(_rxFactory)
- ,m_bAttemptedLoadModule(false)
- ,m_bAttemptedInitialize(false)
- ,m_hConnectorModule(NULL)
- ,m_pConnectionFactoryFunc(NULL)
- ,m_pApplicationInitFunc(NULL)
- ,m_pApplicationShutdownFunc(NULL)
- ,m_pKDEVersionCheckFunc(NULL)
-{
- if ( !m_xORB.is() )
- throw NullPointerException();
-}
-
-// --------------------------------------------------------------------------------
-bool KabImplModule::isKDEPresent()
-{
- if ( !impl_loadModule() )
- return false;
-
- return true;
-}
-
-// --------------------------------------------------------------------------------
-KabImplModule::KDEVersionType KabImplModule::matchKDEVersion()
-{
- OSL_PRECOND( m_pKDEVersionCheckFunc, "KabImplModule::matchKDEVersion: module not loaded!" );
-
- int nVersionInfo = (*m_pKDEVersionCheckFunc)();
- if ( nVersionInfo < 0 )
- return eTooOld;
- if ( nVersionInfo > 0 )
- return eToNew;
- return eSupported;
-}
-
-// --------------------------------------------------------------------------------
-namespace
-{
- template< typename FUNCTION >
- void lcl_getFunctionFromModuleOrUnload( oslModule& _rModule, const sal_Char* _pAsciiSymbolName, FUNCTION& _rFunction )
- {
- _rFunction = NULL;
- if ( _rModule )
- {
- //
- const ::rtl::OUString sSymbolName = ::rtl::OUString::createFromAscii( _pAsciiSymbolName );
- _rFunction = (FUNCTION)( osl_getSymbol( _rModule, sSymbolName.pData ) );
-
- if ( !_rFunction )
- { // did not find the symbol
- OSL_FAIL( ::rtl::OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + ::rtl::OString( _pAsciiSymbolName ) );
- osl_unloadModule( _rModule );
- _rModule = NULL;
- }
- }
- }
-}
-
-// --------------------------------------------------------------------------------
-extern "C" { void SAL_CALL thisModule() {} }
-
-bool KabImplModule::impl_loadModule()
-{
- if ( m_bAttemptedLoadModule )
- return ( m_hConnectorModule != NULL );
- m_bAttemptedLoadModule = true;
-
- OSL_ENSURE( !m_hConnectorModule && !m_pConnectionFactoryFunc && !m_pApplicationInitFunc && !m_pApplicationShutdownFunc && !m_pKDEVersionCheckFunc,
- "KabImplModule::impl_loadModule: inconsistence: inconsistency (never attempted load before, but some values already set)!");
-
- const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM( SAL_MODULENAME( "kabdrv1" ) ));
- m_hConnectorModule = osl_loadModuleRelative( &thisModule, sModuleName.pData, SAL_LOADMODULE_NOW ); // LAZY! #i61335#
- OSL_ENSURE( m_hConnectorModule, "KabImplModule::impl_loadModule: could not load the implementation library!" );
- if ( !m_hConnectorModule )
- return false;
-
- lcl_getFunctionFromModuleOrUnload( m_hConnectorModule, "createKabConnection", m_pConnectionFactoryFunc );
- lcl_getFunctionFromModuleOrUnload( m_hConnectorModule, "initKApplication", m_pApplicationInitFunc );
- lcl_getFunctionFromModuleOrUnload( m_hConnectorModule, "shutdownKApplication", m_pApplicationShutdownFunc );
- lcl_getFunctionFromModuleOrUnload( m_hConnectorModule, "matchKDEVersion", m_pKDEVersionCheckFunc );
-
- if ( !m_hConnectorModule )
- // one of the symbols did not exist
- throw RuntimeException();
-
- return true;
-}
-
-// --------------------------------------------------------------------------------
-void KabImplModule::impl_unloadModule()
-{
- OSL_PRECOND( m_hConnectorModule != NULL, "KabImplModule::impl_unloadModule: no module!" );
-
- osl_unloadModule( m_hConnectorModule );
- m_hConnectorModule = NULL;
-
- m_pConnectionFactoryFunc = NULL;
- m_pApplicationInitFunc = NULL;
- m_pApplicationShutdownFunc = NULL;
- m_pKDEVersionCheckFunc = NULL;
-
- m_bAttemptedLoadModule = false;
-}
-
-// --------------------------------------------------------------------------------
-void KabImplModule::init()
-{
- if ( !impl_loadModule() )
- impl_throwNoKdeException();
-
- // if we're not running on a supported version, throw
- KabImplModule::KDEVersionType eKDEVersion = matchKDEVersion();
-
- if ( eKDEVersion == eTooOld )
- impl_throwKdeTooOldException();
-
- if ( ( eKDEVersion == eToNew ) && !impl_doAllowNewKDEVersion() )
- impl_throwKdeTooNewException();
-
- if ( !m_bAttemptedInitialize )
- {
- m_bAttemptedInitialize = true;
- (*m_pApplicationInitFunc)();
- }
-}
-
-// --------------------------------------------------------------------------------
-bool KabImplModule::impl_doAllowNewKDEVersion()
-{
- try
- {
- Reference< XMultiServiceFactory > xConfigProvider(
- m_xORB->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) ) ),
- UNO_QUERY_THROW );
- Sequence< Any > aCreationArgs(1);
- aCreationArgs[0] <<= PropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) ),
- 0,
- makeAny( KabDriver::impl_getConfigurationSettingsPath() ),
- PropertyState_DIRECT_VALUE );
- Reference< XPropertySet > xSettings( xConfigProvider->createInstanceWithArguments(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" ) ),
- aCreationArgs ),
- UNO_QUERY_THROW );
-
- sal_Bool bDisableCheck = sal_False;
- xSettings->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableKDEMaximumVersionCheck" ) ) ) >>= bDisableCheck;
-
- return bDisableCheck != sal_False;
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return false;
-}
-
-// --------------------------------------------------------------------------------
-void KabImplModule::impl_throwNoKdeException()
-{
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(
- STR_NO_KDE_INST
- ) );
- impl_throwGenericSQLException( sError );
-}
-
-// --------------------------------------------------------------------------------
-void KabImplModule::impl_throwKdeTooOldException()
-{
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_KDE_VERSION_TOO_OLD,
- "$major$",::rtl::OUString::valueOf((sal_Int32)MIN_KDE_VERSION_MAJOR),
- "$minor$",::rtl::OUString::valueOf((sal_Int32)MIN_KDE_VERSION_MINOR)
- ) );
- impl_throwGenericSQLException( sError );
-}
-
-// --------------------------------------------------------------------------------
-void KabImplModule::impl_throwGenericSQLException( const ::rtl::OUString& _rMessage )
-{
- SQLException aError;
- aError.Message = _rMessage;
- aError.SQLState = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "S1000" ) );
- aError.ErrorCode = 0;
- throw aError;
-}
-
-// --------------------------------------------------------------------------------
-void KabImplModule::impl_throwKdeTooNewException()
-{
- ::connectivity::SharedResources aResources;
-
- SQLException aError;
- aError.Message = aResources.getResourceStringWithSubstitution(
- STR_KDE_VERSION_TOO_NEW,
- "$major$",::rtl::OUString::valueOf((sal_Int32)MIN_KDE_VERSION_MAJOR),
- "$minor$",::rtl::OUString::valueOf((sal_Int32)MIN_KDE_VERSION_MINOR)
- );
- aError.SQLState = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "S1000" ) );
- aError.ErrorCode = 0;
-
- SQLContext aDetails;
- ::rtl::OUStringBuffer aMessage;
- aMessage.append( aResources.getResourceString(STR_KDE_VERSION_TOO_NEW_WORK_AROUND) );
-
- aMessage.appendAscii( "Sub disableKDEMaxVersionCheck\n" );
- aMessage.appendAscii( " BasicLibraries.LoadLibrary( \"Tools\" )\n" );
-
- aMessage.appendAscii( " Dim configNode as Object\n" );
- aMessage.appendAscii( " configNode = GetRegistryKeyContent( \"" );
- aMessage.append( KabDriver::impl_getConfigurationSettingsPath() );
- aMessage.appendAscii( "\", true )\n" );
-
- aMessage.appendAscii( " configNode.DisableKDEMaximumVersionCheck = TRUE\n" );
- aMessage.appendAscii( " configNode.commitChanges\n" );
- aMessage.appendAscii( "End Sub\n" );
-
- aDetails.Message = aMessage.makeStringAndClear();
-
- aError.NextException <<= aDetails;
-
- throw aError;
-}
-
-// --------------------------------------------------------------------------------
-KabConnection* KabImplModule::createConnection( KabDriver* _pDriver ) const
-{
- OSL_PRECOND( m_hConnectorModule, "KabImplModule::createConnection: not initialized!" );
-
- void* pUntypedConnection = (*m_pConnectionFactoryFunc)( _pDriver );
- if ( !pUntypedConnection )
- throw RuntimeException();
-
- return static_cast< KabConnection* >( pUntypedConnection );
-}
-
-// --------------------------------------------------------------------------------
-void KabImplModule::shutdown()
-{
- if ( !m_hConnectorModule )
- return;
-
- (*m_pApplicationShutdownFunc)();
- m_bAttemptedInitialize = false;
-
- impl_unloadModule();
-}
-
-// =======================================================================
-// = KabDriver
-// =======================================================================
-KabDriver::KabDriver(
- const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory)
- : KDriver_BASE(m_aMutex),
- m_xMSFactory(_rxFactory),
- m_aImplModule(_rxFactory)
-{
- if ( !m_xMSFactory.is() )
- throw NullPointerException();
-
- osl_incrementInterlockedCount( &m_refCount );
- try
- {
- Reference< XDesktop > xDesktop(
- m_xMSFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ) ),
- UNO_QUERY_THROW );
- xDesktop->addTerminateListener( this );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- osl_decrementInterlockedCount( &m_refCount );
-}
-// --------------------------------------------------------------------------------
-void KabDriver::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- // when driver will be destroied so all our connections have to be destroied as well
- for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
- {
- Reference< XComponent > xComp(i->get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- }
- m_xConnections.clear();
-
- WeakComponentImplHelperBase::disposing();
-}
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString KabDriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return rtl::OUString::createFromAscii( impl_getAsciiImplementationName() );
-}
-//------------------------------------------------------------------------------
-Sequence< ::rtl::OUString > KabDriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
-{
- // which service is supported
- // for more information @see com.sun.star.sdbc.Driver
- Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"));
-
- return aSNS;
-}
-//------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabDriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-//------------------------------------------------------------------
-sal_Bool SAL_CALL KabDriver::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
-
- while (pSupported != pEnd && !pSupported->equals(_rServiceName))
- ++pSupported;
- return pSupported != pEnd;
-}
-//------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL KabDriver::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-// --------------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL KabDriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- m_aImplModule.init();
-
- // create a new connection with the given properties and append it to our vector
- KabConnection* pConnection = m_aImplModule.createConnection( this );
- OSL_POSTCOND( pConnection, "KabDriver::connect: no connection has been created by the factory!" );
-
- // by definition, the factory function returned an object which was acquired once
- Reference< XConnection > xConnection = pConnection;
- pConnection->release();
-
- // late constructor call which can throw exception and allows a correct dtor call when so
- pConnection->construct( url, info );
-
- // remember it
- m_xConnections.push_back( WeakReferenceHelper( *pConnection ) );
-
- return xConnection;
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL KabDriver::acceptsURL( const ::rtl::OUString& url )
- throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- if ( !m_aImplModule.isKDEPresent() )
- return sal_False;
-
- // here we have to look whether we support this URL format
- return (!url.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:kab:")), 16));
-}
-// --------------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL KabDriver::getPropertyInfo( const ::rtl::OUString&, const Sequence< PropertyValue >& ) throw(SQLException, RuntimeException)
-{
- // if you have something special to say, return it here :-)
- return Sequence< DriverPropertyInfo >();
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDriver::getMajorVersion( ) throw(RuntimeException)
-{
- return KAB_DRIVER_VERSION_MAJOR;
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabDriver::getMinorVersion( ) throw(RuntimeException)
-{
- return KAB_DRIVER_VERSION_MINOR;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL KabDriver::queryTermination( const EventObject& ) throw (TerminationVetoException, RuntimeException)
-{
- // nothing to do, nothing to veto
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL KabDriver::notifyTermination( const EventObject& ) throw (RuntimeException)
-{
- m_aImplModule.shutdown();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL KabDriver::disposing( const EventObject& ) throw (RuntimeException)
-{
- // not interested in (this is the disposing of the desktop, if any)
-}
-// --------------------------------------------------------------------------------
-const sal_Char* KabDriver::impl_getAsciiImplementationName()
-{
- return "com.sun.star.comp.sdbc.kab.Driver";
- // this name is referenced in the configuration and in the kab.xml
- // Please be careful when changing it.
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString KabDriver::impl_getConfigurationSettingsPath()
-{
- ::rtl::OUStringBuffer aPath;
- aPath.appendAscii( "/org.openoffice.Office.DataAccess/DriverSettings/" );
- aPath.appendAscii( "com.sun.star.comp.sdbc.kab.Driver" );
- return aPath.makeStringAndClear();
-}
-// --------------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL KabDriver::Create( const Reference< XMultiServiceFactory >& _rxFactory ) throw( Exception )
-{
- return *(new KabDriver(_rxFactory));
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KDriver.hxx b/connectivity/source/drivers/kab/KDriver.hxx
deleted file mode 100644
index aa2d1f252b..0000000000
--- a/connectivity/source/drivers/kab/KDriver.hxx
+++ /dev/null
@@ -1,226 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_DRIVER_HXX_
-#define _CONNECTIVITY_KAB_DRIVER_HXX_
-
-/** === begin UNO includes === **/
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/frame/XTerminateListener.hpp>
-/** === end UNO includes === **/
-#include <cppuhelper/compbase3.hxx>
-#include <osl/module.h>
-
-namespace connectivity
-{
- namespace kab
- {
- class KabConnection;
- class KabDriver;
-
- typedef void* (SAL_CALL * ConnectionFactoryFunction)( void* _pDriver );
- typedef void (SAL_CALL * ApplicationInitFunction)( void );
- typedef void (SAL_CALL * ApplicationShutdownFunction)( void );
- typedef int (SAL_CALL * KDEVersionCheckFunction)( void );
-
- typedef std::vector< ::com::sun::star::uno::WeakReferenceHelper > OWeakRefArray;
-
- // ===============================================================
- // = KabImplModule
- // ===============================================================
- class KabImplModule
- {
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xORB;
-
- /// Did we already attempt to load the module and to retrieve the symbols?
- bool m_bAttemptedLoadModule;
- /// Did we already check the KDE version and initialize the impl module (or at least attempted to)?
- bool m_bAttemptedInitialize;
-
- oslModule m_hConnectorModule;
- ConnectionFactoryFunction m_pConnectionFactoryFunc;
- ApplicationInitFunction m_pApplicationInitFunc;
- ApplicationShutdownFunction m_pApplicationShutdownFunc;
- KDEVersionCheckFunction m_pKDEVersionCheckFunc;
-
- public:
- KabImplModule( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory );
-
- /** determines whether there is a KDE present in the environment
- */
- bool isKDEPresent();
-
- enum KDEVersionType
- {
- eTooOld,
- eSupported,
- eToNew
- };
- /** checks whether the KDE version we're running against is supported
- @precond
- the module is loaded, i.e impl_loadModule has successfully been called
- */
- KDEVersionType matchKDEVersion();
-
- /** initializes the implementation module.
-
- @raises ::com::sun::star::uno::RuntimeException
- if the module could be loaded, but required symbols are missing
- @raises ::com::sun::star::sdbc::SQLException
- if the KDE version we're running against is not supported, or no KDE was found at all
- */
- void init();
-
- /** shuts down the impl module (and the KDE application, if we own it)
- */
- void shutdown();
-
- /** creates a new connection
- @precond
- <member>init</member> has been called before
- @raises ::com::sun::star::uno::RuntimeException
- if no connection object could be created (which is a severe error, normally impossible)
- */
- KabConnection* createConnection( KabDriver* _pDriver ) const;
-
- private:
- /** loads the implementation module and retrieves the needed symbols
-
- Save against being called multiple times.
-
- @return <TRUE/> if the module could be loaded successfully.
-
- @raises ::com::sun::star::uno::RuntimeException
- if the module could be loaded, but required symbols are missing
- */
- bool impl_loadModule();
-
- /** unloads the implementation module, and resets all function pointers to <NULL/>
- @precond m_hConnectorModule is not <NULL/>
- */
- void impl_unloadModule();
-
- /** throws an SQLException saying than no KDE installation was found
- */
- void impl_throwNoKdeException();
-
- /** throws an SQLException saying that the found KDE version is too old
- */
- void impl_throwKdeTooOldException();
-
- /** throws an SQLException saying that the found KDE version is too new
- */
- void impl_throwKdeTooNewException();
-
- /** throws a generic SQL exception with SQLState S1000 and error code 0
- */
- void impl_throwGenericSQLException( const ::rtl::OUString& _rMessage );
-
- /** determines whether it's allowed to run on a too-new (not confirmed to work) version
- */
- bool impl_doAllowNewKDEVersion();
- };
-
- // ===============================================================
- // = KabDriver
- // ===============================================================
- typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbc::XDriver,
- ::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::frame::XTerminateListener > KDriver_BASE;
- class KabDriver : public KDriver_BASE
- {
- protected:
- ::osl::Mutex m_aMutex; // mutex is need to control member access
- OWeakRefArray m_xConnections; // vector containing a list of all the
- // KabConnection objects for this Driver
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xMSFactory; // the multi-service factory
- KabImplModule m_aImplModule;
-
- public:
- static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
-
- // XServiceInfo - static versions
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
- getMSFactory() const { return m_xMSFactory; }
-
- /** returns the driver's implementation name (being pure ASCII) for reference in various places
- */
- static const sal_Char* impl_getAsciiImplementationName();
-
- /** returns the path of our configuration settings
- */
- static ::rtl::OUString impl_getConfigurationSettingsPath();
-
- protected:
- KabDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMajorVersion() throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMinorVersion() throw(::com::sun::star::uno::RuntimeException);
-
- // XTerminateListener
- virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
-
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
-
- private:
- /** shuts down the library which contains the real implementations
-
- This method is safe against being called multiple times
-
- @precond our mutex is locked
- */
- void impl_shutdownImplementationModule();
- };
- }
-
-}
-
-#endif // _CONNECTIVITY_KAB_DRIVER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KPreparedStatement.cxx b/connectivity/source/drivers/kab/KPreparedStatement.cxx
deleted file mode 100644
index d82ca654d7..0000000000
--- a/connectivity/source/drivers/kab/KPreparedStatement.cxx
+++ /dev/null
@@ -1,393 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "KPreparedStatement.hxx"
-#include "propertyids.hxx"
-#include <connectivity/dbexception.hxx>
-#include <connectivity/dbtools.hxx>
-#include "resource/kab_res.hrc"
-#include "resource/sharedresources.hxx"
-
-using namespace connectivity::kab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::util;
-
-IMPLEMENT_SERVICE_INFO(KabPreparedStatement, "com.sun.star.sdbc.drivers.KabPreparedStatement", "com.sun.star.sdbc.PreparedStatement");
-// -------------------------------------------------------------------------
-void KabPreparedStatement::checkAndResizeParameters(sal_Int32 nParams) throw(SQLException)
-{
- if ( !m_aParameterRow.is() )
- m_aParameterRow = new OValueVector();
-
- if (nParams < 1)
- ::dbtools::throwInvalidIndexException(*(KabPreparedStatement *) this,Any());
-
- if (nParams >= (sal_Int32) (m_aParameterRow->get()).size())
- (m_aParameterRow->get()).resize(nParams);
-}
-// -------------------------------------------------------------------------
-void KabPreparedStatement::setKabFields() const throw(SQLException)
-{
- ::rtl::Reference<connectivity::OSQLColumns> xColumns; // selected columns
-
- xColumns = m_aSQLIterator.getSelectColumns();
- if (!xColumns.is())
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(
- STR_INVALID_COLUMN_SELECTION
- ) );
- ::dbtools::throwGenericSQLException(sError,NULL);
- }
- m_xMetaData->setKabFields(xColumns);
-}
-// -------------------------------------------------------------------------
-void KabPreparedStatement::resetParameters() const throw(SQLException)
-{
- m_nParameterIndex = 0;
-}
-// -------------------------------------------------------------------------
-void KabPreparedStatement::getNextParameter(::rtl::OUString &rParameter) const throw(SQLException)
-{
- if (m_nParameterIndex >= (sal_Int32) (m_aParameterRow->get()).size())
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(
- STR_INVALID_PARA_COUNT
- ) );
- ::dbtools::throwGenericSQLException(sError,*(KabPreparedStatement *) this);
- } // if (m_nParameterIndex >= (sal_Int32) (*m_aParameterRow).size())
-
- rParameter = (m_aParameterRow->get())[m_nParameterIndex];
-
- m_nParameterIndex++;
-}
-// -------------------------------------------------------------------------
-KabPreparedStatement::KabPreparedStatement(
- KabConnection* _pConnection,
- const ::rtl::OUString& sql)
- : KabPreparedStatement_BASE(_pConnection),
- m_sSqlStatement(sql),
- m_bPrepared(sal_False),
- m_nParameterIndex(0),
- m_aParameterRow()
-{
-}
-// -------------------------------------------------------------------------
-KabPreparedStatement::~KabPreparedStatement()
-{
-}
-// -------------------------------------------------------------------------
-void KabPreparedStatement::disposing()
-{
- KabPreparedStatement_BASE::disposing();
-
- if (m_aParameterRow.is())
- {
- m_aParameterRow->get().clear();
- m_aParameterRow = NULL;
- }
-}
-// -------------------------------------------------------------------------
-Reference< XResultSetMetaData > SAL_CALL KabPreparedStatement::getMetaData() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- if (!m_xMetaData.is())
- {
- m_xMetaData = new KabResultSetMetaData(getOwnConnection());
- setKabFields();
- }
- Reference< XResultSetMetaData > xMetaData = m_xMetaData.get();
- return xMetaData;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::close() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- // Reset last warning message
- try {
- clearWarnings ();
- KabCommonStatement::close();
- }
- catch (SQLException &) {
- // If we get an error, ignore
- }
-
- // Remove this Statement object from the Connection object's
- // list
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabPreparedStatement::execute() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- Reference< XResultSet> xRS = KabCommonStatement::executeQuery(m_sSqlStatement);
-
- return xRS.is();
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabPreparedStatement::executeUpdate() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- // same as in statement with the difference that this statement also can contain parameter
- return 0;
-}
-// -------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL KabPreparedStatement::getConnection() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- return (Reference< XConnection >) m_pConnection;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabPreparedStatement::executeQuery() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- Reference< XResultSet > rs = KabCommonStatement::executeQuery(m_sSqlStatement);
-
- return rs;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setNull(sal_Int32 parameterIndex, sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- checkAndResizeParameters(parameterIndex);
-
- (m_aParameterRow->get())[parameterIndex - 1].setNull();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setObjectNull(sal_Int32, sal_Int32, const ::rtl::OUString&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setObjectNull", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setBoolean(sal_Int32, sal_Bool) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setBoolean", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setByte(sal_Int32, sal_Int8) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setByte", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setShort(sal_Int32, sal_Int16) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setShort", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setInt(sal_Int32, sal_Int32) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setInt", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setLong(sal_Int32, sal_Int64) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setFloat(sal_Int32, float) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setFloat", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setDouble(sal_Int32, double) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setDouble", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setString(sal_Int32 parameterIndex, const ::rtl::OUString &x) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- checkAndResizeParameters(parameterIndex);
-
- (m_aParameterRow->get())[parameterIndex - 1] = x;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setBytes(sal_Int32, const Sequence< sal_Int8 >&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setBytes", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setDate(sal_Int32, const Date&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setDate", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setTime(sal_Int32, const Time&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setTime", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setTimestamp(sal_Int32, const DateTime&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setTimestamp", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setBinaryStream(sal_Int32, const Reference< ::com::sun::star::io::XInputStream >&, sal_Int32) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setBinaryStream", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setCharacterStream(sal_Int32, const Reference< ::com::sun::star::io::XInputStream >&, sal_Int32) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setCharacterStream", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setObject(sal_Int32 parameterIndex, const Any& x) throw(SQLException, RuntimeException)
-{
- if(!::dbtools::implSetObject(this,parameterIndex,x))
- {
- throw SQLException();
- }
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setObjectWithInfo(sal_Int32, const Any&, sal_Int32, sal_Int32) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setObjectWithInfo", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setRef(sal_Int32, const Reference< XRef >&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setRef", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setBlob(sal_Int32, const Reference< XBlob >&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setBlob", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setClob(sal_Int32, const Reference< XClob >&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setClob", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::setArray(sal_Int32, const Reference< XArray >&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setArray", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabPreparedStatement::clearParameters() throw(SQLException, RuntimeException)
-{
-::dbtools::throwFunctionNotSupportedException("clearParameters", NULL);
-}
-// -------------------------------------------------------------------------
-void KabPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception)
-{
- switch (nHandle)
- {
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- break;
- case PROPERTY_ID_USEBOOKMARKS:
- break;
- default:
- KabCommonStatement::setFastPropertyValue_NoBroadcast(nHandle,rValue);
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KPreparedStatement.hxx b/connectivity/source/drivers/kab/KPreparedStatement.hxx
deleted file mode 100644
index 876afb1719..0000000000
--- a/connectivity/source/drivers/kab/KPreparedStatement.hxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_PREPAREDSTATEMENT_HXX_
-#define _CONNECTIVITY_KAB_PREPAREDSTATEMENT_HXX_
-
-#include "KStatement.hxx"
-#include "KResultSetMetaData.hxx"
-#include <connectivity/FValue.hxx>
-#include <com/sun/star/sdbc/XParameters.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <cppuhelper/implbase4.hxx>
-
-namespace connectivity
-{
- namespace kab
- {
-
- class OBoundParam;
- typedef ::cppu::ImplInheritanceHelper4< KabCommonStatement,
- ::com::sun::star::sdbc::XPreparedStatement,
- ::com::sun::star::sdbc::XParameters,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::lang::XServiceInfo> KabPreparedStatement_BASE;
-
- class KabPreparedStatement : public KabPreparedStatement_BASE
- {
- protected:
- ::rtl::OUString m_sSqlStatement;
- ::rtl::Reference< KabResultSetMetaData >
- m_xMetaData;
- sal_Bool m_bPrepared;
- mutable sal_Int32 m_nParameterIndex;
- OValueRow m_aParameterRow;
-
- void checkAndResizeParameters(sal_Int32 nParams) throw(::com::sun::star::sdbc::SQLException);
- void setKabFields() const throw(::com::sun::star::sdbc::SQLException);
-
- protected:
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception);
-
- virtual void resetParameters() const throw(::com::sun::star::sdbc::SQLException);
- virtual void getNextParameter(::rtl::OUString &rParameter) const throw(::com::sun::star::sdbc::SQLException);
- virtual ~KabPreparedStatement();
-
- public:
- DECLARE_SERVICE_INFO();
- KabPreparedStatement(KabConnection* _pConnection, const ::rtl::OUString& sql);
-
- // OComponentHelper
- virtual void SAL_CALL disposing();
-
- // XPreparedStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL executeUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XParameters
- virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearParameters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // _CONNECTIVITY_KAB_PREPAREDSTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KResultSet.cxx b/connectivity/source/drivers/kab/KResultSet.cxx
deleted file mode 100644
index 1c1b8f35dc..0000000000
--- a/connectivity/source/drivers/kab/KResultSet.cxx
+++ /dev/null
@@ -1,990 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "KResultSet.hxx"
-#include "KResultSetMetaData.hxx"
-#include "KConnection.hxx"
-#include "kcondition.hxx"
-#include "korder.hxx"
-#include "kfields.hxx"
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/sdbcx/CompareBookmark.hpp>
-#include "TConnection.hxx"
-#include <connectivity/dbexception.hxx>
-#include "resource/kab_res.hrc"
-#include "resource/sharedresources.hxx"
-
-using namespace connectivity::kab;
-using namespace cppu;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-
-IMPLEMENT_SERVICE_INFO(KabResultSet, "com.sun.star.sdbc.drivers.KabResultSet", "com.sun.star.sdbc.ResultSet");
-// -------------------------------------------------------------------------
-KabResultSet::KabResultSet(KabCommonStatement* pStmt)
- : KabResultSet_BASE(m_aMutex),
- OPropertySetHelper(KabResultSet_BASE::rBHelper),
- m_xStatement(pStmt),
- m_xMetaData(NULL),
- m_aKabAddressees(),
- m_nRowPos(-1),
- m_bWasNull(sal_True)
-{
-}
-// -------------------------------------------------------------------------
-KabResultSet::~KabResultSet()
-{
-}
-// -------------------------------------------------------------------------
-void KabResultSet::allKabAddressees()
-{
- KabConnection* pConnection = static_cast< KabConnection *>(m_xStatement->getConnection().get());
- KABC::AddressBook* pAddressBook = pConnection->getAddressBook();
-
- m_aKabAddressees = pAddressBook->allAddressees();
-}
-// -------------------------------------------------------------------------
-void KabResultSet::someKabAddressees(const KabCondition *pCondition)
-{
- KabConnection* pConnection = static_cast< KabConnection *>(m_xStatement->getConnection().get());
- KABC::AddressBook* pAddressBook = pConnection->getAddressBook();
-
- KABC::AddressBook::Iterator iterator;
-
- for (iterator = pAddressBook->begin();
- iterator != pAddressBook->end();
- ++iterator)
- {
- if (pCondition->eval(*iterator))
- m_aKabAddressees.push_back(*iterator);
- }
-}
-// -------------------------------------------------------------------------
-void KabResultSet::sortKabAddressees(const KabOrder *pOrder)
-{
- // We do not use class KAddresseeList, which has a sorting algorithm in it, because
- // it uses templates. It would expand to more or less the same code as the one
- // which follows, but it would need not be called in a much less convenient way.
-
- KABC::Addressee::List::Iterator
- begin = m_aKabAddressees.begin(),
- end = m_aKabAddressees.end(),
- iterator;
-
- // Bubble sort. Feel free to implement a better algorithm.
- while (begin != end)
- {
- end--;
- for (iterator = begin; iterator != end; ++iterator)
- {
- if (pOrder->compare(*iterator, *end) > 0)
- qSwap(*iterator, *end);
- }
- }
-}
-// -------------------------------------------------------------------------
-void KabResultSet::disposing()
-{
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
-
-m_xStatement.clear();
-m_xMetaData.clear();
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL KabResultSet::queryInterface(const Type & rType) throw(RuntimeException)
-{
- Any aRet = OPropertySetHelper::queryInterface(rType);
- if (!aRet.hasValue())
- aRet = KabResultSet_BASE::queryInterface(rType);
- return aRet;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::acquire() throw()
-{
- KabResultSet_BASE::acquire();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::release() throw()
-{
- KabResultSet_BASE::release();
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL KabResultSet::getTypes() throw(RuntimeException)
-{
- OTypeCollection aTypes(
- ::getCppuType( (const Reference< ::com::sun::star::beans::XMultiPropertySet >*) 0),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XFastPropertySet >*) 0),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XPropertySet >*) 0));
-
- return comphelper::concatSequences(aTypes.getTypes(), KabResultSet_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL KabResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabResultSet::findColumn(const ::rtl::OUString& columnName) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- // find the first column with the name columnName
- Reference< XResultSetMetaData > xMeta = getMetaData();
- sal_Int32 nLen = xMeta->getColumnCount();
-
- for (sal_Int32 i = 1; i <= nLen; ++i)
- if (xMeta->isCaseSensitive(i) ?
- columnName == xMeta->getColumnName(i) :
- columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
- return i;
-
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_INVALID_COLUMNNAME,
- "$columnname$",columnName
- ) );
- ::dbtools::throwGenericSQLException(sError,NULL);
-
- // Unreachable:
- OSL_ASSERT(false);
- return 0;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabResultSet::getString(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- ::rtl::OUString aRet;
- sal_Int32 nAddressees = m_aKabAddressees.size();
- ::KABC::Field::List aFields = ::KABC::Field::allFields();
-
- if (m_nRowPos != -1 && m_nRowPos != nAddressees && m_xMetaData.is())
- {
- sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
- QString aQtName;
-
- switch (nFieldNumber)
- {
- case KAB_FIELD_REVISION:
-// trigger an exception here
-m_bWasNull = true;
-return aRet;
- default:
- aQtName = aFields[nFieldNumber - KAB_DATA_FIELDS]->value(m_aKabAddressees[m_nRowPos]);
- }
-// KDE address book currently does not use NULL values.
-// But it might do it someday
- if (!aQtName.isNull())
- {
- m_bWasNull = false;
- aRet = ::rtl::OUString((const sal_Unicode *) aQtName.ucs2());
- return aRet;
- }
- }
-// Trigger an exception ?
- m_bWasNull = true;
- return aRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::getBoolean(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getBoolean", NULL);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int8 SAL_CALL KabResultSet::getByte(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getByte", NULL);
-
- sal_Int8 nRet = 0;
- return nRet;
-}
-// -------------------------------------------------------------------------
-sal_Int16 SAL_CALL KabResultSet::getShort(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getShort", NULL);
-
- sal_Int16 nRet = 0;
- return nRet;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabResultSet::getInt(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getInt", NULL);
-
- sal_Int32 nRet = 0;
- return nRet;
-}
-// -------------------------------------------------------------------------
-sal_Int64 SAL_CALL KabResultSet::getLong(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getLong", NULL);
-
- return sal_Int64();
-}
-// -------------------------------------------------------------------------
-float SAL_CALL KabResultSet::getFloat(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getFloat", NULL);
-
- float nVal(0);
- return nVal;
-}
-// -------------------------------------------------------------------------
-double SAL_CALL KabResultSet::getDouble(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getDouble", NULL);
-
- double nRet = 0;
- return nRet;
-}
-// -------------------------------------------------------------------------
-Sequence< sal_Int8 > SAL_CALL KabResultSet::getBytes(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("", NULL);
-
- return Sequence< sal_Int8 >();
-}
-// -------------------------------------------------------------------------
-Date SAL_CALL KabResultSet::getDate(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getDate", NULL);
-
- Date aRet;
- return aRet;
-}
-// -------------------------------------------------------------------------
-Time SAL_CALL KabResultSet::getTime(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getTime", NULL);
-
- Time nRet;
- return nRet;
-}
-// -------------------------------------------------------------------------
-DateTime SAL_CALL KabResultSet::getTimestamp(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- DateTime nRet;
- sal_Int32 nAddressees = m_aKabAddressees.size();
-
- if (m_nRowPos != -1 && m_nRowPos != nAddressees && m_xMetaData.is())
- {
- KabResultSetMetaData *pMeta = static_cast<KabResultSetMetaData *>(m_xMetaData.get());
- sal_Int32 nFieldNumber = pMeta->fieldAtColumn(columnIndex);
-
- if (nFieldNumber == KAB_FIELD_REVISION)
- {
- QDateTime nRevision(m_aKabAddressees[m_nRowPos].revision());
-
- if (!nRevision.isNull())
- {
- m_bWasNull = false;
- nRet.Year = nRevision.date().year();
- nRet.Month = nRevision.date().month();
- nRet.Day = nRevision.date().day();
- nRet.Hours = nRevision.time().hour();
- nRet.Minutes = nRevision.time().minute();
- nRet.Seconds = nRevision.time().second();
- nRet.HundredthSeconds = nRevision.time().msec() / 10;
- return nRet;
- }
- }
- else {
- ;
- }
-// trigger an exception here
- }
-// Trigger an exception ?
- m_bWasNull = true;
- return nRet;
-}
-// -------------------------------------------------------------------------
-Reference< XInputStream > SAL_CALL KabResultSet::getBinaryStream(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getBinaryStream", NULL);
-
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XInputStream > SAL_CALL KabResultSet::getCharacterStream(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getCharacterStream", NULL);
-
- return NULL;
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL KabResultSet::getObject(sal_Int32, const Reference< ::com::sun::star::container::XNameAccess >&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getObject", NULL);
-
- return Any();
-}
-// -------------------------------------------------------------------------
-Reference< XRef > SAL_CALL KabResultSet::getRef(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getRef", NULL);
-
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XBlob > SAL_CALL KabResultSet::getBlob(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getBlob", NULL);
-
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XClob > SAL_CALL KabResultSet::getClob(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getClob", NULL);
-
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XArray > SAL_CALL KabResultSet::getArray(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getArray", NULL);
-
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSetMetaData > SAL_CALL KabResultSet::getMetaData() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- if (!m_xMetaData.is())
- m_xMetaData = new KabResultSetMetaData(m_xStatement->getOwnConnection());
-
- Reference< XResultSetMetaData > xMetaData = m_xMetaData.get();
- return xMetaData;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::isBeforeFirst() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- if (m_nRowPos == -1)
- return sal_True;
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::isAfterLast() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nAddressees = m_aKabAddressees.size();
- if (m_nRowPos == nAddressees)
- return sal_True;
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::isFirst() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- if (m_nRowPos == 0)
- return sal_True;
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::isLast() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nAddressees = m_aKabAddressees.size();
- if (m_nRowPos == nAddressees - 1)
- return sal_True;
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::beforeFirst() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- // move before the first row
- m_nRowPos = -1;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::afterLast() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- // move after the last row
- sal_Int32 nAddressees = m_aKabAddressees.size();
- m_nRowPos = nAddressees;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::close() throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::first() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nAddressees = m_aKabAddressees.size();
- if (nAddressees == 0)
- return sal_False;
-
- m_nRowPos = 0;
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::last() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nAddressees = m_aKabAddressees.size();
- if (nAddressees == 0)
- return sal_False;
-
- m_nRowPos = nAddressees - 1;
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabResultSet::getRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- return m_nRowPos;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::absolute(sal_Int32 row) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nAddressees = m_aKabAddressees.size();
- if (row <= -1 ||
- row >= nAddressees)
- return sal_False;
-
- m_nRowPos = row;
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::relative(sal_Int32 row) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- return absolute(m_nRowPos + row);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::next() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- return absolute(m_nRowPos + 1);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::previous() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- return absolute(m_nRowPos - 1);
-}
-// -------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL KabResultSet::getStatement() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- Reference< XStatement > xStatement = m_xStatement.get();
- return xStatement;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::rowDeleted() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::rowInserted() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::rowUpdated() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::wasNull() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- return m_bWasNull;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::cancel() throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::clearWarnings() throw(SQLException, RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL KabResultSet::getWarnings() throw(SQLException, RuntimeException)
-{
- return Any();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::insertRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- // you only have to implement this if you want to insert new rows
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- // only when you allow updates
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::deleteRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::cancelRowUpdates() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::moveToInsertRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- // only when you allow inserts
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::moveToCurrentRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateNull(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateBoolean(sal_Int32, sal_Bool) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateByte(sal_Int32, sal_Int8) throw(SQLException, RuntimeException)
-{
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateShort(sal_Int32, sal_Int16) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateInt(sal_Int32, sal_Int32) throw(SQLException, RuntimeException)
-{
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateLong(sal_Int32, sal_Int64) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -----------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateFloat(sal_Int32, float) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateDouble(sal_Int32, double) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateString(sal_Int32, const ::rtl::OUString&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateBytes(sal_Int32, const Sequence< sal_Int8 >&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateDate(sal_Int32, const Date&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateTime(sal_Int32, const Time&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateTimestamp(sal_Int32, const DateTime&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateBinaryStream(sal_Int32, const Reference< XInputStream >&, sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateCharacterStream(sal_Int32, const Reference< XInputStream >&, sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::refreshRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateObject(sal_Int32, const Any&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabResultSet::updateNumericObject(sal_Int32, const Any&, sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-// XRowLocate
-Any SAL_CALL KabResultSet::getBookmark() throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nAddressees = m_aKabAddressees.size();
-
- if (m_nRowPos != -1 && m_nRowPos != nAddressees)
- {
- QString aQtName = m_aKabAddressees[m_nRowPos].uid();
- ::rtl::OUString sUniqueIdentifier = ::rtl::OUString((const sal_Unicode *) aQtName.ucs2());
- return makeAny(sUniqueIdentifier);
- }
- return Any();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::moveToBookmark(const Any& bookmark) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- ::rtl::OUString sBookmark = comphelper::getString(bookmark);
- sal_Int32 nAddressees = m_aKabAddressees.size();
-
- for (sal_Int32 nRow = 0; nRow < nAddressees; nRow++)
- {
- QString aQtName = m_aKabAddressees[nRow].uid();
- ::rtl::OUString sUniqueIdentifier = ::rtl::OUString((const sal_Unicode *) aQtName.ucs2());
-
- if (sUniqueIdentifier == sBookmark)
- {
- m_nRowPos = nRow;
- return sal_True;
- }
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::moveRelativeToBookmark(const Any& bookmark, sal_Int32 rows) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nRowSave = m_nRowPos;
-
- if (moveToBookmark(bookmark))
- {
- sal_Int32 nAddressees = m_aKabAddressees.size();
-
- m_nRowPos += rows;
-
- if (-1 < m_nRowPos && m_nRowPos < nAddressees)
- return sal_True;
- }
-
- m_nRowPos = nRowSave;
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabResultSet::compareBookmarks(const Any& firstItem, const Any& secondItem) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- ::rtl::OUString sFirst = comphelper::getString(firstItem);
- ::rtl::OUString sSecond = comphelper::getString(secondItem);
-
- if (sFirst < sSecond)
- return CompareBookmark::LESS;
- if (sFirst > sSecond)
- return CompareBookmark::GREATER;
- return CompareBookmark::EQUAL;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSet::hasOrderedBookmarks() throw( SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabResultSet::hashBookmark(const Any& bookmark) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- ::rtl::OUString sBookmark = comphelper::getString(bookmark);
-
- return sBookmark.hashCode();
-}
-// -------------------------------------------------------------------------
-// XDeleteRows
-Sequence< sal_Int32 > SAL_CALL KabResultSet::deleteRows(const Sequence< Any >&) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabResultSet_BASE::rBHelper.bDisposed);
-
- return Sequence< sal_Int32 >();
-}
-// -------------------------------------------------------------------------
-IPropertyArrayHelper* KabResultSet::createArrayHelper() const
-{
- Sequence< Property > aProps(6);
- Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP1IMPL(CURSORNAME, ::rtl::OUString) PropertyAttribute::READONLY);
- DECL_PROP0(FETCHDIRECTION, sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
- DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
- DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
-
- return new OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-IPropertyArrayHelper & KabResultSet::getInfoHelper()
-{
- return *static_cast<KabResultSet*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool KabResultSet::convertFastPropertyValue(
- Any &,
- Any &,
- sal_Int32 nHandle,
- const Any& )
- throw (::com::sun::star::lang::IllegalArgumentException)
-{
- switch (nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw ::com::sun::star::lang::IllegalArgumentException();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- default:
- ;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void KabResultSet::setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const Any& )
- throw (Exception)
-{
- switch (nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw Exception();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- break;
- case PROPERTY_ID_FETCHSIZE:
- break;
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-void KabResultSet::getFastPropertyValue(
- Any& _rValue,
- sal_Int32 nHandle) const
-{
- switch (nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- _rValue <<= (sal_Bool)sal_False;
- break;
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- ;
- }
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KResultSet.hxx b/connectivity/source/drivers/kab/KResultSet.hxx
deleted file mode 100644
index 209f9a1d6c..0000000000
--- a/connectivity/source/drivers/kab/KResultSet.hxx
+++ /dev/null
@@ -1,227 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_RESULTSET_HXX_
-#define _CONNECTIVITY_KAB_RESULTSET_HXX_
-
-#include "KStatement.hxx"
-#include "KResultSetMetaData.hxx"
-#include <shell/kde_headers.h>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
-#include <com/sun/star/sdbcx/XDeleteRows.hpp>
-#include <cppuhelper/compbase12.hxx>
-
-namespace connectivity
-{
- namespace kab
- {
- /*
- ** KabResultSet
- */
- typedef ::cppu::WeakComponentImplHelper12< ::com::sun::star::sdbc::XResultSet,
- ::com::sun::star::sdbc::XRow,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XResultSetUpdate,
- ::com::sun::star::sdbc::XRowUpdate,
- ::com::sun::star::sdbcx::XRowLocate,
- ::com::sun::star::sdbcx::XDeleteRows,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XColumnLocate,
- ::com::sun::star::lang::XServiceInfo> KabResultSet_BASE;
-
- class KabResultSet : public comphelper::OBaseMutex,
- public KabResultSet_BASE,
- public ::cppu::OPropertySetHelper,
- public comphelper::OPropertyArrayUsageHelper<KabResultSet>
- {
- protected:
- ::rtl::Reference< KabCommonStatement > m_xStatement; // the statement that has created this result set
- ::rtl::Reference< KabResultSetMetaData > m_xMetaData; // the description of the columns in this result set
- ::KABC::Addressee::List m_aKabAddressees; // address book entries matching the query
- sal_Int32 m_nRowPos; // the current row within the result set
- sal_Bool m_bWasNull; // last entry retrieved from this result set was NULL
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
-
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue)
- throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue)
- throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle) const;
-
- // you can't delete objects of this type
- virtual ~KabResultSet();
-
- public:
- DECLARE_SERVICE_INFO();
-
- KabResultSet(KabCommonStatement *pStmt);
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
- {
- return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(*(KabResultSet_BASE*) this);
- }
-
- void allKabAddressees();
- void someKabAddressees(const class KabCondition *pCondition);
- void sortKabAddressees(const class KabOrder *pOrder);
-
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XResultSet
- virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XResultSetUpdate
- virtual void SAL_CALL insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRowUpdate
- virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XColumnLocate
- virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XRowLocate
- virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& firstItem, const ::com::sun::star::uno::Any& secondItem ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XDeleteRows
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // _CONNECTIVITY_KAB_RESULTSET_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KResultSetMetaData.cxx b/connectivity/source/drivers/kab/KResultSetMetaData.cxx
deleted file mode 100644
index 567f3fbaf5..0000000000
--- a/connectivity/source/drivers/kab/KResultSetMetaData.cxx
+++ /dev/null
@@ -1,190 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "KResultSetMetaData.hxx"
-#include "kfields.hxx"
-#include "KDatabaseMetaData.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-
-using namespace connectivity::kab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::sdbc;
-
-KabResultSetMetaData::KabResultSetMetaData(KabConnection* _pConnection)
- : m_pConnection(_pConnection),
- m_aKabFields()
-{
-}
-// -------------------------------------------------------------------------
-KabResultSetMetaData::~KabResultSetMetaData()
-{
-}
-// -------------------------------------------------------------------------
-void KabResultSetMetaData::setKabFields(const ::rtl::Reference<connectivity::OSQLColumns> &xColumns) throw(SQLException)
-{
- OSQLColumns::Vector::const_iterator aIter;
- static const ::rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("Name"));
-
- for (aIter = xColumns->get().begin(); aIter != xColumns->get().end(); ++aIter)
- {
- ::rtl::OUString aFieldName;
- sal_uInt32 nFieldNumber;
-
- (*aIter)->getPropertyValue(aName) >>= aFieldName;
- nFieldNumber = findKabField(aFieldName);
- m_aKabFields.push_back(nFieldNumber);
- }
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabResultSetMetaData::getColumnDisplaySize(sal_Int32 column) throw(SQLException, RuntimeException)
-{
- return m_aKabFields[column - 1] < KAB_DATA_FIELDS? 20: 50;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabResultSetMetaData::getColumnType(sal_Int32 column) throw(SQLException, RuntimeException)
-{
- return m_aKabFields[column - 1] == KAB_FIELD_REVISION? DataType::TIMESTAMP: DataType::CHAR;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabResultSetMetaData::getColumnCount() throw(SQLException, RuntimeException)
-{
- return m_aKabFields.size();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSetMetaData::isCaseSensitive(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabResultSetMetaData::getSchemaName(sal_Int32) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabResultSetMetaData::getColumnName(sal_Int32 column) throw(SQLException, RuntimeException)
-{
- sal_uInt32 nFieldNumber = m_aKabFields[column - 1];
- ::KABC::Field::List aFields = ::KABC::Field::allFields();
- QString aQtName;
-
- switch (nFieldNumber)
- {
- case KAB_FIELD_REVISION:
- aQtName = KABC::Addressee::revisionLabel();
- break;
- default:
- aQtName = aFields[nFieldNumber - KAB_DATA_FIELDS]->label();
- }
- ::rtl::OUString aName((const sal_Unicode *) aQtName.ucs2());
-
- return aName;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabResultSetMetaData::getTableName(sal_Int32) throw(SQLException, RuntimeException)
-{
- return KabDatabaseMetaData::getAddressBookTableName();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabResultSetMetaData::getCatalogName(sal_Int32) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabResultSetMetaData::getColumnTypeName(sal_Int32) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabResultSetMetaData::getColumnLabel(sal_Int32) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL KabResultSetMetaData::getColumnServiceName(sal_Int32) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSetMetaData::isCurrency(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSetMetaData::isAutoIncrement(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSetMetaData::isSigned(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabResultSetMetaData::getPrecision(sal_Int32) throw(SQLException, RuntimeException)
-{
- return 0;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabResultSetMetaData::getScale(sal_Int32) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabResultSetMetaData::isNullable(sal_Int32) throw(SQLException, RuntimeException)
-{
- return (sal_Int32) sal_True;
-// KDE address book currently does not use NULL values.
-// But it might do it someday
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSetMetaData::isSearchable(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSetMetaData::isReadOnly(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSetMetaData::isDefinitelyWritable(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabResultSetMetaData::isWritable(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KResultSetMetaData.hxx b/connectivity/source/drivers/kab/KResultSetMetaData.hxx
deleted file mode 100644
index 5bf1dd2495..0000000000
--- a/connectivity/source/drivers/kab/KResultSetMetaData.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_RESULTSETMETADATA_HXX_
-#define _CONNECTIVITY_KAB_RESULTSETMETADATA_HXX_
-
-#include "KConnection.hxx"
-#include <connectivity/CommonTools.hxx>
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <rtl/ref.hxx>
-
-namespace connectivity
-{
- namespace kab
- {
- /*
- ** KabResultSetMetaData
- */
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> KabResultSetMetaData_BASE;
-
- class KabResultSetMetaData : public KabResultSetMetaData_BASE
- {
- KabConnection* m_pConnection;
- ::std::vector<sal_Int32> m_aKabFields; // for each selected column, contains the number
- // of the corresponding KAddressBook field
-
- protected:
- virtual ~KabResultSetMetaData();
-
- public:
- KabResultSetMetaData(KabConnection* _pConnection);
-
- // avoid ambigous cast error from the compiler
- inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
- { return this; }
-
- void setKabFields(
- const ::rtl::Reference<connectivity::OSQLColumns> &xColumns) throw(::com::sun::star::sdbc::SQLException);
- inline sal_uInt32 fieldAtColumn(sal_Int32 columnIndex) const
- { return m_aKabFields[columnIndex - 1]; }
-
- virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // _CONNECTIVITY_KAB_RESULTSETMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KServices.cxx b/connectivity/source/drivers/kab/KServices.cxx
deleted file mode 100644
index e2bea9cd3c..0000000000
--- a/connectivity/source/drivers/kab/KServices.cxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "KDriver.hxx"
-#include <cppuhelper/factory.hxx>
-
-using namespace connectivity::kab;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pTemp
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void*)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- KabDriver::getImplementationName_Static(),
- KabDriver::getSupportedServiceNames_Static(),
- &KabDriver::Create,
- ::cppu::createSingleFactory)
- ;
-
- if (aReq.xRet.is())
- aReq.xRet->acquire();
-
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KStatement.cxx b/connectivity/source/drivers/kab/KStatement.cxx
deleted file mode 100644
index 655e8ae656..0000000000
--- a/connectivity/source/drivers/kab/KStatement.cxx
+++ /dev/null
@@ -1,587 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "KStatement.hxx"
-#include "KConnection.hxx"
-#include "KDriver.hxx"
-#include "KResultSet.hxx"
-#include "KResultSetMetaData.hxx"
-#include "kcondition.hxx"
-#include "korder.hxx"
-#include "TConnection.hxx"
-#include <connectivity/dbexception.hxx>
-#include "resource/kab_res.hrc"
-#include "resource/sharedresources.hxx"
-
-
-#if OSL_DEBUG_LEVEL > 0
-# define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr())
-#else /* OSL_DEBUG_LEVEL */
-# define OUtoCStr( x ) ("dummy")
-#endif /* OSL_DEBUG_LEVEL */
-
-using namespace connectivity::kab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-
-namespace
-{
- void lcl_throwError(sal_uInt16 _nErrorId)
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(_nErrorId) );
- ::dbtools::throwGenericSQLException(sError,NULL);
- }
-}
-
-IMPLEMENT_SERVICE_INFO(KabStatement, "com.sun.star.sdbc.drivers.KabStatement", "com.sun.star.sdbc.Statement");
-//------------------------------------------------------------------------------
-KabCommonStatement::KabCommonStatement(KabConnection* _pConnection )
- : KabCommonStatement_BASE(m_aMutex),
- OPropertySetHelper(KabCommonStatement_BASE::rBHelper),
- m_aParser(_pConnection->getDriver()->getMSFactory()),
- m_aSQLIterator(_pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL ),
- m_pParseTree(NULL),
- m_pConnection(_pConnection),
- rBHelper(KabCommonStatement_BASE::rBHelper)
-{
- m_pConnection->acquire();
-}
-// -----------------------------------------------------------------------------
-KabCommonStatement::~KabCommonStatement()
-{
-}
-// -----------------------------------------------------------------------------
-void KabCommonStatement::disposing()
-{
- KabCommonStatement_BASE::disposing();
-}
-// -----------------------------------------------------------------------------
-void KabCommonStatement::resetParameters() const throw(::com::sun::star::sdbc::SQLException)
-{
- lcl_throwError(STR_PARA_ONLY_PREPARED);
-}
-// -----------------------------------------------------------------------------
-void KabCommonStatement::getNextParameter(::rtl::OUString &) const throw(::com::sun::star::sdbc::SQLException)
-{
- lcl_throwError(STR_PARA_ONLY_PREPARED);
-}
-// -----------------------------------------------------------------------------
-KabCondition *KabCommonStatement::analyseWhereClause(const OSQLParseNode *pParseNode) const throw(SQLException)
-{
- if (pParseNode->count() == 3)
- {
- const OSQLParseNode *pLeft = pParseNode->getChild(0),
- *pMiddle = pParseNode->getChild(1),
- *pRight = pParseNode->getChild(2);
-
- // WHERE ( ... ) ?
- if (SQL_ISPUNCTUATION(pLeft, "(") && SQL_ISPUNCTUATION(pRight, ")"))
- {
- return analyseWhereClause(pMiddle);
- }
- else if (SQL_ISRULE(pParseNode, comparison_predicate))
- {
- if (pLeft->isToken() && pRight->isToken())
- {
- switch (pMiddle->getNodeType())
- {
- case SQL_NODE_EQUAL:
- // WHERE 0 = 1
- return new KabConditionConstant(pLeft->getTokenValue() == pRight->getTokenValue());
-
- case SQL_NODE_NOTEQUAL:
- // WHERE 0 <> 1
- // (might not be correct SQL... don't care, handling anyway)
- return new KabConditionConstant(pLeft->getTokenValue() != pRight->getTokenValue());
-
- default:
- break;
- }
- }
- else if (SQL_ISRULE(pLeft, column_ref))
- {
- ::rtl::OUString sColumnName,
- sTableRange;
-
- m_aSQLIterator.getColumnRange(pLeft, sColumnName, sTableRange);
-
- if (pRight->isToken() || SQL_ISRULE(pRight, parameter))
- {
- ::rtl::OUString sMatchString;
-
- if (pRight->isToken()) // WHERE Name = 'Doe'
- sMatchString = pRight->getTokenValue();
- else if (SQL_ISRULE(pRight, parameter)) // WHERE Name = ?
- getNextParameter(sMatchString);
-
- switch (pMiddle->getNodeType())
- {
- case SQL_NODE_EQUAL:
- // WHERE Name = 'Smith'
- return new KabConditionEqual(sColumnName, sMatchString);
-
- case SQL_NODE_NOTEQUAL:
- // WHERE Name <> 'Jones'
- return new KabConditionDifferent(sColumnName, sMatchString);
-
- default:
- break;
- }
- }
- }
- }
- else if (SQL_ISRULE(pParseNode, search_condition))
- {
- if (SQL_ISTOKEN(pMiddle, OR))
- {
- // WHERE Name = 'Smith' OR Name = 'Jones'
- return new KabConditionOr(
- analyseWhereClause(pLeft),
- analyseWhereClause(pRight));
- }
- }
- else if (SQL_ISRULE(pParseNode, boolean_term))
- {
- if (SQL_ISTOKEN(pMiddle, AND))
- {
- // WHERE Name = 'Smith' AND "Given Name" = 'Peter'
- return new KabConditionAnd(
- analyseWhereClause(pLeft),
- analyseWhereClause(pRight));
- }
- }
- }
- else if (SQL_ISRULE(pParseNode, test_for_null) || SQL_ISRULE(pParseNode, like_predicate))
- {
- const OSQLParseNode *pLeft = pParseNode->getChild(0);
- const OSQLParseNode* pPart2 = pParseNode->getChild(1);
- const OSQLParseNode *pMiddleLeft = pPart2->getChild(0),
- *pMiddleRight = pPart2->getChild(1),
- *pRight = pPart2->getChild(2);
-
- if (SQL_ISRULE(pParseNode, test_for_null))
- {
- if (SQL_ISRULE(pLeft, column_ref) &&
- SQL_ISTOKEN(pMiddleLeft, IS) &&
- SQL_ISTOKEN(pRight, NULL))
- {
- ::rtl::OUString sColumnName,
- sTableRange;
-
- m_aSQLIterator.getColumnRange(pLeft, sColumnName, sTableRange);
-
- if (SQL_ISTOKEN(pMiddleRight, NOT))
- {
- // WHERE "Mobile Phone" IS NOT NULL
- return new KabConditionNotNull(sColumnName);
- }
- else
- {
- // WHERE "Mobile Phone" IS NULL
- return new KabConditionNull(sColumnName);
- }
- }
- }
- else if (SQL_ISRULE(pParseNode, like_predicate))
- {
- if (SQL_ISRULE(pLeft, column_ref))
- {
- ::rtl::OUString sColumnName,
- sTableRange;
-
- m_aSQLIterator.getColumnRange(pLeft, sColumnName, sTableRange);
-
- if (pMiddleRight->isToken() || SQL_ISRULE(pMiddleRight, parameter))
- {
- ::rtl::OUString sMatchString;
-
- if (pMiddleRight->isToken()) // WHERE Name LIKE 'Sm%'
- sMatchString = pMiddleRight->getTokenValue();
- else if (SQL_ISRULE(pMiddleRight, parameter)) // WHERE Name LIKE ?
- getNextParameter(sMatchString);
-
- return new KabConditionSimilar(sColumnName, sMatchString);
- }
- }
- }
- }
-
- lcl_throwError(STR_QUERY_TOO_COMPLEX);
-
- // Unreachable:
- OSL_ASSERT(false);
- return 0;
-}
-// -----------------------------------------------------------------------------
-KabOrder *KabCommonStatement::analyseOrderByClause(const OSQLParseNode *pParseNode) const throw(SQLException)
-{
- if (SQL_ISRULE(pParseNode, ordering_spec_commalist))
- {
- KabComplexOrder *list = new KabComplexOrder();
- sal_uInt32 n = pParseNode->count();
-
- // Iterate through the ordering columns
- for (sal_uInt32 i = 0; i < n; i++)
- {
- list->addOrder
- (analyseOrderByClause(pParseNode->getChild(i)));
- }
-
- return list;
- }
- else if (SQL_ISRULE(pParseNode, ordering_spec))
- {
- if (pParseNode->count() == 2)
- {
- OSQLParseNode* pColumnRef = pParseNode->getChild(0);
- OSQLParseNode* pAscendingDescending = pParseNode->getChild(1);
-
- if (SQL_ISRULE(pColumnRef, column_ref))
- {
- if (pColumnRef->count() == 3)
- pColumnRef = pColumnRef->getChild(2);
-
- if (pColumnRef->count() == 1)
- {
- ::rtl::OUString sColumnName =
- pColumnRef->getChild(0)->getTokenValue();
- sal_Bool bAscending =
- SQL_ISTOKEN(pAscendingDescending, DESC)?
- sal_False:
- sal_True;
-
- return new KabSimpleOrder(sColumnName, bAscending);
- }
- }
- }
- }
- lcl_throwError(STR_QUERY_TOO_COMPLEX);
- // Unreachable:
- OSL_ASSERT(false);
- return 0;
-}
-//------------------------------------------------------------------------------
-sal_Bool KabCommonStatement::isTableKnown(KabResultSet *pResult) const
-{
- // can handle requests like SELECT * FROM addresses addresses
- // but cannot handle requests like SELECT * FROM addresses persons
- if (m_aSQLIterator.getTables().size() != 1)
- return sal_False;
-
- if (m_aSQLIterator.getTables().begin()->first != pResult->getMetaData()->getTableName(0))
- return sal_False;
-
- return sal_True;
-}
-//------------------------------------------------------------------------------
-void KabCommonStatement::setKabFields(KabResultSet *pResult) const throw(SQLException)
-{
- ::rtl::Reference<connectivity::OSQLColumns> xColumns; // selected columns
- KabResultSetMetaData *pMeta; // meta information - holds the list of KAddressBook fields
-
- xColumns = m_aSQLIterator.getSelectColumns();
- if (!xColumns.is())
- {
- lcl_throwError(STR_INVALID_COLUMN_SELECTION);
- }
- pMeta = static_cast<KabResultSetMetaData *>(pResult->getMetaData().get());
- pMeta->setKabFields(xColumns);
-}
-// -------------------------------------------------------------------------
-void KabCommonStatement::selectAddressees(KabResultSet *pResult) const throw(SQLException)
-{
- const OSQLParseNode *pParseNode;
- KabCondition *pCondition;
-
- pParseNode = m_aSQLIterator.getWhereTree();
- if (pParseNode != NULL)
- {
- if (SQL_ISRULE(pParseNode, where_clause))
- {
- resetParameters();
- pParseNode = pParseNode->getChild(1);
- pCondition = analyseWhereClause(pParseNode);
- if (pCondition->isAlwaysTrue())
- pResult->allKabAddressees();
- else if (!pCondition->isAlwaysFalse())
- pResult->someKabAddressees(pCondition);
- delete pCondition;
- return;
- }
- }
-
- // no WHERE clause: get all rows
- pResult->allKabAddressees();
-}
-// -------------------------------------------------------------------------
-void KabCommonStatement::sortAddressees(KabResultSet *pResult) const throw(SQLException)
-{
- const OSQLParseNode *pParseNode;
- KabOrder *pOrder;
-
- pParseNode = m_aSQLIterator.getOrderTree();
- if (pParseNode != NULL)
- {
- if (SQL_ISRULE(pParseNode, opt_order_by_clause))
- {
- pParseNode = pParseNode->getChild(2);
- pOrder = analyseOrderByClause(pParseNode);
- pResult->sortKabAddressees(pOrder);
- delete pOrder;
- }
- }
-}
-//-----------------------------------------------------------------------------
-Any SAL_CALL KabCommonStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = KabCommonStatement_BASE::queryInterface(rType);
- if (!aRet.hasValue())
- aRet = OPropertySetHelper::queryInterface(rType);
- return aRet;
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL KabCommonStatement::getTypes( ) throw(RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const Reference< XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< XFastPropertySet > *)0 ),
- ::getCppuType( (const Reference< XPropertySet > *)0 ));
-
- return comphelper::concatSequences(aTypes.getTypes(),KabCommonStatement_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabCommonStatement::cancel( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
- // cancel the current sql statement
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabCommonStatement::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL KabCommonStatement::execute(
- const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- Reference< XResultSet > xRS = executeQuery(sql);
-
- return xRS.is();
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL KabCommonStatement::executeQuery(
- const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
-OSL_TRACE("KDE Address book - SQL Request: %s", OUtoCStr(sql));
-
- KabResultSet* pResult = new KabResultSet(this);
- Reference< XResultSet > xRS = pResult;
- ::rtl::OUString aErr;
-
- m_pParseTree = m_aParser.parseTree(aErr, sql);
- if (m_pParseTree == NULL)
- throw SQLException(aErr, *this, aErr, 0, Any());
-
- m_aSQLIterator.setParseTree(m_pParseTree);
- m_aSQLIterator.traverseAll();
- switch (m_aSQLIterator.getStatementType())
- {
- case SQL_STATEMENT_SELECT:
- if (isTableKnown(pResult)) // FROM which table ?
- {
- setKabFields(pResult); // SELECT which columns ?
- selectAddressees(pResult); // WHERE which condition ?
- sortAddressees(pResult); // ORDER BY which columns ?
-// To be continued: DISTINCT
-// etc...
- }
- break;
-
- default:
-// To be continued: UPDATE
-// DELETE
-// etc...
- lcl_throwError(STR_QUERY_TOO_COMPLEX);
- }
-
- return xRS;
-}
-// -------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL KabCommonStatement::getConnection( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- // just return our connection here
- return (Reference< XConnection >) m_pConnection;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL KabCommonStatement::executeUpdate( const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- // the return values gives information about how many rows are affected by executing the sql statement
- return 0;
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL KabCommonStatement::getWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- return makeAny(m_aLastWarning);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL KabCommonStatement::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
-
- m_aLastWarning = SQLWarning();
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* KabCommonStatement::createArrayHelper( ) const
-{
- // this properties are defined by the service statement
- // they must be in alphabetic order
- Sequence< Property > aProps(10);
- Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP0(CURSORNAME, ::rtl::OUString);
- DECL_BOOL_PROP0(ESCAPEPROCESSING);
- DECL_PROP0(FETCHDIRECTION,sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_PROP0(MAXFIELDSIZE,sal_Int32);
- DECL_PROP0(MAXROWS, sal_Int32);
- DECL_PROP0(QUERYTIMEOUT,sal_Int32);
- DECL_PROP0(RESULTSETCONCURRENCY,sal_Int32);
- DECL_PROP0(RESULTSETTYPE,sal_Int32);
- DECL_BOOL_PROP0(USEBOOKMARKS);
-
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & KabCommonStatement::getInfoHelper()
-{
- return *const_cast<KabCommonStatement*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool KabCommonStatement::convertFastPropertyValue(
- Any &,
- Any &,
- sal_Int32,
- const Any&) throw (::com::sun::star::lang::IllegalArgumentException)
-{
- sal_Bool bConverted = sal_False;
- // here we have to try to convert
- return bConverted;
-}
-// -------------------------------------------------------------------------
-void KabCommonStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any&) throw (Exception)
-{
- // set the value to whatever is nescessary
- switch (nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- case PROPERTY_ID_MAXFIELDSIZE:
- case PROPERTY_ID_MAXROWS:
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- case PROPERTY_ID_ESCAPEPROCESSING:
- case PROPERTY_ID_USEBOOKMARKS:
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-void KabCommonStatement::getFastPropertyValue(Any&,sal_Int32 nHandle) const
-{
- switch (nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- case PROPERTY_ID_MAXFIELDSIZE:
- case PROPERTY_ID_MAXROWS:
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- case PROPERTY_ID_ESCAPEPROCESSING:
- case PROPERTY_ID_USEBOOKMARKS:
- default:
- ;
- }
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL KabCommonStatement::acquire() throw()
-{
- KabCommonStatement_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL KabCommonStatement::release() throw()
-{
- KabCommonStatement_BASE::release();
-}
-// -----------------------------------------------------------------------------
-Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL KabCommonStatement::getPropertySetInfo( ) throw(RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-KabStatement::KabStatement(KabConnection* _pConnection)
- : KabStatement_BASE(_pConnection)
-{
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KStatement.hxx b/connectivity/source/drivers/kab/KStatement.hxx
deleted file mode 100644
index 044c473ee1..0000000000
--- a/connectivity/source/drivers/kab/KStatement.hxx
+++ /dev/null
@@ -1,173 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_STATEMENT_HXX_
-#define _CONNECTIVITY_KAB_STATEMENT_HXX_
-
-#include "KConnection.hxx"
-#include <list>
-#include "connectivity/sqliterator.hxx"
-#include "connectivity/sqlparse.hxx"
-#include <com/sun/star/sdbc/XStatement.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <cppuhelper/compbase4.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <comphelper/proparrhlp.hxx>
-
-namespace connectivity
-{
- namespace kab
- {
- typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::sdbc::XStatement,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XCloseable> KabCommonStatement_BASE;
-
- //**************************************************************
- // Class KabCommonStatement
- // is a base class for the normal statement and for the prepared statement
- //**************************************************************
- class KabCommonStatement : public comphelper::OBaseMutex,
- public KabCommonStatement_BASE,
- public ::cppu::OPropertySetHelper,
- public comphelper::OPropertyArrayUsageHelper<KabCommonStatement>
-
- {
- ::com::sun::star::sdbc::SQLWarning m_aLastWarning;
-
- protected:
- ::std::list< ::rtl::OUString> m_aBatchList;
- connectivity::OSQLParser m_aParser;
- connectivity::OSQLParseTreeIterator m_aSQLIterator;
- connectivity::OSQLParseNode* m_pParseTree;
- KabConnection* m_pConnection; // The owning Connection object
-
- protected:
- class KabCondition *analyseWhereClause(
- const OSQLParseNode *pParseNode) const throw(::com::sun::star::sdbc::SQLException);
- class KabOrder *analyseOrderByClause(
- const OSQLParseNode *pParseNode) const throw(::com::sun::star::sdbc::SQLException);
- sal_Bool isTableKnown(class KabResultSet *pResult) const;
- void setKabFields(class KabResultSet *pResult) const throw(::com::sun::star::sdbc::SQLException);
- void selectAddressees(KabResultSet *pResult) const throw(::com::sun::star::sdbc::SQLException);
- void sortAddressees(KabResultSet *pResult) const throw(::com::sun::star::sdbc::SQLException);
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
-
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle) const;
-
- virtual void resetParameters() const throw(::com::sun::star::sdbc::SQLException);
- virtual void getNextParameter(::rtl::OUString &rParameter) const throw(::com::sun::star::sdbc::SQLException);
- virtual ~KabCommonStatement();
-
- public:
- ::cppu::OBroadcastHelper& rBHelper;
-
- KabCommonStatement(KabConnection *_pConnection);
- using KabCommonStatement_BASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
-
- // OComponentHelper
- virtual void SAL_CALL disposing();
-
- // XInterface
- virtual void SAL_CALL release() throw();
- virtual void SAL_CALL acquire() throw();
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType
- ) throw(::com::sun::star::uno::RuntimeException);
-
- // XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(
- ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(
- ) throw(::com::sun::star::uno::RuntimeException);
-
- // XStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery(
- const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL executeUpdate(
- const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL execute(
- const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection(
- ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings(
- ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings(
- ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XCancellable
- virtual void SAL_CALL cancel(
- ) throw(::com::sun::star::uno::RuntimeException);
-
- // XCloseable
- virtual void SAL_CALL close(
- ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // other methods
- inline KabConnection* getOwnConnection() const { return m_pConnection; }
- };
-
- //**************************************************************
- // Class KabStatement
- //**************************************************************
- typedef ::cppu::ImplInheritanceHelper1<
- KabCommonStatement, ::com::sun::star::lang::XServiceInfo > KabStatement_BASE;
-
- class KabStatement : public KabStatement_BASE
- {
- protected:
- virtual ~KabStatement() { }
-
- public:
- KabStatement(KabConnection* _pConnection);
- DECLARE_SERVICE_INFO();
- };
- }
-}
-
-#endif // _CONNECTIVITY_KAB_STATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KTable.cxx b/connectivity/source/drivers/kab/KTable.cxx
deleted file mode 100644
index 20247273a5..0000000000
--- a/connectivity/source/drivers/kab/KTable.cxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "KTable.hxx"
-#include "KTables.hxx"
-#include "KColumns.hxx"
-#include "KCatalog.hxx"
-
-using namespace connectivity::kab;
-using namespace connectivity;
-using namespace ::comphelper;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -------------------------------------------------------------------------
-KabTable::KabTable( sdbcx::OCollection* _pTables, KabConnection* _pConnection)
- : KabTable_TYPEDEF(_pTables, sal_True),
- m_pConnection(_pConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-KabTable::KabTable( sdbcx::OCollection* _pTables,
- KabConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description ,
- const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName
- ) : KabTable_TYPEDEF(_pTables,sal_True,
- _Name,
- _Type,
- _Description,
- _SchemaName,
- _CatalogName),
- m_pConnection(_pConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-void KabTable::refreshColumns()
-{
- TStringVector aVector;
-
- if (!isNew())
- {
- Reference< XResultSet > xResult = m_pConnection->getMetaData()->getColumns(
- Any(),
- m_SchemaName,
- m_Name,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")));
-
- if (xResult.is())
- {
- Reference< XRow > xRow(xResult, UNO_QUERY);
- while (xResult->next())
- aVector.push_back(xRow->getString(4));
- }
- }
-
- if (m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new KabColumns(this,m_aMutex,aVector);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KTable.hxx b/connectivity/source/drivers/kab/KTable.hxx
deleted file mode 100644
index 2b640e4cdb..0000000000
--- a/connectivity/source/drivers/kab/KTable.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_TABLE_HXX_
-#define _CONNECTIVITY_KAB_TABLE_HXX_
-
-#include "KConnection.hxx"
-#include "connectivity/sdbcx/VTable.hxx"
-
-namespace connectivity
-{
- namespace kab
- {
- typedef connectivity::sdbcx::OTable KabTable_TYPEDEF;
-
- ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xColProp);
-
- class KabTable : public KabTable_TYPEDEF
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- KabConnection* m_pConnection;
-
- public:
- KabTable( sdbcx::OCollection* _pTables, KabConnection* _pConnection);
- KabTable( sdbcx::OCollection* _pTables,
- KabConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description = ::rtl::OUString(),
- const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
- const ::rtl::OUString& _CatalogName = ::rtl::OUString()
- );
-
- KabConnection* getConnection() { return m_pConnection;}
-
- virtual void refreshColumns();
-
- ::rtl::OUString getTableName() const { return m_Name; }
- ::rtl::OUString getSchema() const { return m_SchemaName; }
- };
- }
-}
-
-#endif // _CONNECTIVITY_KAB_TABLE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KTables.cxx b/connectivity/source/drivers/kab/KTables.cxx
deleted file mode 100644
index 31d66547bd..0000000000
--- a/connectivity/source/drivers/kab/KTables.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "KTables.hxx"
-#include "KTable.hxx"
-#include "KCatalog.hxx"
-#include "KConnection.hxx"
-#include <comphelper/types.hxx>
-
-using namespace connectivity::kab;
-using namespace connectivity;
-using namespace ::comphelper;
-using namespace ::cppu;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-sdbcx::ObjectType KabTables::createObject(const ::rtl::OUString& _rName)
-{
- ::rtl::OUString aName,aSchema;
- aSchema = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%"));
- aName = _rName;
-
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%"));
- ::rtl::OUString sEmpty;
-
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(), aSchema, aName, aTypes);
-
- sdbcx::ObjectType xRet = NULL;
- if (xResult.is())
- {
- Reference< XRow > xRow(xResult, UNO_QUERY);
- if (xResult->next()) // there can be only one table with this name
- {
- KabTable* pRet = new KabTable(
- this,
- static_cast<KabCatalog&>(m_rParent).getConnection(),
- aName,
- xRow->getString(4),
- xRow->getString(5),
- sEmpty);
- xRet = pRet;
- }
- }
- ::comphelper::disposeComponent(xResult);
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void KabTables::impl_refresh( ) throw(RuntimeException)
-{
- static_cast<KabCatalog&>(m_rParent).refreshTables();
-}
-// -------------------------------------------------------------------------
-void KabTables::disposing(void)
-{
-m_xMetaData.clear();
- OCollection::disposing();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/KTables.hxx b/connectivity/source/drivers/kab/KTables.hxx
deleted file mode 100644
index 438458c8e3..0000000000
--- a/connectivity/source/drivers/kab/KTables.hxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_TABLES_HXX_
-#define _CONNECTIVITY_KAB_TABLES_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-
-namespace connectivity
-{
- namespace kab
- {
- class KabTables : public sdbcx::OCollection
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
-
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
-
- public:
- KabTables(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,
- ::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector)
- : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector),
- m_xMetaData(_rMetaData)
- { }
-
- virtual void SAL_CALL disposing(void);
- };
- }
-}
-
-#endif // _CONNECTIVITY_KAB_TABLES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/exports.dxp b/connectivity/source/drivers/kab/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/drivers/kab/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/drivers/kab/kab.xcu b/connectivity/source/drivers/kab/kab.xcu
deleted file mode 100644
index 0cc515e4ee..0000000000
--- a/connectivity/source/drivers/kab/kab.xcu
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:address:kab" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.kab.Driver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">KDE Address Book</value>
- </prop>
- <node oor:name="Features">
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/kab/kab.xml b/connectivity/source/drivers/kab/kab.xml
deleted file mode 100755
index 115b9f5522..0000000000
--- a/connectivity/source/drivers/kab/kab.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!DOCTYPE COMPONENTDESCRIPTION PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name> kab1 </module-name>
- <component-description>
- <Author>Eric Bischoff</Author>
- <Name>com.sun.star.comp.sdbc.kab.Driver</Name>
- <description>This library implements the database driver for KDE address book formats.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service>com.sun.star.sdbc.Driver</supported-service>
- <service-dependency> ... </service-dependency>
- </component-description>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
-
- <runtime-module-dependency> cppuhelper </runtime-module-dependency>
- <runtime-module-dependency> cppu1 </runtime-module-dependency>
- <runtime-module-dependency> sal1 </runtime-module-dependency>
-
- <type> com.sun.star.registry.XRegistryKey </type>
- <type> com.sun.star.util.XCancellable </type>
- <type> com.sun.star.util.XNumberFormatter </type>
- <type> com.sun.star.uno.TypeClass </type>
- <type> com.sun.star.uno.XWeak </type>
- <type> com.sun.star.uno.XAggregation </type>
- <type> com.sun.star.uno.XComponentContext </type>
- <type> com.sun.star.beans.PropertyAttribute </type>
- <type> com.sun.star.beans.XPropertyState </type>
- <type> com.sun.star.beans.XPropertySet </type>
- <type> com.sun.star.beans.PropertyValue </type>
- <type> com.sun.star.beans.XMultiPropertySet </type>
- <type> com.sun.star.beans.XFastPropertySet </type>
- <type> com.sun.star.lang.XSingleServiceFactory </type>
- <type> com.sun.star.lang.XTypeProvider </type>
- <type> com.sun.star.lang.XSingleComponentFactory </type>
- <type> com.sun.star.lang.EventObject </type>
- <type> com.sun.star.lang.XComponent </type>
- <type> com.sun.star.lang.IllegalArgumentException </type>
- <type> com.sun.star.lang.DisposedException </type>
- <type> com.sun.star.lang.XMultiServiceFactory </type>
- <type> com.sun.star.lang.XServiceInfo </type>
- <type> com.sun.star.lang.XUnoTunnel </type>
- <type> com.sun.star.java.XJavaThreadRegister_11 </type>
- <type> com.sun.star.java.XJavaVM </type>
- <type> com.sun.star.sdbc.FetchDirection </type>
- <type> com.sun.star.sdbc.XConnection </type>
- <type> com.sun.star.sdbc.XStatement </type>
- <type> com.sun.star.sdbc.XResultSet </type>
- <type> com.sun.star.sdbc.XResultSetMetaDataSupplier</type>
- <type> com.sun.star.sdbc.XColumnLocate </type>
- <type> com.sun.star.sdbc.XResultSetUpdate </type>
- <type> com.sun.star.sdbc.XWarningsSupplier </type>
- <type> com.sun.star.sdbc.XRowUpdate </type>
- <type> com.sun.star.sdbc.XMultipleResults </type>
- <type> com.sun.star.sdbc.XBatchExecution </type>
- <type> com.sun.star.sdbc.XPreparedBatchExecution </type>
- <type> com.sun.star.sdbc.XParameters </type>
- <type> com.sun.star.sdbc.XOutParameters </type>
- <type> com.sun.star.sdbc.DriverPropertyInfo </type>
- <type> com.sun.star.sdbc.SQLWarning </type>
- <type> com.sun.star.sdbc.XRow </type>
- <type> com.sun.star.sdbc.ColumnSearch </type>
- <type> com.sun.star.sdbc.ColumnValue </type>
- <type> com.sun.star.sdbc.DataType </type>
- <type> com.sun.star.sdbc.XDriver </type>
- <type> com.sun.star.sdbc.TransactionIsolation </type>
- <type> com.sun.star.sdbc.ResultSetType </type>
- <type> com.sun.star.sdbc.ResultSetConcurrency </type>
- <type> com.sun.star.sdbcx.XRowLocate </type>
- <type> com.sun.star.sdbcx.XDeleteRows </type>
- <type> com.sun.star.sdbcx.CompareBookmark </type>
- <type> com.sun.star.sdb.XColumnUpdate </type>
- <type> com.sun.star.sdb.XColumn </type>
-</module-description>
diff --git a/connectivity/source/drivers/kab/kab1.component b/connectivity/source/drivers/kab/kab1.component
deleted file mode 100755
index 77227501d3..0000000000
--- a/connectivity/source/drivers/kab/kab1.component
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.sdbc.kab.Driver">
- <service name="com.sun.star.sdbc.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/kab/kabdrv.map b/connectivity/source/drivers/kab/kabdrv.map
deleted file mode 100755
index 5de866f2e5..0000000000
--- a/connectivity/source/drivers/kab/kabdrv.map
+++ /dev/null
@@ -1,9 +0,0 @@
-UDK_3_0_0 {
- global:
- createKabConnection;
- initKApplication;
- shutdownKApplication;
- matchKDEVersion;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/kab/kcondition.cxx b/connectivity/source/drivers/kab/kcondition.cxx
deleted file mode 100644
index 2ecdead169..0000000000
--- a/connectivity/source/drivers/kab/kcondition.cxx
+++ /dev/null
@@ -1,232 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "kcondition.hxx"
-#include "kfields.hxx"
-#include "connectivity/CommonTools.hxx"
-
-using namespace ::connectivity::kab;
-using namespace ::com::sun::star::sdbc;
-// -----------------------------------------------------------------------------
-KabCondition::~KabCondition()
-{
-}
-// -----------------------------------------------------------------------------
-KabConditionConstant::KabConditionConstant(const sal_Bool bValue)
- : KabCondition(),
- m_bValue(bValue)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionConstant::isAlwaysTrue() const
-{
- return m_bValue;
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionConstant::isAlwaysFalse() const
-{
- return !m_bValue;
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionConstant::eval(const ::KABC::Addressee &) const
-{
- return m_bValue;
-}
-// -----------------------------------------------------------------------------
-KabConditionColumn::KabConditionColumn(const ::rtl::OUString &sColumnName) throw(SQLException)
- : KabCondition(),
- m_nFieldNumber(findKabField(sColumnName))
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionColumn::isAlwaysTrue() const
-{
- // Sometimes true, sometimes false
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionColumn::isAlwaysFalse() const
-{
- // Sometimes true, sometimes false
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-KabConditionNull::KabConditionNull(const ::rtl::OUString &sColumnName) throw(SQLException)
- : KabConditionColumn(sColumnName)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionNull::eval(const ::KABC::Addressee &aAddressee) const
-{
- QString aQtName = valueOfKabField(aAddressee, m_nFieldNumber);
-
- return aQtName.isNull();
-// KDE address book currently does not use NULL values.
-// But it might do it someday
-}
-// -----------------------------------------------------------------------------
-KabConditionNotNull::KabConditionNotNull(const ::rtl::OUString &sColumnName) throw(SQLException)
- : KabConditionColumn(sColumnName)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionNotNull::eval(const ::KABC::Addressee &aAddressee) const
-{
- QString aQtName = valueOfKabField(aAddressee, m_nFieldNumber);
-
- return !aQtName.isNull();
-// KDE address book currently does not use NULL values.
-// But it might do it someday
-}
-// -----------------------------------------------------------------------------
-KabConditionCompare::KabConditionCompare(const ::rtl::OUString &sColumnName, const ::rtl::OUString &sMatchString) throw(SQLException)
- : KabConditionColumn(sColumnName),
- m_sMatchString(sMatchString)
-{
-}
-// -----------------------------------------------------------------------------
-KabConditionEqual::KabConditionEqual(const ::rtl::OUString &sColumnName, const ::rtl::OUString &sMatchString) throw(SQLException)
- : KabConditionCompare(sColumnName, sMatchString)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionEqual::eval(const ::KABC::Addressee &aAddressee) const
-{
- QString aQtName = valueOfKabField(aAddressee, m_nFieldNumber);
-// Timestamps should not be compared according to their string value
-// The syntax for such queries should be like
-// {ts '2004-03-29 12:55:00.000000'}
-// They should also support operators like '<' or '>='
-
- if (aQtName.isNull()) return sal_False;
-
- ::rtl::OUString sValue((const sal_Unicode *) aQtName.ucs2());
- return sValue == m_sMatchString;
-}
-// -----------------------------------------------------------------------------
-KabConditionDifferent::KabConditionDifferent(const ::rtl::OUString &sColumnName, const ::rtl::OUString &sMatchString) throw(SQLException)
- : KabConditionCompare(sColumnName, sMatchString)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionDifferent::eval(const ::KABC::Addressee &aAddressee) const
-{
- QString aQtName = valueOfKabField(aAddressee, m_nFieldNumber);
-
- if (aQtName.isNull()) return sal_False;
-
- ::rtl::OUString sValue((const sal_Unicode *) aQtName.ucs2());
- return sValue != m_sMatchString;
-}
-// -----------------------------------------------------------------------------
-KabConditionSimilar::KabConditionSimilar(const ::rtl::OUString &sColumnName, const ::rtl::OUString &sMatchString) throw(SQLException)
- : KabConditionCompare(sColumnName, sMatchString)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionSimilar::eval(const ::KABC::Addressee &aAddressee) const
-{
- QString aQtName = valueOfKabField(aAddressee, m_nFieldNumber);
-
- if (aQtName.isNull()) return sal_False;
-
- ::rtl::OUString sValue((const sal_Unicode *) aQtName.ucs2());
- return match(m_sMatchString, sValue, '\0');
-}
-// -----------------------------------------------------------------------------
-KabConditionBoolean::KabConditionBoolean(KabCondition *pLeft, KabCondition *pRight)
- : KabCondition(),
- m_pLeft(pLeft),
- m_pRight(pRight)
-{
-}
-// -----------------------------------------------------------------------------
-KabConditionBoolean::~KabConditionBoolean()
-{
- delete m_pLeft;
- delete m_pRight;
-}
-// -----------------------------------------------------------------------------
-KabConditionOr::KabConditionOr(KabCondition *pLeft, KabCondition *pRight)
- : KabConditionBoolean(pLeft, pRight)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionOr::isAlwaysTrue() const
-{
- return m_pLeft->isAlwaysTrue() || m_pRight->isAlwaysTrue();
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionOr::isAlwaysFalse() const
-{
- return m_pLeft->isAlwaysFalse() && m_pRight->isAlwaysFalse();
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionOr::eval(const ::KABC::Addressee &aAddressee) const
-{
- // We avoid evaluating terms as much as we can
- if (m_pLeft->isAlwaysTrue() || m_pRight->isAlwaysTrue()) return sal_True;
- if (m_pLeft->isAlwaysFalse() && m_pRight->isAlwaysFalse()) return sal_False;
-
- if (m_pLeft->eval(aAddressee)) return sal_True;
- if (m_pRight->eval(aAddressee)) return sal_True;
-
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-KabConditionAnd::KabConditionAnd(KabCondition *pLeft, KabCondition *pRight)
- : KabConditionBoolean(pLeft, pRight)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionAnd::isAlwaysTrue() const
-{
- return m_pLeft->isAlwaysTrue() && m_pRight->isAlwaysTrue();
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionAnd::isAlwaysFalse() const
-{
- return m_pLeft->isAlwaysFalse() || m_pRight->isAlwaysFalse();
-}
-// -----------------------------------------------------------------------------
-sal_Bool KabConditionAnd::eval(const ::KABC::Addressee &aAddressee) const
-{
- // We avoid evaluating terms as much as we can
- if (m_pLeft->isAlwaysFalse() || m_pRight->isAlwaysFalse()) return sal_False;
- if (m_pLeft->isAlwaysTrue() && m_pRight->isAlwaysTrue()) return sal_True;
-
- if (!m_pLeft->eval(aAddressee)) return sal_False;
- if (!m_pRight->eval(aAddressee)) return sal_False;
-
- return sal_True;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/kcondition.hxx b/connectivity/source/drivers/kab/kcondition.hxx
deleted file mode 100644
index 41873bd420..0000000000
--- a/connectivity/source/drivers/kab/kcondition.hxx
+++ /dev/null
@@ -1,163 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_CONDITION_HXX_
-#define _CONNECTIVITY_KAB_CONDITION_HXX_
-
-#include <comphelper/types.hxx>
-#include <shell/kde_headers.h>
-#include <connectivity/dbexception.hxx>
-
-namespace connectivity
-{
- namespace kab
- {
-// -----------------------------------------------------------------------------
-class KabCondition
-{
- public:
- virtual ~KabCondition();
- virtual sal_Bool isAlwaysTrue() const = 0;
- virtual sal_Bool isAlwaysFalse() const = 0;
- virtual sal_Bool eval(const ::KABC::Addressee &aAddressee) const = 0;
-};
-// -----------------------------------------------------------------------------
-class KabConditionConstant : public KabCondition
-{
- protected:
- sal_Bool m_bValue;
-
- public:
- KabConditionConstant(const sal_Bool bValue);
- virtual sal_Bool isAlwaysTrue() const;
- virtual sal_Bool isAlwaysFalse() const;
- virtual sal_Bool eval(const ::KABC::Addressee &aAddressee) const;
-};
-// -----------------------------------------------------------------------------
-class KabConditionColumn : public KabCondition
-{
- protected:
- sal_Int32 m_nFieldNumber;
-
- QString value(const ::KABC::Addressee &aAddressee) const;
-
- public:
- KabConditionColumn(
- const ::rtl::OUString &sColumnName) throw(::com::sun::star::sdbc::SQLException);
- virtual sal_Bool isAlwaysTrue() const;
- virtual sal_Bool isAlwaysFalse() const;
-};
-// -----------------------------------------------------------------------------
-class KabConditionNull : public KabConditionColumn
-{
- public:
- KabConditionNull(
- const ::rtl::OUString &sColumnName) throw(::com::sun::star::sdbc::SQLException);
- virtual sal_Bool eval(const ::KABC::Addressee &aAddressee) const;
-};
-// -----------------------------------------------------------------------------
-class KabConditionNotNull : public KabConditionColumn
-{
- public:
- KabConditionNotNull(
- const ::rtl::OUString &sColumnName) throw(::com::sun::star::sdbc::SQLException);
- virtual sal_Bool eval(const ::KABC::Addressee &aAddressee) const;
-};
-// -----------------------------------------------------------------------------
-class KabConditionCompare : public KabConditionColumn
-{
- protected:
- const ::rtl::OUString m_sMatchString;
-
- public:
- KabConditionCompare(
- const ::rtl::OUString &sColumnName,
- const ::rtl::OUString &sMatchString) throw(::com::sun::star::sdbc::SQLException);
-};
-// -----------------------------------------------------------------------------
-class KabConditionEqual : public KabConditionCompare
-{
- public:
- KabConditionEqual(
- const ::rtl::OUString &sColumnName,
- const ::rtl::OUString &sMatchString) throw(::com::sun::star::sdbc::SQLException);
- virtual sal_Bool eval(const ::KABC::Addressee &aAddressee) const;
-};
-// -----------------------------------------------------------------------------
-class KabConditionDifferent : public KabConditionCompare
-{
- public:
- KabConditionDifferent(
- const ::rtl::OUString &sColumnName,
- const ::rtl::OUString &sMatchString) throw(::com::sun::star::sdbc::SQLException);
- virtual sal_Bool eval(const ::KABC::Addressee &aAddressee) const;
-};
-// -----------------------------------------------------------------------------
-class KabConditionSimilar : public KabConditionCompare
-{
- public:
- KabConditionSimilar(
- const ::rtl::OUString &sColumnName,
- const ::rtl::OUString &sMatchString) throw(::com::sun::star::sdbc::SQLException);
- virtual sal_Bool eval(const ::KABC::Addressee &aAddressee) const;
-};
-// -----------------------------------------------------------------------------
-class KabConditionBoolean : public KabCondition
-{
- protected:
- KabCondition *m_pLeft, *m_pRight;
-
- public:
- KabConditionBoolean(KabCondition *pLeft, KabCondition *pRight);
- virtual ~KabConditionBoolean();
-};
-// -----------------------------------------------------------------------------
-class KabConditionOr : public KabConditionBoolean
-{
- public:
- KabConditionOr(KabCondition *pLeft, KabCondition *pRight);
- virtual sal_Bool isAlwaysTrue() const;
- virtual sal_Bool isAlwaysFalse() const;
- virtual sal_Bool eval(const ::KABC::Addressee &aAddressee) const;
-};
-// -----------------------------------------------------------------------------
-class KabConditionAnd : public KabConditionBoolean
-{
- public:
- KabConditionAnd(KabCondition *pLeft, KabCondition *pRight);
- virtual sal_Bool isAlwaysTrue() const;
- virtual sal_Bool isAlwaysFalse() const;
- virtual sal_Bool eval(const ::KABC::Addressee &addressee) const;
-};
-// -----------------------------------------------------------------------------
- }
-}
-
-#endif // _CONNECTIVITY_KAB_CONDITION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/kfields.cxx b/connectivity/source/drivers/kab/kfields.cxx
deleted file mode 100644
index cf1632b3cd..0000000000
--- a/connectivity/source/drivers/kab/kfields.cxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "kfields.hxx"
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-
-using namespace ::connectivity::kab;
-using namespace ::com::sun::star::sdbc;
-
-namespace connectivity
-{
- namespace kab
- {
-// -----------------------------------------------------------------------------
-// return the value of a KDE address book field, given an addressee and a field number
-QString valueOfKabField(const ::KABC::Addressee &aAddressee, sal_Int32 nFieldNumber)
-{
- switch (nFieldNumber)
- {
- case KAB_FIELD_REVISION:
- return aAddressee.revision().toString("yyyy-MM-dd hh:mm:ss");
- default:
- ::KABC::Field::List aFields = ::KABC::Field::allFields();
- return aFields[nFieldNumber - KAB_DATA_FIELDS]->value(aAddressee);
- }
-}
-// ------------------------------------------------------------------------------
-// search the KDE address book field number of a given column name
-sal_uInt32 findKabField(const ::rtl::OUString& columnName) throw(SQLException)
-{
- QString aQtName;
- ::rtl::OUString aName;
-
- aQtName = KABC::Addressee::revisionLabel();
- aName = ::rtl::OUString((const sal_Unicode *) aQtName.ucs2());
- if (columnName == aName)
- return KAB_FIELD_REVISION;
-
- ::KABC::Field::List aFields = ::KABC::Field::allFields();
- ::KABC::Field::List::iterator aField;
- sal_uInt32 nResult;
-
- for ( aField = aFields.begin(), nResult = KAB_DATA_FIELDS;
- aField != aFields.end();
- ++aField, ++nResult)
- {
- aQtName = (*aField)->label();
- aName = ::rtl::OUString((const sal_Unicode *) aQtName.ucs2());
-
- if (columnName == aName)
- return nResult;
- }
-
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_INVALID_COLUMNNAME,
- "$columnname$",columnName
- ) );
- ::dbtools::throwGenericSQLException(sError,NULL);
- // Unreachable:
- OSL_ASSERT(false);
- return 0;
-}
-// ------------------------------------------------------------------------------
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/kfields.hxx b/connectivity/source/drivers/kab/kfields.hxx
deleted file mode 100644
index 2e628cd413..0000000000
--- a/connectivity/source/drivers/kab/kfields.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_FIELDS_HXX_
-#define _CONNECTIVITY_KAB_FIELDS_HXX_
-
-#include <shell/kde_headers.h>
-#include <connectivity/dbexception.hxx>
-#include <rtl/ustring.hxx>
-
-#define KAB_FIELD_REVISION 0
-#define KAB_DATA_FIELDS 1
-
-namespace connectivity
-{
- namespace kab
- {
- QString valueOfKabField(const ::KABC::Addressee &aAddressee, sal_Int32 nFieldNumber);
- sal_uInt32 findKabField(const ::rtl::OUString& columnName) throw(::com::sun::star::sdbc::SQLException);
- }
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/korder.cxx b/connectivity/source/drivers/kab/korder.cxx
deleted file mode 100644
index e10d2cfeee..0000000000
--- a/connectivity/source/drivers/kab/korder.cxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "korder.hxx"
-#include "kfields.hxx"
-
-using namespace ::connectivity::kab;
-
-KabOrder::~KabOrder()
-{
-}
-// -----------------------------------------------------------------------------
-KabSimpleOrder::KabSimpleOrder(::rtl::OUString &sColumnName, sal_Bool bAscending)
- : KabOrder(),
- m_nFieldNumber(findKabField(sColumnName)),
- m_bAscending(bAscending)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Int32 KabSimpleOrder::compare(const ::KABC::Addressee &aAddressee1, const ::KABC::Addressee &aAddressee2) const
-{
- sal_Int32 result;
-
- result = QString::compare(
- valueOfKabField(aAddressee1, m_nFieldNumber),
- valueOfKabField(aAddressee2, m_nFieldNumber));
-// Timestamps should be compared differently than with their string value
-
- if (!m_bAscending) result = -result;
-
- return result;
-}
-// -----------------------------------------------------------------------------
-KabComplexOrder::KabComplexOrder()
- : KabOrder(),
- m_aOrders()
-{
-}
-// -----------------------------------------------------------------------------
-KabComplexOrder::~KabComplexOrder()
-{
- for (sal_uInt32 i = 0; i < m_aOrders.size(); i++)
- delete m_aOrders[i];
-}
-// -----------------------------------------------------------------------------
-void KabComplexOrder::addOrder(KabOrder *pOrder)
-{
- m_aOrders.push_back(pOrder);
-}
-// -----------------------------------------------------------------------------
-sal_Int32 KabComplexOrder::compare(const ::KABC::Addressee &aAddressee1, const ::KABC::Addressee &aAddressee2) const
-{
- for (sal_uInt32 i = 0; i < m_aOrders.size(); i++)
- {
- const KabOrder *pOrder = m_aOrders[i];
- sal_Int32 result = pOrder->compare(aAddressee1, aAddressee2);
-
- if (result) return result;
- }
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/korder.hxx b/connectivity/source/drivers/kab/korder.hxx
deleted file mode 100644
index d6df56d383..0000000000
--- a/connectivity/source/drivers/kab/korder.hxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_KAB_ORDER_HXX_
-#define _CONNECTIVITY_KAB_ORDER_HXX_
-
-#include "rtl/ustring.hxx"
-#include <shell/kde_headers.h>
-
-#include <vector>
-
-namespace connectivity
-{
- namespace kab
- {
- class KabOrder
- {
- public:
- virtual ~KabOrder();
-
- virtual sal_Int32 compare(const ::KABC::Addressee &aAddressee1, const ::KABC::Addressee &aAddressee2) const = 0;
- };
-
- class KabSimpleOrder : public KabOrder
- {
- sal_Int32 m_nFieldNumber;
- sal_Bool m_bAscending;
-
- QString value(const ::KABC::Addressee &aAddressee) const;
- public:
- KabSimpleOrder(::rtl::OUString &sColumnName, sal_Bool bAscending);
-
- virtual sal_Int32 compare(const ::KABC::Addressee &aAddressee1, const ::KABC::Addressee &aAddressee2) const;
- };
-
- class KabComplexOrder : public KabOrder
- {
- ::std::vector<KabOrder *> m_aOrders;
-
- public:
- KabComplexOrder();
- virtual ~KabComplexOrder();
-
- void addOrder(KabOrder *pOrder);
- virtual sal_Int32 compare(const ::KABC::Addressee &aAddressee1, const ::KABC::Addressee &aAddressee2) const;
- };
- }
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/kab/makefile.mk b/connectivity/source/drivers/kab/makefile.mk
deleted file mode 100755
index 13d4857c91..0000000000
--- a/connectivity/source/drivers/kab/makefile.mk
+++ /dev/null
@@ -1,149 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=kab
-TARGET2=$(TARGET)drv
-
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-.IF "$(GUI)" == "UNX"
-.IF "$(ENABLE_KAB)" == "TRUE"
-
-CFLAGS+=$(KDE_CFLAGS)
-
-.IF "$(KDE_ROOT)"!=""
-EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib
-.IF "$(OS)$(CPU)" == "LINUXX"
-EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib64
-.ENDIF
-.ENDIF
-
-# === KAB base library ==========================
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/KDriver.obj \
- $(SLO)$/KServices.obj
-
-DEPOBJFILES= \
- $(SLO2FILES)
-
-# --- Library -----------------------------------
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-
-SHL1TARGET= $(TARGET)$(KAB_MAJOR)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(DBTOOLSLIB) \
- $(SALLIB) \
- $(SALHELPERLIB)
-
-SHL1DEPN=
-SHL1IMPLIB= i$(TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-
-# === KAB impl library ==========================
-
-# --- Files -------------------------------------
-
-SLO2FILES=\
- $(SLO)$/KColumns.obj \
- $(SLO)$/KTable.obj \
- $(SLO)$/KTables.obj \
- $(SLO)$/KCatalog.obj \
- $(SLO)$/KResultSet.obj \
- $(SLO)$/KStatement.obj \
- $(SLO)$/KPreparedStatement.obj \
- $(SLO)$/KDatabaseMetaData.obj \
- $(SLO)$/KConnection.obj \
- $(SLO)$/KResultSetMetaData.obj \
- $(SLO)$/kcondition.obj \
- $(SLO)$/korder.obj \
- $(SLO)$/kfields.obj \
- $(SLO)$/KDEInit.obj
-
-KAB_LIB=$(KDE_LIBS) -lkabc
-
-# --- Library -----------------------------------
-
-SHL2VERSIONMAP=$(TARGET2).map
-
-SHL2TARGET= $(TARGET2)$(KAB_MAJOR)
-SHL2OBJS=$(SLO2FILES)
-SHL2LINKFLAGS+=$(KAB_LIB)
-SHL2STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(DBTOOLSLIB) \
- $(COMPHELPERLIB)
-
-SHL2DEPN=
-SHL2IMPLIB= i$(TARGET2)
-
-SHL2DEF= $(MISC)$/$(SHL2TARGET).def
-
-DEF2NAME= $(SHL2TARGET)
-
-# --- Targets -----------------------------------
-.ELSE # "$(ENABLE_KAB)" == "TRUE"
-dummy:
- @echo KDE Addressbook disabled - nothing to build
-.ENDIF
-
-.ELSE # "$(GUI)" == "UNX"
-dummy:
- @echo "Nothing to build for GUI $(GUI)"
-.ENDIF
-
-.INCLUDE : $(PRJ)$/target.pmk
-
-
-ALLTAR : $(MISC)/kab1.component
-
-$(MISC)/kab1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- kab1.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt kab1.component
diff --git a/connectivity/source/drivers/macab/MacabAddressBook.cxx b/connectivity/source/drivers/macab/MacabAddressBook.cxx
deleted file mode 100644
index 1f7d0a6b18..0000000000
--- a/connectivity/source/drivers/macab/MacabAddressBook.cxx
+++ /dev/null
@@ -1,258 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabAddressBook.hxx"
-#include "MacabRecords.hxx"
-#include "MacabGroup.hxx"
-
-#include <vector>
-
-#include <premac.h>
-#include <Carbon/Carbon.h>
-#include <AddressBook/ABAddressBookC.h>
-#include <postmac.h>
-#include "connectivity/CommonTools.hxx"
-
-using namespace connectivity::macab;
-using namespace ::com::sun::star::uno;
-
-// -----------------------------------------------------------------------------
-MacabAddressBook::MacabAddressBook( )
-{
- m_aAddressBook = ABGetSharedAddressBook();
- m_xMacabRecords = NULL;
- m_bRetrievedGroups = sal_False;
-}
-
-// -----------------------------------------------------------------------------
-MacabAddressBook::~MacabAddressBook()
-{
- if(m_xMacabRecords != NULL)
- {
- delete m_xMacabRecords;
- m_xMacabRecords = NULL;
- }
-
- if(!m_xMacabGroups.empty())
- {
- ::std::vector<MacabGroup *>::iterator iter, end;
- iter = m_xMacabGroups.begin();
- end = m_xMacabGroups.end();
- for( ; iter != end; ++iter)
- delete (*iter);
- }
-
- m_bRetrievedGroups = sal_False;
-}
-
-// -----------------------------------------------------------------------------
-/* Get the address book's default table name. This is the table name that
- * refers to the table containing _all_ records in the address book.
- */
-const ::rtl::OUString & MacabAddressBook::getDefaultTableName()
-{
- /* This string probably needs to be localized. */
- static const ::rtl::OUString aDefaultTableName
- (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Address Book")));
-
- return aDefaultTableName;
-}
-
-// -----------------------------------------------------------------------------
-MacabRecords *MacabAddressBook::getMacabRecords()
-{
- /* If the MacabRecords don't exist, create them. */
- if(m_xMacabRecords == NULL)
- {
- m_xMacabRecords = new MacabRecords(m_aAddressBook);
- m_xMacabRecords->setName(getDefaultTableName());
- m_xMacabRecords->initialize();
- }
-
- return m_xMacabRecords;
-}
-
-// -----------------------------------------------------------------------------
-/* Get the MacabRecords for a given name: either a group name or the
- * default table name.
- */
-MacabRecords *MacabAddressBook::getMacabRecords(const ::rtl::OUString _tableName)
-{
- if(_tableName == getDefaultTableName())
- {
- return getMacabRecords();
- }
- else
- {
- return getMacabGroup(_tableName);
- }
-}
-
-// -----------------------------------------------------------------------------
-MacabRecords *MacabAddressBook::getMacabRecordsMatch(const ::rtl::OUString _tableName)
-{
- if(match(_tableName, getDefaultTableName(), '\0'))
- {
- return getMacabRecords();
- }
-
- return getMacabGroupMatch(_tableName);
-}
-
-// -----------------------------------------------------------------------------
-::std::vector<MacabGroup *> MacabAddressBook::getMacabGroups()
-{
- /* If the MacabGroups haven't been created yet, create them. */
- if(m_bRetrievedGroups == sal_False)
- {
- /* If the MacabRecords haven't been created yet, create them. */
- if(m_xMacabRecords == NULL)
- {
- m_xMacabRecords = new MacabRecords(m_aAddressBook);
- m_xMacabRecords->setName(getDefaultTableName());
- m_xMacabRecords->initialize();
- }
-
- CFArrayRef allGroups = ABCopyArrayOfAllGroups(m_aAddressBook);
- sal_Int32 nGroups = CFArrayGetCount(allGroups);
- m_xMacabGroups = ::std::vector<MacabGroup *>(nGroups);
-
- sal_Int32 i;
- ABGroupRef xGroup;
-
- /* Go through each group and create a MacabGroup out of it. */
- for(i = 0; i < nGroups; i++)
- {
- xGroup = (ABGroupRef) CFArrayGetValueAtIndex(allGroups, i);
- m_xMacabGroups[i] = new MacabGroup(m_aAddressBook, m_xMacabRecords, xGroup);
- }
-
- CFRelease(allGroups);
-
- /* Manage duplicates. */
- manageDuplicateGroups(m_xMacabGroups);
- m_bRetrievedGroups = sal_True;
- }
-
- return m_xMacabGroups;
-}
-
-// -----------------------------------------------------------------------------
-MacabGroup *MacabAddressBook::getMacabGroup(::rtl::OUString _groupName)
-{
- // initialize groups if not already initialized
- if(m_bRetrievedGroups == sal_False)
- getMacabGroups();
-
- sal_Int32 nGroups = m_xMacabGroups.size();
- sal_Int32 i;
-
- for(i = 0; i < nGroups; i++)
- {
- if(m_xMacabGroups[i] != NULL)
- {
- if(m_xMacabGroups[i]->getName() == _groupName)
- {
- return m_xMacabGroups[i];
- }
- }
- }
-
- return NULL;
-}
-
-// -----------------------------------------------------------------------------
-MacabGroup *MacabAddressBook::getMacabGroupMatch(::rtl::OUString _groupName)
-{
- // initialize groups if not already initialized
- if(m_bRetrievedGroups == sal_False)
- getMacabGroups();
-
- sal_Int32 nGroups = m_xMacabGroups.size();
- sal_Int32 i;
-
- for(i = 0; i < nGroups; i++)
- {
- if(m_xMacabGroups[i] != NULL)
- {
- if(match(m_xMacabGroups[i]->getName(), _groupName, '\0'))
- {
- return m_xMacabGroups[i];
- }
- }
- }
-
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-void MacabAddressBook::manageDuplicateGroups(::std::vector<MacabGroup *> _xGroups) const
-{
- /* If we have two cases of groups, say, family, this makes it:
- * family
- * family (2)
- */
- ::std::vector<MacabGroup *>::reverse_iterator iter1, iter2;
- sal_Int32 count;
-
- for(iter1 = _xGroups.rbegin(); iter1 != _xGroups.rend(); ++iter1)
- {
- /* If the name matches the default table name, there is already
- * (obviously) a conflict. So, start the count of groups with this
- * name at 2 instead of 1.
- */
- if( (*iter1)->getName() == getDefaultTableName() )
- count = 2;
- else
- count = 1;
-
- iter2 = iter1;
- for( ++iter2; iter2 != _xGroups.rend(); ++iter2)
- {
- if( (*iter1)->getName() == (*iter2)->getName() )
- {
- count++;
- }
- }
-
- // duplicate!
- if(count != 1)
- {
- ::rtl::OUString sName = (*iter1)->getName();
- sName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (")) +
- ::rtl::OUString::valueOf(count) +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
- (*iter1)->setName(sName);
- }
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabAddressBook.hxx b/connectivity/source/drivers/macab/MacabAddressBook.hxx
deleted file mode 100644
index 2aefbd8d9e..0000000000
--- a/connectivity/source/drivers/macab/MacabAddressBook.hxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_ADDRESSBOOK_HXX_
-#define _CONNECTIVITY_MACAB_ADDRESSBOOK_HXX_
-
-#include "MacabRecords.hxx"
-#include "MacabGroup.hxx"
-
-#include <vector>
-
-#include <premac.h>
-#include <Carbon/Carbon.h>
-#include <AddressBook/ABAddressBookC.h>
-#include <postmac.h>
-
-namespace connectivity
-{
- namespace macab
- {
- class MacabAddressBook
- {
- protected:
- ABAddressBookRef m_aAddressBook;
- MacabRecords *m_xMacabRecords;
- ::std::vector<MacabGroup *> m_xMacabGroups;
- sal_Bool m_bRetrievedGroups;
- private:
- void manageDuplicateGroups(::std::vector<MacabGroup *> _xGroups) const;
- public:
- MacabAddressBook();
- ~MacabAddressBook();
- static const ::rtl::OUString & getDefaultTableName();
-
- MacabRecords *getMacabRecords();
- ::std::vector<MacabGroup *> getMacabGroups();
-
- MacabGroup *getMacabGroup(::rtl::OUString _groupName);
- MacabRecords *getMacabRecords(const ::rtl::OUString _tableName);
-
- MacabGroup *getMacabGroupMatch(::rtl::OUString _groupName);
- MacabRecords *getMacabRecordsMatch(const ::rtl::OUString _tableName);
- };
-
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_ADDRESSBOOK_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabCatalog.cxx b/connectivity/source/drivers/macab/MacabCatalog.cxx
deleted file mode 100644
index bd9342b4bd..0000000000
--- a/connectivity/source/drivers/macab/MacabCatalog.cxx
+++ /dev/null
@@ -1,127 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabCatalog.hxx"
-#include "MacabConnection.hxx"
-#include "MacabTables.hxx"
-
-using namespace connectivity::macab;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::cppu;
-
-// -------------------------------------------------------------------------
-MacabCatalog::MacabCatalog(MacabConnection* _pCon)
- : connectivity::sdbcx::OCatalog(_pCon),
- m_pConnection(_pCon),
- m_xMetaData(m_pConnection->getMetaData())
-{
-}
-// -------------------------------------------------------------------------
-void MacabCatalog::refreshTables()
-{
- TStringVector aVector;
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%"));
- Reference< XResultSet > xResult = m_xMetaData->getTables(
- Any(),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%")),
- aTypes);
-
- if (xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- ::rtl::OUString aName;
- // const ::rtl::OUString& sDot = MacabCatalog::getDot();
-
- while (xResult->next())
- {
- // aName = xRow->getString(2);
- // aName += sDot;
- aName = xRow->getString(3);
- aVector.push_back(aName);
- }
- }
- if (m_pTables)
- m_pTables->reFill(aVector);
- else
- m_pTables = new MacabTables(m_xMetaData,*this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void MacabCatalog::refreshViews()
-{
-}
-// -------------------------------------------------------------------------
-void MacabCatalog::refreshGroups()
-{
-}
-// -------------------------------------------------------------------------
-void MacabCatalog::refreshUsers()
-{
-}
-// -------------------------------------------------------------------------
-const ::rtl::OUString& MacabCatalog::getDot()
-{
- static const ::rtl::OUString sDot = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("."));
- return sDot;
-}
-// -----------------------------------------------------------------------------
-
-// XTablesSupplier
-Reference< XNameAccess > SAL_CALL MacabCatalog::getTables( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(rBHelper.bDisposed);
-
- try
- {
- if (!m_pTables)
- refreshTables();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return m_pTables;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabCatalog.hxx b/connectivity/source/drivers/macab/MacabCatalog.hxx
deleted file mode 100644
index 52e4e7782f..0000000000
--- a/connectivity/source/drivers/macab/MacabCatalog.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_CATALOG_HXX_
-#define _CONNECTIVITY_MACAB_CATALOG_HXX_
-
-#include "connectivity/sdbcx/VCatalog.hxx"
-
-namespace connectivity
-{
- namespace macab
- {
- class MacabConnection;
-
- class MacabCatalog : public connectivity::sdbcx::OCatalog
- {
- MacabConnection* m_pConnection; // used to get the metadata
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData; // just to make things easier
-
- public:
- MacabCatalog(MacabConnection* _pCon);
-
- inline MacabConnection* getConnection() const { return m_pConnection; }
-
- static const ::rtl::OUString& getDot();
-
- // implementation of the pure virtual methods
- virtual void refreshTables();
- virtual void refreshViews();
- virtual void refreshGroups();
- virtual void refreshUsers();
-
- // XTablesSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTables(
- ) throw(::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_CATALOG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabColumns.cxx b/connectivity/source/drivers/macab/MacabColumns.cxx
deleted file mode 100644
index 0d78b45969..0000000000
--- a/connectivity/source/drivers/macab/MacabColumns.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabColumns.hxx"
-#include "MacabTable.hxx"
-#include "MacabTables.hxx"
-#include "MacabCatalog.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-
-using namespace connectivity::macab;
-using namespace connectivity::sdbcx;
-using namespace connectivity;
-using namespace ::comphelper;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -------------------------------------------------------------------------
-sdbcx::ObjectType MacabColumns::createObject(const ::rtl::OUString& _rName)
-{
- Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns(
- Any(),
- m_pTable->getSchema(),
- m_pTable->getTableName(),
- _rName);
-
- sdbcx::ObjectType xRet = NULL;
- if (xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
-
- while (xResult->next())
- {
- if (xRow->getString(4) == _rName)
- {
- OColumn* pRet = new OColumn(
- _rName,
- xRow->getString(6),
- xRow->getString(13),
- xRow->getString(12),
- xRow->getInt(11),
- xRow->getInt(7),
- xRow->getInt(9),
- xRow->getInt(5),
- sal_False,
- sal_False,
- sal_False,
- sal_True);
- xRet = pRet;
- break;
- }
- }
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void MacabColumns::impl_refresh() throw(RuntimeException)
-{
- m_pTable->refreshColumns();
-}
-// -------------------------------------------------------------------------
-MacabColumns::MacabColumns( MacabTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector)
- : sdbcx::OCollection(*_pTable, sal_True, _rMutex, _rVector),
- m_pTable(_pTable)
-{
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabColumns.hxx b/connectivity/source/drivers/macab/MacabColumns.hxx
deleted file mode 100644
index 1d75c8b585..0000000000
--- a/connectivity/source/drivers/macab/MacabColumns.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_COLUMNS_HXX_
-#define _CONNECTIVITY_MACAB_COLUMNS_HXX_
-
-#include "MacabTable.hxx"
-#include "connectivity/sdbcx/VCollection.hxx"
-
-namespace connectivity
-{
- namespace macab
- {
- class MacabColumns : public sdbcx::OCollection
- {
- protected:
- MacabTable* m_pTable;
-
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
-
- public:
- MacabColumns( MacabTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector);
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_COLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabConnection.cxx b/connectivity/source/drivers/macab/MacabConnection.cxx
deleted file mode 100644
index 4841430a07..0000000000
--- a/connectivity/source/drivers/macab/MacabConnection.cxx
+++ /dev/null
@@ -1,326 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabConnection.hxx"
-#include "MacabAddressBook.hxx"
-#include "MacabDatabaseMetaData.hxx"
-#include "MacabStatement.hxx"
-#include "MacabPreparedStatement.hxx"
-#include "MacabDriver.hxx"
-#include "MacabCatalog.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/TransactionIsolation.hpp>
-
-using namespace connectivity::macab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-
-IMPLEMENT_SERVICE_INFO(MacabConnection, "com.sun.star.sdbc.drivers.MacabConnection", "com.sun.star.sdbc.Connection")
-//-----------------------------------------------------------------------------
-MacabConnection::MacabConnection(MacabDriver* _pDriver)
- : OSubComponent<MacabConnection, MacabConnection_BASE>((::cppu::OWeakObject*)_pDriver, this),
- m_pAddressBook(NULL),
- m_pDriver(_pDriver)
-{
- m_pDriver->acquire();
-}
-//-----------------------------------------------------------------------------
-MacabConnection::~MacabConnection()
-{
- if (!isClosed())
- close();
-
- m_pDriver->release();
- m_pDriver = NULL;
-}
-//-----------------------------------------------------------------------------
-void SAL_CALL MacabConnection::release() throw()
-{
- relase_ChildImpl();
-}
-// -----------------------------------------------------------------------------
-void MacabConnection::construct(const ::rtl::OUString&, const Sequence< PropertyValue >&) throw(SQLException)
-{
- osl_incrementInterlockedCount( &m_refCount );
-
- // get the Mac OS X shared address book
- m_pAddressBook = new MacabAddressBook();
-
- osl_decrementInterlockedCount( &m_refCount );
-}
-// XServiceInfo
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL MacabConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
- // create a statement
- // the statement can only be executed once
- Reference< XStatement > xReturn = new MacabStatement(this);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL MacabConnection::prepareStatement( const ::rtl::OUString& _sSql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
- // create a statement
- // the statement can only be executed more than once
- Reference< XPreparedStatement > xReturn = new MacabPreparedStatement(this, _sSql);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL MacabConnection::prepareCall( const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
- // not implemented yet :-) a task to do
- return NULL;
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabConnection::nativeSQL( const ::rtl::OUString& _sSql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- // when you need to transform SQL92 to you driver specific you can do it here
-
- return _sSql;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL MacabConnection::setAutoCommit( sal_Bool ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
- // here you have to set your commit mode please have a look at the jdbc documentation to get a clear explanation
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabConnection::getAutoCommit( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
- // you have to distinguish which if you are in autocommit mode or not
- // at normal case true should be fine here
-
- return sal_True;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL MacabConnection::commit( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
- // when you database does support transactions you should commit here
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL MacabConnection::rollback( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
- // same as commit but for the other case
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabConnection::isClosed( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- // just simple -> we are closed when we are disposed, that means someone called dispose(); (XComponent)
- return MacabConnection_BASE::rBHelper.bDisposed;
-}
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL MacabConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
- // here we have to create the class with biggest interface
- // The answer is 42 :-)
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if (!xMetaData.is())
- {
- xMetaData = new MacabDatabaseMetaData(this); // need the connection because it can return it
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL MacabConnection::setReadOnly( sal_Bool ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
- // set you connection to readonly
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabConnection::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
- // return if your connection to readonly
- return sal_False;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL MacabConnection::setCatalog( const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
- // if your database doesn't work with catalogs you go to next method otherwise you kjnow what to do
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabConnection::getCatalog( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
-
- // return your current catalog
- return ::rtl::OUString();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL MacabConnection::setTransactionIsolation( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
- // set your isolation level
- // please have a look at @see com.sun.star.sdbc.TransactionIsolation
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabConnection::getTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
-
- // please have a look at @see com.sun.star.sdbc.TransactionIsolation
- return TransactionIsolation::NONE;
-}
-// --------------------------------------------------------------------------------
-Reference< ::com::sun::star::container::XNameAccess > SAL_CALL MacabConnection::getTypeMap( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
-
- // if your driver has special database types you can return it here
-
- return NULL;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL MacabConnection::setTypeMap( const Reference< ::com::sun::star::container::XNameAccess >& ) throw(SQLException, RuntimeException)
-{
- // the other way around
-}
-// --------------------------------------------------------------------------------
-// XCloseable
-void SAL_CALL MacabConnection::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabConnection_BASE::rBHelper.bDisposed);
- }
- dispose();
-}
-// --------------------------------------------------------------------------------
-// XWarningsSupplier
-Any SAL_CALL MacabConnection::getWarnings( ) throw(SQLException, RuntimeException)
-{
- // when you collected some warnings -> return it
- return Any();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL MacabConnection::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- // you should clear your collected warnings here
-}
-//------------------------------------------------------------------------------
-void MacabConnection::disposing()
-{
- // we noticed that we should be destroied in near future so we have to dispose our statements
- ::osl::MutexGuard aGuard(m_aMutex);
-
- for (OWeakRefArray::iterator i = m_aStatements.begin(); m_aStatements.end() != i; ++i)
- {
- Reference< XComponent > xComp(i->get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- }
- m_aStatements.clear();
-
- if (m_pAddressBook != NULL)
- {
- delete m_pAddressBook;
- m_pAddressBook = NULL;
- }
-
- m_xMetaData = ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDatabaseMetaData>();
-
- dispose_ChildImpl();
- MacabConnection_BASE::disposing();
-}
-// -----------------------------------------------------------------------------
-Reference< XTablesSupplier > SAL_CALL MacabConnection::createCatalog()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- Reference< XTablesSupplier > xTab = m_xCatalog;
- if (!m_xCatalog.is())
- {
- MacabCatalog *pCat = new MacabCatalog(this);
- xTab = pCat;
- m_xCatalog = xTab;
- }
- return xTab;
-}
-// -----------------------------------------------------------------------------
-MacabAddressBook* MacabConnection::getAddressBook() const
-{
- return m_pAddressBook;
-}
-// -----------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL createMacabConnection( void* _pDriver )
-{
- MacabConnection* pConnection = new MacabConnection( static_cast< MacabDriver* >( _pDriver ) );
- // by definition, the pointer crossing library boundaries as void ptr is acquired once
- pConnection->acquire();
- return pConnection;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabConnection.hxx b/connectivity/source/drivers/macab/MacabConnection.hxx
deleted file mode 100644
index 65ece28448..0000000000
--- a/connectivity/source/drivers/macab/MacabConnection.hxx
+++ /dev/null
@@ -1,134 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_CONNECTION_HXX_
-#define _CONNECTIVITY_MACAB_CONNECTION_HXX_
-
-#include <map>
-#include "OSubComponent.hxx"
-#include "connectivity/CommonTools.hxx"
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#include <comphelper/broadcasthelper.hxx>
-#include <cppuhelper/compbase3.hxx>
-#include "TConnection.hxx"
-
-namespace connectivity
-{
- namespace macab
- {
-
- typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbc::XConnection,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::lang::XServiceInfo
- > OMetaConnection_BASE;
-
- class MacabStatement_Base;
- class MacabDriver;
- class MacabDatabaseMetaData;
- class MacabAddressBook;
-
- //typedef OMetaConnection_BASE MacabConnection_BASE; // implements basics and text encoding
- typedef std::vector< ::com::sun::star::uno::WeakReferenceHelper > OWeakRefArray;
-
- typedef connectivity::OMetaConnection MacabConnection_BASE;
-
- class MacabConnection : public MacabConnection_BASE,
- public OSubComponent<MacabConnection, MacabConnection_BASE>
- {
- friend class OSubComponent<MacabConnection, MacabConnection_BASE>;
-
- protected:
- //====================================================================
- // Data attributes
- //====================================================================
- MacabAddressBook* m_pAddressBook; // the address book
- MacabDriver* m_pDriver; // pointer to the owning driver object
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier>
- m_xCatalog; // needed for the SQL interpreter
-
- public:
- virtual void construct( const ::rtl::OUString& url,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info) throw(::com::sun::star::sdbc::SQLException);
-
- MacabConnection(MacabDriver* _pDriver);
- virtual ~MacabConnection();
-
- void closeAllStatements () throw( ::com::sun::star::sdbc::SQLException);
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- // XInterface
- virtual void SAL_CALL release() throw();
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
-
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL nativeSQL( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getAutoCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL commit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL rollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isClosed( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCatalog( const ::rtl::OUString& catalog ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalog( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // needed for the SQL interpreter
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL createCatalog();
-
- // accessors
- inline MacabDriver* getDriver() const { return m_pDriver;}
- MacabAddressBook* getAddressBook() const;
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_CONNECTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx
deleted file mode 100644
index 7a8687eb13..0000000000
--- a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx
+++ /dev/null
@@ -1,1127 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabDatabaseMetaData.hxx"
-#include "MacabAddressBook.hxx"
-#include "MacabHeader.hxx"
-#include "MacabGroup.hxx"
-#include "macabutilities.hxx"
-
-#include "MacabDriver.hxx"
-#include "FDatabaseMetaDataResultSet.hxx"
-#include "OTypeInfo.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/TransactionIsolation.hpp>
-
-#include <vector>
-
-using namespace connectivity::macab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-
-MacabDatabaseMetaData::MacabDatabaseMetaData(MacabConnection* _pCon)
- : m_xConnection(_pCon),
- m_bUseCatalog(sal_True)
-{
- OSL_ENSURE(_pCon,"MacabDatabaseMetaData::MacabDatabaseMetaData: No connection set!");
-
- osl_incrementInterlockedCount( &m_refCount );
- m_bUseCatalog = !(usesLocalFiles() || usesLocalFilePerTable());
- osl_decrementInterlockedCount( &m_refCount );
-}
-// -------------------------------------------------------------------------
-MacabDatabaseMetaData::~MacabDatabaseMetaData()
-{
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getCatalogSeparator( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- if (m_bUseCatalog)
- { // do some special here for you database
- }
-
- return aVal;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxTablesInSelect( ) throw(SQLException, RuntimeException)
-{
- // MaxTablesInSelect describes how many tables can participate in the FROM part of a given SELECT statement,
- // currently, the resultset/statement implementations can cope with one table only
- sal_Int32 nValue = 1;
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::storesMixedCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsAlterTableWithAddColumn( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsAlterTableWithDropColumn( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- if (m_bUseCatalog)
- {
- }
- return aVal;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getIdentifierQuoteString( ) throw(SQLException, RuntimeException)
-{
- // normally this is "
- ::rtl::OUString aVal(RTL_CONSTASCII_USTRINGPARAM("\""));
- return aVal;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- return aVal;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::isCatalogAtStart( ) throw(SQLException, RuntimeException)
-{
- sal_Bool bValue = sal_False;
- if (m_bUseCatalog)
- {
- }
- return bValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSchemasInDataManipulation( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException)
-{
- return sal_True; // should be supported at least
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSchemasInTableDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCatalogsInTableDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCatalogsInDataManipulation( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxStatements( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- // for the moment, we have read-only addresses, but this might change in the future
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsConvert( sal_Int32, sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsMixedCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- // if someday we support more than the default address book,
- // this method should return the URL which was used to create it
- ::rtl::OUString aValue( RTL_CONSTASCII_USTRINGPARAM( "sdbc:address:macab:" ));
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue( RTL_CONSTASCII_USTRINGPARAM( "macab" ));
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getDriverVersion() throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue(RTL_CONSTASCII_USTRINGPARAM(MACAB_DRIVER_VERSION));
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException)
-{
- return MACAB_DRIVER_VERSION_MAJOR;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- return TransactionIsolation::NONE;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException)
-{
- return MACAB_DRIVER_VERSION_MINOR;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- switch (setType)
- {
- case ResultSetType::FORWARD_ONLY:
- case ResultSetType::SCROLL_INSENSITIVE:
- return sal_True;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 ) throw(SQLException, RuntimeException)
-{
- switch (setType)
- {
- case ResultSetType::FORWARD_ONLY:
- case ResultSetType::SCROLL_INSENSITIVE:
- return sal_True;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::ownUpdatesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::ownDeletesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::ownInsertsAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::othersUpdatesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::othersDeletesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::othersInsertsAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::updatesAreDetected( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::deletesAreDetected( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::insertsAreDetected( sal_Int32 ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL MacabDatabaseMetaData::getConnection( ) throw(SQLException, RuntimeException)
-{
- return (Reference< XConnection >) m_xConnection.get();
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException)
-{
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTableTypes);
- Reference< XResultSet > xRef = pResult;
-
- static ODatabaseMetaDataResultSet::ORows aRows;
- static const ::rtl::OUString aTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
-
- if (aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow(2);
- aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[1] = new ORowSetValueDecorator(aTable);
- aRows.push_back(aRow);
- }
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTypeInfo( ) throw(SQLException, RuntimeException)
-{
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTypeInfo);
- Reference< XResultSet > xRef = pResult;
-
- static ODatabaseMetaDataResultSet::ORows aRows;
- if (aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow(19);
-
- // We support four types: char, timestamp, integer, float
- aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CHAR")));
- aRow[2] = new ORowSetValueDecorator(DataType::CHAR);
- aRow[3] = new ORowSetValueDecorator((sal_Int32) 254);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[6] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[7] = new ORowSetValueDecorator((sal_Int32) ColumnValue::NULLABLE);
- aRow[8] = ODatabaseMetaDataResultSet::get1Value();
- aRow[9] = new ORowSetValueDecorator((sal_Int32) ColumnSearch::CHAR);
- aRow[10] = ODatabaseMetaDataResultSet::get1Value();
- aRow[11] = ODatabaseMetaDataResultSet::get0Value();
- aRow[12] = ODatabaseMetaDataResultSet::get0Value();
- aRow[13] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[14] = ODatabaseMetaDataResultSet::get0Value();
- aRow[15] = ODatabaseMetaDataResultSet::get0Value();
- aRow[16] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[17] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[18] = new ORowSetValueDecorator((sal_Int32) 10);
-
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP")));
- aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)19);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INTEGER")));
- aRow[2] = new ORowSetValueDecorator(DataType::INTEGER);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
- aRow[15] = new ORowSetValueDecorator((sal_Int32)20);
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FLOAT")));
- aRow[2] = new ORowSetValueDecorator(DataType::FLOAT);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
- aRow[15] = new ORowSetValueDecorator((sal_Int32)15);
- aRows.push_back(aRow);
- }
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getCatalogs( ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eCatalogs );
-}
-// -----------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getSchemas( ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eSchemas );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getColumnPrivileges(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString&,
- const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eColumnPrivileges );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getColumns(
- const Any&,
- const ::rtl::OUString&,
- const ::rtl::OUString& tableNamePattern,
- const ::rtl::OUString& columnNamePattern) throw(SQLException, RuntimeException)
-{
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns);
- Reference< XResultSet > xRef = pResult;
- MacabRecords *aRecords;
- ::rtl::OUString sTableName;
-
- aRecords = m_xConnection->getAddressBook()->getMacabRecordsMatch(tableNamePattern);
-
- ODatabaseMetaDataResultSet::ORows aRows;
- if(aRecords != NULL)
- {
- MacabHeader *aHeader = aRecords->getHeader();
- sTableName = aRecords->getName();
-
- ODatabaseMetaDataResultSet::ORow aRow(19);
-
- aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[1] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[2] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[3] = new ORowSetValueDecorator(sTableName);
- aRow[8] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[9] = ODatabaseMetaDataResultSet::get0Value();
- aRow[10] = new ORowSetValueDecorator((sal_Int32) 10);
- aRow[11] = ODatabaseMetaDataResultSet::get1Value();
- aRow[12] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[13] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[14] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[15] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[16] = new ORowSetValueDecorator((sal_Int32) 254);
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("YES")));
-
- sal_Int32 nPosition = 1;
- ::rtl::OUString sName;
-
- MacabHeader::iterator aField;
-
- for ( aField = aHeader->begin();
- aField != aHeader->end();
- ++aField, ++nPosition)
- {
-
- sName = CFStringToOUString((CFStringRef) (*aField)->value);
- if (match(columnNamePattern, sName, '\0'))
- {
- aRow[4] = new ORowSetValueDecorator(sName);
- aRow[17] = new ORowSetValueDecorator(nPosition);
- switch((*aField)->type)
- {
- case kABStringProperty:
- aRow[5] = new ORowSetValueDecorator(DataType::CHAR);
- aRow[6] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CHAR")));
- aRow[7] = new ORowSetValueDecorator((sal_Int32) 256);
- aRows.push_back(aRow);
- break;
- case kABDateProperty:
- aRow[5] = new ORowSetValueDecorator(DataType::TIMESTAMP);
- aRow[6] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP")));
- aRows.push_back(aRow);
- break;
- case kABIntegerProperty:
- aRow[5] = new ORowSetValueDecorator(DataType::INTEGER);
- aRow[6] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INTEGER")));
- aRow[7] = new ORowSetValueDecorator((sal_Int32) 20);
- aRows.push_back(aRow);
- break;
- case kABRealProperty:
- aRow[5] = new ORowSetValueDecorator(DataType::FLOAT);
- aRow[6] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FLOAT")));
- aRow[7] = new ORowSetValueDecorator((sal_Int32) 15);
- aRows.push_back(aRow);
- break;
- default:
- ;
- // shouldn't happen -- throw an error...?
- }
- }
- }
- }
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTables(
- const Any&,
- const ::rtl::OUString&,
- const ::rtl::OUString&,
- const Sequence< ::rtl::OUString >& types) throw(SQLException, RuntimeException)
-{
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTables);
- Reference< XResultSet > xRef = pResult;
-
- // check whether we have tables in the requested types
- // for the moment, we answer only the "TABLE" table type
- // when no types are given at all, we return all the tables
- static const ::rtl::OUString aTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
- sal_Bool bTableFound = sal_False;
- const ::rtl::OUString* p = types.getConstArray(),
- * pEnd = p + types.getLength();
-
- if (p == pEnd)
- {
- bTableFound = sal_True;
- }
- else while (p < pEnd)
- {
- if (match(*p, aTable, '\0'))
- {
- bTableFound = sal_True;
- break;
- }
- p++;
- }
- if (!bTableFound)
- return xRef;
-
- static ODatabaseMetaDataResultSet::ORows aRows;
-
- if (aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow(6);
-
- MacabRecords *xRecords = m_xConnection->getAddressBook()->getMacabRecords();
- ::std::vector<MacabGroup *> xGroups = m_xConnection->getAddressBook()->getMacabGroups();
- sal_Int32 i, nGroups;
- nGroups = xGroups.size();
-
- aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[1] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[2] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[3] = new ORowSetValueDecorator(xRecords->getName());
- aRow[4] = new ORowSetValueDecorator(aTable);
- aRow[5] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRows.push_back(aRow);
-
- for(i = 0; i < nGroups; i++)
- {
- aRow[3] = new ORowSetValueDecorator(xGroups[i]->getName());
- aRows.push_back(aRow);
- }
- }
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getProcedureColumns(
- const Any&, const ::rtl::OUString&,
- const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eProcedureColumns );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getProcedures(
- const Any&, const ::rtl::OUString&,
- const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eProcedures );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getVersionColumns(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eVersionColumns );
-
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eVersionColumns);
- Reference< XResultSet > xRef = pResult;
-
- ODatabaseMetaDataResultSet::ORows aRows;
-
- if (m_xConnection->getAddressBook()->getMacabRecords(table) != NULL)
- {
- ODatabaseMetaDataResultSet::ORow aRow( 9 );
-
- ::rtl::OUString sName = CFStringToOUString(kABModificationDateProperty);
-
- aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[1] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[2] = new ORowSetValueDecorator(sName);
- aRow[3] = new ORowSetValueDecorator(DataType::TIMESTAMP);
- aRow[4] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP")));
-
- aRow[5] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[6] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[7] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[8] = ODatabaseMetaDataResultSet::getEmptyValue();
-
- aRows.push_back(aRow);
- }
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getExportedKeys(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eExportedKeys );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getImportedKeys(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eImportedKeys );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getPrimaryKeys(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::ePrimaryKeys );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getIndexInfo(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString&,
- sal_Bool, sal_Bool ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eIndexInfo );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getBestRowIdentifier(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString&, sal_Int32,
- sal_Bool ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eBestRowIdentifier );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTablePrivileges(
- const Any&, const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getCrossReference(
- const Any&, const ::rtl::OUString&,
- const ::rtl::OUString&, const Any&,
- const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eCrossReference );
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getUDTs( const Any&, const ::rtl::OUString&, const ::rtl::OUString&, const Sequence< sal_Int32 >& ) throw(SQLException, RuntimeException)
-{
- OSL_FAIL("Not implemented yet!");
- throw SQLException();
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabDatabaseMetaData.hxx b/connectivity/source/drivers/macab/MacabDatabaseMetaData.hxx
deleted file mode 100644
index 852cd32c7d..0000000000
--- a/connectivity/source/drivers/macab/MacabDatabaseMetaData.hxx
+++ /dev/null
@@ -1,215 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_DATABASEMETADATA_HXX_
-#define _CONNECTIVITY_MACAB_DATABASEMETADATA_HXX_
-
-#include "MacabConnection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace connectivity
-{
- namespace macab
- {
- //**************************************************************
- //************ Class: MacabDatabaseMetaData
- //**************************************************************
-
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XDatabaseMetaData> MacabDatabaseMetaData_BASE;
-
- class MacabDatabaseMetaData : public MacabDatabaseMetaData_BASE
- {
- ::com::sun::star::uno::Reference< MacabConnection > m_xConnection;
- sal_Bool m_bUseCatalog;
-
- public:
-
- inline MacabConnection* getOwnConnection() const { return m_xConnection.get(); }
-
- MacabDatabaseMetaData(MacabConnection* _pCon);
- virtual ~MacabDatabaseMetaData();
-
- // this interface is really BIG
- // XDatabaseMetaData
- virtual sal_Bool SAL_CALL allProceduresAreCallable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL allTablesAreSelectable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getUserName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedLow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFiles( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMixedCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesMixedCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getIdentifierQuoteString( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSQLKeywords( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getNumericFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getStringFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSystemFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTimeDateFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSearchStringEscape( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getExtraNameCharacters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsAlterTableWithAddColumn( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsAlterTableWithDropColumn( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsColumnAliasing( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTypeConversion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getProcedureTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCatalogAtStart( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogSeparator( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInDataManipulation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInTableDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInDataManipulation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInTableDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedDelete( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsStoredProcedures( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnionAll( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxConnections( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxIndexLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxRowSize( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxStatementLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxStatements( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxTablesInSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getProcedures( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getProcedureColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTables( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getSchemas( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getCatalogs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTableTypes( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTablePrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getBestRowIdentifier( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope, sal_Bool nullable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getVersionColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getImportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getExportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getCrossReference( const ::com::sun::star::uno::Any& primaryCatalog, const ::rtl::OUString& primarySchema, const ::rtl::OUString& primaryTable, const ::com::sun::star::uno::Any& foreignCatalog, const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTypeInfo( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getIndexInfo( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Bool unique, sal_Bool approximate ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsBatchUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getUDTs( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern, const ::com::sun::star::uno::Sequence< sal_Int32 >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_DATABASEMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabDriver.cxx b/connectivity/source/drivers/macab/MacabDriver.cxx
deleted file mode 100644
index 3751b24ddc..0000000000
--- a/connectivity/source/drivers/macab/MacabDriver.cxx
+++ /dev/null
@@ -1,350 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabDriver.hxx"
-#include "MacabConnection.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/sdb/SQLContext.hpp>
-#include <com/sun/star/lang/NullPointerException.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-/** === end UNO includes === **/
-#include <rtl/ustrbuf.hxx>
-#include <tools/diagnose_ex.h>
-#include "resource/macab_res.hrc"
-
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdb;
-using namespace com::sun::star::frame;
-using namespace connectivity::macab;
-
-// =======================================================================
-// = MacabImplModule
-// =======================================================================
-// --------------------------------------------------------------------------------
-MacabImplModule::MacabImplModule( const Reference< XMultiServiceFactory >& _rxFactory )
- :m_xORB(_rxFactory)
- ,m_bAttemptedLoadModule(false)
- ,m_hConnectorModule(NULL)
- ,m_pConnectionFactoryFunc(NULL)
-{
- if ( !m_xORB.is() )
- throw NullPointerException();
-}
-
-// --------------------------------------------------------------------------------
-bool MacabImplModule::isMacOSPresent()
-{
- return impl_loadModule();
-}
-
-// --------------------------------------------------------------------------------
-namespace
-{
- template< typename FUNCTION >
- void lcl_getFunctionFromModuleOrUnload( oslModule& _rModule, const sal_Char* _pAsciiSymbolName, FUNCTION& _rFunction )
- {
- _rFunction = NULL;
- if ( _rModule )
- {
- //
- const ::rtl::OUString sSymbolName = ::rtl::OUString::createFromAscii( _pAsciiSymbolName );
- _rFunction = (FUNCTION)( osl_getSymbol( _rModule, sSymbolName.pData ) );
-
- if ( !_rFunction )
- { // did not find the symbol
- OSL_FAIL( ::rtl::OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + ::rtl::OString( _pAsciiSymbolName ) );
- osl_unloadModule( _rModule );
- _rModule = NULL;
- }
- }
- }
-}
-
-// --------------------------------------------------------------------------------
-extern "C" { static void SAL_CALL thisModule() {} }
-
-bool MacabImplModule::impl_loadModule()
-{
- if ( m_bAttemptedLoadModule )
- return ( m_hConnectorModule != NULL );
- m_bAttemptedLoadModule = true;
-
- OSL_ENSURE( !m_hConnectorModule && !m_pConnectionFactoryFunc,
- "MacabImplModule::impl_loadModule: inconsistence: inconsistency (never attempted load before, but some values already set)!");
-
- const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM( SAL_MODULENAME( "macabdrv1" )) );
- m_hConnectorModule = osl_loadModuleRelative( &thisModule, sModuleName.pData, SAL_LOADMODULE_NOW ); // LAZY! #i61335#
- OSL_ENSURE( m_hConnectorModule, "MacabImplModule::impl_loadModule: could not load the implementation library!" );
- if ( !m_hConnectorModule )
- return false;
-
- lcl_getFunctionFromModuleOrUnload( m_hConnectorModule, "createMacabConnection", m_pConnectionFactoryFunc );
-
- if ( !m_hConnectorModule )
- // one of the symbols did not exist
- throw RuntimeException();
-
- return true;
-}
-
-// --------------------------------------------------------------------------------
-void MacabImplModule::impl_unloadModule()
-{
- OSL_PRECOND( m_hConnectorModule != NULL, "MacabImplModule::impl_unloadModule: no module!" );
-
- osl_unloadModule( m_hConnectorModule );
- m_hConnectorModule = NULL;
-
- m_pConnectionFactoryFunc = NULL;
-
- m_bAttemptedLoadModule = false;
-}
-
-// --------------------------------------------------------------------------------
-void MacabImplModule::init()
-{
- if ( !impl_loadModule() )
- impl_throwNoMacOSException();
-
-}
-
-// --------------------------------------------------------------------------------
-void MacabImplModule::impl_throwNoMacOSException()
-{
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(
- STR_NO_MAC_OS_FOUND
- ) );
- impl_throwGenericSQLException( sError );
-}
-
-// --------------------------------------------------------------------------------
-void MacabImplModule::impl_throwGenericSQLException( const ::rtl::OUString& _rMessage )
-{
- SQLException aError;
- aError.Message = _rMessage;
- aError.SQLState = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "S1000" ) );
- aError.ErrorCode = 0;
- throw aError;
-}
-
-// --------------------------------------------------------------------------------
-MacabConnection* MacabImplModule::createConnection( MacabDriver* _pDriver ) const
-{
- OSL_PRECOND( m_hConnectorModule, "MacabImplModule::createConnection: not initialized!" );
-
- void* pUntypedConnection = (*m_pConnectionFactoryFunc)( _pDriver );
- if ( !pUntypedConnection )
- throw RuntimeException();
-
- return static_cast< MacabConnection* >( pUntypedConnection );
-}
-
-// --------------------------------------------------------------------------------
-void MacabImplModule::shutdown()
-{
- if ( !m_hConnectorModule )
- return;
-
- impl_unloadModule();
-}
-
-// =======================================================================
-// = MacabDriver
-// =======================================================================
-MacabDriver::MacabDriver(
- const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory)
- : MacabDriver_BASE(m_aMutex),
- m_xMSFactory(_rxFactory),
- m_aImplModule(_rxFactory)
-{
- if ( !m_xMSFactory.is() )
- throw NullPointerException();
-
- osl_incrementInterlockedCount( &m_refCount );
- try
- {
- Reference< XDesktop > xDesktop(
- m_xMSFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ) ),
- UNO_QUERY_THROW );
- xDesktop->addTerminateListener( this );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- osl_decrementInterlockedCount( &m_refCount );
-}
-// --------------------------------------------------------------------------------
-void MacabDriver::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- // when driver will be destroied so all our connections have to be destroied as well
- for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
- {
- Reference< XComponent > xComp(i->get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- }
- m_xConnections.clear();
-
- WeakComponentImplHelperBase::disposing();
-}
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString MacabDriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return rtl::OUString::createFromAscii( impl_getAsciiImplementationName() );
-}
-//------------------------------------------------------------------------------
-Sequence< ::rtl::OUString > MacabDriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
-{
- // which service is supported
- // for more information @see com.sun.star.sdbc.Driver
- Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"));
-
- return aSNS;
-}
-//------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabDriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-//------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDriver::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
-
- while (pSupported != pEnd && !pSupported->equals(_rServiceName))
- ++pSupported;
- return pSupported != pEnd;
-}
-//------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL MacabDriver::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-// --------------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL MacabDriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- m_aImplModule.init();
-
- // create a new connection with the given properties and append it to our vector
- MacabConnection* pConnection = m_aImplModule.createConnection( this );
- OSL_POSTCOND( pConnection, "MacabDriver::connect: no connection has been created by the factory!" );
-
- // by definition, the factory function returned an object which was acquired once
- Reference< XConnection > xConnection = pConnection;
- pConnection->release();
-
- // late constructor call which can throw exception and allows a correct dtor call when so
- pConnection->construct( url, info );
-
- // remember it
- m_xConnections.push_back( WeakReferenceHelper( *pConnection ) );
-
- return xConnection;
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabDriver::acceptsURL( const ::rtl::OUString& url )
- throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- if ( !m_aImplModule.isMacOSPresent() )
- return sal_False;
-
- // here we have to look whether we support this URL format
- return (!url.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:macab:")), 18));
-}
-// --------------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL MacabDriver::getPropertyInfo( const ::rtl::OUString&, const Sequence< PropertyValue >& ) throw(SQLException, RuntimeException)
-{
- // if you have something special to say, return it here :-)
- return Sequence< DriverPropertyInfo >();
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDriver::getMajorVersion( ) throw(RuntimeException)
-{
- return MACAB_DRIVER_VERSION_MAJOR;
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabDriver::getMinorVersion( ) throw(RuntimeException)
-{
- return MACAB_DRIVER_VERSION_MINOR;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL MacabDriver::queryTermination( const EventObject& ) throw (TerminationVetoException, RuntimeException)
-{
- // nothing to do, nothing to veto
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL MacabDriver::notifyTermination( const EventObject& ) throw (RuntimeException)
-{
- m_aImplModule.shutdown();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL MacabDriver::disposing( const EventObject& ) throw (RuntimeException)
-{
- // not interested in (this is the disposing of the desktop, if any)
-}
-// --------------------------------------------------------------------------------
-const sal_Char* MacabDriver::impl_getAsciiImplementationName()
-{
- return "com.sun.star.comp.sdbc.macab.Driver";
- // this name is referenced in the configuration and in the macab.xml
- // Please be careful when changing it.
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString MacabDriver::impl_getConfigurationSettingsPath()
-{
- ::rtl::OUStringBuffer aPath;
- aPath.appendAscii( "/org.openoffice.Office.DataAccess/DriverSettings/" );
- aPath.appendAscii( "com.sun.star.comp.sdbc.macab.Driver" );
- return aPath.makeStringAndClear();
-}
-// --------------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL MacabDriver::Create( const Reference< XMultiServiceFactory >& _rxFactory ) throw( Exception )
-{
- return *(new MacabDriver(_rxFactory));
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabDriver.hxx b/connectivity/source/drivers/macab/MacabDriver.hxx
deleted file mode 100644
index c21715ec09..0000000000
--- a/connectivity/source/drivers/macab/MacabDriver.hxx
+++ /dev/null
@@ -1,199 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_DRIVER_HXX_
-#define _CONNECTIVITY_MACAB_DRIVER_HXX_
-
-/** === begin UNO includes === **/
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/frame/XTerminateListener.hpp>
-/** === end UNO includes === **/
-#include <cppuhelper/compbase3.hxx>
-#include <osl/module.h>
-
-// the address book driver's version
-#define MACAB_DRIVER_VERSION "0.1"
-#define MACAB_DRIVER_VERSION_MAJOR 0
-#define MACAB_DRIVER_VERSION_MINOR 1
-
-namespace connectivity
-{
- namespace macab
- {
- class MacabConnection;
- class MacabDriver;
-
- typedef void* (SAL_CALL * ConnectionFactoryFunction)( void* _pDriver );
-
- typedef std::vector< ::com::sun::star::uno::WeakReferenceHelper > OWeakRefArray;
-
- // ===============================================================
- // = MacabImplModule
- // ===============================================================
- class MacabImplModule
- {
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xORB;
-
- /// Did we already attempt to load the module and to retrieve the symbols?
- bool m_bAttemptedLoadModule;
- oslModule m_hConnectorModule;
- ConnectionFactoryFunction m_pConnectionFactoryFunc;
-
- public:
- MacabImplModule( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory );
-
- /** determines whether there is a mac OS present in the environment
- */
- bool isMacOSPresent();
-
- /** initializes the implementation module.
-
- @raises ::com::sun::star::uno::RuntimeException
- if the module could be loaded, but required symbols are missing
- @raises ::com::sun::star::sdbc::SQLException
- if no Mac OS was found at all
- */
- void init();
-
- /** shuts down the impl module
- */
- void shutdown();
-
- /** creates a new connection
- @precond
- <member>init</member> has been called before
- @raises ::com::sun::star::uno::RuntimeException
- if no connection object could be created (which is a severe error, normally impossible)
- */
- MacabConnection* createConnection( MacabDriver* _pDriver ) const;
-
- private:
- /** loads the implementation module and retrieves the needed symbols
-
- Save against being called multiple times.
-
- @return <TRUE/> if the module could be loaded successfully.
-
- @raises ::com::sun::star::uno::RuntimeException
- if the module could be loaded, but required symbols are missing
- */
- bool impl_loadModule();
-
- /** unloads the implementation module, and resets all function pointers to <NULL/>
- @precond m_hConnectorModule is not <NULL/>
- */
- void impl_unloadModule();
-
- /** throws an SQLException saying than no Mac OS installation was found
- */
- void impl_throwNoMacOSException();
-
- /** throws a generic SQL exception with SQLState S1000 and error code 0
- */
- void impl_throwGenericSQLException( const ::rtl::OUString& _rMessage );
-
- };
-
- // ===============================================================
- // = MacabDriver
- // ===============================================================
- typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbc::XDriver,
- ::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::frame::XTerminateListener > MacabDriver_BASE;
- class MacabDriver : public MacabDriver_BASE
- {
- protected:
- ::osl::Mutex m_aMutex; // mutex is need to control member access
- OWeakRefArray m_xConnections; // vector containing a list of all the
- // MacabConnection objects for this Driver
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xMSFactory; // the multi-service factory
- MacabImplModule m_aImplModule;
-
- public:
- static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
-
- // XServiceInfo - static versions
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
- getMSFactory() const { return m_xMSFactory; }
-
- /** returns the driver's implementation name (being pure ASCII) for reference in various places
- */
- static const sal_Char* impl_getAsciiImplementationName();
-
- /** returns the path of our configuration settings
- */
- static ::rtl::OUString impl_getConfigurationSettingsPath();
-
- protected:
- MacabDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMajorVersion() throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMinorVersion() throw(::com::sun::star::uno::RuntimeException);
-
- // XTerminateListener
- virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
-
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
-
- private:
- /** shuts down the library which contains the real implementations
-
- This method is safe against being called multiple times
-
- @precond our mutex is locked
- */
- void impl_shutdownImplementationModule();
- };
- }
-
-}
-
-#endif // _CONNECTIVITY_MACAB_DRIVER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabGroup.cxx b/connectivity/source/drivers/macab/MacabGroup.cxx
deleted file mode 100644
index 6f0dabf45b..0000000000
--- a/connectivity/source/drivers/macab/MacabGroup.cxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabGroup.hxx"
-#include "MacabRecords.hxx"
-#include "macabutilities.hxx"
-
-using namespace connectivity::macab;
-
-// -------------------------------------------------------------------------
-/* A MacabGroup is basically a MacabRecords with a different constructor.
- * It only exists as a different entity for clarification purposes (a group
- * is its own entity in the Mac OS X Address Book) and because its
- * construction is so unique (it is based on an already existent
- * MacabRecords of the entire address book).
- */
-MacabGroup::MacabGroup(const ABAddressBookRef _addressBook, const MacabRecords *_allRecords, const ABGroupRef _xGroup)
- : MacabRecords(_addressBook)
-{
- sal_Int32 i, j, nAllRecordsSize;
- CFArrayRef xGroupMembers = ABGroupCopyArrayOfAllMembers(_xGroup);
- ABPersonRef xPerson;
- CFStringRef sGroupMemberUID;
- sal_Bool bFound;
- macabfield *xRecordField;
-
- // Set the group's name (stored in MacabRecords as m_sName)
- CFStringRef sGroupName;
- sGroupName = (CFStringRef) ABRecordCopyValue(_xGroup, kABGroupNameProperty);
- m_sName = CFStringToOUString(sGroupName);
- CFRelease(sGroupName);
-
- // The _group's_ records (remember MacabGroup inherits from MacabRecords)
- recordsSize = (sal_Int32) CFArrayGetCount(xGroupMembers);
- records = new MacabRecord *[recordsSize];
- setHeader(_allRecords->getHeader());
-
- /* Go through each record in the group and try to find that record's UID
- * in the MacabRecords that was passed in. If it is found, add that
- * record to the group. Otherwise, report an error. (All records should
- * exist in the MacabRecords that was passed in.)
- */
- nAllRecordsSize = _allRecords->size();
- for(i = 0; i < recordsSize; i++)
- {
- xPerson = (ABPersonRef) CFArrayGetValueAtIndex(xGroupMembers,i);
- if(xPerson != NULL)
- {
- sGroupMemberUID = (CFStringRef) ABRecordCopyValue(xPerson, kABUIDProperty);
- if(sGroupMemberUID != NULL)
- {
- bFound = sal_False;
- for(j = 0; j < nAllRecordsSize; j++)
- {
- xRecordField = _allRecords->getField(j,CFStringToOUString(kABUIDProperty));
- if(xRecordField != NULL && xRecordField->value != NULL)
- {
- if(CFEqual(xRecordField->value, sGroupMemberUID))
- {
- /* Found the matching UID! Insert into the group... */
- insertRecord(_allRecords->getRecord(j));
- bFound = sal_True;
- break;
- }
- }
- }
- OSL_ENSURE(bFound, "MacabGroup::MacabGroup : Could not find group member based on UID!\n");
- CFRelease(sGroupMemberUID);
- }
- }
- }
-
- CFRelease(xGroupMembers);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabGroup.hxx b/connectivity/source/drivers/macab/MacabGroup.hxx
deleted file mode 100644
index 1f09ac0d09..0000000000
--- a/connectivity/source/drivers/macab/MacabGroup.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_GROUP_HXX_
-#define _CONNECTIVITY_MACAB_GROUP_HXX_
-
-#include "MacabRecords.hxx"
-
-#include <premac.h>
-#include <Carbon/Carbon.h>
-#include <AddressBook/ABAddressBookC.h>
-#include <postmac.h>
-
-
-namespace connectivity
-{
- namespace macab
- {
- class MacabGroup: public MacabRecords {
- public:
- MacabGroup(const ABAddressBookRef _addressBook, const MacabRecords *_allRecords, const ABGroupRef _xGroup);
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_GROUP_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabHeader.cxx b/connectivity/source/drivers/macab/MacabHeader.cxx
deleted file mode 100644
index 39fb28c62c..0000000000
--- a/connectivity/source/drivers/macab/MacabHeader.cxx
+++ /dev/null
@@ -1,346 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabHeader.hxx"
-#include "MacabRecord.hxx"
-#include "macabutilities.hxx"
-
-#include <math.h>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <connectivity/dbconversion.hxx>
-
-using namespace connectivity::macab;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::util;
-using namespace ::dbtools;
-
-// -------------------------------------------------------------------------
-MacabHeader::MacabHeader(const sal_Int32 _size, macabfield **_fields)
-{
- sal_Int32 i;
- size = _size;
- fields = new macabfield *[size];
- for(i = 0; i < size; i++)
- {
- if(_fields[i] == NULL)
- {
- fields[i] = NULL;
- }
- else
- {
- /* The constructor duplicates the macabfields it gets because they
- * are either deleted later or used for other purposes.
- */
- fields[i] = new macabfield;
- fields[i]->type = _fields[i]->type;
- fields[i]->value = _fields[i]->value;
- if (fields[i]->value)
- CFRetain(fields[i]->value);
- }
- }
-
-}
-
-// -------------------------------------------------------------------------
-MacabHeader::MacabHeader()
-{
- size = 0;
- fields = NULL;
-}
-
-// -------------------------------------------------------------------------
-MacabHeader::~MacabHeader()
-{
-}
-
-// -------------------------------------------------------------------------
-void MacabHeader::operator+= (const MacabHeader *r)
-{
- /* Add one MacabHeader to another. Anything not already in the header is
- * added to the end of it.
- */
- sal_Int32 rSize = r->getSize();
- if(rSize != 0) // If the new header does actually have fields
- {
- /* If our header is currently empty, just copy all of the fields from
- * the new header to this one.
- */
- if(size == 0)
- {
- sal_Int32 i;
- size = rSize;
- fields = new macabfield *[size];
- for(i = 0; i < size; i++)
- {
- fields[i] = r->copy(i);
- }
- }
-
- /* Otherwise, only add the duplicates. We do this with a two-pass
- * approach. First, find out how many fields to add, then reallocate
- * the size of the fields array and add the old ones at the end.
- * (More precisely, we create a _new_ fields array with the new length
- * allocated to it, then get all of the fields from the current
- * fields array to it, then copy the non-duplicates from the new
- * header to the end.)
- */
- else
- {
- sal_Int32 i;
- sal_Int32 numToAdd = 0, numAdded = 0;
- macabfield **newFields;
- for( i = 0; i < rSize; i++)
- {
- if(!contains(r->get(i)))
- {
- numToAdd++;
- }
- }
-
- newFields = new macabfield *[size+numToAdd];
- for(i = 0; i < size; i++)
- {
- newFields[i] = copy(i);
- }
-
- for( i = 0; i < rSize; i++)
- {
- if(!contains(r->get(i)))
- {
- newFields[size+numAdded] = r->copy(i);
- numAdded++;
- if(numAdded == numToAdd)
- break;
- }
- }
-
- releaseFields();
- delete [] fields;
- size += numAdded;
- fields = newFields;
- }
- }
-}
-
-// -------------------------------------------------------------------------
-::rtl::OUString MacabHeader::getString(const sal_Int32 i) const
-{
- ::rtl::OUString nRet;
-
- if(i < size)
- {
- if(fields[i] == NULL || fields[i]->value == NULL || CFGetTypeID(fields[i]->value) != CFStringGetTypeID())
- return ::rtl::OUString();
- try
- {
- nRet = CFStringToOUString( (CFStringRef) fields[i]->value);
- }
- catch(...){ }
- }
-
- return nRet;
-}
-
-// -------------------------------------------------------------------------
-void MacabHeader::sortRecord()
-{
- sortRecord(0,size);
-}
-
-// -------------------------------------------------------------------------
-macabfield **MacabHeader::sortRecord(const sal_Int32 _start, const sal_Int32 _length)
-{
- /* Sort using mergesort. Because it uses mergesort, it is recursive and
- * not in place (so it creates a new array at every step of the
- * recursion), so if you prefer to use a different sort, please feel
- * free to implement it.
- */
- macabfield** sorted = new macabfield *[_length];
- if(_length <= 2)
- {
- if(_length == 2)
- {
- if(compareFields(fields[_start], fields[_start+1]) > 0)
- {
- sorted[0] = get(_start+1);
- sorted[1] = get(_start);
- }
- else
- {
- sorted[0] = get(_start);
- sorted[1] = get(_start+1);
- }
- }
- else if(_length == 1)
- {
- sorted[0] = get(_start);
- }
- }
- else
- {
- sal_Int32 halfLength = floor(_length/2);
- sal_Int32 fp = 0, lp = 0;
- sal_Int32 i;
- macabfield **firstHalf = new macabfield *[halfLength];
- macabfield **lastHalf = new macabfield *[_length - halfLength];
-
- firstHalf = sortRecord(_start, halfLength);
- lastHalf = sortRecord(_start+halfLength, _length-halfLength);
- for(i = 0; i < _length; i++)
- {
- if(compareFields(firstHalf[fp],lastHalf[lp]) < 0)
- {
- sorted[i] = firstHalf[fp++];
- if(fp == halfLength)
- {
- for( i++; i < _length; i++)
- {
- sorted[i] = lastHalf[lp++];
- }
- break;
- }
- }
- else
- {
- sorted[i] = lastHalf[lp++];
- if(lp == _length - halfLength)
- {
- for( i++; i < _length; i++)
- {
- sorted[i] = firstHalf[fp++];
- }
- break;
- }
- }
- }
- if(_length == size)
- {
- fields = sorted;
- }
- }
- return sorted;
-}
-
-sal_Int32 MacabHeader::compareFields(const macabfield *_field1, const macabfield *_field2)
-{
- /* Comparing two fields in a MacabHeader is different than comparing two
- * fields in a MacabRecord. It starts in the same way (if one of the two
- * fields is NULL, it belongs after the other, so it is considered
- * "greater"). But, then, all headers are CFStrings, no matter what
- * type they claim to be (since they actually hold the expected type for
- * the records with that header). That being said, all we have to do is
- * the built-in CFStringCompare.
- */
- if(_field1 == _field2)
- return 0;
- if(_field1 == NULL)
- return 1;
- if(_field2 == NULL)
- return -1;
-
- CFComparisonResult result = CFStringCompare(
- (CFStringRef) _field1->value,
- (CFStringRef) _field2->value,
- 0); // 0 = no options (like ignore case)
-
- return (sal_Int32) result;
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 MacabHeader::getColumnNumber(const ::rtl::OUString s) const
-{
- sal_Int32 i;
- for(i = 0; i < size; i++)
- {
- if(getString(i) == s)
- break;
- }
-
- if(i == size)
- i = -1;
-
- return i;
-}
-
-// -------------------------------------------------------------------------
-MacabHeader *MacabHeader::begin()
-{
- return this;
-}
-
-// -------------------------------------------------------------------------
-MacabHeader::iterator::iterator ()
-{
-}
-
-// -------------------------------------------------------------------------
-MacabHeader::iterator::~iterator ()
-{
-}
-
-MacabHeader::iterator& MacabHeader::iterator::operator= (MacabHeader *_record)
-{
- id = 0;
- record = _record;
- return *this;
-}
-
-// -------------------------------------------------------------------------
-void MacabHeader::iterator::operator++ ()
-{
- id++;
-}
-
-// -------------------------------------------------------------------------
-sal_Bool MacabHeader::iterator::operator!= (const sal_Int32 i) const
-{
- return(id != i);
-}
-
-// -------------------------------------------------------------------------
-sal_Bool MacabHeader::iterator::operator== (const sal_Int32 i) const
-{
- return(id == i);
-}
-
-// -------------------------------------------------------------------------
-macabfield *MacabHeader::iterator::operator* () const
-{
- return record->get(id);
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 MacabHeader::end() const
-{
- return size;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabHeader.hxx b/connectivity/source/drivers/macab/MacabHeader.hxx
deleted file mode 100644
index f24b593a9b..0000000000
--- a/connectivity/source/drivers/macab/MacabHeader.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_HEADER_HXX_
-#define _CONNECTIVITY_MACAB_HEADER_HXX_
-
-#include "MacabRecord.hxx"
-#include <cppuhelper/compbase3.hxx>
-
-namespace connectivity
-{
- namespace macab
- {
- class MacabHeader: public MacabRecord{
- protected:
- macabfield **sortRecord(sal_Int32 _start, sal_Int32 _length);
- public:
- MacabHeader();
- MacabHeader(const sal_Int32 _size, macabfield **_fields);
- virtual ~MacabHeader();
- void operator+= (const MacabHeader *r);
- ::rtl::OUString getString(const sal_Int32 i) const;
- void sortRecord();
- sal_Int32 getColumnNumber(const ::rtl::OUString s) const;
-
- static sal_Int32 compareFields(const macabfield *_field1, const macabfield *_field2);
-
- MacabHeader *begin();
- sal_Int32 end() const;
- class iterator{
- protected:
- sal_Int32 id;
- MacabHeader *record;
- public:
- iterator& operator= (MacabHeader *_record);
- iterator();
- ~iterator();
- void operator++ ();
- sal_Bool operator!= (const sal_Int32 i) const;
- sal_Bool operator== (const sal_Int32 i) const;
- macabfield *operator* () const;
- };
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_HEADER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabPreparedStatement.cxx b/connectivity/source/drivers/macab/MacabPreparedStatement.cxx
deleted file mode 100644
index 19d9c5f9de..0000000000
--- a/connectivity/source/drivers/macab/MacabPreparedStatement.cxx
+++ /dev/null
@@ -1,410 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabPreparedStatement.hxx"
-#include "MacabAddressBook.hxx"
-#include "propertyids.hxx"
-#include <connectivity/dbexception.hxx>
-#include "connectivity/dbtools.hxx"
-#include "resource/macab_res.hrc"
-#include "resource/sharedresources.hxx"
-
-using namespace connectivity::macab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::util;
-
-IMPLEMENT_SERVICE_INFO(MacabPreparedStatement, "com.sun.star.sdbc.drivers.MacabPreparedStatement", "com.sun.star.sdbc.PreparedStatement");
-// -------------------------------------------------------------------------
-void MacabPreparedStatement::checkAndResizeParameters(sal_Int32 nParams) throw(SQLException)
-{
- if ( !m_aParameterRow.is() )
- m_aParameterRow = new OValueVector();
-
- if (nParams < 1)
- ::dbtools::throwInvalidIndexException(*(MacabPreparedStatement *) this,Any());
-
- if (nParams >= (sal_Int32) (m_aParameterRow->get()).size())
- (m_aParameterRow->get()).resize(nParams);
-}
-// -------------------------------------------------------------------------
-void MacabPreparedStatement::setMacabFields() const throw(SQLException)
-{
- ::rtl::Reference<connectivity::OSQLColumns> xColumns; // selected columns
-
- xColumns = m_aSQLIterator.getSelectColumns();
- if (!xColumns.is())
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(
- STR_INVALID_COLUMN_SELECTION
- ) );
- ::dbtools::throwGenericSQLException(sError,NULL);
- }
- m_xMetaData->setMacabFields(xColumns);
-}
-// -------------------------------------------------------------------------
-void MacabPreparedStatement::resetParameters() const throw(SQLException)
-{
- m_nParameterIndex = 0;
-}
-// -------------------------------------------------------------------------
-void MacabPreparedStatement::getNextParameter(::rtl::OUString &rParameter) const throw(SQLException)
-{
- if (m_nParameterIndex >= (sal_Int32) (m_aParameterRow->get()).size())
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(
- STR_INVALID_PARA_COUNT
- ) );
- ::dbtools::throwGenericSQLException(sError,*(MacabPreparedStatement *) this);
- }
-
- rParameter = (m_aParameterRow->get())[m_nParameterIndex];
-
- m_nParameterIndex++;
-}
-// -------------------------------------------------------------------------
-MacabPreparedStatement::MacabPreparedStatement(
- MacabConnection* _pConnection,
- const ::rtl::OUString& sql)
- : MacabPreparedStatement_BASE(_pConnection),
- m_sSqlStatement(sql),
- m_bPrepared(sal_False),
- m_nParameterIndex(0),
- m_aParameterRow()
-{
-
-}
-// -------------------------------------------------------------------------
-MacabPreparedStatement::~MacabPreparedStatement()
-{
-}
-// -------------------------------------------------------------------------
-void MacabPreparedStatement::disposing()
-{
- MacabPreparedStatement_BASE::disposing();
-
- if (m_aParameterRow.is())
- {
- m_aParameterRow->get().clear();
- m_aParameterRow = NULL;
- }
-}
-// -------------------------------------------------------------------------
-Reference< XResultSetMetaData > SAL_CALL MacabPreparedStatement::getMetaData() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- if (!m_xMetaData.is())
- {
- const OSQLTables& xTabs = m_aSQLIterator.getTables();
- ::rtl::OUString sTableName = MacabAddressBook::getDefaultTableName();
-
- if(! xTabs.empty() )
- {
-
- // can only deal with one table at a time
- if(xTabs.size() == 1 && !m_aSQLIterator.hasErrors() )
- sTableName = xTabs.begin()->first;
-
- }
- m_xMetaData = new MacabResultSetMetaData(getOwnConnection(),sTableName);
- setMacabFields();
- }
- Reference< XResultSetMetaData > xMetaData = m_xMetaData.get();
- return xMetaData;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::close() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- // Reset last warning message
- try {
- clearWarnings ();
- MacabCommonStatement::close();
- }
- catch (SQLException &) {
- // If we get an error, ignore
- }
-
- // Remove this Statement object from the Connection object's
- // list
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabPreparedStatement::execute() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- Reference< XResultSet> xRS = MacabCommonStatement::executeQuery(m_sSqlStatement);
-
- return xRS.is();
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabPreparedStatement::executeUpdate() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- // same as in statement with the difference that this statement also can contain parameter
- return 0;
-}
-// -------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL MacabPreparedStatement::getConnection() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- return (Reference< XConnection >) m_pConnection;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabPreparedStatement::executeQuery() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- Reference< XResultSet > rs = MacabCommonStatement::executeQuery(m_sSqlStatement);
-
- return rs;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setNull(sal_Int32 parameterIndex, sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- checkAndResizeParameters(parameterIndex);
-
- (m_aParameterRow->get())[parameterIndex - 1].setNull();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setObjectNull(sal_Int32, sal_Int32, const ::rtl::OUString&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setObjectNull", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setBoolean(sal_Int32, sal_Bool) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setBoolean", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setByte(sal_Int32, sal_Int8) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setByte", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setShort(sal_Int32, sal_Int16) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setShort", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setInt(sal_Int32, sal_Int32) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setInt", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setLong(sal_Int32, sal_Int64) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setLong", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setFloat(sal_Int32, float) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setFloat", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setDouble(sal_Int32, double) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setDouble", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setString(sal_Int32 parameterIndex, const ::rtl::OUString &x) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- checkAndResizeParameters(parameterIndex);
-
- (m_aParameterRow->get())[parameterIndex - 1] = x;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setBytes(sal_Int32, const Sequence< sal_Int8 >&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setBytes", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setDate(sal_Int32, const Date&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setDate", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setTime(sal_Int32, const Time&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setTime", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setTimestamp(sal_Int32, const DateTime&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setTimestamp", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setBinaryStream(sal_Int32, const Reference< ::com::sun::star::io::XInputStream >&, sal_Int32) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setBinaryStream", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setCharacterStream(sal_Int32, const Reference< ::com::sun::star::io::XInputStream >&, sal_Int32) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setCharacterStream", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setObject(sal_Int32 parameterIndex, const Any& x) throw(SQLException, RuntimeException)
-{
- if(!::dbtools::implSetObject(this,parameterIndex,x))
- {
- const ::rtl::OUString sError( m_pConnection->getResources().getResourceStringWithSubstitution(
- STR_UNKNOWN_PARA_TYPE,
- "$position$", ::rtl::OUString::valueOf(parameterIndex)
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setObjectWithInfo(sal_Int32, const Any&, sal_Int32, sal_Int32) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setObjectWithInfo", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setRef(sal_Int32, const Reference< XRef >&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setRef", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setBlob(sal_Int32, const Reference< XBlob >&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setBlob", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setClob(sal_Int32, const Reference< XClob >&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setClob", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::setArray(sal_Int32, const Reference< XArray >&) throw(SQLException, RuntimeException)
-{
-
-
-
-::dbtools::throwFunctionNotSupportedException("setArray", NULL);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabPreparedStatement::clearParameters() throw(SQLException, RuntimeException)
-{
-::dbtools::throwFunctionNotSupportedException("clearParameters", NULL);
-}
-// -------------------------------------------------------------------------
-void MacabPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception)
-{
- switch (nHandle)
- {
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- break;
- case PROPERTY_ID_USEBOOKMARKS:
- break;
- default:
- MacabCommonStatement::setFastPropertyValue_NoBroadcast(nHandle,rValue);
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabPreparedStatement.hxx b/connectivity/source/drivers/macab/MacabPreparedStatement.hxx
deleted file mode 100644
index 0fb1b6e92d..0000000000
--- a/connectivity/source/drivers/macab/MacabPreparedStatement.hxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_PREPAREDSTATEMENT_HXX_
-#define _CONNECTIVITY_MACAB_PREPAREDSTATEMENT_HXX_
-
-#include "MacabStatement.hxx"
-#include "MacabResultSetMetaData.hxx"
-#include <connectivity/FValue.hxx>
-#include <com/sun/star/sdbc/XParameters.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <cppuhelper/implbase4.hxx>
-
-namespace connectivity
-{
- namespace macab
- {
-
- class OBoundParam;
- typedef ::cppu::ImplInheritanceHelper4< MacabCommonStatement,
- ::com::sun::star::sdbc::XPreparedStatement,
- ::com::sun::star::sdbc::XParameters,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::lang::XServiceInfo> MacabPreparedStatement_BASE;
-
- class MacabPreparedStatement : public MacabPreparedStatement_BASE
- {
- protected:
- ::rtl::OUString m_sSqlStatement;
- ::rtl::Reference< MacabResultSetMetaData >
- m_xMetaData;
- sal_Bool m_bPrepared;
- mutable sal_Int32 m_nParameterIndex;
- OValueRow m_aParameterRow;
-
- void checkAndResizeParameters(sal_Int32 nParams) throw(::com::sun::star::sdbc::SQLException);
- void setMacabFields() const throw(::com::sun::star::sdbc::SQLException);
-
- protected:
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception);
-
- virtual void resetParameters() const throw(::com::sun::star::sdbc::SQLException);
- virtual void getNextParameter(::rtl::OUString &rParameter) const throw(::com::sun::star::sdbc::SQLException);
- virtual ~MacabPreparedStatement();
-
- public:
- DECLARE_SERVICE_INFO();
- MacabPreparedStatement(MacabConnection* _pConnection, const ::rtl::OUString& sql);
-
- // OComponentHelper
- virtual void SAL_CALL disposing();
-
- // XPreparedStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL executeUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XParameters
- virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearParameters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_PREPAREDSTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabRecord.cxx b/connectivity/source/drivers/macab/MacabRecord.cxx
deleted file mode 100644
index 3bf9cac179..0000000000
--- a/connectivity/source/drivers/macab/MacabRecord.cxx
+++ /dev/null
@@ -1,350 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabRecord.hxx"
-#include "macabutilities.hxx"
-#include <com/sun/star/util/DateTime.hpp>
-
-#include <premac.h>
-#include <Carbon/Carbon.h>
-#include <AddressBook/ABAddressBookC.h>
-#include <postmac.h>
-#include <connectivity/dbconversion.hxx>
-
-using namespace connectivity::macab;
-using namespace com::sun::star::util;
-using namespace ::dbtools;
-
-// -------------------------------------------------------------------------
-MacabRecord::MacabRecord()
-{
- size = 0;
- fields = NULL;
-}
-
-// -------------------------------------------------------------------------
-MacabRecord::MacabRecord(const sal_Int32 _size)
-{
- size = _size;
- fields = new macabfield *[size];
- sal_Int32 i;
- for(i = 0; i < size; i++)
- fields[i] = NULL;
-}
-
-// -------------------------------------------------------------------------
-MacabRecord::~MacabRecord()
-{
- if(size > 0)
- {
- int i;
- for(i = 0; i < size; i++)
- {
- delete fields[i];
- fields[i] = NULL;
- }
- }
- delete [] fields;
- fields = NULL;
-}
-
-// -------------------------------------------------------------------------
-void MacabRecord::insertAtColumn (CFTypeRef _value, ABPropertyType _type, const sal_Int32 _column)
-{
- if(_column < size)
- {
- if(fields[_column] == NULL)
- fields[_column] = new macabfield;
-
- fields[_column]->value = _value;
- if (fields[_column]->value)
- CFRetain(fields[_column]->value);
- fields[_column]->type = _type;
- }
-}
-
-// -------------------------------------------------------------------------
-sal_Bool MacabRecord::contains (const macabfield *_field) const
-{
- if(_field == NULL)
- return sal_False;
- else
- return contains(_field->value);
-}
-
-// -------------------------------------------------------------------------
-sal_Bool MacabRecord::contains (const CFTypeRef _value) const
-{
- sal_Int32 i;
- for(i = 0; i < size; i++)
- {
- if(fields[i] != NULL)
- {
- if(CFEqual(fields[i]->value, _value))
- {
- return sal_True;
- }
- }
- }
-
- return sal_False;
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 MacabRecord::getSize() const
-{
- return size;
-}
-
-// -------------------------------------------------------------------------
-macabfield *MacabRecord::copy(const sal_Int32 i) const
-{
- /* Note: copy(i) creates a new macabfield identical to that at
- * location i, whereas get(i) returns a pointer to the macabfield
- * at location i.
- */
- if(i < size)
- {
- macabfield *_copy = new macabfield;
- _copy->type = fields[i]->type;
- _copy->value = fields[i]->value;
- if (_copy->value)
- CFRetain(_copy->value);
- return _copy;
- }
-
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-macabfield *MacabRecord::get(const sal_Int32 i) const
-{
- /* Note: copy(i) creates a new macabfield identical to that at
- * location i, whereas get(i) returns a pointer to the macabfield
- * at location i.
- */
- if(i < size)
- {
- return fields[i];
- }
-
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-void MacabRecord::releaseFields()
-{
- /* This method is, at the moment, only used in MacabHeader.cxx, but
- * the idea is simple: if you are not destroying this object but want
- * to clear it of its macabfields, you should release each field's
- * value.
- */
- sal_Int32 i;
- for(i = 0; i < size; i++)
- CFRelease(fields[i]->value);
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 MacabRecord::compareFields(const macabfield *_field1, const macabfield *_field2)
-{
-
- /* When comparing records, if either field is NULL (and the other is
- * not), that field is considered "greater than" the other, so that it
- * shows up later in the list when fields are ordered.
- */
- if(_field1 == _field2)
- return 0;
- if(_field1 == NULL)
- return 1;
- if(_field2 == NULL)
- return -1;
-
- /* If they aren't the same type, for now, return the one with
- * the smaller type ID... I don't know of a better way to compare
- * two different data types.
- */
- if(_field1->type != _field2->type)
- return(_field1->type - _field2->type);
-
- CFComparisonResult result;
-
- /* Carbon has a unique compare function for each data type: */
- switch(_field1->type)
- {
- case kABStringProperty:
- result = CFStringCompare(
- (CFStringRef) _field1->value,
- (CFStringRef) _field2->value,
- kCFCompareLocalized); // Specifies that the comparison should take into account differences related to locale, such as the thousands separator character.
- break;
-
- case kABDateProperty:
- result = CFDateCompare(
- (CFDateRef) _field1->value,
- (CFDateRef) _field2->value,
- NULL); // NULL = unused variable
- break;
-
- case kABIntegerProperty:
- case kABRealProperty:
- result = CFNumberCompare(
- (CFNumberRef) _field1->value,
- (CFNumberRef) _field2->value,
- NULL); // NULL = unused variable
- break;
-
- default:
- result = kCFCompareEqualTo; // can't compare
- }
-
- return (sal_Int32) result;
-}
-
-// -------------------------------------------------------------------------
-/* Create a macabfield out of an OUString and type. Together with the
- * method fieldToString() (below), it is possible to switch conveniently
- * between an OUString and a macabfield (for use when creating and handling
- * SQL statement).
- */
-macabfield *MacabRecord::createMacabField(const ::rtl::OUString _newFieldString, const ABPropertyType _abType)
-{
- macabfield *newField = NULL;
- switch(_abType)
- {
- case kABStringProperty:
- newField = new macabfield;
- newField->value = OUStringToCFString(_newFieldString);
- newField->type = _abType;
- break;
- case kABDateProperty:
- {
- DateTime aDateTime = DBTypeConversion::toDateTime(_newFieldString);
-
- // bad format...
- if(aDateTime.Year == 0 && aDateTime.Month == 0 && aDateTime.Day == 0)
- {
- }
- else
- {
- double nTime = DBTypeConversion::toDouble(aDateTime, DBTypeConversion::getStandardDate());
- nTime -= kCFAbsoluteTimeIntervalSince1970;
- newField = new macabfield;
- newField->value = CFDateCreate(NULL, (CFAbsoluteTime) nTime);
- newField->type = _abType;
- }
- }
- break;
- case kABIntegerProperty:
- try
- {
- sal_Int64 nVal = _newFieldString.toInt64();
-
- newField = new macabfield;
- newField->value = CFNumberCreate(NULL,kCFNumberLongType, &nVal);
- newField->type = _abType;
- }
- // bad format...
- catch(...)
- {
- }
- break;
- case kABRealProperty:
- try
- {
- double nVal = _newFieldString.toDouble();
-
- newField = new macabfield;
- newField->value = CFNumberCreate(NULL,kCFNumberDoubleType, &nVal);
- newField->type = _abType;
- }
- // bad format...
- catch(...)
- {
- }
- break;
- default:
- ;
- }
- return newField;
-}
-
-// -------------------------------------------------------------------------
-/* Create an OUString out of a macabfield. Together with the method
- * createMacabField() (above), it is possible to switch conveniently
- * between an OUString and a macabfield (for use when creating and handling
- * SQL statement).
- */
-::rtl::OUString MacabRecord::fieldToString(const macabfield *_aField)
-{
- if(_aField == NULL)
- return ::rtl::OUString();
-
- ::rtl::OUString fieldString;
-
- switch(_aField->type)
- {
- case kABStringProperty:
- fieldString = CFStringToOUString((CFStringRef) _aField->value);
- break;
- case kABDateProperty:
- {
- DateTime aTime = CFDateToDateTime((CFDateRef) _aField->value);
- fieldString = DBTypeConversion::toDateTimeString(aTime);
- }
- break;
- case kABIntegerProperty:
- {
- CFNumberType numberType = CFNumberGetType( (CFNumberRef) _aField->value );
- sal_Int64 nVal;
- // Should we check for the wrong type here, e.g., a float?
- sal_Bool m_bSuccess = !CFNumberGetValue((CFNumberRef) _aField->value, numberType, &nVal);
- if(m_bSuccess != sal_False)
- fieldString = ::rtl::OUString::valueOf(nVal);
- }
- break;
- case kABRealProperty:
- {
- CFNumberType numberType = CFNumberGetType( (CFNumberRef) _aField->value );
- double nVal;
- // Should we check for the wrong type here, e.g., an int?
- sal_Bool m_bSuccess = !CFNumberGetValue((CFNumberRef) _aField->value, numberType, &nVal);
- if(m_bSuccess != sal_False)
- fieldString = ::rtl::OUString::valueOf(nVal);
- }
- break;
- default:
- ;
- }
- return fieldString;
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabRecord.hxx b/connectivity/source/drivers/macab/MacabRecord.hxx
deleted file mode 100644
index aa47f8377b..0000000000
--- a/connectivity/source/drivers/macab/MacabRecord.hxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_RECORD_HXX_
-#define _CONNECTIVITY_MACAB_RECORD_HXX_
-
-#include <cppuhelper/compbase3.hxx>
-
-#include <premac.h>
-#include <Carbon/Carbon.h>
-#include <AddressBook/ABAddressBookC.h>
-#include <postmac.h>
-
-namespace connectivity
-{
- namespace macab
- {
- /* a MacabRecord is at root a list of macabfields (which is just
- * something to hold both a CFTypeRef (a CoreFoundation object) and
- * its Address Book type.
- */
- struct macabfield
- {
- CFTypeRef value;
- ABPropertyType type;
- };
-
- class MacabRecord{
- protected:
- sal_Int32 size;
- macabfield **fields;
- protected:
- void releaseFields();
- public:
- MacabRecord();
- MacabRecord(const sal_Int32 _size);
- virtual ~MacabRecord();
- void insertAtColumn (CFTypeRef _value, ABPropertyType _type, const sal_Int32 _column);
- sal_Bool contains(const macabfield *_field) const;
- sal_Bool contains(const CFTypeRef _value) const;
- sal_Int32 getSize() const;
- macabfield *copy(const sal_Int32 i) const;
- macabfield *get(const sal_Int32 i) const;
-
- static sal_Int32 compareFields(const macabfield *_field1, const macabfield *_field2);
- static macabfield *createMacabField(const ::rtl::OUString _newFieldString, const ABPropertyType _abtype);
- static ::rtl::OUString fieldToString(const macabfield *_aField);
-
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_RECORD_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabRecords.cxx b/connectivity/source/drivers/macab/MacabRecords.cxx
deleted file mode 100644
index a92e2313e9..0000000000
--- a/connectivity/source/drivers/macab/MacabRecords.cxx
+++ /dev/null
@@ -1,1215 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabRecords.hxx"
-#include "MacabRecord.hxx"
-#include "MacabHeader.hxx"
-#include "macabutilities.hxx"
-
-#include <premac.h>
-#include <Carbon/Carbon.h>
-#include <AddressBook/ABAddressBookC.h>
-#include <postmac.h>
-#include <com/sun/star/util/DateTime.hpp>
-
-using namespace connectivity::macab;
-using namespace com::sun::star::util;
-
-// -------------------------------------------------------------------------
-MacabRecords::MacabRecords(const ABAddressBookRef _addressBook, MacabHeader *_header, MacabRecord **_records, sal_Int32 _numRecords)
-{
- /* Variables passed in... */
- header = _header;
- recordsSize = _numRecords;
- currentRecord = _numRecords;
- records = _records;
- addressBook = _addressBook;
-
- /* Default variables... */
- recordType = kABPersonRecordType;
-
- /* Variables constructed... */
- bootstrap_CF_types();
- bootstrap_requiredProperties();
-}
-
-// -------------------------------------------------------------------------
-/* Creates a MacabRecords from another: copies the length, name, and
- * address book of the original, but the header or the records themselves.
- * The idea is that the only reason to copy a MacabRecords is to create
- * a filtered version of it, which can have the same length (to avoid
- * resizing) and will work from the same base addressbook, but might have
- * entirey different values and even (possibly in the future) a different
- * header.
- */
-MacabRecords::MacabRecords(const MacabRecords *_copy)
-{
- /* Variables passed in... */
- recordsSize = _copy->recordsSize;
- addressBook = _copy->addressBook;
- m_sName = _copy->m_sName;
-
- /* Default variables... */
- currentRecord = 0;
- header = NULL;
- records = new MacabRecord *[recordsSize];
- recordType = kABPersonRecordType;
-
- /* Variables constructed... */
- bootstrap_CF_types();
- bootstrap_requiredProperties();
-}
-
-// -------------------------------------------------------------------------
-MacabRecords::MacabRecords(const ABAddressBookRef _addressBook)
-{
- /* Variables passed in... */
- addressBook = _addressBook;
-
- /* Default variables... */
- recordsSize = 0;
- currentRecord = 0;
- records = NULL;
- header = NULL;
- recordType = kABPersonRecordType;
-
- /* Variables constructed... */
- bootstrap_CF_types();
- bootstrap_requiredProperties();
-}
-
-// -------------------------------------------------------------------------
-void MacabRecords::initialize()
-{
-
- /* Make sure everything is NULL before initializing. (We usually just
- * initialize after we use the constructor that takes only a
- * MacabAddressBook, so these variables will most likely already be
- * NULL.
- */
- if(records != NULL)
- {
- sal_Int32 i;
-
- for(i = 0; i < recordsSize; i++)
- delete records[i];
-
- delete [] records;
- }
-
- if(header != NULL)
- delete header;
-
- /* We can handle both default record Address Book record types in
- * this method, though only kABPersonRecordType is ever used.
- */
- CFArrayRef allRecords;
- if(CFStringCompare(recordType, kABPersonRecordType, 0) == kCFCompareEqualTo)
- allRecords = ABCopyArrayOfAllPeople(addressBook);
- else
- allRecords = ABCopyArrayOfAllGroups(addressBook);
-
- ABRecordRef record;
- sal_Int32 i;
- recordsSize = (sal_Int32) CFArrayGetCount(allRecords);
- records = new MacabRecord *[recordsSize];
-
- /* First, we create the header... */
- header = createHeaderForRecordType(allRecords, recordType);
-
- /* Then, we create each of the records... */
- for(i = 0; i < recordsSize; i++)
- {
- record = (ABRecordRef) CFArrayGetValueAtIndex(allRecords, i);
- records[i] = createMacabRecord(record, header, recordType);
- }
- currentRecord = recordsSize;
-
- CFRelease(allRecords);
-}
-
-// -------------------------------------------------------------------------
-MacabRecords::~MacabRecords()
-{
-}
-
-// -------------------------------------------------------------------------
-void MacabRecords::setHeader(MacabHeader *_header)
-{
- if(header != NULL)
- delete header;
- header = _header;
-}
-
-// -------------------------------------------------------------------------
-MacabHeader *MacabRecords::getHeader() const
-{
- return header;
-}
-
-// -------------------------------------------------------------------------
-/* Inserts a MacabRecord at a given location. If there is already a
- * MacabRecord at that location, return it.
- */
-MacabRecord *MacabRecords::insertRecord(MacabRecord *_newRecord, const sal_Int32 _location)
-{
- MacabRecord *oldRecord;
-
- /* If the location is greater than the current allocated size of this
- * MacabRecords, allocate more space.
- */
- if(_location >= recordsSize)
- {
- sal_Int32 i;
- MacabRecord **newRecordsArray = new MacabRecord *[_location+1];
- for(i = 0; i < recordsSize; i++)
- {
- newRecordsArray[i] = records[i];
- }
- delete [] records;
- records = newRecordsArray;
- }
-
- /* Remember: currentRecord refers to one above the highest existing
- * record (i.e., it refers to where to place the next record if a
- * location is not given).
- */
- if(_location >= currentRecord)
- currentRecord = _location+1;
-
- oldRecord = records[_location];
- records[_location] = _newRecord;
- return oldRecord;
-}
-
-// -------------------------------------------------------------------------
-/* Insert a record at the next available place. */
-void MacabRecords::insertRecord(MacabRecord *_newRecord)
-{
- insertRecord(_newRecord, currentRecord);
-}
-
-// -------------------------------------------------------------------------
-MacabRecord *MacabRecords::getRecord(const sal_Int32 _location) const
-{
- if(_location >= recordsSize)
- return NULL;
- return records[_location];
-}
-
-// -------------------------------------------------------------------------
-macabfield *MacabRecords::getField(const sal_Int32 _recordNumber, const sal_Int32 _columnNumber) const
-{
- if(_recordNumber >= recordsSize)
- return NULL;
-
- MacabRecord *record = records[_recordNumber];
-
- if(_columnNumber < 0 || _columnNumber >= record->getSize())
- return NULL;
-
- return record->get(_columnNumber);
-}
-
-// -------------------------------------------------------------------------
-macabfield *MacabRecords::getField(const sal_Int32 _recordNumber, const ::rtl::OUString _columnName) const
-{
- if(header != NULL)
- {
- sal_Int32 columnNumber = header->getColumnNumber(_columnName);
- if(columnNumber == -1)
- return NULL;
-
- return getField(_recordNumber, columnNumber);
- }
- else
- {
- // error: shouldn't access field with null header!
- return NULL;
- }
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 MacabRecords::getFieldNumber(const ::rtl::OUString _columnName) const
-{
- if(header != NULL)
- return header->getColumnNumber(_columnName);
- else
- // error: shouldn't access field with null header!
- return -1;
-}
-
-// -------------------------------------------------------------------------
-/* Create the lcl_CFTypes array -- we need this because there is no
- * way to get the ABType of an object from the object itself, and the
- * function ABTypeOfProperty can't handle multiple levels of data
- * (e.g., it can tell us that "address" is of type
- * kABDictionaryProperty, but it cannot tell us that all of the keys
- * and values in the dictionary have type kABStringProperty. On the
- * other hand, we _can_ get the CFType out of any object.
- * Unfortunately, all information about CFTypeIDs comes with the
- * warning that they change between releases, so we build them
- * ourselves here. (The one that we can't build is for multivalues,
- * e.g., kABMultiStringProperty. All of these appear to have the
- * same type: 1, but there is no function that I've found to give
- * us that dynamically in case that number ever changes.
- */
-void MacabRecords::bootstrap_CF_types()
-{
- lcl_CFTypesLength = 6;
- lcl_CFTypes = new lcl_CFType[lcl_CFTypesLength];
-
- lcl_CFTypes[0].cf = CFNumberGetTypeID();
- lcl_CFTypes[0].ab = kABIntegerProperty;
-
- lcl_CFTypes[1].cf = CFStringGetTypeID();
- lcl_CFTypes[1].ab = kABStringProperty;
-
- lcl_CFTypes[2].cf = CFDateGetTypeID();
- lcl_CFTypes[2].ab = kABDateProperty;
-
- lcl_CFTypes[3].cf = CFArrayGetTypeID();
- lcl_CFTypes[3].ab = kABArrayProperty;
-
- lcl_CFTypes[4].cf = CFDictionaryGetTypeID();
- lcl_CFTypes[4].ab = kABDictionaryProperty;
-
- lcl_CFTypes[5].cf = CFDataGetTypeID();
- lcl_CFTypes[5].ab = kABDataProperty;
-}
-
-// -------------------------------------------------------------------------
-/* This is based on the possible fields required in the mail merge template
- * in sw. If the fields possible there change, it would be optimal to
- * change these fields as well.
- */
-void MacabRecords::bootstrap_requiredProperties()
-{
- numRequiredProperties = 7;
- requiredProperties = new CFStringRef[numRequiredProperties];
- requiredProperties[0] = kABTitleProperty;
- requiredProperties[1] = kABFirstNameProperty;
- requiredProperties[2] = kABLastNameProperty;
- requiredProperties[3] = kABOrganizationProperty;
- requiredProperties[4] = kABAddressProperty;
- requiredProperties[5] = kABPhoneProperty;
- requiredProperties[6] = kABEmailProperty;
-}
-
-// -------------------------------------------------------------------------
-/* Create the header for a given record type and a given array of records.
- * Because the array of records and the record type are given, if you want
- * to, you can run this method on the members of a group, or on any other
- * filtered list of people and get a header relevant to them (e.g., if
- * they only have home addresses, the work address fields won't show up).
- */
-MacabHeader *MacabRecords::createHeaderForRecordType(const CFArrayRef _records, const CFStringRef _recordType) const
-{
- /* We have two types of properties for a given record type, nonrequired
- * and required. Required properties are ones that will show up whether
- * or not they are empty. Nonrequired properties will only show up if
- * at least one record in the set has that property filled. The reason
- * is that some properties, like the kABTitleProperty are required by
- * the mail merge wizard (in module sw) but are by default not shown in
- * the Mac OS X address book, so they would be weeded out at this stage
- * and not shown if they were not required.
- *
- * Note: with the addition of required properties, I am not sure that
- * this method still works for kABGroupRecordType (since the required
- * properites are all for kABPersonRecordType).
- *
- * Note: required properties are constructed in the method
- * bootstrap_requiredProperties() (above).
- */
- CFArrayRef allProperties = ABCopyArrayOfPropertiesForRecordType(addressBook, _recordType);
- CFStringRef *nonRequiredProperties;
- sal_Int32 numRecords = (sal_Int32) CFArrayGetCount(_records);
- sal_Int32 numProperties = (sal_Int32) CFArrayGetCount(allProperties);
- sal_Int32 numNonRequiredProperties = numProperties - numRequiredProperties;
-
- /* While searching through the properties for required properties, these
- * sal_Bools will keep track of what we have found.
- */
- sal_Bool bFoundProperty;
- sal_Bool bFoundRequiredProperties[numRequiredProperties];
-
-
- /* We have three MacabHeaders: headerDataForProperty is where we
- * store the result of createHeaderForProperty(), which return a
- * MacabHeader for a single property. lcl_header is where we store
- * the MacabHeader that we are constructing. And, nonRequiredHeader
- * is where we construct the MacabHeader for non-required properties,
- * so that we can sort them before adding them to lcl_header.
- */
- MacabHeader *headerDataForProperty;
- MacabHeader *lcl_header = new MacabHeader();
- MacabHeader *nonRequiredHeader = new MacabHeader();
-
- /* Other variables... */
- sal_Int32 i, j, k;
- ABRecordRef record;
- CFStringRef property;
-
-
- /* Allocate and initialize... */
- nonRequiredProperties = new CFStringRef[numNonRequiredProperties];
- k = 0;
- for(i = 0; i < numRequiredProperties; i++)
- bFoundRequiredProperties[i] = sal_False;
-
- /* Determine the non-required properties... */
- for(i = 0; i < numProperties; i++)
- {
- property = (CFStringRef) CFArrayGetValueAtIndex(allProperties, i);
- bFoundProperty = sal_False;
- for(j = 0; j < numRequiredProperties; j++)
- {
- if(CFEqual(property, requiredProperties[j]))
- {
- bFoundProperty = sal_True;
- bFoundRequiredProperties[j] = sal_True;
- break;
- }
- }
-
- if(bFoundProperty == sal_False)
- {
- /* If we have found too many non-required properties */
- if(k == numNonRequiredProperties)
- {
- k++; // so that the OSL_ENSURE below fails
- break;
- }
- nonRequiredProperties[k] = property;
- k++;
- }
- }
-
- // Somehow, we got too many or too few non-requird properties...
- // Most likely, one of the required properties no longer exists, which
- // we also test later.
- OSL_ENSURE(k == numNonRequiredProperties, "MacabRecords::createHeaderForRecordType: Found an unexpected number of non-required properties");
-
- /* Fill the header with required properties first... */
- for(i = 0; i < numRequiredProperties; i++)
- {
- if(bFoundRequiredProperties[i] == sal_True)
- {
- /* The order of these matters (we want all address properties
- * before any phone properties, or else things will look weird),
- * so we get all possibilitities for each property, going through
- * each record, and then go onto the next property.
- * (Note: the reason that we have to go through all records
- * in the first place is that properties like address, phone, and
- * e-mail are multi-value properties with an unknown number of
- * values. A user could specify thirteen different kinds of
- * e-mail addresses for one of her or his contacts, and we need to
- * get all of them.
- */
- for(j = 0; j < numRecords; j++)
- {
- record = (ABRecordRef) CFArrayGetValueAtIndex(_records, j);
- headerDataForProperty = createHeaderForProperty(record,requiredProperties[i],_recordType,sal_True);
- if(headerDataForProperty != NULL)
- {
- (*lcl_header) += headerDataForProperty;
- delete headerDataForProperty;
- }
- }
- }
- else
- {
- // Couldn't find a required property...
- OSL_FAIL(::rtl::OString("MacabRecords::createHeaderForRecordType: could not find required property: ") +
- ::rtl::OUStringToOString(CFStringToOUString(requiredProperties[i]), RTL_TEXTENCODING_ASCII_US));
- }
- }
-
- /* And now, non-required properties... */
- for(i = 0; i < numRecords; i++)
- {
- record = (ABRecordRef) CFArrayGetValueAtIndex(_records, i);
-
- for(j = 0; j < numNonRequiredProperties; j++)
- {
- property = nonRequiredProperties[j];
- headerDataForProperty = createHeaderForProperty(record,property,_recordType,sal_False);
- if(headerDataForProperty != NULL)
- {
- (*nonRequiredHeader) += headerDataForProperty;
- delete headerDataForProperty;
- }
- }
-
- }
- nonRequiredHeader->sortRecord();
-
- (*lcl_header) += nonRequiredHeader;
- delete nonRequiredHeader;
-
- CFRelease(allProperties);
- delete [] nonRequiredProperties;
-
- return lcl_header;
-}
-
-// -------------------------------------------------------------------------
-/* Create a header for a single property. Basically, this method gets
- * the property's value and type and then calls another method of
- * the same name to do the dirty work.
- */
-MacabHeader *MacabRecords::createHeaderForProperty(const ABRecordRef _record, const CFStringRef _propertyName, const CFStringRef _recordType, const sal_Bool _isPropertyRequired) const
-{
- // local variables
- CFStringRef localizedPropertyName;
- CFTypeRef propertyValue;
- ABPropertyType propertyType;
- MacabHeader *result;
-
- /* Get the property's value */
- propertyValue = ABRecordCopyValue(_record,_propertyName);
- if(propertyValue == NULL && _isPropertyRequired == sal_False)
- return NULL;
-
- propertyType = ABTypeOfProperty(addressBook, _recordType, _propertyName);
- localizedPropertyName = ABCopyLocalizedPropertyOrLabel(_propertyName);
-
- result = createHeaderForProperty(propertyType, propertyValue, localizedPropertyName);
-
- if(propertyValue != NULL)
- CFRelease(propertyValue);
-
- return result;
-}
-
-// -------------------------------------------------------------------------
-/* Create a header for a single property. This method is recursive
- * because a single property might contain several sub-properties that
- * we also want to treat singly.
- */
-MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propertyType, const CFTypeRef _propertyValue, const CFStringRef _propertyName) const
-{
- macabfield **headerNames = NULL;
- sal_Int32 length = 0;
-
- switch(_propertyType)
- {
- /* Scalars */
- case kABStringProperty:
- case kABRealProperty:
- case kABIntegerProperty:
- case kABDateProperty:
- length = 1;
- headerNames = new macabfield *[1];
- headerNames[0] = new macabfield;
- headerNames[0]->value = _propertyName;
- headerNames[0]->type = _propertyType;
- break;
-
- /* Multi-scalars */
- case kABMultiIntegerProperty:
- case kABMultiDateProperty:
- case kABMultiStringProperty:
- case kABMultiRealProperty:
- case kABMultiDataProperty:
- /* For non-scalars, we can only get more information if the property
- * actually exists.
- */
- if(_propertyValue != NULL)
- {
- sal_Int32 i;
-
- sal_Int32 multiLength = ABMultiValueCount((ABMutableMultiValueRef) _propertyValue);
- CFStringRef multiLabel, localizedMultiLabel;
- ::rtl::OUString multiLabelString;
- ::rtl::OUString multiPropertyString;
- ::rtl::OUString headerNameString;
- ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType((ABMutableMultiValueRef) _propertyValue) - 0x100);
-
- length = multiLength;
- headerNames = new macabfield *[multiLength];
- multiPropertyString = CFStringToOUString(_propertyName);
-
- /* Go through each element, and - since each element is a scalar -
- * just create a new macabfield for it.
- */
- for(i = 0; i < multiLength; i++)
- {
- multiLabel = ABMultiValueCopyLabelAtIndex((ABMutableMultiValueRef) _propertyValue, i);
- localizedMultiLabel = ABCopyLocalizedPropertyOrLabel(multiLabel);
- multiLabelString = CFStringToOUString(localizedMultiLabel);
- CFRelease(multiLabel);
- CFRelease(localizedMultiLabel);
- headerNameString = multiPropertyString + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(": ")) + fixLabel(multiLabelString);
- headerNames[i] = new macabfield;
- headerNames[i]->value = OUStringToCFString(headerNameString);
- headerNames[i]->type = multiType;
- }
- }
- break;
-
- /* Multi-array or dictionary */
- case kABMultiArrayProperty:
- case kABMultiDictionaryProperty:
- /* For non-scalars, we can only get more information if the property
- * actually exists.
- */
- if(_propertyValue != NULL)
- {
- sal_Int32 i,j,k;
-
- // Total number of multi-array or multi-dictionary elements.
- sal_Int32 multiLengthFirstLevel = ABMultiValueCount((ABMutableMultiValueRef) _propertyValue);
-
- /* Total length, including the length of each element (e.g., if
- * this multi-dictionary contains three dictionaries, and each
- * dictionary has four elements, this variable will be twelve,
- * whereas multiLengthFirstLevel will be three.
- */
- sal_Int32 multiLengthSecondLevel = 0;
-
- CFStringRef multiLabel, localizedMultiLabel;
- CFTypeRef multiValue;
- ::rtl::OUString multiLabelString;
- ::rtl::OUString multiPropertyString;
- MacabHeader **multiHeaders = new MacabHeader *[multiLengthFirstLevel];
- ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType((ABMutableMultiValueRef) _propertyValue) - 0x100);
-
- multiPropertyString = CFStringToOUString(_propertyName);
-
- /* Go through each element - since each element can really
- * contain anything, we run this method again on each element
- * and store the resulting MacabHeader (in the multiHeaders
- * array). Then, all we'll have to do is combine the MacabHeaders
- * into a single one.
- */
- for(i = 0; i < multiLengthFirstLevel; i++)
- {
- /* label */
- multiLabel = ABMultiValueCopyLabelAtIndex((ABMutableMultiValueRef) _propertyValue, i);
- multiValue = ABMultiValueCopyValueAtIndex((ABMutableMultiValueRef) _propertyValue, i);
- if(multiValue && multiLabel)
- {
- localizedMultiLabel = ABCopyLocalizedPropertyOrLabel(multiLabel);
- multiLabelString = multiPropertyString + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(": ")) + fixLabel(CFStringToOUString(localizedMultiLabel));
- CFRelease(multiLabel);
- CFRelease(localizedMultiLabel);
- multiLabel = OUStringToCFString(multiLabelString);
- multiHeaders[i] = createHeaderForProperty(multiType, multiValue, multiLabel);
- if (!multiHeaders[i])
- multiHeaders[i] = new MacabHeader();
- multiLengthSecondLevel += multiHeaders[i]->getSize();
- }
- else
- {
- multiHeaders[i] = new MacabHeader();
- }
- if(multiValue)
- CFRelease(multiValue);
- }
-
- /* We now have enough information to create our final MacabHeader.
- * We go through each field of each header and add it to the
- * headerNames array (which is what is used below to construct
- * the MacabHeader we return).
- */
- length = multiLengthSecondLevel;
- headerNames = new macabfield *[multiLengthSecondLevel];
-
- for(i = 0, j = 0, k = 0; i < multiLengthSecondLevel; i++,k++)
- {
- while(multiHeaders[j]->getSize() == k)
- {
- j++;
- k = 0;
- }
-
- headerNames[i] = multiHeaders[j]->copy(k);
- }
- for(i = 0; i < multiLengthFirstLevel; i++)
- delete multiHeaders[i];
-
- delete [] multiHeaders;
- }
- break;
-
- /* Dictionary */
- case kABDictionaryProperty:
- /* For non-scalars, we can only get more information if the property
- * actually exists.
- */
- if(_propertyValue != NULL)
- {
- /* Assume all keys are strings */
- sal_Int32 numRecords = (sal_Int32) CFDictionaryGetCount((CFDictionaryRef) _propertyValue);
-
- /* The only method for getting info out of a CFDictionary, of both
- * keys and values, is to all of them all at once, so these
- * variables will hold them.
- */
- CFStringRef *dictKeys;
- CFTypeRef *dictValues;
-
- sal_Int32 i,j,k;
- ::rtl::OUString dictKeyString, propertyNameString;
- ABPropertyType dictType;
- MacabHeader **dictHeaders = new MacabHeader *[numRecords];
- ::rtl::OUString dictLabelString;
- CFStringRef dictLabel, localizedDictKey;
-
- /* Get the keys and values */
- dictKeys = (CFStringRef *) malloc(sizeof(CFStringRef)*numRecords);
- dictValues = (CFTypeRef *) malloc(sizeof(CFTypeRef)*numRecords);
- CFDictionaryGetKeysAndValues((CFDictionaryRef) _propertyValue, (const void **) dictKeys, (const void **) dictValues);
-
- propertyNameString = CFStringToOUString(_propertyName);
-
- length = 0;
- /* Go through each element - assuming that the key is a string but
- * that the value could be anything. Since the value could be
- * anything, we can't assume that it is scalar (it could even be
- * another dictionary), so we attempt to get its type using
- * the method getABTypeFromCFType and then run this method
- * recursively on that element, storing the MacabHeader that
- * results. Then, we just combine all of the MacabHeaders into
- * one.
- */
- for(i = 0; i < numRecords; i++)
- {
- dictType = (ABPropertyType) getABTypeFromCFType( CFGetTypeID(dictValues[i]) );
- localizedDictKey = ABCopyLocalizedPropertyOrLabel(dictKeys[i]);
- dictKeyString = CFStringToOUString(localizedDictKey);
- dictLabelString = propertyNameString + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(": ")) + fixLabel(dictKeyString);
- dictLabel = OUStringToCFString(dictLabelString);
- dictHeaders[i] = createHeaderForProperty(dictType, dictValues[i], dictLabel);
- if (!dictHeaders[i])
- dictHeaders[i] = new MacabHeader();
- length += dictHeaders[i]->getSize();
- CFRelease(dictLabel);
- CFRelease(localizedDictKey);
- }
-
- /* Combine all of the macabfields in each MacabHeader into the
- * headerNames array, which (at the end of this method) is used
- * to create the MacabHeader that is returned.
- */
- headerNames = new macabfield *[length];
- for(i = 0, j = 0, k = 0; i < length; i++,k++)
- {
- while(dictHeaders[j]->getSize() == k)
- {
- j++;
- k = 0;
- }
-
- headerNames[i] = dictHeaders[j]->copy(k);
- }
-
- for(i = 0; i < numRecords; i++)
- delete dictHeaders[i];
-
- delete [] dictHeaders;
- free(dictKeys);
- free(dictValues);
- }
- break;
-
- /* Array */
- case kABArrayProperty:
- /* For non-scalars, we can only get more information if the property
- * actually exists.
- */
- if(_propertyValue != NULL)
- {
- sal_Int32 arrLength = (sal_Int32) CFArrayGetCount( (CFArrayRef) _propertyValue);
- sal_Int32 i,j,k;
- CFTypeRef arrValue;
- ABPropertyType arrType;
- MacabHeader **arrHeaders = new MacabHeader *[arrLength];
- ::rtl::OUString propertyNameString = CFStringToOUString(_propertyName);
- ::rtl::OUString arrLabelString;
- CFStringRef arrLabel;
-
- length = 0;
- /* Go through each element - since the elements here do not have
- * unique keys like the ones in dictionaries, we create a unique
- * key out of the id of the element in the array (the first
- * element gets a 0 plopped onto the end of it, the second a 1...
- * As with dictionaries, the elements could be anything, including
- * another array, so we have to run this method recursively on
- * each element, storing the resulting MacabHeader into an array,
- * which we then combine into one MacabHeader that is returned.
- */
- for(i = 0; i < arrLength; i++)
- {
- arrValue = (CFTypeRef) CFArrayGetValueAtIndex( (CFArrayRef) _propertyValue, i);
- arrType = (ABPropertyType) getABTypeFromCFType( CFGetTypeID(arrValue) );
- arrLabelString = propertyNameString + ::rtl::OUString::valueOf(i);
- arrLabel = OUStringToCFString(arrLabelString);
- arrHeaders[i] = createHeaderForProperty(arrType, arrValue, arrLabel);
- if (!arrHeaders[i])
- arrHeaders[i] = new MacabHeader();
- length += arrHeaders[i]->getSize();
- CFRelease(arrLabel);
- }
-
- headerNames = new macabfield *[length];
- for(i = 0, j = 0, k = 0; i < length; i++,k++)
- {
- while(arrHeaders[j]->getSize() == k)
- {
- j++;
- k = 0;
- }
-
- headerNames[i] = arrHeaders[j]->copy(k);
- }
- for(i = 0; i < arrLength; i++)
- delete arrHeaders[i];
-
- delete [] arrHeaders;
- }
- break;
-
- default:
- break;
-
- }
-
- /* If we succeeded at adding elements to the headerNames array, then
- * length will no longer be 0. If it is, create a new MacabHeader
- * out of the headerNames (after weeding out duplicate headers), and
- * then return the result. If the length is still 0, return NULL: we
- * failed to create a MacabHeader out of this property.
- */
- if(length != 0)
- {
- manageDuplicateHeaders(headerNames, length);
- MacabHeader *headerResult = new MacabHeader(length, headerNames);
- delete [] headerNames;
- return headerResult;
- }
- else
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-void MacabRecords::manageDuplicateHeaders(macabfield **_headerNames, const sal_Int32 _length) const
-{
- /* If we have two cases of, say, phone: home, this makes it:
- * phone: home (1)
- * phone: home (2)
- */
- sal_Int32 i, j;
- sal_Int32 count;
- for(i = _length-1; i >= 0; i--)
- {
- count = 1;
- for( j = i-1; j >= 0; j--)
- {
- if(CFEqual(_headerNames[i]->value, _headerNames[j]->value))
- {
- count++;
- }
- }
-
- // duplicate!
- if(count != 1)
- {
- // There is probably a better way to do this...
- ::rtl::OUString newName = CFStringToOUString((CFStringRef) _headerNames[i]->value);
- CFRelease(_headerNames[i]->value);
- newName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (")) + ::rtl::OUString::valueOf(count) + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
- _headerNames[i]->value = OUStringToCFString(newName);
- }
- }
-}
-
-// -------------------------------------------------------------------------
-/* Create a MacabRecord out of an ABRecord, using a given MacabHeader and
- * the record's type. We go through each property for this record type
- * then process it much like we processed the header (above), with two
- * exceptions: if we come upon something not in the header, we ignore it
- * (it's something we don't want to add), and once we find a corresponding
- * location in the header, we store the property and the property type in
- * a macabfield. (For the header, we stored the property type and the name
- * of the property as a CFString.)
- */
-MacabRecord *MacabRecords::createMacabRecord(const ABRecordRef _abrecord, const MacabHeader *_header, const CFStringRef _recordType) const
-{
- /* The new record that we will create... */
- MacabRecord *macabRecord = new MacabRecord(_header->getSize());
-
- CFArrayRef recordProperties = ABCopyArrayOfPropertiesForRecordType(addressBook, _recordType);
- sal_Int32 numProperties = (sal_Int32) CFArrayGetCount(recordProperties);
-
- sal_Int32 i;
-
- CFTypeRef propertyValue;
- ABPropertyType propertyType;
-
- CFStringRef propertyName, localizedPropertyName;
- ::rtl::OUString propertyNameString;
- for(i = 0; i < numProperties; i++)
- {
- propertyName = (CFStringRef) CFArrayGetValueAtIndex(recordProperties, i);
- localizedPropertyName = ABCopyLocalizedPropertyOrLabel(propertyName);
- propertyNameString = CFStringToOUString(localizedPropertyName);
- CFRelease(localizedPropertyName);
-
- /* Get the property's value */
- propertyValue = ABRecordCopyValue(_abrecord,propertyName);
- if(propertyValue != NULL)
- {
- propertyType = ABTypeOfProperty(addressBook, _recordType, propertyName);
- if(propertyType != kABErrorInProperty)
- insertPropertyIntoMacabRecord(propertyType, macabRecord, _header, propertyNameString, propertyValue);
-
- CFRelease(propertyValue);
- }
- }
- CFRelease(recordProperties);
- return macabRecord;
-}
-
-// -------------------------------------------------------------------------
-/* Inserts a given property into a MacabRecord. This method calls another
- * method by the same name after getting the property type (it only
- * receives the property value). It is called when we aren't given the
- * property's type already.
- */
-void MacabRecords::insertPropertyIntoMacabRecord(MacabRecord *_abrecord, const MacabHeader *_header, const ::rtl::OUString _propertyName, const CFTypeRef _propertyValue) const
-{
- CFTypeID cf_type = CFGetTypeID(_propertyValue);
- ABPropertyType ab_type = getABTypeFromCFType( cf_type );
-
- if(ab_type != kABErrorInProperty)
- insertPropertyIntoMacabRecord(ab_type, _abrecord, _header, _propertyName, _propertyValue);
-}
-
-// -------------------------------------------------------------------------
-/* Inserts a given property into a MacabRecord. This method is recursive
- * because properties can contain many sub-properties.
- */
-void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyType, MacabRecord *_abrecord, const MacabHeader *_header, const ::rtl::OUString _propertyName, const CFTypeRef _propertyValue) const
-{
- /* If there is no value, return */
- if(_propertyValue == NULL)
- return;
-
- /* The main switch statement */
- switch(_propertyType)
- {
- /* Scalars */
- case kABStringProperty:
- case kABRealProperty:
- case kABIntegerProperty:
- case kABDateProperty:
- {
- /* Only scalars actually insert a property into the MacabRecord.
- * In all other cases, this method is called recursively until a
- * scalar type, an error, or an unknown type are found.
- * Because of that, the following checks only occur for this type.
- * We store whether we have successfully placed this property
- * into the MacabRecord (or whether an unrecoverable error occurred).
- * Then, we try over and over again to place the property into the
- * record. There are three possible results:
- * 1) Success!
- * 2) There is already a property stored at the column of this name,
- * in which case we have a duplicate header (see the method
- * manageDuplicateHeaders()). If that is the case, we add an ID
- * to the end of the column name in the same format as we do in
- * manageDuplicateHeaders() and try again.
- * 3) No column of this name exists in the header. In this case,
- * there is nothing we can do: we have failed to place this
- * property into the record.
- */
- sal_Bool bPlaced = sal_False;
- ::rtl::OUString columnName = ::rtl::OUString(_propertyName);
- sal_Int32 i = 1;
-
- // A big safeguard to prevent two fields from having the same name.
- while(bPlaced != sal_True)
- {
- sal_Int32 columnNumber = _header->getColumnNumber(columnName);
- bPlaced = sal_True;
- if(columnNumber != -1)
- {
- // collision! A property already exists here!
- if(_abrecord->get(columnNumber) != NULL)
- {
- bPlaced = sal_False;
- i++;
- columnName = ::rtl::OUString(_propertyName) + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (")) + ::rtl::OUString::valueOf(i) + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
- }
-
- // success!
- else
- {
- _abrecord->insertAtColumn(_propertyValue, _propertyType, columnNumber);
- }
- }
- }
- }
- break;
-
- /* Array */
- case kABArrayProperty:
- {
- /* An array is basically just a list of anything, so all we do
- * is go through the array, and rerun this method recursively
- * on each element.
- */
- sal_Int32 arrLength = (sal_Int32) CFArrayGetCount( (CFArrayRef) _propertyValue);
- sal_Int32 i;
- const void *arrValue;
- ::rtl::OUString newPropertyName;
-
- /* Going through each element... */
- for(i = 0; i < arrLength; i++)
- {
- arrValue = CFArrayGetValueAtIndex( (CFArrayRef) _propertyValue, i);
- newPropertyName = _propertyName + ::rtl::OUString::valueOf(i);
- insertPropertyIntoMacabRecord(_abrecord, _header, newPropertyName, arrValue);
- CFRelease(arrValue);
- }
-
- }
- break;
-
- /* Dictionary */
- case kABDictionaryProperty:
- {
- /* A dictionary is basically a hashmap. Technically, it can
- * hold any object as a key and any object as a value.
- * For our case, we assume that the key is a string (so that
- * we can use the key to get the column name and match it against
- * the header), but we don't assume anything about the value, so
- * we run this method recursively (or, rather, we run the version
- * of this method for when we don't know the object's type) until
- * we hit a scalar value.
- */
-
- sal_Int32 numRecords = (sal_Int32) CFDictionaryGetCount((CFDictionaryRef) _propertyValue);
- ::rtl::OUString dictKeyString;
- sal_Int32 i;
- ::rtl::OUString newPropertyName;
-
- /* Unfortunately, the only way to get both keys and values out
- * of a dictionary in Carbon is to get them all at once, so we
- * do that.
- */
- CFStringRef *dictKeys;
- CFStringRef localizedDictKey;
- CFTypeRef *dictValues;
- dictKeys = (CFStringRef *) malloc(sizeof(CFStringRef)*numRecords);
- dictValues = (CFTypeRef *) malloc(sizeof(CFTypeRef)*numRecords);
- CFDictionaryGetKeysAndValues((CFDictionaryRef) _propertyValue, (const void **) dictKeys, (const void **) dictValues);
-
- /* Going through each element... */
- for(i = 0; i < numRecords; i++)
- {
- localizedDictKey = ABCopyLocalizedPropertyOrLabel(dictKeys[i]);
- dictKeyString = CFStringToOUString(localizedDictKey);
- CFRelease(localizedDictKey);
- newPropertyName = _propertyName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(": ")) + fixLabel(dictKeyString);
- insertPropertyIntoMacabRecord(_abrecord, _header, newPropertyName, dictValues[i]);
- }
-
- free(dictKeys);
- free(dictValues);
- }
- break;
-
- /* Multivalue */
- case kABMultiIntegerProperty:
- case kABMultiDateProperty:
- case kABMultiStringProperty:
- case kABMultiRealProperty:
- case kABMultiDataProperty:
- case kABMultiDictionaryProperty:
- case kABMultiArrayProperty:
- {
- /* All scalar multivalues are handled in the same way. Each element
- * is a label and a value. All labels are strings
- * (kABStringProperty), and all values have the same type
- * (which is the type of the multivalue minus 255, or as
- * Carbon's list of property types has it, minus 0x100.
- * We just get the correct type, then go through each element
- * and get the label and value and print them in a list.
- */
-
- sal_Int32 i;
- sal_Int32 multiLength = ABMultiValueCount((ABMutableMultiValueRef) _propertyValue);
- CFStringRef multiLabel, localizedMultiLabel;
- CFTypeRef multiValue;
- ::rtl::OUString multiLabelString, newPropertyName;
- ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType((ABMutableMultiValueRef) _propertyValue) - 0x100);
-
- /* Go through each element... */
- for(i = 0; i < multiLength; i++)
- {
- /* Label and value */
- multiLabel = ABMultiValueCopyLabelAtIndex((ABMutableMultiValueRef) _propertyValue, i);
- multiValue = ABMultiValueCopyValueAtIndex((ABMutableMultiValueRef) _propertyValue, i);
-
- localizedMultiLabel = ABCopyLocalizedPropertyOrLabel(multiLabel);
- multiLabelString = CFStringToOUString(localizedMultiLabel);
- newPropertyName = _propertyName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(": ")) + fixLabel(multiLabelString);
- insertPropertyIntoMacabRecord(multiType, _abrecord, _header, newPropertyName, multiValue);
-
- /* free our variables */
- CFRelease(multiLabel);
- CFRelease(localizedMultiLabel);
- CFRelease(multiValue);
- }
- }
- break;
-
- /* Unhandled types */
- case kABErrorInProperty:
- case kABDataProperty:
- default:
- /* An error, as far as I have seen, only shows up as a type
- * returned by a function for dictionaries when the dictionary
- * holds many types of values. Since we do not use that function,
- * it shouldn't come up. I have yet to see the kABDataProperty,
- * and I am not sure how to represent it as a string anyway,
- * since it appears to just be a bunch of bytes. Assumably, if
- * these bytes made up a string, the type would be
- * kABStringProperty. I think that this is used when we are not
- * sure what the type is (e.g., it could be a string or a number).
- * That being the case, I still don't know how to represent it.
- * And, default should never come up, since we've exhausted all
- * of the possible types for ABPropertyType, but... just in case.
- */
- break;
- }
-
-}
-
-// -------------------------------------------------------------------------
-ABPropertyType MacabRecords::getABTypeFromCFType(const CFTypeID cf_type ) const
-{
- sal_Int32 i;
- for(i = 0; i < lcl_CFTypesLength; i++)
- {
- /* A match! */
- if(lcl_CFTypes[i].cf == (sal_Int32) cf_type)
- {
- return (ABPropertyType) lcl_CFTypes[i].ab;
- }
- }
- return kABErrorInProperty;
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 MacabRecords::size() const
-{
- return currentRecord;
-}
-
-// -------------------------------------------------------------------------
-MacabRecords *MacabRecords::begin()
-{
- return this;
-}
-
-// -------------------------------------------------------------------------
-MacabRecords::iterator::iterator ()
-{
-}
-
-// -------------------------------------------------------------------------
-MacabRecords::iterator::~iterator ()
-{
-}
-
-// -------------------------------------------------------------------------
-MacabRecords::iterator& MacabRecords::iterator::operator= (MacabRecords *_records)
-{
- id = 0;
- records = _records;
- return *this;
-}
-
-// -------------------------------------------------------------------------
-void MacabRecords::iterator::operator++ ()
-{
- id++;
-}
-
-// -------------------------------------------------------------------------
-sal_Bool MacabRecords::iterator::operator!= (const sal_Int32 i) const
-{
- return(id != i);
-}
-
-// -------------------------------------------------------------------------
-sal_Bool MacabRecords::iterator::operator== (const sal_Int32 i) const
-{
- return(id == i);
-}
-
-// -------------------------------------------------------------------------
-MacabRecord *MacabRecords::iterator::operator* () const
-{
- return records->getRecord(id);
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 MacabRecords::end() const
-{
- return currentRecord;
-}
-
-// -------------------------------------------------------------------------
-void MacabRecords::swap(const sal_Int32 _id1, const sal_Int32 _id2)
-{
- MacabRecord *swapRecord = records[_id1];
-
- records[_id1] = records[_id2];
- records[_id2] = swapRecord;
-}
-
-// -------------------------------------------------------------------------
-void MacabRecords::setName(const ::rtl::OUString _sName)
-{
- m_sName = _sName;
-}
-
-// -------------------------------------------------------------------------
-::rtl::OUString MacabRecords::getName() const
-{
- return m_sName;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabRecords.hxx b/connectivity/source/drivers/macab/MacabRecords.hxx
deleted file mode 100644
index 0ac946b5c0..0000000000
--- a/connectivity/source/drivers/macab/MacabRecords.hxx
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_RECORDS_HXX_
-#define _CONNECTIVITY_MACAB_RECORDS_HXX_
-
-#include "MacabRecord.hxx"
-#include "MacabHeader.hxx"
-
-#include <premac.h>
-#include <Carbon/Carbon.h>
-#include <AddressBook/ABAddressBookC.h>
-#include <postmac.h>
-#include <com/sun/star/util/DateTime.hpp>
-
-namespace connectivity
-{
- namespace macab
- {
- /* This struct is for converting CF types to AB types (Core Foundation
- * types to Address Book types).
- */
- struct lcl_CFType {
- sal_Int32 cf;
- sal_Int32 ab;
- };
-
- class MacabRecords{
- protected:
- /* MacabRecords is, at its core, a table of macabfields, in the
- * form of a header and a list of objects of type MacabRecord.
- * It also has a unique name that refers to the name of the table.
- */
- sal_Int32 recordsSize;
- sal_Int32 currentRecord;
- CFStringRef recordType;
- MacabHeader *header;
- MacabRecord **records;
- ABAddressBookRef addressBook;
- ::rtl::OUString m_sName;
-
- /* For converting CF types to AB types */
- sal_Int32 lcl_CFTypesLength;
- lcl_CFType *lcl_CFTypes;
-
- /* For required properties */
- CFStringRef *requiredProperties;
- sal_Int32 numRequiredProperties;
-
- private:
- /* All of the private methods are for creating a MacabHeader or a
- * MacabRecord. They are used by the initialize method that goes
- * about filling a MacabRecords using all of the records in the
- * Mac OS X Address Book.
- */
- void bootstrap_CF_types();
- void bootstrap_requiredProperties();
- MacabHeader *createHeaderForProperty(const ABRecordRef _record, const CFStringRef _propertyName, const CFStringRef _recordType, const sal_Bool _isPropertyRequired) const;
- MacabHeader *createHeaderForProperty(const ABPropertyType _propertyType, const CFTypeRef _propertyValue, const CFStringRef _propertyName) const;
- void manageDuplicateHeaders(macabfield **_headerNames, const sal_Int32 _length) const;
- ABPropertyType getABTypeFromCFType(const CFTypeID cf_type ) const;
- void insertPropertyIntoMacabRecord(MacabRecord *_abrecord, const MacabHeader *_header, const ::rtl::OUString _propertyName, const CFTypeRef _propertyValue) const;
- void insertPropertyIntoMacabRecord(const ABPropertyType _propertyType, MacabRecord *_abrecord, const MacabHeader *_header, const ::rtl::OUString _propertyName, const CFTypeRef _propertyValue) const;
- public:
- MacabRecords(const ABAddressBookRef _addressBook, MacabHeader *_header, MacabRecord **_records, sal_Int32 _numRecords);
- MacabRecords(const MacabRecords *_copy);
- MacabRecords(const ABAddressBookRef _addressBook);
- ~MacabRecords();
-
- void initialize();
-
- void setHeader(MacabHeader *_header);
- MacabHeader *getHeader() const;
-
- void setName(const ::rtl::OUString _sName);
- ::rtl::OUString getName() const;
-
- MacabRecord *insertRecord(MacabRecord *_newRecord, const sal_Int32 _location);
- void insertRecord(MacabRecord *_newRecord);
- MacabRecord *getRecord(const sal_Int32 _location) const;
- void swap(const sal_Int32 _id1, const sal_Int32 _id2);
-
- macabfield *getField(const sal_Int32 _recordNumber, const sal_Int32 _columnNumber) const;
- macabfield *getField(const sal_Int32 _recordNumber, const ::rtl::OUString _columnName) const;
- sal_Int32 getFieldNumber(const ::rtl::OUString _columnName) const;
-
- sal_Int32 size() const;
-
- MacabHeader *createHeaderForRecordType(const CFArrayRef _records, const CFStringRef _recordType) const;
- MacabRecord *createMacabRecord(const ABRecordRef _abrecord, const MacabHeader *_header, const CFStringRef _recordType) const;
-
- MacabRecords *begin();
- sal_Int32 end() const;
- class iterator{
- protected:
- MacabRecords *records;
- public:
- sal_Int32 id;
- iterator& operator= (MacabRecords *_records);
- iterator();
- ~iterator();
- void operator++ ();
- sal_Bool operator!= (const sal_Int32 i) const;
- sal_Bool operator== (const sal_Int32 i) const;
- MacabRecord *operator* () const;
- };
-
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_RECORDS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabResultSet.cxx b/connectivity/source/drivers/macab/MacabResultSet.cxx
deleted file mode 100644
index 851052aa59..0000000000
--- a/connectivity/source/drivers/macab/MacabResultSet.cxx
+++ /dev/null
@@ -1,1076 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabResultSet.hxx"
-#include "MacabAddressBook.hxx"
-#include "MacabRecords.hxx"
-#include "macabutilities.hxx"
-#include "MacabResultSetMetaData.hxx"
-#include "MacabConnection.hxx"
-#include "macabcondition.hxx"
-#include "macaborder.hxx"
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/sdbcx/CompareBookmark.hpp>
-#include "TConnection.hxx"
-#include <connectivity/dbexception.hxx>
-#include "resource/sharedresources.hxx"
-#include "resource/macab_res.hrc"
-
-using namespace connectivity::macab;
-using namespace cppu;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-
-IMPLEMENT_SERVICE_INFO(MacabResultSet, "com.sun.star.sdbc.drivers.MacabResultSet", "com.sun.star.sdbc.ResultSet");
-// -------------------------------------------------------------------------
-MacabResultSet::MacabResultSet(MacabCommonStatement* pStmt)
- : MacabResultSet_BASE(m_aMutex),
- OPropertySetHelper(MacabResultSet_BASE::rBHelper),
- m_xStatement(pStmt),
- m_xMetaData(NULL),
- m_aMacabRecords(),
- m_nRowPos(-1),
- m_bWasNull(sal_True)
-{
- m_sTableName = MacabAddressBook::getDefaultTableName();
-}
-// -------------------------------------------------------------------------
-MacabResultSet::~MacabResultSet()
-{
-}
-// -------------------------------------------------------------------------
-void MacabResultSet::allMacabRecords()
-{
- MacabConnection* pConnection = static_cast< MacabConnection *>(m_xStatement->getConnection().get());
-
- m_aMacabRecords = pConnection->getAddressBook()->getMacabRecords(m_sTableName);
-}
-// -------------------------------------------------------------------------
-void MacabResultSet::someMacabRecords(const MacabCondition *pCondition)
-{
- MacabConnection* pConnection = static_cast< MacabConnection *>(m_xStatement->getConnection().get());
- MacabRecords* allRecords;
-
- allRecords = pConnection->getAddressBook()->getMacabRecords(m_sTableName);
-
- // Bad table!! Throw exception?
- if(allRecords == NULL)
- return;
-
- if(m_aMacabRecords != NULL && m_aMacabRecords != allRecords)
- delete m_aMacabRecords;
-
- // The copy constructor copies everything but records (including the
- // maximum alloted size, which means that we'll never have to resize)
- m_aMacabRecords = new MacabRecords(allRecords);
-
- MacabRecords::iterator iterator;
-
- for (iterator = allRecords->begin();
- iterator != allRecords->end();
- ++iterator)
- {
- if (pCondition->eval(*iterator))
- m_aMacabRecords->insertRecord(*iterator);
- }
-}
-// -------------------------------------------------------------------------
-void MacabResultSet::sortMacabRecords(const MacabOrder *pOrder)
-{
- // I do this with ints rather than an iterator because the ids will
- // be changing when we change the order and ints are easier to deal
- // with (for me).
- sal_Int32 i, j, size, smallest;
- size = m_aMacabRecords->size();
-
- for(i = 0; i < size; i++)
- {
- smallest = i;
- for( j = i + 1; j < size; j++)
- {
- // if smallest > j
- if(pOrder->compare(m_aMacabRecords->getRecord(smallest),
- m_aMacabRecords->getRecord(j) ) > 0)
- {
- smallest = j;
- }
-
- }
-
- if(smallest != i)
- {
- m_aMacabRecords->swap(i,smallest);
- }
- }
-
-}
-// -------------------------------------------------------------------------
-void MacabResultSet::setTableName(::rtl::OUString _sTableName)
-{
- m_sTableName = _sTableName;
-}
-// -------------------------------------------------------------------------
-void MacabResultSet::disposing()
-{
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
-
-m_xStatement.clear();
-m_xMetaData.clear();
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL MacabResultSet::queryInterface(const Type & rType) throw(RuntimeException)
-{
- Any aRet = OPropertySetHelper::queryInterface(rType);
- if (!aRet.hasValue())
- aRet = MacabResultSet_BASE::queryInterface(rType);
- return aRet;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::acquire() throw()
-{
- MacabResultSet_BASE::acquire();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::release() throw()
-{
- MacabResultSet_BASE::release();
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL MacabResultSet::getTypes() throw(RuntimeException)
-{
- OTypeCollection aTypes(
- ::getCppuType( (const Reference< ::com::sun::star::beans::XMultiPropertySet >*) 0),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XFastPropertySet >*) 0),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XPropertySet >*) 0));
-
- return comphelper::concatSequences(aTypes.getTypes(), MacabResultSet_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL MacabResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabResultSet::findColumn(const ::rtl::OUString& columnName) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- // find the first column with the name columnName
- Reference< XResultSetMetaData > xMeta = getMetaData();
- sal_Int32 nLen = xMeta->getColumnCount();
-
- for (sal_Int32 i = 1; i <= nLen; ++i)
- if (xMeta->isCaseSensitive(i) ?
- columnName == xMeta->getColumnName(i) :
- columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
- return i;
-
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_NO_ELEMENT_NAME,
- "$name$", columnName
- ) );
- ::dbtools::throwGenericSQLException(sError , *this);
- // Unreachable:
- OSL_ASSERT(false);
- return 0;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabResultSet::getString(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- ::rtl::OUString aRet;
- sal_Int32 nRecords = m_aMacabRecords->size();
- m_bWasNull = true;
-
- if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
- {
- sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
- macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
- if(aField != NULL)
- {
- if(aField->type == kABStringProperty)
- {
- aRet = CFStringToOUString( (CFStringRef) aField->value);
- m_bWasNull = false;
- }
- }
- }
-
-// Trigger an exception if m_bWasNull is true?
- return aRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::getBoolean(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getBoolean", NULL);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int8 SAL_CALL MacabResultSet::getByte(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getByte", NULL);
-
- sal_Int8 nRet = 0;
- return nRet;
-}
-// -------------------------------------------------------------------------
-sal_Int16 SAL_CALL MacabResultSet::getShort(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getShort", NULL);
-
- sal_Int16 nRet = 0;
- return nRet;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabResultSet::getInt(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nRet = 0;
- sal_Int32 nRecords = m_aMacabRecords->size();
- m_bWasNull = true;
-
- if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
- {
- sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
- macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
- if(aField != NULL)
- {
- if(aField->type == kABIntegerProperty)
- {
- CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
- // m_bWasNull now becomes whether getting the value was successful
- // Should we check for the wrong type here, e.g., a float or a 64 bit int?
- m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nRet);
- }
- }
- }
-
-// Trigger an exception if m_bWasNull is true?
- return nRet;
-}
-// -------------------------------------------------------------------------
-sal_Int64 SAL_CALL MacabResultSet::getLong(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int64 nRet = 0;
- sal_Int32 nRecords = m_aMacabRecords->size();
- m_bWasNull = true;
-
- if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
- {
- sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
- macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
- if(aField != NULL)
- {
- if(aField->type == kABIntegerProperty)
- {
- CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
- // m_bWasNull now becomes whether getting the value was successful
- // Should we check for the wrong type here, e.g., a float or a 32 bit int?
- m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nRet);
- }
- }
- }
-
-// Trigger an exception if m_bWasNull is true?
- return nRet;
-}
-// -------------------------------------------------------------------------
-float SAL_CALL MacabResultSet::getFloat(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- float nVal = 0;
- sal_Int32 nRecords = m_aMacabRecords->size();
- m_bWasNull = true;
-
- if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
- {
- sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
- macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
- if(aField != NULL)
- {
- if(aField->type == kABRealProperty)
- {
- CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
- // m_bWasNull now becomes whether getting the value was successful
- // Should we check for the wrong type here, e.g., an int or a double?
- m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nVal);
- }
- }
- }
-
-// Trigger an exception if m_bWasNull is true?
- return nVal;
-}
-// -------------------------------------------------------------------------
-double SAL_CALL MacabResultSet::getDouble(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- double nVal = 0;
- sal_Int32 nRecords = m_aMacabRecords->size();
- m_bWasNull = true;
-
- if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
- {
- sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
- macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
- if(aField != NULL)
- {
- if(aField->type == kABRealProperty)
- {
- CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
- // m_bWasNull now becomes whether getting the value was successful
- // Should we check for the wrong type here, e.g., an int or a float?
- m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nVal);
- }
- }
- }
-
-// Trigger an exception if m_bWasNull is true?
- return nVal;
-}
-// -------------------------------------------------------------------------
-Sequence< sal_Int8 > SAL_CALL MacabResultSet::getBytes(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getBytes", NULL);
-
- return Sequence< sal_Int8 >();
-}
-// -------------------------------------------------------------------------
-Date SAL_CALL MacabResultSet::getDate(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getDate", NULL);
-
- Date aRet;
- return aRet;
-}
-// -------------------------------------------------------------------------
-Time SAL_CALL MacabResultSet::getTime(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getTime", NULL);
-
- Time nRet;
- return nRet;
-}
-// -------------------------------------------------------------------------
-DateTime SAL_CALL MacabResultSet::getTimestamp(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- DateTime nRet;
- sal_Int32 nRecords = m_aMacabRecords->size();
- m_bWasNull = true;
-
- if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
- {
- sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
- macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
- if(aField != NULL)
- {
- if(aField->type == kABDateProperty)
- {
- nRet = CFDateToDateTime((CFDateRef) aField->value);
- m_bWasNull = false;
- }
- }
- }
-
-// Trigger an exception if m_bWasNull is true?
- return nRet;
-}
-// -------------------------------------------------------------------------
-Reference< XInputStream > SAL_CALL MacabResultSet::getBinaryStream(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getBinaryStream", NULL);
-
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XInputStream > SAL_CALL MacabResultSet::getCharacterStream(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getCharacterStream", NULL);
-
- return NULL;
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL MacabResultSet::getObject(sal_Int32, const Reference< ::com::sun::star::container::XNameAccess >&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getObject", NULL);
-
- return Any();
-}
-// -------------------------------------------------------------------------
-Reference< XRef > SAL_CALL MacabResultSet::getRef(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getRef", NULL);
-
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XBlob > SAL_CALL MacabResultSet::getBlob(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getBlob", NULL);
-
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XClob > SAL_CALL MacabResultSet::getClob(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getClob", NULL);
-
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XArray > SAL_CALL MacabResultSet::getArray(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
-::dbtools::throwFunctionNotSupportedException("getArray", NULL);
-
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSetMetaData > SAL_CALL MacabResultSet::getMetaData() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- if (!m_xMetaData.is())
- m_xMetaData = new MacabResultSetMetaData(m_xStatement->getOwnConnection(), m_sTableName);
-
- Reference< XResultSetMetaData > xMetaData = m_xMetaData.get();
- return xMetaData;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::isBeforeFirst() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- if (m_nRowPos == -1)
- return sal_True;
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::isAfterLast() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nRecords = m_aMacabRecords->size();
- if (m_nRowPos == nRecords)
- return sal_True;
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::isFirst() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- if (m_nRowPos == 0)
- return sal_True;
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::isLast() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nRecords = m_aMacabRecords->size();
- if (m_nRowPos == nRecords - 1)
- return sal_True;
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::beforeFirst() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- // move before the first row
- m_nRowPos = -1;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::afterLast() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- // move after the last row
- sal_Int32 nRecords = m_aMacabRecords->size();
- m_nRowPos = nRecords;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::close() throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::first() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nRecords = m_aMacabRecords->size();
- if (nRecords == 0)
- return sal_False;
-
- m_nRowPos = 0;
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::last() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nRecords = m_aMacabRecords->size();
- if (nRecords == 0)
- return sal_False;
-
- m_nRowPos = nRecords - 1;
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabResultSet::getRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- return m_nRowPos;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::absolute(sal_Int32 row) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nRecords = m_aMacabRecords->size();
- if (row <= -1 ||
- row >= nRecords)
- return sal_False;
-
- m_nRowPos = row;
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::relative(sal_Int32 row) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- return absolute(m_nRowPos + row);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::next() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- return absolute(m_nRowPos + 1);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::previous() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- return absolute(m_nRowPos - 1);
-}
-// -------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL MacabResultSet::getStatement() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- Reference< XStatement > xStatement = m_xStatement.get();
- return xStatement;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::rowDeleted() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::rowInserted() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::rowUpdated() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::wasNull() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- return m_bWasNull;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::cancel() throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::clearWarnings() throw(SQLException, RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL MacabResultSet::getWarnings() throw(SQLException, RuntimeException)
-{
- return Any();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::insertRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- // you only have to implement this if you want to insert new rows
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- // only when you allow updates
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::deleteRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::cancelRowUpdates() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::moveToInsertRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- // only when you allow inserts
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::moveToCurrentRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateNull(sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateBoolean(sal_Int32, sal_Bool) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateByte(sal_Int32, sal_Int8) throw(SQLException, RuntimeException)
-{
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateShort(sal_Int32, sal_Int16) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateInt(sal_Int32, sal_Int32) throw(SQLException, RuntimeException)
-{
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateLong(sal_Int32, sal_Int64) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -----------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateFloat(sal_Int32, float) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateDouble(sal_Int32, double) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateString(sal_Int32, const ::rtl::OUString&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateBytes(sal_Int32, const Sequence< sal_Int8 >&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateDate(sal_Int32, const Date&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateTime(sal_Int32, const Time&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateTimestamp(sal_Int32, const DateTime&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateBinaryStream(sal_Int32, const Reference< XInputStream >&, sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateCharacterStream(sal_Int32, const Reference< XInputStream >&, sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::refreshRow() throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateObject(sal_Int32, const Any&) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabResultSet::updateNumericObject(sal_Int32, const Any&, sal_Int32) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-}
-// -------------------------------------------------------------------------
-// XRowLocate
-Any SAL_CALL MacabResultSet::getBookmark() throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nRecords = m_aMacabRecords->size();
-
- if (m_nRowPos != -1 && m_nRowPos != nRecords)
- {
- macabfield *uidField = m_aMacabRecords->getField(m_nRowPos,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UID")));
- if(uidField != NULL)
- {
- if(uidField->type == kABStringProperty)
- {
- return makeAny(CFStringToOUString( (CFStringRef) uidField->value ));
- }
- }
- }
- return Any();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::moveToBookmark(const Any& bookmark) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- ::rtl::OUString sBookmark = comphelper::getString(bookmark);
- sal_Int32 nRecords = m_aMacabRecords->size();
-
- for (sal_Int32 nRow = 0; nRow < nRecords; nRow++)
- {
- macabfield *uidField = m_aMacabRecords->getField(m_nRowPos,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UID")));
- if(uidField != NULL)
- {
- if(uidField->type == kABStringProperty)
- {
- ::rtl::OUString sUniqueIdentifier = CFStringToOUString( (CFStringRef) uidField->value );
- if (sUniqueIdentifier == sBookmark)
- {
- m_nRowPos = nRow;
- return sal_True;
- }
- }
- }
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::moveRelativeToBookmark(const Any& bookmark, sal_Int32 rows) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- sal_Int32 nRowSave = m_nRowPos;
-
- if (moveToBookmark(bookmark))
- {
- sal_Int32 nRecords = m_aMacabRecords->size();
-
- m_nRowPos += rows;
-
- if (-1 < m_nRowPos && m_nRowPos < nRecords)
- return sal_True;
- }
-
- m_nRowPos = nRowSave;
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabResultSet::compareBookmarks(const Any& firstItem, const Any& secondItem) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- ::rtl::OUString sFirst = comphelper::getString(firstItem);
- ::rtl::OUString sSecond = comphelper::getString(secondItem);
-
- if (sFirst < sSecond)
- return CompareBookmark::LESS;
- if (sFirst > sSecond)
- return CompareBookmark::GREATER;
- return CompareBookmark::EQUAL;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSet::hasOrderedBookmarks() throw( SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabResultSet::hashBookmark(const Any& bookmark) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- ::rtl::OUString sBookmark = comphelper::getString(bookmark);
-
- return sBookmark.hashCode();
-}
-// -------------------------------------------------------------------------
-// XDeleteRows
-Sequence< sal_Int32 > SAL_CALL MacabResultSet::deleteRows(const Sequence< Any >&) throw( SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
-
- return Sequence< sal_Int32 >();
-}
-// -------------------------------------------------------------------------
-IPropertyArrayHelper* MacabResultSet::createArrayHelper() const
-{
- Sequence< Property > aProps(6);
- Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP1IMPL(CURSORNAME, ::rtl::OUString) PropertyAttribute::READONLY);
- DECL_PROP0(FETCHDIRECTION, sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
- DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
- DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
-
- return new OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-IPropertyArrayHelper & MacabResultSet::getInfoHelper()
-{
- return *static_cast<MacabResultSet*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool MacabResultSet::convertFastPropertyValue(
- Any &,
- Any &,
- sal_Int32 nHandle,
- const Any& )
- throw (::com::sun::star::lang::IllegalArgumentException)
-{
- switch (nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw ::com::sun::star::lang::IllegalArgumentException();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- default:
- ;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void MacabResultSet::setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const Any& )
- throw (Exception)
-{
- switch (nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw Exception();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- break;
- case PROPERTY_ID_FETCHSIZE:
- break;
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-void MacabResultSet::getFastPropertyValue(
- Any& _rValue,
- sal_Int32 nHandle) const
-{
- switch (nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- _rValue <<= (sal_Bool)sal_False;
- break;
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- ;
- }
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabResultSet.hxx b/connectivity/source/drivers/macab/MacabResultSet.hxx
deleted file mode 100644
index 029aa6c13a..0000000000
--- a/connectivity/source/drivers/macab/MacabResultSet.hxx
+++ /dev/null
@@ -1,229 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_RESULTSET_HXX_
-#define _CONNECTIVITY_MACAB_RESULTSET_HXX_
-
-#include "MacabStatement.hxx"
-#include "MacabResultSetMetaData.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
-#include <com/sun/star/sdbcx/XDeleteRows.hpp>
-#include <cppuhelper/compbase12.hxx>
-
-namespace connectivity
-{
- namespace macab
- {
- /*
- ** MacabResultSet
- */
- typedef ::cppu::WeakComponentImplHelper12< ::com::sun::star::sdbc::XResultSet,
- ::com::sun::star::sdbc::XRow,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XResultSetUpdate,
- ::com::sun::star::sdbc::XRowUpdate,
- ::com::sun::star::sdbcx::XRowLocate,
- ::com::sun::star::sdbcx::XDeleteRows,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XColumnLocate,
- ::com::sun::star::lang::XServiceInfo> MacabResultSet_BASE;
- class MacabRecords;
-
- class MacabResultSet : public comphelper::OBaseMutex,
- public MacabResultSet_BASE,
- public ::cppu::OPropertySetHelper,
- public comphelper::OPropertyArrayUsageHelper<MacabResultSet>
- {
- protected:
- ::rtl::Reference< MacabCommonStatement > m_xStatement; // the statement that has created this result set
- ::rtl::Reference< MacabResultSetMetaData > m_xMetaData; // the description of the columns in this result set
- MacabRecords * m_aMacabRecords; // address book entries matching the query
- sal_Int32 m_nRowPos; // the current row within the result set
- sal_Bool m_bWasNull; // last entry retrieved from this result set was NULL
- ::rtl::OUString m_sTableName;
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
-
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue)
- throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue)
- throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle) const;
-
- // you can't delete objects of this type
- virtual ~MacabResultSet();
-
- public:
- DECLARE_SERVICE_INFO();
-
- MacabResultSet(MacabCommonStatement *pStmt);
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
- {
- return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(*(MacabResultSet_BASE*) this);
- }
-
- void allMacabRecords();
- void someMacabRecords(const class MacabCondition *pCondition);
- void sortMacabRecords(const class MacabOrder *pOrder);
- void setTableName(const ::rtl::OUString _sTableName);
-
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XResultSet
- virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XResultSetUpdate
- virtual void SAL_CALL insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRowUpdate
- virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XColumnLocate
- virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XRowLocate
- virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& firstItem, const ::com::sun::star::uno::Any& secondItem ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XDeleteRows
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_RESULTSET_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx b/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx
deleted file mode 100644
index 064065213c..0000000000
--- a/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx
+++ /dev/null
@@ -1,227 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabResultSetMetaData.hxx"
-#include "MacabHeader.hxx"
-#include "MacabRecords.hxx"
-#include "MacabAddressBook.hxx"
-#include "macabutilities.hxx"
-#include "resource/macab_res.hrc"
-
-using namespace connectivity::macab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::sdbc;
-
-MacabResultSetMetaData::MacabResultSetMetaData(MacabConnection* _pConnection, ::rtl::OUString _sTableName)
- : m_pConnection(_pConnection),
- m_sTableName(_sTableName),
- m_aMacabFields()
-{
-}
-// -------------------------------------------------------------------------
-MacabResultSetMetaData::~MacabResultSetMetaData()
-{
-}
-// -------------------------------------------------------------------------
-void MacabResultSetMetaData::setMacabFields(const ::rtl::Reference<connectivity::OSQLColumns> &xColumns) throw(SQLException)
-{
- OSQLColumns::Vector::const_iterator aIter;
- static const ::rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("Name"));
- MacabRecords *aRecords;
- MacabHeader *aHeader;
-
- aRecords = m_pConnection->getAddressBook()->getMacabRecords(m_sTableName);
-
- // In case, somehow, we don't have anything with the name m_sTableName
- if(aRecords == NULL)
- {
- impl_throwError(STR_NO_TABLE);
- }
-
- aHeader = aRecords->getHeader();
-
- for (aIter = xColumns->get().begin(); aIter != xColumns->get().end(); ++aIter)
- {
- ::rtl::OUString aFieldName;
- sal_uInt32 nFieldNumber;
-
- (*aIter)->getPropertyValue(aName) >>= aFieldName;
- nFieldNumber = aHeader->getColumnNumber(aFieldName);
- m_aMacabFields.push_back(nFieldNumber);
- }
-
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabResultSetMetaData::getColumnDisplaySize(sal_Int32 column) throw(SQLException, RuntimeException)
-{
- // For now, all columns are the same size.
- return 50;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabResultSetMetaData::getColumnType(sal_Int32 column) throw(SQLException, RuntimeException)
-{
- MacabRecords *aRecords;
- MacabHeader *aHeader;
- macabfield *aField;
-
- aRecords = m_pConnection->getAddressBook()->getMacabRecords(m_sTableName);
-
- // In case, somehow, we don't have anything with the name m_sTableName
- if(aRecords == NULL)
- {
- impl_throwError(STR_NO_TABLE);
- }
-
- aHeader = aRecords->getHeader();
- aField = aHeader->get(column-1);
-
- if(aField == NULL)
- {
- ::dbtools::throwInvalidIndexException(*this,Any());
- return -1;
- }
-
- return ABTypeToDataType(aField->type);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabResultSetMetaData::getColumnCount() throw(SQLException, RuntimeException)
-{
- return m_aMacabFields.size();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSetMetaData::isCaseSensitive(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabResultSetMetaData::getSchemaName(sal_Int32) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabResultSetMetaData::getColumnName(sal_Int32 column) throw(SQLException, RuntimeException)
-{
- sal_uInt32 nFieldNumber = m_aMacabFields[column - 1];
- MacabRecords *aRecords;
- MacabHeader *aHeader;
-
- aRecords = m_pConnection->getAddressBook()->getMacabRecords(m_sTableName);
-
- // In case, somehow, we don't have anything with the name m_sTableName
- if(aRecords == NULL)
- {
- impl_throwError(STR_NO_TABLE);
- }
-
- aHeader = aRecords->getHeader();
- ::rtl::OUString aName = aHeader->getString(nFieldNumber);
-
- return aName;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabResultSetMetaData::getTableName(sal_Int32) throw(SQLException, RuntimeException)
-{
- return m_sTableName;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabResultSetMetaData::getCatalogName(sal_Int32) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabResultSetMetaData::getColumnTypeName(sal_Int32) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabResultSetMetaData::getColumnLabel(sal_Int32) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL MacabResultSetMetaData::getColumnServiceName(sal_Int32) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSetMetaData::isCurrency(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSetMetaData::isAutoIncrement(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSetMetaData::isSigned(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabResultSetMetaData::getPrecision(sal_Int32) throw(SQLException, RuntimeException)
-{
- return 0;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabResultSetMetaData::getScale(sal_Int32) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabResultSetMetaData::isNullable(sal_Int32) throw(SQLException, RuntimeException)
-{
- return (sal_Int32) sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSetMetaData::isSearchable(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSetMetaData::isReadOnly(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSetMetaData::isDefinitelyWritable(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabResultSetMetaData::isWritable(sal_Int32) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabResultSetMetaData.hxx b/connectivity/source/drivers/macab/MacabResultSetMetaData.hxx
deleted file mode 100644
index 2140a03b30..0000000000
--- a/connectivity/source/drivers/macab/MacabResultSetMetaData.hxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_RESULTSETMETADATA_HXX_
-#define _CONNECTIVITY_MACAB_RESULTSETMETADATA_HXX_
-
-#include "MacabConnection.hxx"
-#include <connectivity/CommonTools.hxx>
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <connectivity/dbexception.hxx>
-#include <rtl/ref.hxx>
-
-namespace connectivity
-{
- namespace macab
- {
- /*
- ** MacabResultSetMetaData
- */
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> MacabResultSetMetaData_BASE;
-
- class MacabResultSetMetaData : public MacabResultSetMetaData_BASE
- {
- MacabConnection* m_pConnection;
- ::rtl::OUString m_sTableName;
- ::std::vector<sal_Int32> m_aMacabFields; // for each selected column, contains the number
- // of the corresponding AddressBook field
-
- protected:
- virtual ~MacabResultSetMetaData();
-
- public:
- MacabResultSetMetaData(MacabConnection* _pConnection, ::rtl::OUString _sTableName);
-
- // avoid ambigous cast error from the compiler
- inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
- { return this; }
-
- void setMacabFields(
- const ::rtl::Reference<connectivity::OSQLColumns> &xColumns) throw(::com::sun::star::sdbc::SQLException);
- inline sal_uInt32 fieldAtColumn(sal_Int32 columnIndex) const
- { return m_aMacabFields[columnIndex - 1]; }
-
- virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_RESULTSETMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabServices.cxx b/connectivity/source/drivers/macab/MacabServices.cxx
deleted file mode 100644
index 3319c19cdc..0000000000
--- a/connectivity/source/drivers/macab/MacabServices.cxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabDriver.hxx"
-#include <cppuhelper/factory.hxx>
-
-using namespace connectivity::macab;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pTemp
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void*)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- MacabDriver::getImplementationName_Static(),
- MacabDriver::getSupportedServiceNames_Static(),
- &MacabDriver::Create,
- ::cppu::createSingleFactory)
- ;
-
- if (aReq.xRet.is())
- aReq.xRet->acquire();
-
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabStatement.cxx b/connectivity/source/drivers/macab/MacabStatement.cxx
deleted file mode 100644
index fa2654131f..0000000000
--- a/connectivity/source/drivers/macab/MacabStatement.cxx
+++ /dev/null
@@ -1,614 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabStatement.hxx"
-#include "MacabConnection.hxx"
-#include "MacabAddressBook.hxx"
-#include "MacabDriver.hxx"
-#include "MacabResultSet.hxx"
-#include "MacabResultSetMetaData.hxx"
-#include "macabcondition.hxx"
-#include "macaborder.hxx"
-#include "TConnection.hxx"
-#include <connectivity/dbexception.hxx>
-#include "resource/sharedresources.hxx"
-#include "resource/macab_res.hrc"
-
-#if OSL_DEBUG_LEVEL > 0
-# define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr())
-#else /* OSL_DEBUG_LEVEL */
-# define OUtoCStr( x ) ("dummy")
-#endif /* OSL_DEBUG_LEVEL */
-
-using namespace connectivity::macab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-
-namespace connectivity
-{
- namespace macab
- {
- void impl_throwError(sal_uInt16 _nErrorId)
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(_nErrorId) );
- ::dbtools::throwGenericSQLException(sError,NULL);
- }
- }
-}
-
-IMPLEMENT_SERVICE_INFO(MacabStatement, "com.sun.star.sdbc.drivers.MacabStatement", "com.sun.star.sdbc.Statement");
-//------------------------------------------------------------------------------
-MacabCommonStatement::MacabCommonStatement(MacabConnection* _pConnection )
- : MacabCommonStatement_BASE(m_aMutex),
- OPropertySetHelper(MacabCommonStatement_BASE::rBHelper),
- m_aParser(_pConnection->getDriver()->getMSFactory()),
- m_aSQLIterator(_pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL ),
- m_pParseTree(NULL),
- m_pConnection(_pConnection),
- rBHelper(MacabCommonStatement_BASE::rBHelper)
-{
- m_pConnection->acquire();
-}
-// -----------------------------------------------------------------------------
-MacabCommonStatement::~MacabCommonStatement()
-{
-}
-// -----------------------------------------------------------------------------
-void MacabCommonStatement::disposing()
-{
- MacabCommonStatement_BASE::disposing();
-}
-// -----------------------------------------------------------------------------
-void MacabCommonStatement::resetParameters() const throw(::com::sun::star::sdbc::SQLException)
-{
- impl_throwError(STR_PARA_ONLY_PREPARED);
-}
-// -----------------------------------------------------------------------------
-void MacabCommonStatement::getNextParameter(::rtl::OUString &) const throw(::com::sun::star::sdbc::SQLException)
-{
- impl_throwError(STR_PARA_ONLY_PREPARED);
-}
-// -----------------------------------------------------------------------------
-MacabCondition *MacabCommonStatement::analyseWhereClause(const OSQLParseNode *pParseNode) const throw(SQLException)
-{
- if (pParseNode->count() == 3)
- {
- const OSQLParseNode *pLeft = pParseNode->getChild(0),
- *pMiddle = pParseNode->getChild(1),
- *pRight = pParseNode->getChild(2);
-
- // WHERE ( ... ) ?
- if (SQL_ISPUNCTUATION(pLeft, "(") && SQL_ISPUNCTUATION(pRight, ")"))
- {
- return analyseWhereClause(pMiddle);
- }
- else if (SQL_ISRULE(pParseNode, comparison_predicate))
- {
- if (pLeft->isToken() && pRight->isToken())
- {
- switch (pMiddle->getNodeType())
- {
- case SQL_NODE_EQUAL:
- // WHERE 0 = 1
- return new MacabConditionConstant(pLeft->getTokenValue() == pRight->getTokenValue());
-
- case SQL_NODE_NOTEQUAL:
- // WHERE 0 <> 1
- // (might not be correct SQL... don't care, handling anyway)
- return new MacabConditionConstant(pLeft->getTokenValue() != pRight->getTokenValue());
-
- default:
- break;
- }
- }
- else if (SQL_ISRULE(pLeft, column_ref))
- {
- ::rtl::OUString sColumnName,
- sTableRange;
-
- m_aSQLIterator.getColumnRange(pLeft, sColumnName, sTableRange);
-
- if (pRight->isToken() || SQL_ISRULE(pRight, parameter))
- {
- ::rtl::OUString sMatchString;
-
- if (pRight->isToken()) // WHERE Name = 'Doe'
- sMatchString = pRight->getTokenValue();
- else if (SQL_ISRULE(pRight, parameter)) // WHERE Name = ?
- getNextParameter(sMatchString);
-
- switch (pMiddle->getNodeType())
- {
- case SQL_NODE_EQUAL:
- // WHERE Name = 'Smith'
- return new MacabConditionEqual(m_pHeader, sColumnName, sMatchString);
-
- case SQL_NODE_NOTEQUAL:
- // WHERE Name <> 'Jones'
- return new MacabConditionDifferent(m_pHeader, sColumnName, sMatchString);
-
- default:
- break;
- }
- }
- }
- }
- else if (SQL_ISRULE(pParseNode, search_condition))
- {
- if (SQL_ISTOKEN(pMiddle, OR))
- {
- // WHERE Name = 'Smith' OR Name = 'Jones'
- return new MacabConditionOr(
- analyseWhereClause(pLeft),
- analyseWhereClause(pRight));
- }
- }
- else if (SQL_ISRULE(pParseNode, boolean_term))
- {
- if (SQL_ISTOKEN(pMiddle, AND))
- {
- // WHERE Name = 'Smith' AND "Given Name" = 'Peter'
- return new MacabConditionAnd(
- analyseWhereClause(pLeft),
- analyseWhereClause(pRight));
- }
- }
- }
- else if (SQL_ISRULE(pParseNode, test_for_null) || SQL_ISRULE(pParseNode, like_predicate))
- {
- const OSQLParseNode *pLeft = pParseNode->getChild(0);
- const OSQLParseNode* pPart2 = pParseNode->getChild(1);
- const OSQLParseNode *pMiddleLeft = pPart2->getChild(0),
- *pMiddleRight = pPart2->getChild(1),
- *pRight = pPart2->getChild(2);
-
- if (SQL_ISRULE(pParseNode, test_for_null))
- {
- if (SQL_ISRULE(pLeft, column_ref) &&
- SQL_ISTOKEN(pMiddleLeft, IS) &&
- SQL_ISTOKEN(pRight, NULL))
- {
- ::rtl::OUString sColumnName,
- sTableRange;
-
- m_aSQLIterator.getColumnRange(pLeft, sColumnName, sTableRange);
-
- if (SQL_ISTOKEN(pMiddleRight, NOT))
- {
- // WHERE "Mobile Phone" IS NOT NULL
- return new MacabConditionNotNull(m_pHeader, sColumnName);
- }
- else
- {
- // WHERE "Mobile Phone" IS NULL
- return new MacabConditionNull(m_pHeader, sColumnName);
- }
- }
- }
- else if (SQL_ISRULE(pParseNode, like_predicate))
- {
- if (SQL_ISRULE(pLeft, column_ref))
- {
- ::rtl::OUString sColumnName,
- sTableRange;
-
- m_aSQLIterator.getColumnRange(pLeft, sColumnName, sTableRange);
-
- if (pMiddleRight->isToken() || SQL_ISRULE(pMiddleRight, parameter))
- {
- ::rtl::OUString sMatchString;
-
- if (pMiddleRight->isToken()) // WHERE Name LIKE 'Sm%'
- sMatchString = pMiddleRight->getTokenValue();
- else if (SQL_ISRULE(pMiddleRight, parameter)) // WHERE Name LIKE ?
- getNextParameter(sMatchString);
-
- return new MacabConditionSimilar(m_pHeader, sColumnName, sMatchString);
- }
- }
- }
- }
- impl_throwError(STR_QUERY_TOO_COMPLEX);
- // Unreachable:
- OSL_ASSERT(false);
- return 0;
-}
-// -----------------------------------------------------------------------------
-MacabOrder *MacabCommonStatement::analyseOrderByClause(const OSQLParseNode *pParseNode) const throw(SQLException)
-{
- if (SQL_ISRULE(pParseNode, ordering_spec_commalist))
- {
- MacabComplexOrder *list = new MacabComplexOrder();
- sal_uInt32 n = pParseNode->count();
-
- // Iterate through the ordering columns
- for (sal_uInt32 i = 0; i < n; i++)
- {
- list->addOrder
- (analyseOrderByClause(pParseNode->getChild(i)));
- }
-
- return list;
- }
- else if (SQL_ISRULE(pParseNode, ordering_spec))
- {
- if (pParseNode->count() == 2)
- {
- OSQLParseNode* pColumnRef = pParseNode->getChild(0);
- OSQLParseNode* pAscendingDescending = pParseNode->getChild(1);
-
- if (SQL_ISRULE(pColumnRef, column_ref))
- {
- if (pColumnRef->count() == 3)
- pColumnRef = pColumnRef->getChild(2);
-
- if (pColumnRef->count() == 1)
- {
- ::rtl::OUString sColumnName =
- pColumnRef->getChild(0)->getTokenValue();
- sal_Bool bAscending =
- SQL_ISTOKEN(pAscendingDescending, DESC)?
- sal_False:
- sal_True;
-
- return new MacabSimpleOrder(m_pHeader, sColumnName, bAscending);
- }
- }
- }
- }
- impl_throwError(STR_QUERY_TOO_COMPLEX);
- // Unreachable:
- OSL_ASSERT(false);
- return 0;
-}
-//------------------------------------------------------------------------------
-::rtl::OUString MacabCommonStatement::getTableName() const
-{
- const OSQLTables& xTabs = m_aSQLIterator.getTables();
-
- if( xTabs.empty() )
- return ::rtl::OUString();
-
- // can only deal with one table at a time
- if(xTabs.size() > 1 || m_aSQLIterator.hasErrors() )
- return ::rtl::OUString();
-
- return xTabs.begin()->first;
-}
-//------------------------------------------------------------------------------
-void MacabCommonStatement::setMacabFields(MacabResultSet *pResult) const throw(SQLException)
-{
- ::rtl::Reference<connectivity::OSQLColumns> xColumns; // selected columns
- MacabResultSetMetaData *pMeta; // meta information - holds the list of AddressBook fields
-
- xColumns = m_aSQLIterator.getSelectColumns();
- if (!xColumns.is())
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(
- STR_INVALID_COLUMN_SELECTION
- ) );
- ::dbtools::throwGenericSQLException(sError,NULL);
- }
- pMeta = static_cast<MacabResultSetMetaData *>(pResult->getMetaData().get());
- pMeta->setMacabFields(xColumns);
-}
-// -------------------------------------------------------------------------
-void MacabCommonStatement::selectRecords(MacabResultSet *pResult) const throw(SQLException)
-{
- const OSQLParseNode *pParseNode;
- MacabCondition *pCondition;
-
- pParseNode = m_aSQLIterator.getWhereTree();
- if (pParseNode != NULL)
- {
- if (SQL_ISRULE(pParseNode, where_clause))
- {
- // Since we don't support parameters, don't reset them. If we ever
- // support them, uncomment this line and fix resetParameters.
- //resetParameters();
- pParseNode = pParseNode->getChild(1);
- pCondition = analyseWhereClause(pParseNode);
- if (pCondition->isAlwaysTrue())
- pResult->allMacabRecords();
- else if (!pCondition->isAlwaysFalse())
- pResult->someMacabRecords(pCondition);
- delete pCondition;
- return;
- }
- }
-
- // no WHERE clause: get all rows
- pResult->allMacabRecords();
-}
-// -------------------------------------------------------------------------
-void MacabCommonStatement::sortRecords(MacabResultSet *pResult) const throw(SQLException)
-{
- const OSQLParseNode *pParseNode;
- MacabOrder *pOrder;
-
- pParseNode = m_aSQLIterator.getOrderTree();
- if (pParseNode != NULL)
- {
- if (SQL_ISRULE(pParseNode, opt_order_by_clause))
- {
- pParseNode = pParseNode->getChild(2);
- pOrder = analyseOrderByClause(pParseNode);
- pResult->sortMacabRecords(pOrder);
- delete pOrder;
- }
- }
-}
-//-----------------------------------------------------------------------------
-Any SAL_CALL MacabCommonStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = MacabCommonStatement_BASE::queryInterface(rType);
- if (!aRet.hasValue())
- aRet = OPropertySetHelper::queryInterface(rType);
- return aRet;
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL MacabCommonStatement::getTypes( ) throw(RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const Reference< XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< XFastPropertySet > *)0 ),
- ::getCppuType( (const Reference< XPropertySet > *)0 ));
-
- return comphelper::concatSequences(aTypes.getTypes(),MacabCommonStatement_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabCommonStatement::cancel( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
- // cancel the current sql statement
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabCommonStatement::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL MacabCommonStatement::execute(
- const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- Reference< XResultSet > xRS = executeQuery(sql);
-
- return xRS.is();
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL MacabCommonStatement::executeQuery(
- const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
-OSL_TRACE("Mac OS Address book - SQL Request: %s", OUtoCStr(sql));
-
- MacabResultSet* pResult = new MacabResultSet(this);
- Reference< XResultSet > xRS = pResult;
- ::rtl::OUString aErr;
-
- m_pParseTree = m_aParser.parseTree(aErr, sql);
- if (m_pParseTree == NULL)
- throw SQLException(aErr, *this, aErr, 0, Any());
-
- m_aSQLIterator.setParseTree(m_pParseTree);
- m_aSQLIterator.traverseAll();
- switch (m_aSQLIterator.getStatementType())
- {
- case SQL_STATEMENT_SELECT:
- {
- ::rtl::OUString sTableName = getTableName(); // FROM which table ?
- if (sTableName.getLength() != 0) // a match
- {
- MacabRecords *aRecords;
- aRecords = m_pConnection->getAddressBook()->getMacabRecords(sTableName);
-
- // In case, somehow, we don't have anything with the name m_sTableName
- if(aRecords == NULL)
- {
- impl_throwError(STR_NO_TABLE);
- }
- else
- {
- m_pHeader = aRecords->getHeader();
-
- pResult->setTableName(sTableName);
-
- setMacabFields(pResult); // SELECT which columns ?
- selectRecords(pResult); // WHERE which condition ?
- sortRecords(pResult); // ORDER BY which columns ?
- }
-// To be continued: DISTINCT
-// etc...
- }
- }
- break;
-
- default:
-// To be continued: UPDATE
-// DELETE
-// etc...
- impl_throwError(STR_QUERY_TOO_COMPLEX);
- }
-
- m_xResultSet = Reference<XResultSet>(pResult);
- return xRS;
-}
-// -------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL MacabCommonStatement::getConnection( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- // just return our connection here
- return (Reference< XConnection >) m_pConnection;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL MacabCommonStatement::executeUpdate( const ::rtl::OUString& ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- // the return values gives information about how many rows are affected by executing the sql statement
- return 0;
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL MacabCommonStatement::getWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- return makeAny(m_aLastWarning);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL MacabCommonStatement::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(MacabCommonStatement_BASE::rBHelper.bDisposed);
-
- m_aLastWarning = SQLWarning();
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* MacabCommonStatement::createArrayHelper( ) const
-{
- // this properties are defined by the service statement
- // they must be in alphabetic order
- Sequence< Property > aProps(10);
- Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP0(CURSORNAME, ::rtl::OUString);
- DECL_BOOL_PROP0(ESCAPEPROCESSING);
- DECL_PROP0(FETCHDIRECTION,sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_PROP0(MAXFIELDSIZE,sal_Int32);
- DECL_PROP0(MAXROWS, sal_Int32);
- DECL_PROP0(QUERYTIMEOUT,sal_Int32);
- DECL_PROP0(RESULTSETCONCURRENCY,sal_Int32);
- DECL_PROP0(RESULTSETTYPE,sal_Int32);
- DECL_BOOL_PROP0(USEBOOKMARKS);
-
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & MacabCommonStatement::getInfoHelper()
-{
- return *const_cast<MacabCommonStatement*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool MacabCommonStatement::convertFastPropertyValue(
- Any &,
- Any &,
- sal_Int32,
- const Any&) throw (::com::sun::star::lang::IllegalArgumentException)
-{
- sal_Bool bConverted = sal_False;
- // here we have to try to convert
- return bConverted;
-}
-// -------------------------------------------------------------------------
-void MacabCommonStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any&) throw (Exception)
-{
- // set the value to whatever is nescessary
- switch (nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- case PROPERTY_ID_MAXFIELDSIZE:
- case PROPERTY_ID_MAXROWS:
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- case PROPERTY_ID_ESCAPEPROCESSING:
- case PROPERTY_ID_USEBOOKMARKS:
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-void MacabCommonStatement::getFastPropertyValue(Any&,sal_Int32 nHandle) const
-{
- switch (nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- case PROPERTY_ID_MAXFIELDSIZE:
- case PROPERTY_ID_MAXROWS:
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- case PROPERTY_ID_ESCAPEPROCESSING:
- case PROPERTY_ID_USEBOOKMARKS:
- default:
- ;
- }
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL MacabCommonStatement::acquire() throw()
-{
- MacabCommonStatement_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL MacabCommonStatement::release() throw()
-{
- MacabCommonStatement_BASE::release();
-}
-// -----------------------------------------------------------------------------
-Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL MacabCommonStatement::getPropertySetInfo( ) throw(RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-MacabStatement::MacabStatement(MacabConnection* _pConnection)
- : MacabStatement_BASE(_pConnection)
-{
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabStatement.hxx b/connectivity/source/drivers/macab/MacabStatement.hxx
deleted file mode 100644
index 0eda7b05f5..0000000000
--- a/connectivity/source/drivers/macab/MacabStatement.hxx
+++ /dev/null
@@ -1,177 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_STATEMENT_HXX_
-#define _CONNECTIVITY_MACAB_STATEMENT_HXX_
-
-#include "MacabConnection.hxx"
-#include "MacabHeader.hxx"
-#include <list>
-#include "connectivity/sqliterator.hxx"
-#include "connectivity/sqlparse.hxx"
-#include <com/sun/star/sdbc/XStatement.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <cppuhelper/compbase4.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <comphelper/proparrhlp.hxx>
-
-namespace connectivity
-{
- namespace macab
- {
- typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::sdbc::XStatement,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XCloseable> MacabCommonStatement_BASE;
-
- //**************************************************************
- // Class MacabCommonStatement
- // is a base class for the normal statement and for the prepared statement
- //**************************************************************
- class MacabCommonStatement : public comphelper::OBaseMutex,
- public MacabCommonStatement_BASE,
- public ::cppu::OPropertySetHelper,
- public comphelper::OPropertyArrayUsageHelper<MacabCommonStatement>
-
- {
- ::com::sun::star::sdbc::SQLWarning m_aLastWarning;
-
- protected:
- ::std::list< ::rtl::OUString> m_aBatchList;
- connectivity::OSQLParser m_aParser;
- connectivity::OSQLParseTreeIterator m_aSQLIterator;
- connectivity::OSQLParseNode* m_pParseTree;
- MacabConnection* m_pConnection; // The owning Connection object
- MacabHeader* m_pHeader; // The header of the address book on which to run queries (provided by m_pConnection)
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet> m_xResultSet; // The last ResultSet created
-
-
- protected:
- class MacabCondition *analyseWhereClause(
- const OSQLParseNode *pParseNode) const throw(::com::sun::star::sdbc::SQLException);
- class MacabOrder *analyseOrderByClause(
- const OSQLParseNode *pParseNode) const throw(::com::sun::star::sdbc::SQLException);
- ::rtl::OUString getTableName( ) const;
- void setMacabFields(class MacabResultSet *pResult) const throw(::com::sun::star::sdbc::SQLException);
- void selectRecords(MacabResultSet *pResult) const throw(::com::sun::star::sdbc::SQLException);
- void sortRecords(MacabResultSet *pResult) const throw(::com::sun::star::sdbc::SQLException);
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
-
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle) const;
-
- virtual void resetParameters() const throw(::com::sun::star::sdbc::SQLException);
- virtual void getNextParameter(::rtl::OUString &rParameter) const throw(::com::sun::star::sdbc::SQLException);
- virtual ~MacabCommonStatement();
-
- public:
- ::cppu::OBroadcastHelper& rBHelper;
-
- MacabCommonStatement(MacabConnection *_pConnection);
- using MacabCommonStatement_BASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
-
- // OComponentHelper
- virtual void SAL_CALL disposing();
-
- // XInterface
- virtual void SAL_CALL release() throw();
- virtual void SAL_CALL acquire() throw();
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type & rType
- ) throw(::com::sun::star::uno::RuntimeException);
-
- // XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(
- ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(
- ) throw(::com::sun::star::uno::RuntimeException);
-
- // XStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery(
- const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL executeUpdate(
- const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL execute(
- const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection(
- ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings(
- ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings(
- ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XCancellable
- virtual void SAL_CALL cancel(
- ) throw(::com::sun::star::uno::RuntimeException);
-
- // XCloseable
- virtual void SAL_CALL close(
- ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // other methods
- inline MacabConnection* getOwnConnection() const { return m_pConnection; }
- };
-
- //**************************************************************
- // Class MacabStatement
- //**************************************************************
- typedef ::cppu::ImplInheritanceHelper1<
- MacabCommonStatement, ::com::sun::star::lang::XServiceInfo > MacabStatement_BASE;
-
- class MacabStatement : public MacabStatement_BASE
- {
- protected:
- virtual ~MacabStatement() { }
-
- public:
- MacabStatement(MacabConnection* _pConnection);
- DECLARE_SERVICE_INFO();
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_STATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabTable.cxx b/connectivity/source/drivers/macab/MacabTable.cxx
deleted file mode 100644
index ab4ff29d65..0000000000
--- a/connectivity/source/drivers/macab/MacabTable.cxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabTable.hxx"
-#include "MacabTables.hxx"
-#include "MacabColumns.hxx"
-#include "MacabCatalog.hxx"
-
-using namespace connectivity::macab;
-using namespace connectivity;
-using namespace ::comphelper;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -------------------------------------------------------------------------
-MacabTable::MacabTable( sdbcx::OCollection* _pTables, MacabConnection* _pConnection)
- : MacabTable_TYPEDEF(_pTables, sal_True),
- m_pConnection(_pConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-MacabTable::MacabTable( sdbcx::OCollection* _pTables,
- MacabConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description ,
- const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName
- ) : MacabTable_TYPEDEF(_pTables,sal_True,
- _Name,
- _Type,
- _Description,
- _SchemaName,
- _CatalogName),
- m_pConnection(_pConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-void MacabTable::refreshColumns()
-{
- TStringVector aVector;
-
- if (!isNew())
- {
- Reference< XResultSet > xResult = m_pConnection->getMetaData()->getColumns(
- Any(),
- m_SchemaName,
- m_Name,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")));
-
- if (xResult.is())
- {
- Reference< XRow > xRow(xResult, UNO_QUERY);
- while (xResult->next())
- aVector.push_back(xRow->getString(4));
- }
- }
-
- if (m_pColumns)
- m_pColumns->reFill(aVector);
- else
- m_pColumns = new MacabColumns(this,m_aMutex,aVector);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabTable.hxx b/connectivity/source/drivers/macab/MacabTable.hxx
deleted file mode 100644
index 39f113368e..0000000000
--- a/connectivity/source/drivers/macab/MacabTable.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_TABLE_HXX_
-#define _CONNECTIVITY_MACAB_TABLE_HXX_
-
-#include "MacabConnection.hxx"
-#include "connectivity/sdbcx/VTable.hxx"
-
-namespace connectivity
-{
- namespace macab
- {
- typedef connectivity::sdbcx::OTable MacabTable_TYPEDEF;
-
- ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xColProp);
-
- class MacabTable : public MacabTable_TYPEDEF
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- MacabConnection* m_pConnection;
-
- public:
- MacabTable( sdbcx::OCollection* _pTables, MacabConnection* _pConnection);
- MacabTable( sdbcx::OCollection* _pTables,
- MacabConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description = ::rtl::OUString(),
- const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
- const ::rtl::OUString& _CatalogName = ::rtl::OUString()
- );
-
- MacabConnection* getConnection() { return m_pConnection;}
-
- virtual void refreshColumns();
-
- ::rtl::OUString getTableName() const { return m_Name; }
- ::rtl::OUString getSchema() const { return m_SchemaName; }
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_TABLE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabTables.cxx b/connectivity/source/drivers/macab/MacabTables.cxx
deleted file mode 100644
index 1d839f40f9..0000000000
--- a/connectivity/source/drivers/macab/MacabTables.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MacabTables.hxx"
-#include "MacabTable.hxx"
-#include "MacabCatalog.hxx"
-#include "MacabConnection.hxx"
-#include <comphelper/types.hxx>
-
-using namespace connectivity::macab;
-using namespace connectivity;
-using namespace ::comphelper;
-using namespace ::cppu;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-sdbcx::ObjectType MacabTables::createObject(const ::rtl::OUString& _rName)
-{
- ::rtl::OUString aName,aSchema;
- aSchema = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%"));
- aName = _rName;
-
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%"));
- ::rtl::OUString sEmpty;
-
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(), aSchema, aName, aTypes);
-
- sdbcx::ObjectType xRet = NULL;
- if (xResult.is())
- {
- Reference< XRow > xRow(xResult, UNO_QUERY);
- if (xResult->next()) // there can be only one table with this name
- {
- MacabTable* pRet = new MacabTable(
- this,
- static_cast<MacabCatalog&>(m_rParent).getConnection(),
- aName,
- xRow->getString(4),
- xRow->getString(5),
- sEmpty);
- xRet = pRet;
- }
- }
- ::comphelper::disposeComponent(xResult);
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void MacabTables::impl_refresh( ) throw(RuntimeException)
-{
- static_cast<MacabCatalog&>(m_rParent).refreshTables();
-}
-// -------------------------------------------------------------------------
-void MacabTables::disposing(void)
-{
-m_xMetaData.clear();
- OCollection::disposing();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/MacabTables.hxx b/connectivity/source/drivers/macab/MacabTables.hxx
deleted file mode 100644
index 17422ce862..0000000000
--- a/connectivity/source/drivers/macab/MacabTables.hxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_TABLES_HXX_
-#define _CONNECTIVITY_MACAB_TABLES_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-
-namespace connectivity
-{
- namespace macab
- {
- class MacabTables : public sdbcx::OCollection
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
-
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
-
- public:
- MacabTables(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,
- ::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector)
- : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector),
- m_xMetaData(_rMetaData)
- { }
-
- virtual void SAL_CALL disposing(void);
- };
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_TABLES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/exports.dxp b/connectivity/source/drivers/macab/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/drivers/macab/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/drivers/macab/macab.xcu b/connectivity/source/drivers/macab/macab.xcu
deleted file mode 100644
index cbb9d0b6b0..0000000000
--- a/connectivity/source/drivers/macab/macab.xcu
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:address:macab" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.macab.Driver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Mac OS X Address Book</value>
- </prop>
- <node oor:name="Features">
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/macab/macab.xml b/connectivity/source/drivers/macab/macab.xml
deleted file mode 100755
index e1c4b57c37..0000000000
--- a/connectivity/source/drivers/macab/macab.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!DOCTYPE COMPONENTDESCRIPTION PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name> macab1 </module-name>
- <component-description>
- <Author>Omer bar-or</Author>
- <Name>com.sun.star.comp.sdbc.macab.Driver</Name>
- <description>This library implements the database driver for Mac OS address book formats.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="alpha"/>
- <supported-service>com.sun.star.sdbc.Driver</supported-service>
- <service-dependency> ... </service-dependency>
- </component-description>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
-
- <runtime-module-dependency> cppuhelper </runtime-module-dependency>
- <runtime-module-dependency> cppu1 </runtime-module-dependency>
- <runtime-module-dependency> sal1 </runtime-module-dependency>
-
- <type> com.sun.star.registry.XRegistryKey </type>
- <type> com.sun.star.util.XCancellable </type>
- <type> com.sun.star.util.XNumberFormatter </type>
- <type> com.sun.star.uno.TypeClass </type>
- <type> com.sun.star.uno.XWeak </type>
- <type> com.sun.star.uno.XAggregation </type>
- <type> com.sun.star.uno.XComponentContext </type>
- <type> com.sun.star.beans.PropertyAttribute </type>
- <type> com.sun.star.beans.XPropertyState </type>
- <type> com.sun.star.beans.XPropertySet </type>
- <type> com.sun.star.beans.PropertyValue </type>
- <type> com.sun.star.beans.XMultiPropertySet </type>
- <type> com.sun.star.beans.XFastPropertySet </type>
- <type> com.sun.star.lang.XSingleServiceFactory </type>
- <type> com.sun.star.lang.XTypeProvider </type>
- <type> com.sun.star.lang.XSingleComponentFactory </type>
- <type> com.sun.star.lang.EventObject </type>
- <type> com.sun.star.lang.XComponent </type>
- <type> com.sun.star.lang.IllegalArgumentException </type>
- <type> com.sun.star.lang.DisposedException </type>
- <type> com.sun.star.lang.XMultiServiceFactory </type>
- <type> com.sun.star.lang.XServiceInfo </type>
- <type> com.sun.star.lang.XUnoTunnel </type>
- <type> com.sun.star.java.XJavaThreadRegister_11 </type>
- <type> com.sun.star.java.XJavaVM </type>
- <type> com.sun.star.sdbc.FetchDirection </type>
- <type> com.sun.star.sdbc.XConnection </type>
- <type> com.sun.star.sdbc.XStatement </type>
- <type> com.sun.star.sdbc.XResultSet </type>
- <type> com.sun.star.sdbc.XResultSetMetaDataSupplier</type>
- <type> com.sun.star.sdbc.XColumnLocate </type>
- <type> com.sun.star.sdbc.XResultSetUpdate </type>
- <type> com.sun.star.sdbc.XWarningsSupplier </type>
- <type> com.sun.star.sdbc.XRowUpdate </type>
- <type> com.sun.star.sdbc.XMultipleResults </type>
- <type> com.sun.star.sdbc.XBatchExecution </type>
- <type> com.sun.star.sdbc.XPreparedBatchExecution </type>
- <type> com.sun.star.sdbc.XParameters </type>
- <type> com.sun.star.sdbc.XOutParameters </type>
- <type> com.sun.star.sdbc.DriverPropertyInfo </type>
- <type> com.sun.star.sdbc.SQLWarning </type>
- <type> com.sun.star.sdbc.XRow </type>
- <type> com.sun.star.sdbc.ColumnSearch </type>
- <type> com.sun.star.sdbc.ColumnValue </type>
- <type> com.sun.star.sdbc.DataType </type>
- <type> com.sun.star.sdbc.XDriver </type>
- <type> com.sun.star.sdbc.TransactionIsolation </type>
- <type> com.sun.star.sdbc.ResultSetType </type>
- <type> com.sun.star.sdbc.ResultSetConcurrency </type>
- <type> com.sun.star.sdbcx.XRowLocate </type>
- <type> com.sun.star.sdbcx.XDeleteRows </type>
- <type> com.sun.star.sdbcx.CompareBookmark </type>
- <type> com.sun.star.sdb.XColumnUpdate </type>
- <type> com.sun.star.sdb.XColumn </type>
-</module-description>
diff --git a/connectivity/source/drivers/macab/macab1.component b/connectivity/source/drivers/macab/macab1.component
deleted file mode 100755
index 0a120c0418..0000000000
--- a/connectivity/source/drivers/macab/macab1.component
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.sdbc.macab.Driver">
- <service name="com.sun.star.sdbc.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/macab/macabcondition.cxx b/connectivity/source/drivers/macab/macabcondition.cxx
deleted file mode 100644
index 3faf0aa261..0000000000
--- a/connectivity/source/drivers/macab/macabcondition.cxx
+++ /dev/null
@@ -1,253 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "macabcondition.hxx"
-#include "MacabHeader.hxx"
-#include "MacabRecord.hxx"
-#include "connectivity/CommonTools.hxx"
-
-using namespace ::connectivity::macab;
-using namespace ::com::sun::star::sdbc;
-// -----------------------------------------------------------------------------
-MacabCondition::~MacabCondition()
-{
-}
-// -----------------------------------------------------------------------------
-MacabConditionConstant::MacabConditionConstant(const sal_Bool bValue)
- : MacabCondition(),
- m_bValue(bValue)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionConstant::isAlwaysTrue() const
-{
- return m_bValue;
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionConstant::isAlwaysFalse() const
-{
- return !m_bValue;
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionConstant::eval(const MacabRecord *) const
-{
- return m_bValue;
-}
-// -----------------------------------------------------------------------------
-MacabConditionColumn::MacabConditionColumn(const MacabHeader *header, const ::rtl::OUString &sColumnName) throw(SQLException)
- : MacabCondition(),
- m_nFieldNumber(header->getColumnNumber(sColumnName))
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionColumn::isAlwaysTrue() const
-{
- // Sometimes true, sometimes false
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionColumn::isAlwaysFalse() const
-{
- // Sometimes true, sometimes false
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-MacabConditionNull::MacabConditionNull(const MacabHeader *header, const ::rtl::OUString &sColumnName) throw(SQLException)
- : MacabConditionColumn(header, sColumnName)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionNull::eval(const MacabRecord *aRecord) const
-{
- macabfield *aValue = aRecord->get(m_nFieldNumber);
-
- if(aValue == NULL)
- return sal_True;
- else if(aValue->value == NULL)
- return sal_True;
- else
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-MacabConditionNotNull::MacabConditionNotNull(const MacabHeader *header, const ::rtl::OUString &sColumnName) throw(SQLException)
- : MacabConditionColumn(header, sColumnName)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionNotNull::eval(const MacabRecord *aRecord) const
-{
- macabfield *aValue = aRecord->get(m_nFieldNumber);
-
- if(aValue == NULL)
- return sal_False;
- else if(aValue->value == NULL)
- return sal_False;
- else
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-MacabConditionCompare::MacabConditionCompare(const MacabHeader *header, const ::rtl::OUString &sColumnName, const ::rtl::OUString &sMatchString) throw(SQLException)
- : MacabConditionColumn(header, sColumnName),
- m_sMatchString(sMatchString)
-{
-}
-// -----------------------------------------------------------------------------
-MacabConditionEqual::MacabConditionEqual(const MacabHeader *header, const ::rtl::OUString &sColumnName, const ::rtl::OUString &sMatchString) throw(SQLException)
- : MacabConditionCompare(header, sColumnName, sMatchString)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionEqual::eval(const MacabRecord *aRecord) const
-{
- macabfield *aValue = aRecord->get(m_nFieldNumber);
-
- if(aValue == NULL)
- return sal_False;
-
- macabfield *aValue2 = MacabRecord::createMacabField(m_sMatchString,aValue->type);
-
- if(aValue2 == NULL)
- return sal_False;
-
- sal_Int32 nReturn = MacabRecord::compareFields(aValue, aValue2);
-
- delete aValue2;
- return nReturn == 0;
-}
-// -----------------------------------------------------------------------------
-MacabConditionDifferent::MacabConditionDifferent(const MacabHeader *header, const ::rtl::OUString &sColumnName, const ::rtl::OUString &sMatchString) throw(SQLException)
- : MacabConditionCompare(header, sColumnName, sMatchString)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionDifferent::eval(const MacabRecord *aRecord) const
-{
- macabfield *aValue = aRecord->get(m_nFieldNumber);
-
- if(aValue == NULL)
- return sal_False;
-
- macabfield *aValue2 = MacabRecord::createMacabField(m_sMatchString,aValue->type);
-
- if(aValue2 == NULL)
- return sal_False;
-
- sal_Int32 nReturn = MacabRecord::compareFields(aValue, aValue2);
-
- delete aValue2;
- return nReturn != 0;
-}
-// -----------------------------------------------------------------------------
-MacabConditionSimilar::MacabConditionSimilar(const MacabHeader *header, const ::rtl::OUString &sColumnName, const ::rtl::OUString &sMatchString) throw(SQLException)
- : MacabConditionCompare(header, sColumnName, sMatchString)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionSimilar::eval(const MacabRecord *aRecord) const
-{
- macabfield *aValue = aRecord->get(m_nFieldNumber);
-
- if(aValue == NULL)
- return sal_False;
-
- ::rtl::OUString sName = MacabRecord::fieldToString(aValue);
-
- return match(m_sMatchString, sName, '\0');
-}
-// -----------------------------------------------------------------------------
-MacabConditionBoolean::MacabConditionBoolean(MacabCondition *pLeft, MacabCondition *pRight)
- : MacabCondition(),
- m_pLeft(pLeft),
- m_pRight(pRight)
-{
-}
-// -----------------------------------------------------------------------------
-MacabConditionBoolean::~MacabConditionBoolean()
-{
- delete m_pLeft;
- delete m_pRight;
-}
-// -----------------------------------------------------------------------------
-MacabConditionOr::MacabConditionOr(MacabCondition *pLeft, MacabCondition *pRight)
- : MacabConditionBoolean(pLeft, pRight)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionOr::isAlwaysTrue() const
-{
- return m_pLeft->isAlwaysTrue() || m_pRight->isAlwaysTrue();
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionOr::isAlwaysFalse() const
-{
- return m_pLeft->isAlwaysFalse() && m_pRight->isAlwaysFalse();
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionOr::eval(const MacabRecord *aRecord) const
-{
- // We avoid evaluating terms as much as we can
- if (m_pLeft->isAlwaysTrue() || m_pRight->isAlwaysTrue()) return sal_True;
- if (m_pLeft->isAlwaysFalse() && m_pRight->isAlwaysFalse()) return sal_False;
-
- if (m_pLeft->eval(aRecord)) return sal_True;
- if (m_pRight->eval(aRecord)) return sal_True;
-
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-MacabConditionAnd::MacabConditionAnd(MacabCondition *pLeft, MacabCondition *pRight)
- : MacabConditionBoolean(pLeft, pRight)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionAnd::isAlwaysTrue() const
-{
- return m_pLeft->isAlwaysTrue() && m_pRight->isAlwaysTrue();
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionAnd::isAlwaysFalse() const
-{
- return m_pLeft->isAlwaysFalse() || m_pRight->isAlwaysFalse();
-}
-// -----------------------------------------------------------------------------
-sal_Bool MacabConditionAnd::eval(const MacabRecord *aRecord) const
-{
- // We avoid evaluating terms as much as we can
- if (m_pLeft->isAlwaysFalse() || m_pRight->isAlwaysFalse()) return sal_False;
- if (m_pLeft->isAlwaysTrue() && m_pRight->isAlwaysTrue()) return sal_True;
-
- if (!m_pLeft->eval(aRecord)) return sal_False;
- if (!m_pRight->eval(aRecord)) return sal_False;
-
- return sal_True;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/macabcondition.hxx b/connectivity/source/drivers/macab/macabcondition.hxx
deleted file mode 100644
index 29f27bc52f..0000000000
--- a/connectivity/source/drivers/macab/macabcondition.hxx
+++ /dev/null
@@ -1,170 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_CONDITION_HXX_
-#define _CONNECTIVITY_MACAB_CONDITION_HXX_
-
-#include "MacabHeader.hxx"
-#include "MacabRecord.hxx"
-
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-
-namespace connectivity
-{
- namespace macab
- {
-// -----------------------------------------------------------------------------
-class MacabCondition
-{
- public:
- virtual ~MacabCondition();
- virtual sal_Bool isAlwaysTrue() const = 0;
- virtual sal_Bool isAlwaysFalse() const = 0;
- virtual sal_Bool eval(const MacabRecord *aRecord) const = 0;
-};
-// -----------------------------------------------------------------------------
-class MacabConditionConstant : public MacabCondition
-{
- protected:
- sal_Bool m_bValue;
-
- public:
- MacabConditionConstant(const sal_Bool bValue);
- virtual sal_Bool isAlwaysTrue() const;
- virtual sal_Bool isAlwaysFalse() const;
- virtual sal_Bool eval(const MacabRecord *aRecord) const;
-};
-// -----------------------------------------------------------------------------
-class MacabConditionColumn : public MacabCondition
-{
- protected:
- sal_Int32 m_nFieldNumber;
-
- public:
- MacabConditionColumn(
- const MacabHeader *header,
- const ::rtl::OUString &sColumnName) throw(::com::sun::star::sdbc::SQLException);
- virtual sal_Bool isAlwaysTrue() const;
- virtual sal_Bool isAlwaysFalse() const;
-};
-// -----------------------------------------------------------------------------
-class MacabConditionNull : public MacabConditionColumn
-{
- public:
- MacabConditionNull(
- const MacabHeader *header,
- const ::rtl::OUString &sColumnName) throw(::com::sun::star::sdbc::SQLException);
- virtual sal_Bool eval(const MacabRecord *aRecord) const;
-};
-// -----------------------------------------------------------------------------
-class MacabConditionNotNull : public MacabConditionColumn
-{
- public:
- MacabConditionNotNull(
- const MacabHeader *header,
- const ::rtl::OUString &sColumnName) throw(::com::sun::star::sdbc::SQLException);
- virtual sal_Bool eval(const MacabRecord *aRecord) const;
-};
-// -----------------------------------------------------------------------------
-class MacabConditionCompare : public MacabConditionColumn
-{
- protected:
- const ::rtl::OUString m_sMatchString;
-
- public:
- MacabConditionCompare(
- const MacabHeader *header,
- const ::rtl::OUString &sColumnName,
- const ::rtl::OUString &sMatchString) throw(::com::sun::star::sdbc::SQLException);
-};
-// -----------------------------------------------------------------------------
-class MacabConditionEqual : public MacabConditionCompare
-{
- public:
- MacabConditionEqual(
- const MacabHeader *header,
- const ::rtl::OUString &sColumnName,
- const ::rtl::OUString &sMatchString) throw(::com::sun::star::sdbc::SQLException);
- virtual sal_Bool eval(const MacabRecord *aRecord) const;
-};
-// -----------------------------------------------------------------------------
-class MacabConditionDifferent : public MacabConditionCompare
-{
- public:
- MacabConditionDifferent(
- const MacabHeader *header,
- const ::rtl::OUString &sColumnName,
- const ::rtl::OUString &sMatchString) throw(::com::sun::star::sdbc::SQLException);
- virtual sal_Bool eval(const MacabRecord *aRecord) const;
-};
-// -----------------------------------------------------------------------------
-class MacabConditionSimilar : public MacabConditionCompare
-{
- public:
- MacabConditionSimilar(
- const MacabHeader *header,
- const ::rtl::OUString &sColumnName,
- const ::rtl::OUString &sMatchString) throw(::com::sun::star::sdbc::SQLException);
- virtual sal_Bool eval(const MacabRecord *aRecord) const;
-};
-// -----------------------------------------------------------------------------
-class MacabConditionBoolean : public MacabCondition
-{
- protected:
- MacabCondition *m_pLeft, *m_pRight;
-
- public:
- MacabConditionBoolean(MacabCondition *pLeft, MacabCondition *pRight);
- virtual ~MacabConditionBoolean();
-};
-// -----------------------------------------------------------------------------
-class MacabConditionOr : public MacabConditionBoolean
-{
- public:
- MacabConditionOr(MacabCondition *pLeft, MacabCondition *pRight);
- virtual sal_Bool isAlwaysTrue() const;
- virtual sal_Bool isAlwaysFalse() const;
- virtual sal_Bool eval(const MacabRecord *aRecord) const;
-};
-// -----------------------------------------------------------------------------
-class MacabConditionAnd : public MacabConditionBoolean
-{
- public:
- MacabConditionAnd(MacabCondition *pLeft, MacabCondition *pRight);
- virtual sal_Bool isAlwaysTrue() const;
- virtual sal_Bool isAlwaysFalse() const;
- virtual sal_Bool eval(const MacabRecord *aRecord) const;
-};
-// -----------------------------------------------------------------------------
- }
-}
-
-#endif // _CONNECTIVITY_MACAB_CONDITION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/macaborder.cxx b/connectivity/source/drivers/macab/macaborder.cxx
deleted file mode 100644
index fa8ba7a1ab..0000000000
--- a/connectivity/source/drivers/macab/macaborder.cxx
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "macaborder.hxx"
-#include "MacabHeader.hxx"
-#include "MacabRecord.hxx"
-
-using namespace ::connectivity::macab;
-
-MacabOrder::~MacabOrder()
-{
-}
-// -----------------------------------------------------------------------------
-MacabSimpleOrder::MacabSimpleOrder(MacabHeader *header, ::rtl::OUString &sColumnName, sal_Bool bAscending)
- : MacabOrder(),
- m_nFieldNumber(header->getColumnNumber(sColumnName)),
- m_bAscending(bAscending)
-{
-}
-// -----------------------------------------------------------------------------
-sal_Int32 MacabSimpleOrder::compare(const MacabRecord *record1, const MacabRecord *record2) const
-{
- sal_Int32 result;
-
- result = MacabRecord::compareFields(record1->get(m_nFieldNumber), record2->get(m_nFieldNumber));
-
- if (!m_bAscending) result = -result;
-
- return result;
-}
-// -----------------------------------------------------------------------------
-MacabComplexOrder::MacabComplexOrder()
- : MacabOrder(),
- m_aOrders()
-{
-}
-// -----------------------------------------------------------------------------
-MacabComplexOrder::~MacabComplexOrder()
-{
- for (sal_uInt32 i = 0; i < m_aOrders.size(); i++)
- delete m_aOrders[i];
-}
-// -----------------------------------------------------------------------------
-void MacabComplexOrder::addOrder(MacabOrder *pOrder)
-{
- m_aOrders.push_back(pOrder);
-}
-// -----------------------------------------------------------------------------
-sal_Int32 MacabComplexOrder::compare(const MacabRecord *record1, const MacabRecord *record2) const
-{
- for (sal_uInt32 i = 0; i < m_aOrders.size(); i++)
- {
- const MacabOrder *pOrder = m_aOrders[i];
- sal_Int32 result = pOrder->compare(record1, record2);
-
- if (result) return result;
- }
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/macaborder.hxx b/connectivity/source/drivers/macab/macaborder.hxx
deleted file mode 100644
index bad4bc8133..0000000000
--- a/connectivity/source/drivers/macab/macaborder.hxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_ORDER_HXX_
-#define _CONNECTIVITY_MACAB_ORDER_HXX_
-
-#include "rtl/ustring.hxx"
-#include "MacabHeader.hxx"
-#include "MacabRecord.hxx"
-
-#include <vector>
-
-namespace connectivity
-{
- namespace macab
- {
- class MacabOrder
- {
- public:
- virtual ~MacabOrder();
-
- virtual sal_Int32 compare(const MacabRecord *record1, const MacabRecord *record2) const = 0;
- };
-
- class MacabSimpleOrder : public MacabOrder
- {
- sal_Int32 m_nFieldNumber;
- sal_Bool m_bAscending;
-
- public:
- MacabSimpleOrder(MacabHeader *header, ::rtl::OUString &sColumnName, sal_Bool bAscending);
-
- virtual sal_Int32 compare(const MacabRecord *record1, const MacabRecord *record2) const;
- };
-
- class MacabComplexOrder : public MacabOrder
- {
- ::std::vector<MacabOrder *> m_aOrders;
-
- public:
- MacabComplexOrder();
- virtual ~MacabComplexOrder();
-
- void addOrder(MacabOrder *pOrder);
- virtual sal_Int32 compare(const MacabRecord *record1, const MacabRecord *record2) const;
- };
- }
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/macabutilities.hxx b/connectivity/source/drivers/macab/macabutilities.hxx
deleted file mode 100644
index 237a7e4456..0000000000
--- a/connectivity/source/drivers/macab/macabutilities.hxx
+++ /dev/null
@@ -1,152 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MACAB_UTILITIES_HXX_
-#define _CONNECTIVITY_MACAB_UTILITIES_HXX_
-
-#include <com/sun/star/util/DateTime.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-
-#include <time.h>
-#include <premac.h>
-#include <Carbon/Carbon.h>
-#include <AddressBook/ABAddressBookC.h>
-#include <postmac.h>
-
-namespace connectivity
-{
- namespace macab
- {
- // -------------------------------------------------------------------------
- inline ::rtl::OUString CFStringToOUString(const CFStringRef sOrig)
- {
- /* Copied all-but directly from code by Florian Heckl in
- * cws_src680_aquafilepicker01
- * File was: fpicker/source/aqua/CFStringUtilities
- * I only removed commented debugging lines and changed variable
- * names.
- */
- if (NULL == sOrig) {
- return rtl::OUString();
- }
-
- CFRetain(sOrig);
- CFIndex nStringLength = CFStringGetLength(sOrig);
-
- UniChar unichars[nStringLength+1];
-
- //'close' the string buffer correctly
- unichars[nStringLength] = '\0';
-
- CFStringGetCharacters (sOrig, CFRangeMake(0,nStringLength), unichars);
- CFRelease(sOrig);
-
- return rtl::OUString(unichars);
- }
-
- // -------------------------------------------------------------------------
- inline CFStringRef OUStringToCFString(const ::rtl::OUString& aString)
- {
- /* Copied directly from code by Florian Heckl in
- * cws_src680_aquafilepicker01
- * File was: fpicker/source/aqua/CFStringUtilities
- */
-
- CFStringRef ref = CFStringCreateWithCharacters(kCFAllocatorDefault, aString.getStr(), aString.getLength());
-
- return ref;
- }
-
- // -------------------------------------------------------------------------
- inline com::sun::star::util::DateTime CFDateToDateTime(const CFDateRef _cfDate)
- {
- /* Carbon can give us the time since 2001 of any CFDateRef,
- * and it also stores the time since 1970 as a constant,
- * basically allowing us to get the unixtime of any
- * CFDateRef. From there, it is just a matter of choosing what
- * we want to do with it.
- */
- com::sun::star::util::DateTime nRet;
- double timeSince2001 = CFDateGetAbsoluteTime(_cfDate);
- time_t unixtime = timeSince2001+kCFAbsoluteTimeIntervalSince1970;
- struct tm *ptm = localtime(&unixtime);
- nRet.Year = ptm->tm_year+1900;
- nRet.Month = ptm->tm_mon+1;
- nRet.Day = ptm->tm_mday;
- nRet.Hours = ptm->tm_hour;
- nRet.Minutes = ptm->tm_min;
- nRet.Seconds = ptm->tm_sec;
- nRet.HundredthSeconds = 0;
- return nRet;
- }
-
- // -------------------------------------------------------------------------
- inline ::rtl::OUString fixLabel(const ::rtl::OUString _originalLabel)
- {
- /* Get the length, and make sure that there is actually a string
- * here.
- */
- if(_originalLabel.indexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_$!<"))) == 0)
- {
- return _originalLabel.copy(4,_originalLabel.getLength()-8);
- }
-
- return _originalLabel;
- }
-
- // -------------------------------------------------------------------------
- inline sal_Int32 ABTypeToDataType(const ABPropertyType _abType)
- {
- sal_Int32 dataType;
- switch(_abType)
- {
- case kABStringProperty:
- dataType = ::com::sun::star::sdbc::DataType::CHAR;
- break;
- case kABDateProperty:
- dataType = ::com::sun::star::sdbc::DataType::TIMESTAMP;
- break;
- case kABIntegerProperty:
- dataType = ::com::sun::star::sdbc::DataType::INTEGER;
- break;
- case kABRealProperty:
- dataType = ::com::sun::star::sdbc::DataType::FLOAT;
- break;
- default:
- dataType = -1;
- }
- return dataType;
- }
-
- void impl_throwError(sal_uInt16 _nErrorId);
- }
-}
-
-#endif // _ CONNECTIVITY_MACAB_UTILITIES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk
deleted file mode 100755
index b2e8db65dc..0000000000
--- a/connectivity/source/drivers/macab/makefile.mk
+++ /dev/null
@@ -1,138 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=macab
-TARGET2=$(TARGET)drv
-VISIBILITY_HIDDEN=TRUE
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-.IF "$(GUI)" == "UNX"
-.IF "$(OS)" == "MACOSX"
-
-# === MACAB base library ==========================
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/MacabDriver.obj \
- $(SLO)$/MacabServices.obj
-
-DEPOBJFILES= \
- $(SLO2FILES)
-
-# --- Library -----------------------------------
-
-SHL1TARGET= $(TARGET)$(MACAB_MAJOR)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(DBTOOLSLIB) \
- $(SALHELPERLIB) \
- $(SALLIB)
-
-SHL1DEPN=
-SHL1IMPLIB= i$(TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-
-# === MACAB impl library ==========================
-
-# --- Files -------------------------------------
-
-SLO2FILES=\
- $(SLO)$/MacabColumns.obj \
- $(SLO)$/MacabTable.obj \
- $(SLO)$/MacabTables.obj \
- $(SLO)$/MacabCatalog.obj \
- $(SLO)$/MacabResultSet.obj \
- $(SLO)$/MacabStatement.obj \
- $(SLO)$/MacabPreparedStatement.obj \
- $(SLO)$/MacabDatabaseMetaData.obj \
- $(SLO)$/MacabConnection.obj \
- $(SLO)$/MacabResultSetMetaData.obj \
- $(SLO)$/macabcondition.obj \
- $(SLO)$/macaborder.obj \
- $(SLO)$/MacabRecord.obj \
- $(SLO)$/MacabRecords.obj \
- $(SLO)$/MacabHeader.obj \
- $(SLO)$/MacabGroup.obj \
- $(SLO)$/MacabAddressBook.obj
-
-MACAB_LIB=-framework Carbon -framework AddressBook
-
-# --- Library -----------------------------------
-
-SHL2TARGET= $(TARGET2)$(MACAB_MAJOR)
-SHL2OBJS=$(SLO2FILES)
-SHL2STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALHELPERLIB) \
- $(SALLIB) \
- $(DBTOOLSLIB) \
- $(COMPHELPERLIB) \
- $(MACAB_LIB)
-
-SHL2DEPN=
-SHL2IMPLIB= i$(TARGET2)
-
-SHL2DEF= $(MISC)$/$(SHL2TARGET).def
-
-DEF2NAME= $(SHL2TARGET)
-
-# --- Targets -----------------------------------
-.ELSE # "$(OS)" == "MACOSX"
-dummy:
- @echo Not using Mac OS X - nothing to build
-.ENDIF
-
-.ELSE # "$(GUI)" == "UNX"
-dummy:
- @echo "Nothing to build for GUI $(GUI)"
-.ENDIF
-
-.INCLUDE : $(PRJ)$/target.pmk
-
-
-ALLTAR : $(MISC)/macab1.component
-
-$(MISC)/macab1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- macab1.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt macab1.component
diff --git a/connectivity/source/drivers/mozab/MCatalog.cxx b/connectivity/source/drivers/mozab/MCatalog.cxx
deleted file mode 100644
index 4cf7492772..0000000000
--- a/connectivity/source/drivers/mozab/MCatalog.cxx
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "MCatalog.hxx"
-#include "MConnection.hxx"
-#include "MTables.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <cppuhelper/interfacecontainer.h>
-
-// -------------------------------------------------------------------------
-using namespace connectivity::mozab;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::cppu;
-
-// -------------------------------------------------------------------------
-OCatalog::OCatalog(OConnection* _pCon) : connectivity::sdbcx::OCatalog(_pCon)
- ,m_pConnection(_pCon)
- ,m_xMetaData(m_pConnection->getMetaData( ))
-{
-// osl_incrementInterlockedCount( &m_refCount );
-// refreshTables();
-// refreshViews();
-// refreshGroups();
-// refreshUsers();
-// osl_decrementInterlockedCount( &m_refCount );
-}
-// -------------------------------------------------------------------------
-void OCatalog::refreshTables()
-{
- TStringVector aVector;
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%"));
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%")),::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%")),aTypes);
-
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- ::rtl::OUString aName;
- while(xResult->next())
- {
- aName = xRow->getString(3);
- aVector.push_back(aName);
- }
- }
- if(m_pTables)
- m_pTables->reFill(aVector);
- else
- m_pTables = new OTables(m_xMetaData,*this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void OCatalog::refreshViews()
-{
-}
-// -------------------------------------------------------------------------
-void OCatalog::refreshGroups()
-{
-}
-// -------------------------------------------------------------------------
-void OCatalog::refreshUsers()
-{
-}
-// -------------------------------------------------------------------------
-const ::rtl::OUString& OCatalog::getDot()
-{
- static const ::rtl::OUString sDot = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("."));
- return sDot;
-}
-// -----------------------------------------------------------------------------
-
-// XTablesSupplier
-Reference< XNameAccess > SAL_CALL OCatalog::getTables( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(rBHelper.bDisposed);
-
- try
- {
- if(!m_pTables || m_pConnection->getForceLoadTables())
- refreshTables();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return const_cast<OCatalog*>(this)->m_pTables;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MCatalog.hxx b/connectivity/source/drivers/mozab/MCatalog.hxx
deleted file mode 100644
index cc57748fe1..0000000000
--- a/connectivity/source/drivers/mozab/MCatalog.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_MOZAB_CATALOG_HXX_
-#define _CONNECTIVITY_MOZAB_CATALOG_HXX_
-
-#include "connectivity/sdbcx/VCatalog.hxx"
-
-namespace connectivity
-{
- namespace mozab
- {
- // please don't name the class the same name as in an other namespaces
- // some compilers have problems with this task as I noticed on windows
- class OConnection;
- class OCatalog : public connectivity::sdbcx::OCatalog
- {
- OConnection* m_pConnection; // used to get the metadata
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData; // just to make things easier
-
- public:
- // implementation of the pure virtual methods
- virtual void refreshTables();
- virtual void refreshViews() ;
- virtual void refreshGroups();
- virtual void refreshUsers() ;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTables( ) throw(::com::sun::star::uno::RuntimeException);
- public:
- OCatalog(OConnection* _pCon);
-
- OConnection* getConnection() const { return m_pConnection; }
- sdbcx::OCollection* getPrivateTables() const { return m_pTables;}
- sdbcx::OCollection* getPrivateViews() const { return m_pViews; }
-
- static const ::rtl::OUString& getDot();
- };
- }
-}
-#endif // _CONNECTIVITY_MOZAB_CATALOG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MColumnAlias.cxx b/connectivity/source/drivers/mozab/MColumnAlias.cxx
deleted file mode 100644
index 7cbd66ae72..0000000000
--- a/connectivity/source/drivers/mozab/MColumnAlias.cxx
+++ /dev/null
@@ -1,195 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <sal/macros.h>
-#include "MColumnAlias.hxx"
-#include "MConnection.hxx"
-#include "MExtConfigAccess.hxx"
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-
-#include <tools/diagnose_ex.h>
-
-#include <algorithm>
-#include <functional>
-
-using namespace ::connectivity;
-using namespace ::connectivity::mozab;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-
-//------------------------------------------------------------------------------
-OColumnAlias::OColumnAlias( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB )
-{
- static const sal_Char* s_pProgrammaticNames[] =
- {
- "FirstName",
- "LastName",
- "DisplayName",
- "NickName",
- "PrimaryEmail",
- "SecondEmail",
- "PreferMailFormat",
- "WorkPhone",
- "HomePhone",
- "FaxNumber",
- "PagerNumber",
- "CellularNumber",
- "HomeAddress",
- "HomeAddress2",
- "HomeCity",
- "HomeState",
- "HomeZipCode",
- "HomeCountry",
- "WorkAddress",
- "WorkAddress2",
- "WorkCity",
- "WorkState",
- "WorkZipCode",
- "WorkCountry",
- "JobTitle",
- "Department",
- "Company",
- "WebPage1",
- "WebPage2",
- "BirthYear",
- "BirthMonth",
- "BirthDay",
- "Custom1",
- "Custom2",
- "Custom3",
- "Custom4",
- "Notes",
- };
-
- for ( size_t i = 0; i < SAL_N_ELEMENTS( s_pProgrammaticNames ); ++i )
- m_aAliasMap[ ::rtl::OUString::createFromAscii( s_pProgrammaticNames[i] ) ] = AliasEntry( s_pProgrammaticNames[i], i );
-
- initialize( _rxORB );
-}
-
-//------------------------------------------------------------------------------
-void OColumnAlias::initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB )
-{
- // open our driver settings config node
-
- // the config path for our own driver's settings
- Reference< XPropertySet > xDriverNode = createDriverConfigNode( _rxORB );
- if ( xDriverNode.is() )
- {
- try
- {
- //.............................................................
- Reference< XNameAccess > xAliasesNode;
- xDriverNode->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ColumnAliases")) ) >>= xAliasesNode;
- OSL_ENSURE( xAliasesNode.is(), "OColumnAlias::setAlias: missing the aliases node!" );
-
- // this is a set of string nodes
- Sequence< ::rtl::OUString > aProgrammaticNames;
- if ( xAliasesNode.is() )
- aProgrammaticNames = xAliasesNode->getElementNames();
-
- //.............................................................
- // travel through all the set elements
- const ::rtl::OUString* pProgrammaticNames = aProgrammaticNames.getConstArray();
- const ::rtl::OUString* pProgrammaticNamesEnd = pProgrammaticNames + aProgrammaticNames.getLength();
- ::rtl::OUString sAssignedAlias;
-
- for ( ; pProgrammaticNames < pProgrammaticNamesEnd; ++pProgrammaticNames )
- {
- OSL_VERIFY( xAliasesNode->getByName( *pProgrammaticNames ) >>= sAssignedAlias );
-
- // normalize in case the config data is corrupted
- // (what we really don't need is an empty alias ...)
- if ( 0 == sAssignedAlias.getLength() )
- sAssignedAlias = *pProgrammaticNames;
-
- ::rtl::OString sAsciiProgrammaticName( ::rtl::OUStringToOString( *pProgrammaticNames, RTL_TEXTENCODING_ASCII_US ) );
- //.............................................................
- #if OSL_DEBUG_LEVEL > 0
- bool bFound = false;
- #endif
- for ( AliasMap::iterator search = m_aAliasMap.begin();
- ( search != m_aAliasMap.end() );
- ++search
- )
- {
- if ( search->second.programmaticAsciiName.equals( sAsciiProgrammaticName ) )
- {
- AliasEntry entry( search->second );
- m_aAliasMap.erase( search );
- m_aAliasMap[ sAssignedAlias ] = entry;
-
- #if OSL_DEBUG_LEVEL > 0
- bFound = true;
- #endif
-
- break;
- }
- }
-
- OSL_ENSURE( bFound, "OColumnAlias::setAlias: did not find a programmatic name which exists in the configuration!" );
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
-}
-
-//------------------------------------------------------------------
-::rtl::OString OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias( const ::rtl::OUString& _rAlias ) const
-{
- AliasMap::const_iterator pos = m_aAliasMap.find( _rAlias );
- if ( pos == m_aAliasMap.end() )
- {
- OSL_FAIL( "OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias: no programmatic name for this alias!" );
- return ::rtl::OUStringToOString( _rAlias, RTL_TEXTENCODING_UTF8 );
- }
- return pos->second.programmaticAsciiName;
-}
-
-//------------------------------------------------------------------
-bool OColumnAlias::isColumnSearchable( const ::rtl::OUString _alias ) const
-{
- ::rtl::OString sProgrammatic = getProgrammaticNameOrFallbackToUTF8Alias( _alias );
-
- return ( !sProgrammatic.equals( "HomeCountry" )
- && !sProgrammatic.equals( "WorkCountry" )
- );
- // for those, we know that they're not searchable in the Mozilla/LDAP implementation.
- // There might be more ...
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MColumnAlias.hxx b/connectivity/source/drivers/mozab/MColumnAlias.hxx
deleted file mode 100644
index 4aa9c07d7f..0000000000
--- a/connectivity/source/drivers/mozab/MColumnAlias.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _CONNECTIVITY_MAB_COLUMNALIAS_HXX_
-#define _CONNECTIVITY_MAB_COLUMNALIAS_HXX_
-
-#include <unotools/confignode.hxx>
-
-#include <osl/mutex.hxx>
-#include <vector>
-#include <boost/unordered_map.hpp>
-
-namespace connectivity
-{
- namespace mozab
- {
- class OColumnAlias
- {
- public:
- struct AliasEntry
- {
- ::rtl::OString programmaticAsciiName;
- sal_Int32 columnPosition;
-
- AliasEntry()
- :programmaticAsciiName()
- ,columnPosition( 0 )
- {
- }
- AliasEntry( const sal_Char* _programmaticAsciiName, sal_Int32 _columnPosition )
- :programmaticAsciiName( _programmaticAsciiName )
- ,columnPosition( _columnPosition )
- {
- }
- };
- typedef ::boost::unordered_map< ::rtl::OUString, AliasEntry, ::rtl::OUStringHash > AliasMap;
-
- private:
- AliasMap m_aAliasMap;
-
- public:
- OColumnAlias( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
-
- inline bool hasAlias( const ::rtl::OUString& _rAlias ) const
- {
- return m_aAliasMap.find( _rAlias ) != m_aAliasMap.end();
- }
- ::rtl::OString getProgrammaticNameOrFallbackToUTF8Alias( const ::rtl::OUString& _rAlias ) const;
-
- inline AliasMap::const_iterator begin() const { return m_aAliasMap.begin(); }
- inline AliasMap::const_iterator end() const { return m_aAliasMap.end(); }
-
- bool isColumnSearchable( const ::rtl::OUString _alias ) const;
-
- private:
- void initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB );
- };
- }
-}
-#endif // _CONNECTIVITY_MAB_COLUMNALIAS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MColumns.cxx b/connectivity/source/drivers/mozab/MColumns.cxx
deleted file mode 100644
index 9e81cfdc0b..0000000000
--- a/connectivity/source/drivers/mozab/MColumns.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "MColumns.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include "MTable.hxx"
-#include "MTables.hxx"
-#include "MCatalog.hxx"
-#include <comphelper/types.hxx>
-#include "connectivity/dbtools.hxx"
-
-using namespace ::comphelper;
-
-
-using namespace connectivity::mozab;
-using namespace connectivity::sdbcx;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
-{
- Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns(Any(),
- m_pTable->getSchema(),m_pTable->getTableName(),_rName);
-
- sdbcx::ObjectType xRet = NULL;
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- {
- if(xRow->getString(4) == _rName)
- {
- sal_Int32 nType = xRow->getInt(5);
- ::rtl::OUString sTypeName = xRow->getString(6);
- sal_Int32 nPrec = xRow->getInt(7);
-
- OColumn* pRet = new OColumn(_rName,
- sTypeName,
- xRow->getString(13),
- xRow->getString(12),
- xRow->getInt(11),
- nPrec,
- xRow->getInt(9),
- nType,
- sal_False,sal_False,sal_False,sal_True);
- xRet = pRet;
- break;
- }
- }
- }
-
- return xRet;
-}
-
-// -------------------------------------------------------------------------
-void OColumns::impl_refresh() throw(RuntimeException)
-{
- m_pTable->refreshColumns();
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MColumns.hxx b/connectivity/source/drivers/mozab/MColumns.hxx
deleted file mode 100644
index ffa11ed4af..0000000000
--- a/connectivity/source/drivers/mozab/MColumns.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MOZAB_COLUMNS_HXX_
-#define _CONNECTIVITY_MOZAB_COLUMNS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include "connectivity/sdbcx/IRefreshable.hxx"
-#include "MTable.hxx"
-
-namespace connectivity
-{
- namespace mozab
- {
- class OColumns : public sdbcx::OCollection
- {
- protected:
- OTable* m_pTable;
-
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- public:
- OColumns( OTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector
- ) : sdbcx::OCollection(*_pTable,sal_True,_rMutex,_rVector)
- ,m_pTable(_pTable)
- {}
- };
- }
-}
-#endif // _CONNECTIVITY_MOZAB_COLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MConfigAccess.cxx b/connectivity/source/drivers/mozab/MConfigAccess.cxx
deleted file mode 100644
index 4609b10985..0000000000
--- a/connectivity/source/drivers/mozab/MConfigAccess.cxx
+++ /dev/null
@@ -1,271 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MConfigAccess.hxx"
-#include "MExtConfigAccess.hxx"
-#include "MConnection.hxx"
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-
-//.........................................................................
-namespace connectivity
-{
- namespace mozab
- {
- //-----------------------------------------------------------------
- Reference< XPropertySet > createDriverConfigNode( Reference< XMultiServiceFactory > _rxORB )
- {
- Reference< XPropertySet > xNode;
- try
- {
- //=============================================================
- // create the config provider
- Reference< XMultiServiceFactory > xConfigProvider(
- _rxORB->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider" )) ),
- UNO_QUERY
- );
- OSL_ENSURE( xConfigProvider.is(), "createDriverConfigNode: could not create the config provider!" );
-
- if ( xConfigProvider.is() )
- {
- ::rtl::OUString sCompleteNodePath(RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.DataAccess/DriverSettings/" ));
- sCompleteNodePath += OConnection::getDriverImplementationName();
-
- //=========================================================
- // arguments for creating the config access
- Sequence< Any > aArguments(2);
- // the path to the node to open
- aArguments[0] <<= PropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("nodepath")),
- 0,
- makeAny( sCompleteNodePath ),
- PropertyState_DIRECT_VALUE
- );
- // the depth: -1 means unlimited
- aArguments[1] <<= PropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("depth")),
- 0,
- makeAny( (sal_Int32)-1 ),
- PropertyState_DIRECT_VALUE
- );
-
- //=========================================================
- // create the access
- Reference< XInterface > xAccess = xConfigProvider->createInstanceWithArguments(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess" )),
- aArguments
- );
- OSL_ENSURE( xAccess.is(), "createDriverConfigNode: invalid access returned (should throw an exception instead)!" );
-
- xNode = xNode.query( xAccess );
- }
- }
- catch( const Exception& )
- {
- OSL_FAIL( "createDriverConfigNode: caught an exception while accessing the driver's config node!" );
- }
-
- // outta here
- return xNode;
- }
-
- //-----------------------------------------------------------------
- namespace
- {
- // a private helper to accessing the point where we store the reference
- // to the factory
- Reference< XMultiServiceFactory >& accessFactoryStorage( )
- {
- static Reference< XMultiServiceFactory > xMozabServiceFactory;
- return xMozabServiceFactory;
- }
- }
-
- //-----------------------------------------------------------------
- void setMozabServiceFactory( const Reference< XMultiServiceFactory >& _rxFactory )
- {
- accessFactoryStorage( ) = _rxFactory;
- }
-
- //-----------------------------------------------------------------
- const Reference< XMultiServiceFactory >& getMozabServiceFactory( )
- {
- return accessFactoryStorage( );
- }
-
- //-----------------------------------------------------------------
- ::rtl::OUString getDescription(const sal_Char* sNode,const ::rtl::OUString & sDefault)
- {
- ::rtl::OUString sPreferredName;
- ::rtl::OUString sDescription;
-
- Reference< XMultiServiceFactory > xFactory = getMozabServiceFactory();
- OSL_ENSURE( xFactory.is(), "getPreferredProfileName: invalid service factory!" );
- if ( xFactory.is() )
- {
- try
- {
- Reference< XPropertySet > xDriverNode = createDriverConfigNode( xFactory );
- Reference< XPropertySet > xMozPrefsNode;
- if ( xDriverNode.is() )
- xDriverNode->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("MozillaPreferences" )) ) >>= xMozPrefsNode;
- OSL_ENSURE( xMozPrefsNode.is(), "getPreferredProfileName: could not access the node for the mozilla preferences!" );
- if ( xMozPrefsNode.is() )
- xMozPrefsNode->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ProfileName" )) ) >>= sPreferredName;
- if ( xMozPrefsNode.is() )
- xMozPrefsNode->getPropertyValue( ::rtl::OUString::createFromAscii(sNode) ) >>= sDescription;
- if (sDescription.getLength() == 0)
- sDescription = sDefault;
- }
- catch( const Exception& )
- {
- OSL_FAIL( "getDescription: caught an exception!" );
- }
- }
- if (sDescription.getLength() == 0)
- sDescription = sDefault;
- return sDescription;
- }
- //-----------------------------------------------------------------
- ::rtl::OUString getPreferredProfileName( )
- {
- ::rtl::OUString sPreferredName;
-
- Reference< XMultiServiceFactory > xFactory = getMozabServiceFactory();
- OSL_ENSURE( xFactory.is(), "getPreferredProfileName: invalid service factory!" );
- if ( xFactory.is() )
- {
- try
- {
- Reference< XPropertySet > xDriverNode = createDriverConfigNode( xFactory );
- Reference< XPropertySet > xMozPrefsNode;
- if ( xDriverNode.is() )
- xDriverNode->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("MozillaPreferences" )) ) >>= xMozPrefsNode;
- OSL_ENSURE( xMozPrefsNode.is(), "getPreferredProfileName: could not access the node for the mozilla preferences!" );
- if ( xMozPrefsNode.is() )
- xMozPrefsNode->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ProfileName" )) ) >>= sPreferredName;
- }
- catch( const Exception& )
- {
- OSL_FAIL( "getPreferredProfileName: caught an exception!" );
- }
- }
- return sPreferredName;
- }
- }
-}
-
-//.........................................................................
-
-//-------------------------------------------------------------------------
-extern "C" const sal_Unicode* SAL_CALL getUserProfile( void )
-{
- static sal_Bool bReadConfig = sal_False;
- static ::rtl::OUString sUserProfile;
- if ( !bReadConfig )
- {
- sUserProfile = ::connectivity::mozab::getPreferredProfileName( );
- bReadConfig = sal_True;
- }
-
- return sUserProfile.getStr();
-}
-//------------------------------------------------------------------------
-extern "C" const sal_Char* SAL_CALL getPabDescription( void )
-{
- static sal_Bool bReadConfig = sal_False;
- static ::rtl::OUString usPabDescription;
- static ::rtl::OString sPabDescription;
-
- if ( !bReadConfig )
- {
- usPabDescription = ::connectivity::mozab::getDescription(
- "PabDescription" ,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Personal Address Book" )));
- sPabDescription = ::rtl::OUStringToOString( usPabDescription,
- RTL_TEXTENCODING_UTF8);
- bReadConfig = sal_True;
- }
-
- return sPabDescription.getStr();
-}
-
-//-------------------------------------------------------------------------
-extern "C" const sal_Char* SAL_CALL getHisDescription( void )
-{
- static sal_Bool bReadConfig = sal_False;
- static ::rtl::OUString usHisDescription;
- static ::rtl::OString sHisDescription;
-
- if ( !bReadConfig )
- {
- usHisDescription = ::connectivity::mozab::getDescription(
- "HisDescription" ,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Collected Addresses" )));
- sHisDescription = ::rtl::OUStringToOString( usHisDescription,
- RTL_TEXTENCODING_UTF8);
- bReadConfig = sal_True;
- }
-
- return sHisDescription.getStr();
-}
-
-//-------------------------------------------------------------------------
-// MConfigAccess was invented to allow non-UNO parts access to the configuration.
-// Unfortunately, configuration access requires a XMultiServiceFactory - which the
-// mozilla side does not have.
-// So we create a "library-local" service factory here: Every need for a service
-// factory can be fullfilled by this factory (similar to the get/setProcessServiceFactory
-// in comphelper).
-// This is halfway valid, as usually, the mozabdrv library is invoked from the mozab library
-// only. The latter contains the driver class (and only this class and nothing more), and
-// the driver class is a singleton. The driver itself is created with a service factory,
-// which (by definition) can and should be used for all subsequent service requests.
-// And this is exactly what we're allowing with the following functions ....
-
-/** _pFactory must point to an XMultiServiceFactory, which must be aquired once
- for purpose of safely transfering it. The callee will release this interface
- when it has stored the pointer somewhere else.
-*/
-extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL setMozabServiceFactory(
- void* _pFactory )
-{
- Reference< XMultiServiceFactory > xFactory = static_cast< XMultiServiceFactory* >( _pFactory );
- ::connectivity::mozab::setMozabServiceFactory( xFactory );
-
- // by definition, the object behind the interface pointer has been acquired once for purpose
- // of safely transporting it
- xFactory->release();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MConfigAccess.hxx b/connectivity/source/drivers/mozab/MConfigAccess.hxx
deleted file mode 100644
index 7b66797a1f..0000000000
--- a/connectivity/source/drivers/mozab/MConfigAccess.hxx
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_MOZAB_MCONFIGACCESS_HXX
-
-#include <sal/types.h>
-
-extern "C" const sal_Unicode* SAL_CALL getUserProfile( void );
-
-extern "C" const sal_Char* SAL_CALL getPabDescription( void );
-
-extern "C" const sal_Char* SAL_CALL getHisDescription( void );
-
-#endif // CONNECTIVITY_MOZAB_MCONFIGACCESS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MConnection.cxx b/connectivity/source/drivers/mozab/MConnection.cxx
deleted file mode 100644
index f7bb24e053..0000000000
--- a/connectivity/source/drivers/mozab/MConnection.cxx
+++ /dev/null
@@ -1,607 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "diagnose_ex.h"
-#include "MConnection.hxx"
-#include "MDatabaseMetaData.hxx"
-#include "MDriver.hxx"
-#include "MColumnAlias.hxx"
-#include "MStatement.hxx"
-#include "MPreparedStatement.hxx"
-
-#include <connectivity/dbcharset.hxx>
-#include <connectivity/dbexception.hxx>
-#include <connectivity/sqlerror.hxx>
-
-#include "resource/mozab_res.hrc"
-#include "resource/common_res.hrc"
-
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/TransactionIsolation.hpp>
-
-#include <comphelper/officeresourcebundle.hxx>
-
-#if OSL_DEBUG_LEVEL > 0
-# define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr())
-#else /* OSL_DEBUG_LEVEL */
-# define OUtoCStr( x ) ("dummy")
-#endif /* OSL_DEBUG_LEVEL */
-
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL OMozabConnection_CreateInstance(
- void* _pDriver)
-{
- return (new connectivity::mozab::OConnection( reinterpret_cast<connectivity::mozab::MozabDriver*>(_pDriver) ));
-}
-
-using namespace dbtools;
-
-//------------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-// --------------------------------------------------------------------------------
-
-namespace connectivity { namespace mozab {
-
-// =====================================================================
-// = ConnectionImplData
-// =====================================================================
-struct ConnectionImplData
-{
- ::boost::shared_ptr< ::comphelper::OfficeResourceBundle > pResourceBundle;
-};
-
-// -----------------------------------------------------------------------------
-#ifdef __MINGW32__
-extern "C"
-#endif
-const sal_Char* getSdbcScheme( SdbcScheme _eScheme )
-{
- switch ( _eScheme )
- {
- case SDBC_MOZILLA: return "mozilla";
- case SDBC_THUNDERBIRD: return "thunderbird";
- case SDBC_LDAP: return "ldap";
- case SDBC_OUTLOOK_MAPI: return "outlook";
- case SDBC_OUTLOOK_EXPRESS: return "outlookexp";
- }
- return NULL;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OConnection::getDriverImplementationName()
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MOZAB_DRIVER_IMPL_NAME));
-}
-
-// -----------------------------------------------------------------------------
-const sal_Char* getSchemeURI( MozillaScheme _eScheme )
-{
- switch ( _eScheme )
- {
- case SCHEME_MOZILLA : return "moz-abdirectory://";
- case SCHEME_MOZILLA_MDB : return "moz-abmdbdirectory://";
- case SCHEME_LDAP : return "moz-abldapdirectory://";
- case SCHEME_OUTLOOK_MAPI : return "moz-aboutlookdirectory://op/";
- case SCHEME_OUTLOOK_EXPRESS : return "moz-aboutlookdirectory://oe/";
- }
- return NULL;
-}
-
-// -----------------------------------------------------------------------------
-
-OConnection::OConnection(MozabDriver* _pDriver)
- :OSubComponent<OConnection, OConnection_BASE>((::cppu::OWeakObject*)_pDriver, this)
- ,m_pDriver(_pDriver)
- ,m_pImplData( new ConnectionImplData )
- ,m_aColumnAlias( _pDriver->getMSFactory() )
- ,m_nMaxResultRecords( -1 )
- ,m_aNameMapper(NULL)
- ,m_eSDBCAddressType(SDBCAddress::Unknown)
- ,m_bForceLoadTable(false)
-{
- m_pDriver->acquire();
-
-}
-//-----------------------------------------------------------------------------
-OConnection::~OConnection()
-{
- acquire();
- if(!isClosed())
- close();
- m_pDriver->release();
- m_pDriver = NULL;
-}
-//-----------------------------------------------------------------------------
-void SAL_CALL OConnection::release() throw()
-{
- relase_ChildImpl();
-}
-// -----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyValue >& info) throw(SQLException)
-{
- OSL_TRACE("IN OConnection::construct()\n" );
- // open file
- setURL(url);
- //
- // Skip 'sdbc:mozab: part of URL
- //
- sal_Int32 nLen = url.indexOf(':');
- nLen = url.indexOf(':',nLen+1);
- OSL_ENSURE( url.copy( 0, nLen ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:address" ) ), "OConnection::construct: invalid start of the URI - should never have survived XDriver::acceptsURL!" );
-
- ::rtl::OUString aAddrbookURI(url.copy(nLen+1));
- // Get Scheme
- nLen = aAddrbookURI.indexOf(':');
- ::rtl::OUString aAddrbookScheme;
- ::rtl::OUString sAdditionalInfo;
- if ( nLen == -1 )
- {
- // There isn't any subschema: - but could be just subschema
- if ( aAddrbookURI.getLength() > 0 )
- {
- aAddrbookScheme= aAddrbookURI;
- }
- else
- {
- OSL_TRACE( "No subschema given!!!\n");
- throwSQLException( STR_URI_SYNTAX_ERROR, *this );
- }
- }
- else
- {
- aAddrbookScheme = aAddrbookURI.copy(0, nLen);
- sAdditionalInfo = aAddrbookURI.copy( nLen + 1 );
- }
-
- OSL_TRACE("URI = %s\n", ((OUtoCStr(aAddrbookURI)) ? (OUtoCStr(aAddrbookURI)):("NULL")) );
- OSL_TRACE("Scheme = %s\n", ((OUtoCStr(aAddrbookScheme)) ? (OUtoCStr(aAddrbookScheme)):("NULL")) );
-
- //
- // Now we have a URI convert it to a MozillaURI
- //
- // The Mapping being used is:
- //
- // * for Mozilla
- // "sdbc:address:mozilla:" -> abdirectory://
- // * for LDAP
- // "sdbc:address:ldap:" -> abldapdirectory://
- // * for Outlook (using MAPI API)
- // "sdbc:address:outlook:" -> aboutlookdirectory://op/
- // * for windows system address book
- // "sdbc:address:outlookexp:" -> aboutlookdirectory://oe/
- //
- m_sBindDN = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(""));
- m_sPassword = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(""));
- m_bUseSSL = sal_False;
-
- if ( aAddrbookScheme.compareToAscii( getSdbcScheme( SDBC_MOZILLA ) ) == 0 ) {
- m_sMozillaURI = rtl::OUString::createFromAscii( getSchemeURI( SCHEME_MOZILLA ) );
- m_eSDBCAddressType = SDBCAddress::Mozilla;
- if(sAdditionalInfo.getLength())
- m_sMozillaProfile = sAdditionalInfo;
- }
- else
- if ( aAddrbookScheme.compareToAscii( getSdbcScheme( SDBC_THUNDERBIRD ) ) == 0 ) {
- //Yes. I am sure it is SCHEME_MOZILLA
- m_sMozillaURI = rtl::OUString::createFromAscii( getSchemeURI( SCHEME_MOZILLA ) );
- m_eSDBCAddressType = SDBCAddress::ThunderBird;
- if(sAdditionalInfo.getLength())
- m_sMozillaProfile = sAdditionalInfo;
- }
- else if ( aAddrbookScheme.compareToAscii( getSdbcScheme( SDBC_LDAP ) ) == 0 ) {
- rtl::OUString sBaseDN;
- sal_Int32 nPortNumber = -1;
-
- m_sMozillaURI = rtl::OUString::createFromAscii( getSchemeURI( SCHEME_LDAP ) );
- m_eSDBCAddressType = SDBCAddress::LDAP;
-
- if ( !m_sHostName.getLength() )
- {
- // see whether the URI contains a hostname/port
- if ( sAdditionalInfo.getLength() )
- {
- sal_Int32 nPortSeparator = sAdditionalInfo.indexOf( ':' );
- if ( nPortSeparator == -1 )
- m_sHostName = sAdditionalInfo;
- else
- {
- m_sHostName = sAdditionalInfo.copy( 0, nPortSeparator );
- nPortNumber = sAdditionalInfo.copy( nPortSeparator + 1 ).toInt32();
- OSL_ENSURE( nPortNumber != 0, "OConnection::construct: invalid LDAP port number in the URL!" );
- if ( nPortNumber == 0 )
- nPortNumber = -1;
- }
- }
- }
-
- const PropertyValue* pInfo = info.getConstArray();
- const PropertyValue* pInfoEnd = pInfo + info.getLength();
-
- for (; pInfo != pInfoEnd; ++pInfo)
- {
- OSL_TRACE( "info[%d].Name = %s\n", pInfo - info.getConstArray(), OUtoCStr( pInfo->Name ) );
-
- if ( 0 == pInfo->Name.compareToAscii("HostName") )
- {
- pInfo->Value >>= m_sHostName;
- }
- else if ( 0 == pInfo->Name.compareToAscii("BaseDN") )
- {
- pInfo->Value >>= sBaseDN;
- }
- else if ( 0 == pInfo->Name.compareToAscii("user") )
- {
- pInfo->Value >>= m_sBindDN;
- }
- else if ( 0 == pInfo->Name.compareToAscii("password") )
- {
- pInfo->Value >>= m_sPassword;
- }
- else if ( 0 == pInfo->Name.compareToAscii("UseSSL") )
- {
- pInfo->Value >>= m_bUseSSL;
- }
- else if ( 0 == pInfo->Name.compareToAscii("PortNumber") )
- {
- OSL_VERIFY( pInfo->Value >>= nPortNumber );
- }
- else if ( 0 == pInfo->Name.compareToAscii("MaxRowCount") )
- {
- pInfo->Value >>= m_nMaxResultRecords;
- }
- }
-
- if ( m_sHostName.getLength() != 0 ) {
- m_sMozillaURI += m_sHostName;
- }
- else
- throwSQLException( STR_NO_HOSTNAME, *this );
-
- if ( nPortNumber > 0 ) {
- m_sMozillaURI += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(":") );
- m_sMozillaURI += rtl::OUString::valueOf( nPortNumber );
- }
-
- if ( sBaseDN.getLength() != 0 ) {
- m_sMozillaURI += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") );
- m_sMozillaURI += sBaseDN;
- }
- else
- throwSQLException( STR_NO_BASEDN, *this );
-
- // Addition of a fake query to enable the Mozilla LDAP directory to work correctly.
- m_sMozillaURI += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("?(or(DisplayName,=,DontDoThisAtHome)))"));
-
- }
- else if ( aAddrbookScheme.compareToAscii( getSdbcScheme( SDBC_OUTLOOK_MAPI ) ) == 0 ) {
- m_sMozillaURI = ::rtl::OUString::createFromAscii( getSchemeURI( SCHEME_OUTLOOK_MAPI ) );
- m_eSDBCAddressType = SDBCAddress::Outlook;
- }
- else if ( aAddrbookScheme.compareToAscii( getSdbcScheme( SDBC_OUTLOOK_EXPRESS ) ) == 0 ) {
- m_sMozillaURI = rtl::OUString::createFromAscii( getSchemeURI( SCHEME_OUTLOOK_EXPRESS ) );
- m_eSDBCAddressType = SDBCAddress::OutlookExp;
- }
- else
- {
- OSL_TRACE("Invalid subschema given!!!\n");
- throwSQLException( STR_URI_SYNTAX_ERROR, *this );
- }
-
- OSL_TRACE("Moz URI = %s, %s\n", ((OUtoCStr(m_sMozillaURI)) ? (OUtoCStr(m_sMozillaURI)):("NULL")), usesFactory() ? "uses factory" : "no factory");
- OSL_TRACE( "\tOUT OConnection::construct()\n" );
-
- MDatabaseMetaDataHelper _aDbHelper;
-
- // The creation of the nsIAbDirectory i/f for LDAP doesn't actually test
- // the validity of the connection, it's normally delayed until the query
- // is executed, but it's a bit late then to fail...
- if ( isLDAP() )
- {
- if ( !_aDbHelper.testLDAPConnection( this ) )
- {
- OSL_TRACE("testLDAPConnection : FAILED\n" );
- throwSQLException( _aDbHelper.getError(), *this );
- }
- else
- {
- OSL_TRACE("testLDAPConnection : SUCCESS\n" );
- }
- }
-
- // Test connection by getting to get the Table Names
- ::std::vector< ::rtl::OUString > tables;
- ::std::vector< ::rtl::OUString > types;
- if ( !_aDbHelper.getTableStrings( this, tables, types ) )
- {
- throwSQLException( _aDbHelper.getError(), *this );
- }
-
-}
-// XServiceInfo
-// --------------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OConnection, "com.sun.star.sdbc.drivers.mozab.OConnection", "com.sun.star.sdbc.Connection")
-
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL OConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- // create a statement
- // the statement can only be executed once
- Reference< XStatement > xReturn = new OStatement(this);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::rtl::OUString& _sSql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- OSL_TRACE("OConnection::prepareStatement( %s )", OUtoCStr( _sSql ) );
- // the pre
- // create a statement
- // the statement can only be executed more than once
- OPreparedStatement* pPrepared = new OPreparedStatement(this,_sSql);
- Reference< XPreparedStatement > xReturn = pPrepared;
- pPrepared->lateInit();
-
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl::OUString& _sSql ) throw(SQLException, RuntimeException)
-{
- OSL_UNUSED( _sSql );
- ::dbtools::throwFeatureNotImplementedException( "XConnection::prepareCall", *this );
- OSL_TRACE("OConnection::prepareCall( %s )", OUtoCStr( _sSql ) );
- return NULL;
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConnection::nativeSQL( const ::rtl::OUString& _sSql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- // when you need to transform SQL92 to you driver specific you can do it here
- OSL_TRACE("OConnection::nativeSQL( %s )", OUtoCStr( _sSql ) );
-
- return _sSql;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setAutoCommit( sal_Bool /*autoCommit*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setAutoCommit", *this );
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::getAutoCommit( ) throw(SQLException, RuntimeException)
-{
- // you have to distinguish which if you are in autocommit mode or not
- // at normal case true should be fine here
-
- return sal_True;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::commit( ) throw(SQLException, RuntimeException)
-{
- // when you database does support transactions you should commit here
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::rollback( ) throw(SQLException, RuntimeException)
-{
- // same as commit but for the other case
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::isClosed( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- // just simple -> we are close when we are disposed taht means someone called dispose(); (XComponent)
- return OConnection_BASE::rBHelper.bDisposed;
-}
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL OConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- // here we have to create the class with biggest interface
- // The answer is 42 :-)
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if(!xMetaData.is())
- {
- xMetaData = new ODatabaseMetaData(this); // need the connection because it can return it
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setReadOnly( sal_Bool /*readOnly*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setReadOnly", *this );
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- // return if your connection to readonly
- return sal_False;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& /*catalog*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setCatalog", *this );
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConnection::getCatalog( ) throw(SQLException, RuntimeException)
-{
- // return your current catalog
- return ::rtl::OUString();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 /*level*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setTransactionIsolation", *this );
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OConnection::getTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- // please have a look at @see com.sun.star.sdbc.TransactionIsolation
- return TransactionIsolation::NONE;
-}
-// --------------------------------------------------------------------------------
-Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OConnection::getTypeMap( ) throw(SQLException, RuntimeException)
-{
- // if your driver has special database types you can return it here
- return NULL;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setTypeMap( const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setTypeMap", *this );
-}
-// --------------------------------------------------------------------------------
-// XCloseable
-void SAL_CALL OConnection::close( ) throw(SQLException, RuntimeException)
-{
- // we just dispose us
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-}
-// --------------------------------------------------------------------------------
-// XWarningsSupplier
-Any SAL_CALL OConnection::getWarnings( ) throw(SQLException, RuntimeException)
-{
- // when you collected some warnings -> return it
- return Any();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- // you should clear your collected warnings here
-}
-//------------------------------------------------------------------------------
-void OConnection::disposing()
-{
- // we noticed that we should be destroied in near future so we have to dispose our statements
- ::osl::MutexGuard aGuard(m_aMutex);
-
- m_pImplData->pResourceBundle.reset();
-
- OConnection_BASE::disposing();
- if ( m_aNameMapper ) {
- MQuery::FreeNameMapper( m_aNameMapper );
- m_aNameMapper = NULL;
- }
-
- dispose_ChildImpl();
-}
-// -----------------------------------------------------------------------------
-
-Reference< XTablesSupplier > SAL_CALL OConnection::createCatalog()
-{
- OSL_TRACE("IN OConnection::createCatalog()\n" );
- ::osl::MutexGuard aGuard( m_aMutex );
- Reference< XTablesSupplier > xTab = m_xCatalog;
- if(!m_xCatalog.is())
- {
- OCatalog *pCat = new OCatalog(this);
- xTab = pCat;
- m_xCatalog = xTab;
- }
- OSL_TRACE( "\tOUT OConnection::createCatalog()\n" );
- return xTab;
-}
-// -----------------------------------------------------------------------------
-
-MNameMapper* OConnection::getNameMapper ()
-{
- if (m_aNameMapper==NULL)
- m_aNameMapper = MQuery::CreateNameMapper();
-
- return m_aNameMapper;
-}
-
-// -----------------------------------------------------------------------------
-void OConnection::throwSQLException( const ErrorDescriptor& _rError, const Reference< XInterface >& _rxContext )
-{
- if ( _rError.getResId() != 0 )
- {
- OSL_ENSURE( ( _rError.getErrorCondition() == 0 ),
- "OConnection::throwSQLException: unsupported error code combination!" );
-
- ::rtl::OUString sParameter( _rError.getParameter() );
- if ( sParameter.getLength() )
- {
- const ::rtl::OUString sError( getResources().getResourceStringWithSubstitution(
- _rError.getResId(),
- "$1$", sParameter
- ) );
- ::dbtools::throwGenericSQLException( sError, _rxContext );
- OSL_FAIL( "OConnection::throwSQLException: unreachable (1)!" );
- }
-
- throwGenericSQLException( _rError.getResId(), _rxContext );
- OSL_FAIL( "OConnection::throwSQLException: unreachable (2)!" );
- }
-
- if ( _rError.getErrorCondition() != 0 )
- {
- SQLError aErrorHelper( getDriver()->getMSFactory() );
- ::rtl::OUString sParameter( _rError.getParameter() );
- if ( sParameter.getLength() )
- aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext, sParameter );
- else
- aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext);
- OSL_FAIL( "OConnection::throwSQLException: unreachable (3)!" );
- }
-
- throwGenericSQLException( STR_UNSPECIFIED_ERROR, _rxContext );
-}
-
-// -----------------------------------------------------------------------------
-void OConnection::throwSQLException( const sal_uInt16 _nErrorResourceId, const Reference< XInterface >& _rxContext )
-{
- ErrorDescriptor aError;
- aError.setResId( _nErrorResourceId );
- throwSQLException( aError, _rxContext );
-}
-
-} } // namespace connectivity::mozab
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MConnection.hxx b/connectivity/source/drivers/mozab/MConnection.hxx
deleted file mode 100644
index 4ec99a1294..0000000000
--- a/connectivity/source/drivers/mozab/MConnection.hxx
+++ /dev/null
@@ -1,233 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_SCONNECTION_HXX
-#define CONNECTIVITY_SCONNECTION_HXX
-
-#include "connectivity/CommonTools.hxx"
-
-#include "MCatalog.hxx"
-#include "MColumnAlias.hxx"
-#include "OSubComponent.hxx"
-#include "TConnection.hxx"
-
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/mozilla/MozillaProductType.hpp>
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-
-#include <cppuhelper/weakref.hxx>
-
-#include <memory>
-
-namespace connectivity
-{
- namespace mozab
- {
-
- class MozabDriver;
- class ODatabaseMetaData;
- class MNameMapper;
- class ErrorDescriptor;
-
- namespace SDBCAddress {
- typedef enum {
- Unknown = 0,
- Mozilla = 1,
- ThunderBird = 2,
- LDAP = 3,
- Outlook = 4,
- OutlookExp = 5
- } sdbc_address_type;
- }
-
- // For the moment, we will connect the Mozilla address book to the Mozilla
- // top-level address book which will display whatever is in the preferences
- // file of Mozilla.
- enum MozillaScheme
- {
- // This one is a base uri which will be completed with the connection data.
- SCHEME_MOZILLA,
- // This one is for mozilla native address book
- SCHEME_MOZILLA_MDB,
- // This one is for LDAP address book
- SCHEME_LDAP,
- // These two uris will be used to obtain directory factories to access all
- // address books of the given type.
- SCHEME_OUTLOOK_MAPI,
- SCHEME_OUTLOOK_EXPRESS
- };
- const sal_Char* getSchemeURI( MozillaScheme _eScheme );
-
- enum SdbcScheme
- {
- SDBC_MOZILLA,
- SDBC_THUNDERBIRD,
- SDBC_LDAP,
- SDBC_OUTLOOK_MAPI,
- SDBC_OUTLOOK_EXPRESS
- };
-#ifdef __MINGW32__
- extern "C"
-#endif
- const sal_Char* getSdbcScheme( SdbcScheme _eScheme );
-
- typedef connectivity::OMetaConnection OConnection_BASE; // implements basics and text encoding
-
- struct ConnectionImplData;
- class OConnection : public OConnection_BASE,
- public connectivity::OSubComponent<OConnection, OConnection_BASE>
- {
- friend class connectivity::OSubComponent<OConnection, OConnection_BASE>;
-
- protected:
- //====================================================================
- // Data attributes
- //====================================================================
- ::com::sun::star::sdbc::SQLWarning m_aLastWarning; // Last SQLWarning generated by
- // an operation
- MozabDriver* m_pDriver; // Pointer to the owning
- // driver object
- ::std::auto_ptr< ConnectionImplData > m_pImplData;
- // This is to be able to hold a boost::shared_ptr. If we would hold it as member, it would
- // not compile the mozillasrc directory, since this directory is compiled without RTTI support
- // and boost seems to require RTTI on some platforms.
- // Store Catalog
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier> m_xCatalog;
- // Start of Additions from the land of mozilla
- OColumnAlias m_aColumnAlias;
- rtl::OUString m_sMozillaURI;
- rtl::OUString m_sMozillaProfile;
- sal_Int32 m_nMaxResultRecords;
- MNameMapper* m_aNameMapper;
- //LDAP only
- rtl::OUString m_sHostName;
- sal_Bool m_bUseSSL;
- rtl::OUString m_sBindDN;
- rtl::OUString m_sUser; // the user name
- rtl::OUString m_sPassword;
-
- SDBCAddress::sdbc_address_type m_eSDBCAddressType;
-
- sal_Bool m_bForceLoadTable;
-
- public:
- virtual void construct( const ::rtl::OUString& url,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info) throw(::com::sun::star::sdbc::SQLException);
- OConnection(MozabDriver* _pDriver);
- virtual ~OConnection();
-
- void closeAllStatements () throw( ::com::sun::star::sdbc::SQLException);
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL release() throw();
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL nativeSQL( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getAutoCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL commit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL rollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isClosed( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCatalog( const ::rtl::OUString& catalog ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalog( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- //
- MozabDriver* getDriver() const { return m_pDriver;}
-
- // Added to enable me to use SQLInterpreter which requires an
- // XNameAccess i/f to access tables.
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL createCatalog();
-
-
- // Additions from the land of mozilla
- rtl::OUString getMozURI() const { return m_sMozillaURI; }
- rtl::OUString getMozProfile() const { return m_sMozillaProfile; }
- void setMozProfile(rtl::OUString &aNewProfile) { m_sMozillaProfile = aNewProfile; }
-
- ::com::sun::star::mozilla::MozillaProductType getProduct()
- {
- if (m_eSDBCAddressType == SDBCAddress::ThunderBird)
- return ::com::sun::star::mozilla::MozillaProductType_Thunderbird;
- return ::com::sun::star::mozilla::MozillaProductType_Mozilla;
- }
-
- // Get Ldap BindDN (user name)
- rtl::OUString getBindDN() const { return m_sBindDN; }
- // Get Ldap Password
- rtl::OUString getPassword() const { return m_sPassword; }
- // Get Ldap Host name
- rtl::OUString getHost() const { return m_sHostName; }
- // Get whether use ssl to connect to ldap
- sal_Bool getUseSSL() const {return m_bUseSSL;}
-
- sal_Bool usesFactory(void) const { return (m_eSDBCAddressType == SDBCAddress::Outlook) || (m_eSDBCAddressType == SDBCAddress::OutlookExp); }
- sal_Bool isLDAP(void) const { return m_eSDBCAddressType == SDBCAddress::LDAP; }
- sal_Bool isThunderbird(void) const { return m_eSDBCAddressType == SDBCAddress::ThunderBird; }
-
- sal_Bool isOutlookExpress() const { return m_eSDBCAddressType == SDBCAddress::OutlookExp;}
- sal_Int32 getMaxResultRecords() const { return m_nMaxResultRecords; }
-
- SDBCAddress::sdbc_address_type getSDBCAddressType() const { return m_eSDBCAddressType;}
-
- const OColumnAlias & getColumnAlias() const { return (m_aColumnAlias); }
-
- static ::rtl::OUString getDriverImplementationName();
-
- MNameMapper* getNameMapper();
- void setForceLoadTables(sal_Bool aForce){ m_bForceLoadTable = aForce;}
- sal_Bool getForceLoadTables() { return m_bForceLoadTable;}
-
- void throwSQLException( const ErrorDescriptor& _rError, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext );
- void throwSQLException( const sal_uInt16 _nErrorResourceId, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext );
-
- private:
- // make this private - clients should use throwSQLException instead
- using OConnection_BASE::throwGenericSQLException;
- };
- }
-}
-#endif // CONNECTIVITY_SCONNECTION_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MDatabaseMetaData.cxx b/connectivity/source/drivers/mozab/MDatabaseMetaData.cxx
deleted file mode 100644
index 161d0bced0..0000000000
--- a/connectivity/source/drivers/mozab/MDatabaseMetaData.cxx
+++ /dev/null
@@ -1,1033 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "MDatabaseMetaData.hxx"
-#include "FDatabaseMetaDataResultSet.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/TransactionIsolation.hpp>
-#include <connectivity/dbexception.hxx>
-#include <connectivity/FValue.hxx>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/ColumnSearch.hpp>
-#include "resource/common_res.hrc"
-#include <vector>
-
-#if OSL_DEBUG_LEVEL > 0
-# define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr())
-#else /* OSL_DEBUG_LEVEL */
-# define OUtoCStr( x ) ("dummy")
-#endif /* OSL_DEBUG_LEVEL */
-
-using namespace connectivity::mozab;
-using namespace connectivity;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-
-
-namespace connectivity
-{
- namespace mozab
- {
- static sal_Int32 const s_nCOLUMN_SIZE = 256;
- static sal_Int32 const s_nDECIMAL_DIGITS = 0;
- static sal_Int32 const s_nNULLABLE = 1;
- static sal_Int32 const s_nCHAR_OCTET_LENGTH = 65535;
- }
-}
-
-
-ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon)
- : ::connectivity::ODatabaseMetaDataBase(_pCon,_pCon->getConnectionInfo())
- ,m_pConnection(_pCon)
-{
- OSL_ENSURE(m_pConnection,"ODatabaseMetaData::ODatabaseMetaData: No connection set!");
- m_pDbMetaDataHelper = new MDatabaseMetaDataHelper();
-}
-// -------------------------------------------------------------------------
-ODatabaseMetaData::~ODatabaseMetaData()
-{
- delete m_pDbMetaDataHelper;
-}
-
-// -------------------------------------------------------------------------
-ODatabaseMetaDataResultSet::ORows& SAL_CALL ODatabaseMetaData::getColumnRows(
- const ::rtl::OUString& tableNamePattern,
- const ::rtl::OUString& columnNamePattern ) throw(SQLException)
-{
- static ODatabaseMetaDataResultSet::ORows aRows;
- ODatabaseMetaDataResultSet::ORow aRow(19);
- aRows.clear();
-
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ::std::vector< ::rtl::OUString > tables;
- ::std::vector< ::rtl::OUString > types;
- if ( !m_pDbMetaDataHelper->getTableStrings( m_pConnection, tables, types) ) {
- getOwnConnection()->throwSQLException( m_pDbMetaDataHelper->getError(), *this );
- }
-
- // ****************************************************
- // Some entries in a row never change, so set them now
- // ****************************************************
-
- // Catalog
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("")));
- // Schema
- aRow[2] = new ORowSetValueDecorator(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("")));
- // DATA_TYPE
- aRow[5] = new ORowSetValueDecorator(static_cast<sal_Int16>(DataType::VARCHAR));
- // TYPE_NAME, not used
- aRow[6] = new ORowSetValueDecorator(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VARCHAR")));
- // COLUMN_SIZE
- aRow[7] = new ORowSetValueDecorator(s_nCOLUMN_SIZE);
- // BUFFER_LENGTH, not used
- aRow[8] = ODatabaseMetaDataResultSet::getEmptyValue();
- // DECIMAL_DIGITS.
- aRow[9] = new ORowSetValueDecorator(s_nDECIMAL_DIGITS);
- // NUM_PREC_RADIX
- aRow[10] = new ORowSetValueDecorator((sal_Int32)10);
- // NULLABLE
- aRow[11] = new ORowSetValueDecorator(s_nNULLABLE);
- // REMARKS
- aRow[12] = ODatabaseMetaDataResultSet::getEmptyValue();
- // COULUMN_DEF, not used
- aRow[13] = ODatabaseMetaDataResultSet::getEmptyValue();
- // SQL_DATA_TYPE, not used
- aRow[14] = ODatabaseMetaDataResultSet::getEmptyValue();
- // SQL_DATETIME_SUB, not used
- aRow[15] = ODatabaseMetaDataResultSet::getEmptyValue();
- // CHAR_OCTET_LENGTH, refer to [5]
- aRow[16] = new ORowSetValueDecorator(s_nCHAR_OCTET_LENGTH);
- // IS_NULLABLE
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("YES")));
-
- const OColumnAlias& colNames = m_pConnection->getColumnAlias();
-
- // Iterate over all tables
- for(size_t j = 0; j < tables.size(); j++ ) {
- if(match(tableNamePattern, tables[j],'\0')) {
- // TABLE_NAME
- aRow[3] = new ORowSetValueDecorator( tables[j] );
-
- OSL_TRACE( "\t\tTableName = %s;\n",OUtoCStr( tables[j] ));
-
- // Iterate over all collumns in the table.
- for ( OColumnAlias::AliasMap::const_iterator compare = colNames.begin();
- compare != colNames.end();
- ++compare
- )
- {
- if ( match( columnNamePattern, compare->first, '\0' ) )
- {
- OSL_TRACE( "\t\t\tColumnName = %s;\n", OUtoCStr( compare->first ) );
- // COLUMN_NAME
- aRow[4] = new ORowSetValueDecorator( compare->first );
- // ORDINAL_POSITION
- aRow[17] = new ORowSetValueDecorator( static_cast< sal_Int32 >( compare->second.columnPosition ) + 1 );
- aRows.push_back(aRow);
- }
- }
- }
- }
- return( aRows );
-}
-// -------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaData::impl_getCatalogSeparator_throw( )
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 65535; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 254; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 20; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaData::impl_getMaxStatements_throw( )
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaData::impl_getMaxTablesInSelect_throw( )
-{
- // We only support a single table
- return 1;
-}
-// -------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- return aVal;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaData::impl_getIdentifierQuoteString_throw( )
-{
- // normally this is "
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("\""));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- return aVal;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_isCatalogAtStart_throw( )
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException)
-{
- //We support create table
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 /*level*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException)
-{
- return sal_True; // should be supported at least
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( )
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException)
-{
- return 0;// 0 means no limit
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException)
-{
- // We allow you to select from any table.
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- //we support insert/update/delete now
- //But we have to set this to return sal_True otherwise the UI will add create "table/edit table"
- //entry to the popup menu. We should avoid them.
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException)
-{
- // Support added for this.
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 /*fromType*/, sal_Int32 /*toType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
-{
- // Any case may be used
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- return m_pConnection->getURL();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverVersion() throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue = ::rtl::OUString::valueOf((sal_Int32)1);
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue = ::rtl::OUString::valueOf((sal_Int32)0);
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException)
-{
- return 1;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- return TransactionIsolation::NONE;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue = 0; // 0 means no limit
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 /*setType*/, sal_Int32 /*concurrency*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-// here follow all methods which return a resultset
-// the first methods is an example implementation how to use this resultset
-// of course you could implement it on your and you should do this because
-// the general way is more memory expensive
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException)
-{
- // there exists no possibility to get table types so we have to check
- static ::rtl::OUString sTableTypes[] =
- {
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TABLE")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VIEW"))
- // Currently we only support a 'TABLE' and 'VIEW' nothing more complex
- //
- // ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SYSTEM TABLE")),
- // ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("GLOBAL TEMPORARY")),
- // ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LOCAL TEMPORARY")),
- // ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ALIAS")),
- // ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SYNONYM"))
- };
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTableTypes);
- Reference< XResultSet > xRef = pResult;
-
- // here we fill the rows which should be visible when ask for data from the resultset returned here
- const sal_Int32 nSize = sizeof(sTableTypes) / sizeof(::rtl::OUString);
- ODatabaseMetaDataResultSet::ORows aRows;
- for(sal_Int32 i=0;i < nSize;++i)
- {
- ODatabaseMetaDataResultSet::ORow aRow;
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator(sTableTypes[i]));
- // bound row
- aRows.push_back(aRow);
- }
- // here we set the rows at the resultset
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > ODatabaseMetaData::impl_getTypeInfo_throw( )
-{
- // this returns an empty resultset where the column-names are already set
- // in special the metadata of the resultset already returns the right columns
- ODatabaseMetaDataResultSet* pResultSet = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTypeInfo);
- Reference< XResultSet > xResultSet = pResultSet;
- static ODatabaseMetaDataResultSet::ORows aRows;
-
- if(aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow;
- aRow.reserve(19);
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VARCHAR"))));
- aRow.push_back(new ORowSetValueDecorator(DataType::VARCHAR));
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)s_nCHAR_OCTET_LENGTH));
- aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- // aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnValue::NULLABLE));
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnSearch::CHAR));
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)10));
-
- aRows.push_back(aRow);
-
- }
- pResultSet->setRows(aRows);
- return xResultSet;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& tableNamePattern,
- const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- // this returns an empty resultset where the column-names are already set
- // in special the metadata of the resultset already returns the right columns
- ODatabaseMetaDataResultSet* pResultSet = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eColumns);
- Reference< XResultSet > xResultSet = pResultSet;
- pResultSet->setRows( getColumnRows( tableNamePattern, columnNamePattern ));
- return xResultSet;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/,
- const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException)
-{
- // this returns an empty resultset where the column-names are already set
- // in special the metadata of the resultset already returns the right columns
- ODatabaseMetaDataResultSet* pResultSet = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTables);
- Reference< XResultSet > xResultSet = pResultSet;
-
- // ODatabaseMetaDataResultSet::ORows aRows;
- // aRows = m_pDbMetaDataHelper->getTables( m_pConnection, tableNamePattern );
- // pResultSet->setRows( aRows );
- ODatabaseMetaDataResultSet::ORows _rRows;
- if ( !m_pDbMetaDataHelper->getTables( m_pConnection, tableNamePattern, types,_rRows ) ) {
- getOwnConnection()->throwSQLException( m_pDbMetaDataHelper->getError(), *this );
- }
- pResultSet->setRows( _rRows );
-
- return xResultSet;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException)
-{
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTablePrivileges);
- Reference< XResultSet > xRef = NULL;
-
- xRef = pResult;
-
- ::std::vector< ::rtl::OUString > tables;
- ::std::vector< ::rtl::OUString > types;
- if ( !m_pDbMetaDataHelper->getTableStrings( m_pConnection, tables, types ) )
- getOwnConnection()->throwSQLException( m_pDbMetaDataHelper->getError(), *this );
-
- ::connectivity::ODatabaseMetaDataResultSet::ORows aRows;
- ::connectivity::ODatabaseMetaDataResultSet::ORow aRow(8);
- aRows.reserve(8);
- aRow[0] = ::connectivity::ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[1] = ::connectivity::ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[3] = ::connectivity::ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[4] = ::connectivity::ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[5] = new ::connectivity::ORowSetValueDecorator(getUserName());
- aRow[7] = new ::connectivity::ORowSetValueDecorator(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NO")));
-
-
- // Iterate over all tables
- for(size_t j = 0; j < tables.size(); j++ ) {
- if(match(tableNamePattern, tables[j],'\0'))
- {
- // TABLE_NAME
- aRow[2] = new ORowSetValueDecorator( tables[j] );
-
- OSL_TRACE( "\t\tTableName = %s;\n",OUtoCStr( tables[j] ));
-
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getSelectValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getInsertValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getDeleteValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getUpdateValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getCreateValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getReadValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getAlterValue();
- aRows.push_back(aRow);
- aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getDropValue();
- aRows.push_back(aRow);
- }
- }
- pResult->setRows(aRows);
- return xRef;
-
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getUDTs( const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& /*typeNamePattern*/, const Sequence< sal_Int32 >& /*types*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MDatabaseMetaData.hxx b/connectivity/source/drivers/mozab/MDatabaseMetaData.hxx
deleted file mode 100644
index 89f908367d..0000000000
--- a/connectivity/source/drivers/mozab/MDatabaseMetaData.hxx
+++ /dev/null
@@ -1,207 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_SDATABASEMETADATA_HXX
-#define CONNECTIVITY_SDATABASEMETADATA_HXX
-#include "MConnection.hxx"
-#include "mozillasrc/MDatabaseMetaDataHelper.hxx"
-#include "TDatabaseMetaDataBase.hxx"
-
-namespace connectivity
-{
- namespace mozab
- {
- //**************************************************************
- //************ Class: ODatabaseMetaData
- //**************************************************************
-
- class ODatabaseMetaData : public ODatabaseMetaDataBase
- {
- OConnection* m_pConnection;
- MDatabaseMetaDataHelper* m_pDbMetaDataHelper;
-
- ODatabaseMetaDataResultSet::ORows& SAL_CALL getColumnRows( const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw( ::com::sun::star::sdbc::SQLException );
-
- protected:
- virtual ~ODatabaseMetaData();
- public:
-
- inline OConnection* getOwnConnection() const { return m_pConnection; }
-
- ODatabaseMetaData(OConnection* _pCon);
-
- private:
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw();
- // cached database information
- virtual ::rtl::OUString impl_getIdentifierQuoteString_throw( );
- virtual sal_Bool impl_isCatalogAtStart_throw( );
- virtual ::rtl::OUString impl_getCatalogSeparator_throw( );
- virtual sal_Bool impl_supportsCatalogsInTableDefinitions_throw( );
- virtual sal_Bool impl_supportsSchemasInTableDefinitions_throw( ) ;
- virtual sal_Bool impl_supportsCatalogsInDataManipulation_throw( );
- virtual sal_Bool impl_supportsSchemasInDataManipulation_throw( ) ;
- virtual sal_Bool impl_supportsMixedCaseQuotedIdentifiers_throw( ) ;
- virtual sal_Bool impl_supportsAlterTableWithAddColumn_throw( );
- virtual sal_Bool impl_supportsAlterTableWithDropColumn_throw( );
- virtual sal_Int32 impl_getMaxStatements_throw( );
- virtual sal_Int32 impl_getMaxTablesInSelect_throw( );
- virtual sal_Bool impl_storesMixedCaseQuotedIdentifiers_throw( );
-
- // as I mentioned before this interface is really BIG
- // XDatabaseMetaData
- virtual sal_Bool SAL_CALL allProceduresAreCallable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL allTablesAreSelectable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getUserName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedLow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFiles( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSQLKeywords( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getNumericFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getStringFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSystemFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTimeDateFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSearchStringEscape( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getExtraNameCharacters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsColumnAliasing( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTypeConversion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getProcedureTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedDelete( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsStoredProcedures( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnionAll( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxConnections( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxIndexLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxRowSize( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxStatementLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTables( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTableTypes( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTablePrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsBatchUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getUDTs( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern, const ::com::sun::star::uno::Sequence< sal_Int32 >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // CONNECTIVITY_SDATABASEMETADATA_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MDriver.cxx b/connectivity/source/drivers/mozab/MDriver.cxx
deleted file mode 100644
index 37d0a74dda..0000000000
--- a/connectivity/source/drivers/mozab/MDriver.cxx
+++ /dev/null
@@ -1,333 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <sal/macros.h>
-#include "MDriver.hxx"
-#include "MConnection.hxx"
-#include "connectivity/dbexception.hxx"
-#include "resource/mozab_res.hrc"
-#include "resource/common_res.hrc"
-
-#include <tools/solar.h>
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace connectivity::mozab;
-
-namespace connectivity
-{
- namespace mozab
- {
- //------------------------------------------------------------------
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL MozabDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
- {
- return *(new MozabDriver( _rxFactory ));
- }
- }
-}
-// --------------------------------------------------------------------------------
-MozabDriver::MozabDriver(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory)
- : ODriver_BASE(m_aMutex), m_xMSFactory( _rxFactory )
- ,m_hModule(NULL)
- ,m_pCreationFunc(NULL)
-{
-}
-// -----------------------------------------------------------------------------
-MozabDriver::~MozabDriver()
-{
-}
-// --------------------------------------------------------------------------------
-void MozabDriver::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- // when driver will be destroied so all our connections have to be destroied as well
- for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
- {
- Reference< XComponent > xComp(i->get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- }
- m_xConnections.clear();
- connectivity::OWeakRefArray().swap(m_xConnections); // this really clears
-
- ODriver_BASE::disposing();
- if(m_hModule)
- {
- m_pCreationFunc = NULL;
- osl_unloadModule(m_hModule);
- m_hModule = NULL;
- }
-}
-
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString MozabDriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MOZAB_DRIVER_IMPL_NAME));
- // this name is referenced in the configuration and in the mozab.xml
- // Please take care when changing it.
-}
-//------------------------------------------------------------------------------
-Sequence< ::rtl::OUString > MozabDriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
-{
- // which service is supported
- // for more information @see com.sun.star.sdbc.Driver
- Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"));
- return aSNS;
-}
-
-//------------------------------------------------------------------
-::rtl::OUString SAL_CALL MozabDriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-
-//------------------------------------------------------------------
-sal_Bool SAL_CALL MozabDriver::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-
-//------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL MozabDriver::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-
-// --------------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL MozabDriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- if ( !ensureInit() )
- return NULL;
-
- if ( ! acceptsURL( url ) )
- return NULL;
- // create a new connection with the given properties and append it to our vector
- Reference< XConnection > xCon;
- if (m_pCreationFunc)
- {
- ::osl::MutexGuard aGuard(m_aMutex);
- //We must make sure we create an com.sun.star.mozilla.MozillaBootstrap brfore call any mozilla codes
- Reference<XInterface> xInstance = m_xMSFactory->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")) );
- OSL_ENSURE( xInstance.is(), "failed to create instance" );
-
- OConnection* pCon = reinterpret_cast<OConnection*>((*m_pCreationFunc)(this));
- xCon = pCon; // important here because otherwise the connection could be deleted inside (refcount goes -> 0)
- pCon->construct(url,info); // late constructor call which can throw exception and allows a correct dtor call when so
- m_xConnections.push_back(WeakReferenceHelper(*pCon));
-
- }
- else
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_COULD_NOT_LOAD_LIB,
- "$libname$", ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "mozabdrv" )) )
- ) );
-
- ::dbtools::throwGenericSQLException(sError,*this);
- }
-
- return xCon;
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL MozabDriver::acceptsURL( const ::rtl::OUString& url )
- throw(SQLException, RuntimeException)
-{
- if ( !ensureInit() )
- return sal_False;
-
- // here we have to look if we support this url format
- return impl_classifyURL(url) != Unknown;
-}
-// --------------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL MozabDriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException)
-{
- if ( !ensureInit() )
- return Sequence< DriverPropertyInfo >();
-
- if ( acceptsURL(url) )
- {
- if ( impl_classifyURL(url) != LDAP )
- return Sequence< DriverPropertyInfo >();
-
- ::std::vector< DriverPropertyInfo > aDriverInfo;
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseDN"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Base DN."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MaxRowCount"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Records (max.)"))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("100"))
- ,Sequence< ::rtl::OUString >())
- );
- return Sequence< DriverPropertyInfo >(&aDriverInfo[0],aDriverInfo.size());
- }
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- // if you have somthing special to say return it here :-)
- return Sequence< DriverPropertyInfo >();
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL MozabDriver::getMajorVersion( ) throw(RuntimeException)
-{
- return 1; // depends on you
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL MozabDriver::getMinorVersion( ) throw(RuntimeException)
-{
- return 0; // depends on you
-}
-// --------------------------------------------------------------------------------
-EDriverType MozabDriver::impl_classifyURL( const ::rtl::OUString& url )
-{
- // Skip 'sdbc:mozab: part of URL
- //
- sal_Int32 nLen = url.indexOf(':');
- nLen = url.indexOf(':',nLen+1);
- ::rtl::OUString aAddrbookURI(url.copy(nLen+1));
- // Get Scheme
- nLen = aAddrbookURI.indexOf(':');
- ::rtl::OUString aAddrbookScheme;
- if ( nLen == -1 )
- {
- // There isn't any subschema: - but could be just subschema
- if ( aAddrbookURI.getLength() > 0 )
- aAddrbookScheme= aAddrbookURI;
- else if(url == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:")) )
- return Unknown; // TODO check
- else
- return Unknown;
- }
- else
- aAddrbookScheme = aAddrbookURI.copy(0, nLen);
-
- struct __scheme_map
- {
- EDriverType eType;
- const sal_Char* pScheme;
- } aSchemeMap[] =
- {
-#if defined(WNT)
- { Outlook, "outlook" },
- { OutlookExpress, "outlookexp" },
-#endif
- { Mozilla, "mozilla" },
- { ThunderBird, "thunderbird" },
- { LDAP, "ldap" }
- };
-
- for ( size_t i=0; i < SAL_N_ELEMENTS( aSchemeMap ); ++i )
- {
- if ( aAddrbookScheme.compareToAscii( aSchemeMap[i].pScheme ) == 0 )
- return aSchemeMap[i].eType;
- }
-
- return Unknown;
-}
-
-// --------------------------------------------------------------------------------
-namespace
-{
- template< typename FUNCTION >
- void lcl_getFunctionFromModuleOrUnload( oslModule& _rModule, const sal_Char* _pAsciiSymbolName, FUNCTION& _rFunction )
- {
- _rFunction = NULL;
- if ( _rModule )
- {
- const ::rtl::OUString sSymbolName = ::rtl::OUString::createFromAscii( _pAsciiSymbolName );
- _rFunction = (FUNCTION)( osl_getFunctionSymbol( _rModule, sSymbolName.pData ) );
-
- if ( !_rFunction )
- { // did not find the symbol
- OSL_FAIL( ::rtl::OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + ::rtl::OString( _pAsciiSymbolName ) );
- osl_unloadModule( _rModule );
- _rModule = NULL;
- }
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-extern "C" { static void SAL_CALL thisModule() {} }
-
-bool MozabDriver::ensureInit()
-{
- if ( m_hModule )
- return true;
-
- OSL_ENSURE(NULL == m_pCreationFunc, "MozabDriver::ensureInit: inconsistence: already have a factory function!");
-
- const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM(SVLIBRARY( "mozabdrv" )));
-
- // load the mozabdrv library
- m_hModule = osl_loadModuleRelative(&thisModule, sModuleName.pData, 0);
- OSL_ENSURE(NULL != m_hModule, "MozabDriver::ensureInit: could not load the mozabdrv library!");
- if ( !m_hModule )
- return false;
-
- OSetMozabServiceFactory pSetFactoryFunc( NULL );
-
- lcl_getFunctionFromModuleOrUnload( m_hModule, "setMozabServiceFactory", pSetFactoryFunc );
- lcl_getFunctionFromModuleOrUnload( m_hModule, "OMozabConnection_CreateInstance", m_pCreationFunc );
-
- if ( !m_hModule )
- // one of the symbols did not exist
- return false;
-
- if ( m_xMSFactory.is() )
- {
- // for purpose of transfer safety, the interface needs to be acuired once
- // (will be release by the callee)
- m_xMSFactory->acquire();
- ( *pSetFactoryFunc )( m_xMSFactory.get() );
- }
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MDriver.hxx b/connectivity/source/drivers/mozab/MDriver.hxx
deleted file mode 100644
index 5684486b39..0000000000
--- a/connectivity/source/drivers/mozab/MDriver.hxx
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_SDRIVER_HXX
-#define CONNECTIVITY_SDRIVER_HXX
-
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/compbase2.hxx>
-#include "connectivity/CommonTools.hxx"
-#include <osl/module.h>
-
-
-#define MOZAB_DRIVER_IMPL_NAME "com.sun.star.comp.sdbc.MozabDriver"
-
-namespace connectivity
-{
- namespace mozab
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL MozabDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
-
- typedef void* (SAL_CALL * OMozabConnection_CreateInstanceFunction)(void* _pDriver );
- typedef void (SAL_CALL * OSetMozabServiceFactory)( void* _pFactory );
- typedef const void* (SAL_CALL * OGetSdbcScheme_Function)( short );
-
-
- typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::sdbc::XDriver,
- ::com::sun::star::lang::XServiceInfo > ODriver_BASE;
-
- enum EDriverType
- {
- Mozilla,
- ThunderBird,
- LDAP,
- Outlook,
- OutlookExpress,
- Unknown
- };
-
- class MozabDriver : public ODriver_BASE
- {
- protected:
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xMSFactory;
-
- ::osl::Mutex m_aMutex; // mutex is need to control member access
- connectivity::OWeakRefArray m_xConnections; // vector containing a list
- // of all the Connection objects
- // for this Driver
- oslModule m_hModule;
- OMozabConnection_CreateInstanceFunction m_pCreationFunc;
- OGetSdbcScheme_Function m_pSchemeFunction;
-
- bool ensureInit();
- virtual ~MozabDriver();
- public:
-
- MozabDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
-
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- & getMSFactory(void) const { return m_xMSFactory; }
-
- private:
- EDriverType impl_classifyURL( const ::rtl::OUString& url );
- };
- }
-
-}
-
-#endif // CONNECTIVITY_SDRIVER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MExtConfigAccess.hxx b/connectivity/source/drivers/mozab/MExtConfigAccess.hxx
deleted file mode 100644
index 94f15db36b..0000000000
--- a/connectivity/source/drivers/mozab/MExtConfigAccess.hxx
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_MOZAB_MEXTCONFIGACCESS_HXX
-
-// This is the extended version (for use on the SO side of the driver) of MConfigAccess
-// (which is for use on the mozilla side only)
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-namespace connectivity
-{
- namespace mozab
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- createDriverConfigNode( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB );
- }
-}
-
-#endif // CONNECTIVITY_MOZAB_MEXTCONFIGACCESS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.cxx b/connectivity/source/drivers/mozab/MPreparedStatement.cxx
deleted file mode 100644
index 6136507a0b..0000000000
--- a/connectivity/source/drivers/mozab/MPreparedStatement.cxx
+++ /dev/null
@@ -1,546 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <stdio.h>
-#include <osl/diagnose.h>
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "MPreparedStatement.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include "MResultSetMetaData.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/dbexception.hxx"
-#include "connectivity/dbtools.hxx"
-#include <comphelper/types.hxx>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include "diagnose_ex.h"
-
-#if OSL_DEBUG_LEVEL > 0
-# define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr())
-#else /* OSL_DEBUG_LEVEL */
-# define OUtoCStr( x ) ("dummy")
-#endif /* OSL_DEBUG_LEVEL */
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::mozab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-
-IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbcx.mozab.PreparedStatement","com.sun.star.sdbc.PreparedStatement");
-
-
-OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const ::rtl::OUString& sql)
- :OCommonStatement(_pConnection)
- ,m_nNumParams(0)
- ,m_sSqlStatement(sql)
- ,m_bPrepared(sal_False)
- ,m_pResultSet()
-{
-}
-// -----------------------------------------------------------------------------
-OPreparedStatement::~OPreparedStatement()
-{
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::lateInit()
-{
- if ( eSelect != parseSql( m_sSqlStatement ) )
- throw SQLException();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- OCommonStatement::disposing();
-
- m_xMetaData.clear();
- if(m_aParameterRow.is())
- {
- m_aParameterRow->get().clear();
- m_aParameterRow = NULL;
- }
- m_xParamColumns = NULL;
-}
-// -----------------------------------------------------------------------------
-
-OCommonStatement::StatementType OPreparedStatement::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted )
- throw ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException )
-{
- StatementType eStatementType = OCommonStatement::parseSql( sql, bAdjusted );
- if ( eStatementType != eSelect )
- return eStatementType;
-
- m_xParamColumns = new OSQLColumns();
-
- // describe all parameters need for the resultset
- describeParameter();
-
- Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
- OResultSet::setBoundedColumns( m_aRow, m_xParamColumns, xNames, sal_False, m_xDBMetaData, m_aColMapping );
-
- return eStatementType;
-}
-
-// -----------------------------------------------------------------------------
-void OPreparedStatement::initializeResultSet( OResultSet* _pResult )
-{
- OCommonStatement::initializeResultSet( _pResult );
- _pResult->setParameterColumns( m_xParamColumns );
- _pResult->setParameterRow( m_aParameterRow );
-}
-
-// -----------------------------------------------------------------------------
-void OPreparedStatement::clearCachedResultSet()
-{
- OCommonStatement::clearCachedResultSet();
- m_pResultSet.clear();
- m_xMetaData.clear();
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult )
-{
- OCommonStatement::cacheResultSet( _pResult );
- OSL_PRECOND( m_pResultSet == NULL, "OPreparedStatement::parseSql: you should call clearCachedResultSet before!" );
- m_pResultSet = _pResult;
-}
-
-// -----------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::acquire() throw()
-{
- OCommonStatement::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::release() throw()
-{
- OCommonStatement::release();
-}
-// -----------------------------------------------------------------------------
-Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OCommonStatement::queryInterface(rType);
- if(!aRet.hasValue())
- aRet = OPreparedStatement_BASE::queryInterface(rType);
- return aRet;
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL OPreparedStatement::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::comphelper::concatSequences(OPreparedStatement_BASE::getTypes(),OCommonStatement::getTypes());
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
- sal_Bool bReadOnly = sal_True;
- if ( m_pResultSet.is() )
- bReadOnly = m_pResultSet->determineReadOnly();
- // if we do not have a result set, then we have not been executed, yet. In this case, assuming readonly=true is
- // okay, /me thinks.
-
- if ( !m_xMetaData.is() )
- m_xMetaData = new OResultSetMetaData( m_pSQLIterator->getSelectColumns(), m_pSQLIterator->getTables().begin()->first ,m_pTable,bReadOnly );
-
- return m_xMetaData;
-}
-
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
- Reference< XResultSet> xResult = executeQuery();
- return xResult.is();
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XStatement::executeUpdate", *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
- OSL_TRACE("prepStmt::setString( %s )", OUtoCStr( x ) );
- setParameter( parameterIndex, x );
-}
-// -------------------------------------------------------------------------
-
-Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
- return (Reference< XConnection >)m_pConnection;
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- OSL_TRACE("In: OPreparedStatement::executeQuery" );
- checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
- // our statement has already been parsed in lateInit, no need to do all this (potentially expensive)
- // stuff again. Just execute.
- return impl_executeCurrentQuery();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 /*parameterIndex*/, sal_Bool /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setBoolean", *this );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::setByte( sal_Int32 /*parameterIndex*/, sal_Int8 /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setByte", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setDate( sal_Int32 /*parameterIndex*/, const Date& /*aData*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setDate", *this );
-}
-// -------------------------------------------------------------------------
-
-
-void SAL_CALL OPreparedStatement::setTime( sal_Int32 /*parameterIndex*/, const Time& /*aVal*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setTime", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 /*parameterIndex*/, const DateTime& /*aVal*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setTimestamp", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setDouble( sal_Int32 /*parameterIndex*/, double /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setDouble", *this );
-}
-
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setFloat( sal_Int32 /*parameterIndex*/, float /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setFloat", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setInt( sal_Int32 /*parameterIndex*/, sal_Int32 /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setInt", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setLong( sal_Int32 /*parameterIndex*/, sal_Int64 /*aVal*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setLong", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
- checkAndResizeParameters(parameterIndex);
-
- (m_aParameterRow->get())[parameterIndex].setNull();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setClob( sal_Int32 /*parameterIndex*/, const Reference< XClob >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setClob", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBlob( sal_Int32 /*parameterIndex*/, const Reference< XBlob >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setBlob", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setArray( sal_Int32 /*parameterIndex*/, const Reference< XArray >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setArray", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setRef( sal_Int32 /*parameterIndex*/, const Reference< XRef >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setRef", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 /*parameterIndex*/, const Any& /*x*/, sal_Int32 /*sqlType*/, sal_Int32 /*scale*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setObjectWithInfo", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& /*typeName*/ ) throw(SQLException, RuntimeException)
-{
- setNull(parameterIndex,sqlType);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x ) throw(SQLException, RuntimeException)
-{
- ::dbtools::implSetObject(this,parameterIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setShort( sal_Int32 /*parameterIndex*/, sal_Int16 /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setShort", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBytes( sal_Int32 /*parameterIndex*/, const Sequence< sal_Int8 >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setBytes", *this );
-}
-// -------------------------------------------------------------------------
-
-
-void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 /*parameterIndex*/, const Reference< ::com::sun::star::io::XInputStream >& /*x*/, sal_Int32 /*length*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setCharacterStream", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 /*parameterIndex*/, const Reference< ::com::sun::star::io::XInputStream >& /*x*/, sal_Int32 /*length*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XParameters::setBinaryStream", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::clearParameters( ) throw(SQLException, RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-void OPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception)
-{
- switch(nHandle)
- {
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- break;
- case PROPERTY_ID_USEBOOKMARKS:
- break;
- default:
- OCommonStatement::setFastPropertyValue_NoBroadcast(nHandle,rValue);
- }
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::checkParameterIndex(sal_Int32 _parameterIndex)
-{
- if( !_parameterIndex || _parameterIndex > m_nNumParams)
- ::dbtools::throwInvalidIndexException(*this);
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::checkAndResizeParameters(sal_Int32 parameterIndex)
-{
- ::connectivity::checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
- if ( !m_aParameterRow.is() ) {
- m_aParameterRow = new OValueVector();
- m_aParameterRow->get().push_back(sal_Int32(0));
- }
-
- if ((sal_Int32)(m_aParameterRow->get()).size() <= parameterIndex)
- (m_aParameterRow->get()).resize(parameterIndex+1);
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::setParameter(sal_Int32 parameterIndex, const
-ORowSetValue& x)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkAndResizeParameters(parameterIndex);
-
- OSL_TRACE("setParameter( %d, '%s')", parameterIndex, OUtoCStr(x) );
- (m_aParameterRow->get())[parameterIndex] = x;
-}
-
-//------------------------------------------------------------------
-sal_uInt32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Reference<XPropertySet>& _xCol)
-{
- OSL_UNUSED( pParameter );
- // Nr. of the new added Parameters
- sal_uInt32 nParameter = m_xParamColumns->get().size()+1;
-
- OSL_ENSURE(SQL_ISRULE(pParameter,parameter),"OResultSet::AddParameter: Argument ist kein Parameter");
- OSL_ENSURE(pParameter->count() > 0,"OResultSet: Fehler im Parse Tree");
-#if OSL_DEBUG_LEVEL > 0
- OSQLParseNode * pMark = pParameter->getChild(0);
- OSL_UNUSED( pMark );
-#endif
-
- ::rtl::OUString sParameterName;
-
- // set up Parameter-Column:
- sal_Int32 eType = DataType::VARCHAR;
- sal_uInt32 nPrecision = 255;
- sal_Int32 nScale = 0;
- sal_Int32 nNullable = ColumnValue::NULLABLE;
-
- if (_xCol.is())
- {
- // Type, Precision, Scale ... utilize the selected Columns,
- // then this Column will get the value assigned or with this
- // Column will the value be compared.
- eType = getINT32(_xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)));
- nPrecision = getINT32(_xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)));
- nScale = getINT32(_xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)));
- nNullable = getINT32(_xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)));
- _xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sParameterName;
- }
-
- Reference<XPropertySet> xParaColumn = new connectivity::sdbcx::OColumn(sParameterName
- ,::rtl::OUString()
- ,::rtl::OUString()
- ,::rtl::OUString()
- ,nNullable
- ,nPrecision
- ,nScale
- ,eType
- ,sal_False
- ,sal_False
- ,sal_False
- ,m_pSQLIterator->isCaseSensitive());
- m_xParamColumns->get().push_back(xParaColumn);
- return nParameter;
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::describeColumn(OSQLParseNode*
-_pParameter,OSQLParseNode* _pNode,const OSQLTable& _xTable)
-{
- Reference<XPropertySet> xProp;
- if(SQL_ISRULE(_pNode,column_ref))
- {
- ::rtl::OUString sColumnName,sTableRange;
- m_pSQLIterator->getColumnRange(_pNode,sColumnName,sTableRange);
- if(sColumnName.getLength())
- {
- Reference<XNameAccess> xNameAccess = _xTable->getColumns();
- if(xNameAccess->hasByName(sColumnName))
- xNameAccess->getByName(sColumnName) >>= xProp;
- AddParameter(_pParameter,xProp);
- }
- }
- // else
- // AddParameter(_pParameter,xProp);
-}
-// -------------------------------------------------------------------------
-void OPreparedStatement::describeParameter()
-{
- ::std::vector< OSQLParseNode*> aParseNodes;
- scanParameter(m_pParseTree,aParseNodes);
- if(aParseNodes.size())
- {
- m_xParamColumns = new OSQLColumns();
- const OSQLTables& xTabs = m_pSQLIterator->getTables();
- if(xTabs.size())
- {
- OSQLTable xTable = xTabs.begin()->second;
- ::std::vector< OSQLParseNode*>::const_iterator aIter =
-aParseNodes.begin();
- for (;aIter != aParseNodes.end();++aIter )
- {
- describeColumn(*aIter,(*aIter)->getParent()->getChild(0),xTable);
- }
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-void OPreparedStatement::scanParameter(OSQLParseNode* pParseNode,::std::vector< OSQLParseNode*>& _rParaNodes)
-{
- OSL_ENSURE(pParseNode != NULL,"OResultSet: interner Fehler: ungueltiger ParseNode");
-
- // Parameter Name-Row found?
- if (SQL_ISRULE(pParseNode,parameter))
- {
- OSL_ENSURE(pParseNode->count() >= 1,"OResultSet: Parse Tree fehlerhaft");
- OSL_ENSURE(pParseNode->getChild(0)->getNodeType() == SQL_NODE_PUNCTUATION,"OResultSet: Parse Tree fehlerhaft");
-
- _rParaNodes.push_back(pParseNode);
- // further search isn't necessary
- return;
- }
-
- // Search on in Parse Tree
- for (sal_uInt32 i = 0; i < pParseNode->count(); i++)
- scanParameter(pParseNode->getChild(i),_rParaNodes);
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL OPreparedStatement::getResultSet( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return NULL;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OPreparedStatement::getUpdateCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return 0;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OPreparedStatement::getMoreResults( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.hxx b/connectivity/source/drivers/mozab/MPreparedStatement.hxx
deleted file mode 100644
index cf2dd1986e..0000000000
--- a/connectivity/source/drivers/mozab/MPreparedStatement.hxx
+++ /dev/null
@@ -1,170 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_SPREPAREDSTATEMENT_HXX
-#define CONNECTIVITY_SPREPAREDSTATEMENT_HXX
-
-#include "MResultSet.hxx"
-#include "MStatement.hxx"
-#include <com/sun/star/sdbc/XPreparedStatement.hpp>
-#include <com/sun/star/sdbc/XParameters.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/sdbc/XMultipleResults.hpp>
-#include <cppuhelper/compbase5.hxx>
-
-namespace connectivity
-{
- namespace mozab
- {
-
- class OBoundParam;
- typedef ::cppu::ImplHelper5< ::com::sun::star::sdbc::XPreparedStatement,
- ::com::sun::star::sdbc::XParameters,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::sdbc::XMultipleResults,
- ::com::sun::star::lang::XServiceInfo> OPreparedStatement_BASE;
-
- class OPreparedStatement : public OCommonStatement,
- public OPreparedStatement_BASE
- {
- protected:
- struct Parameter
- {
- ::com::sun::star::uno::Any aValue;
- sal_Int32 nDataType;
-
- Parameter(const ::com::sun::star::uno::Any& rValue,
- sal_Int32 rDataType) : aValue(rValue),nDataType(rDataType)
- {
- }
-
- };
-
- ::std::vector< Parameter> m_aParameters;
- //====================================================================
- // Data attributes
- //====================================================================
- sal_Int32 m_nNumParams; // Number of parameter markers
- // for the prepared statement
-
- ::rtl::OUString m_sSqlStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData;
- sal_Bool m_bPrepared;
- ::rtl::Reference< OResultSet > m_pResultSet;
- ::rtl::Reference<connectivity::OSQLColumns> m_xParamColumns; // the parameter columns
- OValueRow m_aParameterRow;
-
-
- void checkParameterIndex(sal_Int32 _parameterIndex);
-
- protected:
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue)
- throw (::com::sun::star::uno::Exception);
- virtual ~OPreparedStatement();
-
- virtual void SAL_CALL disposing();
-
- // OCommonStatement overridables
- virtual StatementType
- parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
- virtual void initializeResultSet( OResultSet* _pResult );
- virtual void clearCachedResultSet();
- virtual void cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult );
-
-
- void checkAndResizeParameters(sal_Int32 parameterIndex);
- void setParameter(sal_Int32 parameterIndex, const ORowSetValue& x);
-
- sal_uInt32 AddParameter(connectivity::OSQLParseNode * pParameter,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xCol);
- void scanParameter(OSQLParseNode* pParseNode,::std::vector< OSQLParseNode*>& _rParaNodes);
- void describeColumn(OSQLParseNode* _pParameter,OSQLParseNode* _pNode,const OSQLTable& _xTable);
- void describeParameter();
-
- public:
- DECLARE_SERVICE_INFO();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- OPreparedStatement( OConnection* _pConnection,const ::rtl::OUString& sql);
- void lateInit();
-
- //XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPreparedStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL executeUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XParameters
- virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearParameters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XMultipleResults
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getResultSet( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getUpdateCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getMoreResults( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- public:
- using OCommonStatement::executeQuery;
- using OCommonStatement::executeUpdate;
- using OCommonStatement::execute;
- protected:
- using OPropertySetHelper::getFastPropertyValue;
- };
- }
-}
-#endif // CONNECTIVITY_SPREPAREDSTATEMENT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx
deleted file mode 100644
index 4552b9dc69..0000000000
--- a/connectivity/source/drivers/mozab/MResultSet.cxx
+++ /dev/null
@@ -1,1980 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <comphelper/property.hxx>
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/extract.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-#include <connectivity/dbtools.hxx>
-
-#include <TSortIndex.hxx>
-#include <rtl/string.hxx>
-#include <vector>
-#include <algorithm>
-#include "MResultSet.hxx"
-#include "MResultSetMetaData.hxx"
-#include "FDatabaseMetaDataResultSet.hxx"
-#include "resource/mozab_res.hrc"
-#include "resource/common_res.hrc"
-
-#if OSL_DEBUG_LEVEL > 0
-# define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr())
-#else /* OSL_DEBUG_LEVEL */
-# define OUtoCStr( x ) ("dummy")
-#endif /* OSL_DEBUG_LEVEL */
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::mozab;
-using namespace ::cppu;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-
-//------------------------------------------------------------------------------
-// IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
-::rtl::OUString SAL_CALL OResultSet::getImplementationName( ) throw ( RuntimeException) \
-{
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.mozab.ResultSet"));
-}
-// -------------------------------------------------------------------------
- Sequence< ::rtl::OUString > SAL_CALL OResultSet::getSupportedServiceNames( ) throw( RuntimeException)
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(2);
- aSupported[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.ResultSet"));
- aSupported[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.ResultSet"));
- return aSupported;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw( RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-
-// -------------------------------------------------------------------------
-OResultSet::OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< connectivity::OSQLParseTreeIterator >& _pSQLIterator )
- : OResultSet_BASE(m_aMutex)
- ,OPropertySetHelper(OResultSet_BASE::rBHelper)
- ,m_pStatement(pStmt)
- ,m_xStatement(*pStmt)
- ,m_xMetaData(NULL)
- ,m_nRowPos(0)
- ,m_nOldRowPos(0)
- ,m_nFetchSize(0)
- ,m_nResultSetType(ResultSetType::SCROLL_INSENSITIVE)
- ,m_nFetchDirection(FetchDirection::FORWARD)
- ,m_nResultSetConcurrency(ResultSetConcurrency::UPDATABLE)
- ,m_pSQLIterator( _pSQLIterator )
- ,m_pParseTree( _pSQLIterator->getParseTree() )
- ,m_aQuery( pStmt->getOwnConnection()->getColumnAlias() )
- ,m_pTable(NULL)
- ,m_CurrentRowCount(0)
- ,m_nParamIndex(0)
- ,m_bIsAlwaysFalseQuery(sal_False)
- ,m_pKeySet(NULL)
- ,m_nNewRow(0)
- ,m_nUpdatedRow(0)
- ,m_RowStates(0)
- ,m_bIsReadOnly(-1)
-{
-
- m_aQuery.setMaxNrOfReturns(pStmt->getOwnConnection()->getMaxResultRecords());
-}
-// -------------------------------------------------------------------------
-OResultSet::~OResultSet()
-{
-}
-
-// -------------------------------------------------------------------------
-void OResultSet::disposing(void)
-{
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
-
- m_xStatement.clear();
- m_xMetaData.clear();
- m_pParseTree = NULL;
- m_xColumns = NULL;
- m_xParamColumns = NULL;
- m_pKeySet = NULL;
- if(m_pTable)
- {
- m_pTable->release();
- m_pTable = NULL;
- }
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OPropertySetHelper::queryInterface(rType);
- if(!aRet.hasValue())
- aRet = OResultSet_BASE::queryInterface(rType);
- return aRet;
-}
-// -------------------------------------------------------------------------
- Sequence< Type > SAL_CALL OResultSet::getTypes( ) throw( RuntimeException)
-{
- OTypeCollection aTypes( ::getCppuType( (const Reference< ::com::sun::star::beans::XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XFastPropertySet > *)0 ),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XPropertySet > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),OResultSet_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-void OResultSet::methodEntry()
-{
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- if ( !m_pTable )
- {
- OSL_FAIL( "OResultSet::methodEntry: looks like we're disposed, but how is this possible?" );
- throw DisposedException( ::rtl::OUString(), *this );
- }
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- // find the first column with the name columnName
- Reference< XResultSetMetaData > xMeta = getMetaData();
- sal_Int32 nLen = xMeta->getColumnCount();
- sal_Int32 i = 1;
- for(;i<=nLen;++i)
- if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
- columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
- break;
- return i;
-}
-// -------------------------------------------------------------------------
-Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- m_bWasNull = sal_True;
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-
-Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- return Sequence< sal_Int8 >();
-}
-// -------------------------------------------------------------------------
-
-Date SAL_CALL OResultSet::getDate( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- return Date();
-}
-// -------------------------------------------------------------------------
-
-double SAL_CALL OResultSet::getDouble( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- return 0.0;
-}
-// -------------------------------------------------------------------------
-
-float SAL_CALL OResultSet::getFloat( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- return 0;
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSet::getRow( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- OSL_TRACE("In/Out: OResultSet::getRow, return = %u", m_nRowPos );
- return m_nRowPos;
-}
-// -------------------------------------------------------------------------
-
-sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- return sal_Int64();
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- if(!m_xMetaData.is())
- m_xMetaData = new OResultSetMetaData(
- m_pSQLIterator->getSelectColumns(), m_pSQLIterator->getTables().begin()->first ,m_pTable,determineReadOnly());
- return m_xMetaData;
-}
-// -------------------------------------------------------------------------
-Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-
-Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XBlob > SAL_CALL OResultSet::getBlob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL OResultSet::getObject( sal_Int32 /*columnIndex*/, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- return Any();
-}
-// -------------------------------------------------------------------------
-
-sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-
-void OResultSet::checkIndex(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException)
-{
- if(columnIndex <= 0 || columnIndex > (sal_Int32)m_xColumns->get().size())
- ::dbtools::throwInvalidIndexException(*this);
-}
-// -------------------------------------------------------------------------
-sal_uInt32 OResultSet::currentRowCount()
-{
- if ( m_bIsAlwaysFalseQuery )
- return 0;
- return m_aQuery.getRealRowCount() - deletedCount();
-}
-
-// -------------------------------------------------------------------------
-
-sal_Bool OResultSet::fetchCurrentRow( ) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("fetchCurrentRow, m_nRowPos = %u", m_nRowPos );
- return fetchRow(getCurrentCardNumber());
-}
-
-// -------------------------------------------------------------------------
-sal_Bool OResultSet::pushCard(sal_uInt32 cardNumber) throw(SQLException, RuntimeException)
-{
- if (cardNumber == 0)
- return sal_True;
- // Check whether we are storing the updated row
- if ( (m_aRow->get())[0].isNull() || (sal_Int32)(m_aRow->get())[0] != (sal_Int32)cardNumber )
- return sal_False;
-
- sal_Int32 nCount = m_aColumnNames.getLength();
- m_aQuery.setRowStates(cardNumber,m_RowStates);
- for( sal_Int32 i = 1; i <= nCount; i++ )
- {
- if ( (m_aRow->get())[i].isBound() )
- {
- //
- // Everything in the addressbook is a string!
- //
- if ( !m_aQuery.setRowValue( (m_aRow->get())[i], cardNumber, m_aColumnNames[i-1], DataType::VARCHAR ))
- {
- m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
- }
- }
- }
- return sal_True;
-
-}
-// -------------------------------------------------------------------------
-sal_Bool OResultSet::fetchRow(sal_Int32 cardNumber,sal_Bool bForceReload) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("fetchRow, cardNumber = %u", cardNumber );
- if (!bForceReload)
- {
- // Check whether we've already fetched the row...
- if ( !(m_aRow->get())[0].isNull() && (sal_Int32)(m_aRow->get())[0] == (sal_Int32)cardNumber )
- return sal_True;
- //Check whether the old row has been changed
- if (cardNumber == m_nUpdatedRow)
- {
- //write back the changes first
- if (!pushCard(cardNumber)) //error write back the changes
- throw SQLException();
- }
- }
- else
- m_aQuery.resyncRow(cardNumber);
-
- if ( validRow( cardNumber ) == sal_False )
- return sal_False;
-
- (m_aRow->get())[0] = (sal_Int32)cardNumber;
- sal_Int32 nCount = m_aColumnNames.getLength();
- m_RowStates = m_aQuery.getRowStates(cardNumber);
- for( sal_Int32 i = 1; i <= nCount; i++ )
- {
- if ( (m_aRow->get())[i].isBound() )
- {
- //
- // Everything in the addressbook is a string!
- //
- if ( !m_aQuery.getRowValue( (m_aRow->get())[i], cardNumber, m_aColumnNames[i-1], DataType::VARCHAR ))
- {
- m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
- }
- }
- }
- return sal_True;
-}
-// -------------------------------------------------------------------------
-
-const ORowSetValue& OResultSet::getValue(sal_Int32 cardNumber, sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- if ( fetchRow( cardNumber ) == sal_False )
- {
- OSL_FAIL("fetchRow() returned False" );
- m_bWasNull = sal_True;
- return *ODatabaseMetaDataResultSet::getEmptyValue();
- }
-
- m_bWasNull = (m_aRow->get())[columnIndex].isNull();
- return (m_aRow->get())[columnIndex];
-
-}
-// -------------------------------------------------------------------------
-
-
-::rtl::OUString SAL_CALL OResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- OSL_ENSURE(m_xColumns.is(), "Need the Columns!!");
- OSL_ENSURE(columnIndex <= (sal_Int32)m_xColumns->get().size(), "Trying to access invalid columns number");
- checkIndex( columnIndex );
-
- // If this query was sorted then we should have a valid KeySet, so use it
- return getValue(getCurrentCardNumber(), mapColumn( columnIndex ) );
-
-}
-// -------------------------------------------------------------------------
-
-Time SAL_CALL OResultSet::getTime( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- return Time();
-}
-// -------------------------------------------------------------------------
-
-
-DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- return DateTime();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- // here you have to implement your movements
- // return true means there is no data
- OSL_TRACE("In/Out: OResultSet::isBeforeFirst" );
- return( m_nRowPos < 1 );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- OSL_TRACE("In/Out: OResultSet::isAfterLast" );
- return m_nRowPos > currentRowCount() && m_aQuery.queryComplete();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- OSL_TRACE("In/Out: OResultSet::isFirst" );
- return m_nRowPos == 1;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- OSL_TRACE("In/Out: OResultSet::isLast" );
- return m_nRowPos == currentRowCount() && m_aQuery.queryComplete();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- // move before the first row so that isBeforeFirst returns false
- OSL_TRACE("In/Out: OResultSet::beforeFirst" );
- if ( first() )
- previous();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::afterLast( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("In/Out: OResultSet::afterLast" );
-
- if(last())
- next();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("In/Out: OResultSet::close" );
- dispose();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::first( ) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("In/Out: OResultSet::first" );
- return seekRow( FIRST_POS );
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::last( ) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("In/Out: OResultSet::last" );
- return seekRow( LAST_POS );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("In/Out: OResultSet::absolute" );
- return seekRow( ABSOLUTE_POS, row );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("In/Out: OResultSet::relative" );
- return seekRow( RELATIVE_POS, row );
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::previous( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("In/Out: OResultSet::previous" );
- return seekRow( PRIOR_POS );
-}
-// -------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL OResultSet::getStatement( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- OSL_TRACE("In/Out: OResultSet::getStatement" );
- return m_xStatement;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::rowDeleted( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("In/Out: OResultSet::rowDeleted, m_RowStates=%u",m_RowStates );
- return ((m_RowStates & RowStates_Deleted) == RowStates_Deleted) ;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::rowInserted( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("In/Out: OResultSet::rowInserted,m_RowStates=%u",m_RowStates );
- return ((m_RowStates & RowStates_Inserted) == RowStates_Inserted);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("In/Out: OResultSet::rowUpdated,m_RowStates=%u",m_RowStates );
- return ((m_RowStates & RowStates_Updated) == RowStates_Updated) ;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::next( ) throw(SQLException, RuntimeException)
-{
- return seekRow( NEXT_POS );
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::wasNull( ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- return m_bWasNull;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::cancel( ) throw(RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("In/Out: OResultSet::cancel" );
-
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("In/Out: OResultSet::clearWarnings" );
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OResultSet::getWarnings( ) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("In/Out: OResultSet::getWarnings" );
- return Any();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("In/Out: OResultSet::refreshRow" );
- if (fetchRow(getCurrentCardNumber(),sal_True)) //force fetch current row will cause we lose all change to the current row
- m_pStatement->getOwnConnection()->throwSQLException( STR_ERROR_REFRESH_ROW, *this );
-}
-// -------------------------------------------------------------------------
-IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
-{
- Sequence< Property > aProps(5);
- Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP0(FETCHDIRECTION, sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
- DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
- DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
-
- return new OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-IPropertyArrayHelper & OResultSet::getInfoHelper()
-{
- return *const_cast<OResultSet*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool OResultSet::convertFastPropertyValue(
- Any & /*rConvertedValue*/,
- Any & /*rOldValue*/,
- sal_Int32 nHandle,
- const Any& /*rValue*/ )
- throw (::com::sun::star::lang::IllegalArgumentException)
-{
- OSL_FAIL( "OResultSet::convertFastPropertyValue: not implemented!" );
- switch(nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw ::com::sun::star::lang::IllegalArgumentException();
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- default:
- ;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void OResultSet::setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const Any& /*rValue*/
- )
- throw (Exception)
-{
- OSL_FAIL( "OResultSet::setFastPropertyValue_NoBroadcast: not implemented!" );
- switch(nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw Exception();
- case PROPERTY_ID_FETCHDIRECTION:
- break;
- case PROPERTY_ID_FETCHSIZE:
- break;
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-void OResultSet::getFastPropertyValue(
- Any& rValue,
- sal_Int32 nHandle
- ) const
-{
- switch(nHandle)
- {
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- rValue <<= (sal_Int32)m_nResultSetConcurrency;
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- rValue <<= m_nResultSetType;
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- rValue <<= m_nFetchDirection;
- break;
- case PROPERTY_ID_FETCHSIZE:
- rValue <<= m_nFetchSize;
- break;
- case PROPERTY_ID_ISBOOKMARKABLE:
- const_cast< OResultSet* >( this )->determineReadOnly();
- rValue <<= !m_bIsReadOnly;
- break;
- }
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OResultSet::acquire() throw()
-{
- OResultSet_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OResultSet::release() throw()
-{
- OResultSet_BASE::release();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-void OResultSet::initializeRow(OValueRow& _rRow,sal_Int32 _nColumnCount)
-{
- if(!_rRow.is())
- {
- _rRow = new OValueVector(_nColumnCount);
- (_rRow->get())[0].setBound(sal_True);
- ::std::for_each(_rRow->get().begin()+1,_rRow->get().end(),TSetBound(sal_False));
- }
-}
-
-// -------------------------------------------------------------------------
-void OResultSet::parseParameter( const OSQLParseNode* pNode, rtl::OUString& rMatchString )
-{
- OSL_ENSURE(pNode->count() > 0,"Error parsing parameter in Parse Tree");
- OSQLParseNode *pMark = pNode->getChild(0);
-
- // Initialize to empty string
- rMatchString = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(""));
-
- rtl::OUString aParameterName;
- if (SQL_ISPUNCTUATION(pMark,"?")) {
- aParameterName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("?"));
- }
- else if (SQL_ISPUNCTUATION(pMark,":")) {
- aParameterName = pNode->getChild(1)->getTokenValue();
- }
- // XXX - Now we know name, what's value????
- m_nParamIndex ++;
- OSL_TRACE("Parameter name [%d]: %s\n", m_nParamIndex,OUtoCStr(aParameterName) );
-
- if ( m_aParameterRow.is() ) {
- OSL_ENSURE( m_nParamIndex < (sal_Int32)m_aParameterRow->get().size() + 1, "More parameters than values found" );
- rMatchString = (m_aParameterRow->get())[(sal_uInt16)m_nParamIndex];
-#if OSL_DEBUG_LEVEL > 0
- OSL_TRACE("Prop Value : %s\n", OUtoCStr( rMatchString ) );
-#endif
- }
-#if OSL_DEBUG_LEVEL > 0
- else {
- OSL_TRACE("Prop Value : Invalid ParameterRow!\n" );
- }
-#endif
-}
-
-void OResultSet::analyseWhereClause( const OSQLParseNode* parseTree,
- MQueryExpression &queryExpression)
-{
- ::rtl::OUString columnName;
- MQueryOp::cond_type op( MQueryOp::Is );
- ::rtl::OUString matchString;
-
- if ( parseTree == NULL )
- return;
-
- if ( m_pSQLIterator->getParseTree() != NULL ) {
- ::rtl::Reference<OSQLColumns> xColumns = m_pSQLIterator->getParameters();
- if(xColumns.is())
- {
- ::rtl::OUString aTabName,aColName,aParameterName,aParameterValue;
- OSQLColumns::Vector::iterator aIter = xColumns->get().begin();
- sal_Int32 i = 1;
- for(;aIter != xColumns->get().end();++aIter)
- {
- (*aIter)->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName;
- OSL_TRACE("Prop Column Name : %s\n", OUtoCStr( aColName ) );
- if ( m_aParameterRow.is() ) {
- aParameterValue = (m_aParameterRow->get())[(sal_uInt16)i];
-#if OSL_DEBUG_LEVEL > 0
- OSL_TRACE("Prop Value : %s\n", OUtoCStr( aParameterValue ) );
-#endif
- }
-#if OSL_DEBUG_LEVEL > 0
- else {
- OSL_TRACE("Prop Value : Invalid ParameterRow!\n" );
- }
-#endif
- i++;
- }
- }
-
- }
-
- if ( SQL_ISRULE(parseTree,where_clause) )
- {
- OSL_TRACE("analyseSQL : Got WHERE clause\n");
- // Reset Parameter Counter
- resetParameters();
- analyseWhereClause( parseTree->getChild( 1 ), queryExpression );
- }
- else if ( parseTree->count() == 3 && // Handle ()'s
- SQL_ISPUNCTUATION(parseTree->getChild(0),"(") &&
- SQL_ISPUNCTUATION(parseTree->getChild(2),")"))
- {
-
- OSL_TRACE("analyseSQL : Got Punctuation ()\n");
- MQueryExpression *subExpression = new MQueryExpression();
- analyseWhereClause( parseTree->getChild( 1 ), *subExpression );
- queryExpression.getExpressions().push_back( subExpression );
- }
- else if ((SQL_ISRULE(parseTree,search_condition) || (SQL_ISRULE(parseTree,boolean_term)))
- && parseTree->count() == 3) // Handle AND/OR
- {
-
- OSL_TRACE("analyseSQL : Got AND/OR clause\n");
-
- // TODO - Need to take care or AND, for now match is always OR
- analyseWhereClause( parseTree->getChild( 0 ), queryExpression );
- analyseWhereClause( parseTree->getChild( 2 ), queryExpression );
-
- if (SQL_ISTOKEN(parseTree->getChild(1),OR)) { // OR-Operator
- queryExpression.setExpressionCondition( MQueryExpression::OR );
- }
- else if (SQL_ISTOKEN(parseTree->getChild(1),AND)) { // AND-Operator
- queryExpression.setExpressionCondition( MQueryExpression::AND );
- }
- else {
- OSL_FAIL("analyseSQL: Error in Parse Tree");
- }
- }
- else if (SQL_ISRULE(parseTree,comparison_predicate))
- {
- OSL_ENSURE(parseTree->count() == 3, "Error parsing COMPARE predicate");
- if (!(SQL_ISRULE(parseTree->getChild(0),column_ref) ||
- parseTree->getChild(2)->getNodeType() == SQL_NODE_STRING ||
- parseTree->getChild(2)->getNodeType() == SQL_NODE_INTNUM ||
- parseTree->getChild(2)->getNodeType() == SQL_NODE_APPROXNUM ||
- SQL_ISTOKEN(parseTree->getChild(2),TRUE) ||
- SQL_ISTOKEN(parseTree->getChild(2),FALSE) ||
- SQL_ISRULE(parseTree->getChild(2),parameter) ||
- // odbc date
- (SQL_ISRULE(parseTree->getChild(2),set_fct_spec) && SQL_ISPUNCTUATION(parseTree->getChild(2)->getChild(0),"{"))))
- {
- m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
- }
-
- OSQLParseNode *pPrec = parseTree->getChild(1);
- if (pPrec->getNodeType() == SQL_NODE_EQUAL)
- op = MQueryOp::Is;
- else if (pPrec->getNodeType() == SQL_NODE_NOTEQUAL)
- op = MQueryOp::IsNot;
-
- ::rtl::OUString sTableRange;
- if(SQL_ISRULE(parseTree->getChild(0),column_ref))
- m_pSQLIterator->getColumnRange(parseTree->getChild(0),columnName,sTableRange);
- else if(parseTree->getChild(0)->isToken())
- columnName = parseTree->getChild(0)->getTokenValue();
-
- if ( SQL_ISRULE(parseTree->getChild(2),parameter) ) {
- parseParameter( parseTree->getChild(2), matchString );
- }
- else {
- matchString = parseTree->getChild(2)->getTokenValue();
- }
-
- if ( columnName.compareToAscii("0") ==0 && op == MQueryOp::Is &&
- matchString.compareToAscii("1") == 0 ) {
- OSL_TRACE("Query always evaluates to FALSE");
- m_bIsAlwaysFalseQuery = sal_True;
- }
- queryExpression.getExpressions().push_back( new MQueryExpressionString( columnName, op, matchString ));
- }
- else if (SQL_ISRULE(parseTree,like_predicate))
- {
- OSL_ENSURE(parseTree->count() == 2, "Error parsing LIKE predicate");
-
- OSL_TRACE("analyseSQL : Got LIKE rule\n");
-
- if ( !(SQL_ISRULE(parseTree->getChild(0), column_ref)) )
- {
- m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_INVALID_LIKE_COLUMN, *this );
- }
-
-
- OSQLParseNode *pColumn;
- OSQLParseNode *pAtom;
- OSQLParseNode *pOptEscape;
- const OSQLParseNode* pPart2 = parseTree->getChild(1);
- pColumn = parseTree->getChild(0); // Match Item
- pAtom = pPart2->getChild(pPart2->count()-2); // Match String
- pOptEscape = pPart2->getChild(pPart2->count()-1); // Opt Escape Rule
- (void)pOptEscape;
- const bool bNot = SQL_ISTOKEN(pPart2->getChild(0), NOT);
-
- if (!(pAtom->getNodeType() == SQL_NODE_STRING ||
- pAtom->getNodeType() == SQL_NODE_NAME ||
- SQL_ISRULE(pAtom,parameter) ||
- ( pAtom->getChild(0) && pAtom->getChild(0)->getNodeType() == SQL_NODE_NAME ) ||
- ( pAtom->getChild(0) && pAtom->getChild(0)->getNodeType() == SQL_NODE_STRING )
- ) )
- {
- OSL_TRACE("analyseSQL : pAtom->count() = %d\n", pAtom->count() );
-
- m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_INVALID_LIKE_STRING, *this );
- }
-
- const sal_Unicode WILDCARD = '%';
- const sal_Unicode ALT_WILDCARD = '*';
- const sal_Unicode MATCHCHAR = '_';
-
- ::rtl::OUString sTableRange;
- if(SQL_ISRULE(pColumn,column_ref))
- m_pSQLIterator->getColumnRange(pColumn,columnName,sTableRange);
-
- OSL_TRACE("ColumnName = %s\n", OUtoCStr( columnName ) );
-
- if ( SQL_ISRULE(pAtom,parameter) ) {
- parseParameter( pAtom, matchString );
- // Replace all '*' with '%' : UI Usually does this but not with
- // Parameters for some reason.
- matchString = matchString.replace( ALT_WILDCARD, WILDCARD );
- }
- else
- {
- matchString = pAtom->getTokenValue();
- }
-
- // Determine where '%' character is...
-
- if ( matchString.equals( ::rtl::OUString::valueOf( WILDCARD ) ) )
- {
- // String containing only a '%' and nothing else
- op = MQueryOp::Exists;
- // Will be ignored for Exists case, but clear anyway.
- matchString = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(""));
- }
- else if ( matchString.indexOf ( WILDCARD ) == -1 &&
- matchString.indexOf ( MATCHCHAR ) == -1 )
- {
- // Simple string , eg. "to match"
- if ( bNot )
- op = MQueryOp::DoesNotContain;
- else
- op = MQueryOp::Contains;
- }
- else if ( matchString.indexOf ( WILDCARD ) == 0
- && matchString.lastIndexOf ( WILDCARD ) == matchString.getLength() -1
- && matchString.indexOf ( WILDCARD, 1 ) == matchString.lastIndexOf ( WILDCARD )
- && matchString.indexOf( MATCHCHAR ) == -1
- )
- {
- // Relatively simple "%string%" - ie, contains...
- // Cut '%' from front and rear
- matchString = matchString.replaceAt( 0, 1, rtl::OUString() );
- matchString = matchString.replaceAt( matchString.getLength() -1 , 1, rtl::OUString() );
-
- if (bNot)
- op = MQueryOp::DoesNotContain;
- else
- op = MQueryOp::Contains;
- }
- else if ( bNot )
- {
- // We currently can't handle a 'NOT LIKE' when there are '%' or
- // '_' dispersed throughout
- m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_NOT_LIKE_TOO_COMPLEX, *this );
- }
- else
- {
- if ( (matchString.indexOf ( WILDCARD ) == matchString.lastIndexOf ( WILDCARD ))
- && matchString.indexOf( MATCHCHAR ) == -1
- )
- {
- // One occurrence of '%' - no '_' matches...
- if ( matchString.indexOf ( WILDCARD ) == 0 )
- {
- op = MQueryOp::EndsWith;
- matchString = matchString.replaceAt( 0, 1, rtl::OUString());
- }
- else if ( matchString.indexOf ( WILDCARD ) == matchString.getLength() -1 )
- {
- op = MQueryOp::BeginsWith;
- matchString = matchString.replaceAt( matchString.getLength() -1 , 1, rtl::OUString() );
- }
- else
- {
- sal_Int32 pos = matchString.indexOf ( WILDCARD );
- matchString = matchString.replaceAt( pos, 1,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".*")) );
- op = MQueryOp::RegExp;
- }
-
- }
- else
- {
- // Most Complex, need to use an RE
- sal_Int32 pos = matchString.indexOf ( WILDCARD );
- while ( (pos = matchString.indexOf ( WILDCARD )) != -1 )
- {
- matchString = matchString.replaceAt( pos, 1, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".*")) );
- }
-
- pos = matchString.indexOf ( MATCHCHAR );
- while ( (pos = matchString.indexOf( MATCHCHAR )) != -1 )
- {
- matchString = matchString.replaceAt( pos, 1, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".")) );
- }
-
- op = MQueryOp::RegExp;
- }
- }
-
- queryExpression.getExpressions().push_back( new MQueryExpressionString( columnName, op, matchString ));
- }
- else if (SQL_ISRULE(parseTree,test_for_null))
- {
- OSL_ENSURE(parseTree->count() == 2,"Error in ParseTree");
- const OSQLParseNode* pPart2 = parseTree->getChild(1);
- OSL_ENSURE(SQL_ISTOKEN(pPart2->getChild(0),IS),"Error in ParseTree");
-
- if (!SQL_ISRULE(parseTree->getChild(0),column_ref))
- {
- m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_INVALID_IS_NULL_COLUMN, *this );
- }
-
- if (SQL_ISTOKEN(pPart2->getChild(1),NOT))
- {
- op = MQueryOp::Exists;
- }
- else
- op = MQueryOp::DoesNotExist;
-
- ::rtl::OUString sTableRange;
- m_pSQLIterator->getColumnRange(parseTree->getChild(0),columnName,sTableRange);
-
- queryExpression.getExpressions().push_back( new MQueryExpressionString( columnName, op ));
- }
- else
- {
- OSL_TRACE( "Unexpected statement!!!" );
-
- m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
- }
-}
-
-
-// -----------------------------------------------------------------------------
-
-void OResultSet::fillRowData()
- throw( ::com::sun::star::sdbc::SQLException )
-{
- OSL_ENSURE( m_pStatement, "Require a statement" );
-
- MQueryExpression queryExpression;
-
- OConnection* xConnection = static_cast<OConnection*>(m_pStatement->getConnection().get());
- m_xColumns = m_pSQLIterator->getSelectColumns();
-
- OSL_ENSURE(m_xColumns.is(), "Need the Columns!!");
-
- OSQLColumns::Vector::const_iterator aIter = m_xColumns->get().begin();
- const ::rtl::OUString sProprtyName = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME);
- ::rtl::OUString sName;
- m_aAttributeStrings.clear();
- m_aAttributeStrings.reserve(m_xColumns->get().size());
- for (sal_Int32 i = 1; aIter != m_xColumns->get().end();++aIter, i++)
- {
- (*aIter)->getPropertyValue(sProprtyName) >>= sName;
-#if OSL_DEBUG_LEVEL > 0
- OSL_TRACE("Query Columns : (%d) %s\n", i, OUtoCStr(sName) );
-#endif
- m_aAttributeStrings.push_back( sName );
- }
-
-
- // Generate Match Conditions for Query
- const OSQLParseNode* pParseTree = m_pSQLIterator->getWhereTree();
-
- // const OSQLParseNode* pParseTree = NULL;
-
- m_bIsAlwaysFalseQuery = sal_False;
- if ( pParseTree != NULL )
- {
- // Extract required info
-
- OSL_TRACE("\tHave a Where Clause\n");
-
- analyseWhereClause( pParseTree, queryExpression );
- }
- else
- {
- OSL_TRACE("\tDon't have a Where Clause\n");
-
- MQueryExpression::ExprVector eVector;
-
- // LDAP does not allow a query without restriction, so we add a dummy
- // for PrimaryEmail
- // For other types we stick to the old behaviour of using
- // card:nsIAbCard.
- OSL_ENSURE(m_pStatement, "Cannot determine Parent Statement");
- ::rtl::OUString aStr;
- if (xConnection->isLDAP())
- aStr = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrimaryEmail"));
- else
- aStr = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("card:nsIAbCard"));
- eVector.push_back( new MQueryExpressionString(aStr, MQueryOp::Exists) );
-
- queryExpression.setExpressions( eVector );
- }
-
- // If the query is a 0=1 then set Row count to 0 and return
- if ( m_bIsAlwaysFalseQuery )
- {
- m_bIsReadOnly = 1;
- return;
- }
-
- m_aQuery.setExpression( queryExpression );
-
- rtl::OUString aStr( m_pTable->getName() );
- m_aQuery.setAddressbook( aStr );
-
- sal_Int32 rv = m_aQuery.executeQuery(xConnection);
- if ( rv == -1 ) {
- m_pStatement->getOwnConnection()->throwSQLException( STR_ERR_EXECUTING_QUERY, *this );
- }
- //determine whether the address book is readonly
- determineReadOnly();
-
-#if OSL_DEBUG_LEVEL > 0
- OSL_TRACE( "executeQuery returned %d\n", rv );
-
- OSL_TRACE( "\tOUT OResultSet::fillRowData()\n" );
-#endif
-}
-
-// -----------------------------------------------------------------------------
-static sal_Bool matchRow( OValueRow& row1, OValueRow& row2 )
-{
- OValueVector::Vector::iterator row1Iter = row1->get().begin();
- OValueVector::Vector::iterator row2Iter = row2->get().begin();
- for ( ++row1Iter,++row2Iter; // the first column is the bookmark column
- row1Iter != row1->get().end(); ++row1Iter,++row2Iter)
- {
- if ( row1Iter->isBound())
- {
- // Compare values, if at anytime there's a mismatch return false
- if ( !( (*row1Iter) == (*row2Iter) ) )
- return sal_False;
- }
- }
-
- // If we get to here the rows match
- return sal_True;
-}
-sal_Int32 OResultSet::getRowForCardNumber(sal_Int32 nCardNum)
-{
- OSL_TRACE("In/Out: OResultSet::getRowForCardNumber, nCardNum = %u", nCardNum );
-
- if ( m_pKeySet.is() )
- {
- sal_Int32 nPos;
- for(nPos=0;nPos < (sal_Int32)m_pKeySet->get().size();nPos++)
- {
- if (nCardNum == (m_pKeySet->get())[nPos])
- {
- OSL_TRACE("In/Out: OResultSet::getRowForCardNumber, return = %u", nPos+1 );
- return nPos+1;
- }
- }
- }
-
- m_pStatement->getOwnConnection()->throwSQLException( STR_INVALID_BOOKMARK, *this );
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- OSL_ENSURE( m_pTable, "Need a Table object");
- if(!m_pTable)
- {
- const OSQLTables& xTabs = m_pSQLIterator->getTables();
- if ((xTabs.begin() == xTabs.end()) || !xTabs.begin()->second.is())
- m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
-
- m_pTable = static_cast< OTable* > ((xTabs.begin()->second).get());
-
- }
-
- m_nRowPos = 0;
-
- fillRowData();
-
- OSL_ENSURE(m_xColumns.is(), "Need the Columns!!");
-
- // sal_Int32 nColumnCount = m_xColumns->size();
- // initializeRow(m_aRow,nColumnCount);
- // initializeRow(m_aEvaluateRow,nColumnCount);
-
- switch( m_pSQLIterator->getStatementType() )
- {
- case SQL_STATEMENT_SELECT:
- {
- if(m_bIsAlwaysFalseQuery) {
- break;
- }
- else if(isCount())
- {
- m_pStatement->getOwnConnection()->throwSQLException( STR_NO_COUNT_SUPPORT, *this );
- }
- else
- {
- sal_Bool bDistinct = sal_False;
- OSQLParseNode *pDistinct = m_pParseTree->getChild(1);
- if (pDistinct && pDistinct->getTokenID() == SQL_TOKEN_DISTINCT)
- {
- if(!IsSorted())
- {
- m_aOrderbyColumnNumber.push_back(m_aColMapping[1]);
- m_aOrderbyAscending.push_back(SQL_DESC);
- }
- bDistinct = sal_True;
- }
-
- OSortIndex::TKeyTypeVector eKeyType(m_aOrderbyColumnNumber.size());
- ::std::vector<sal_Int32>::iterator aOrderByIter = m_aOrderbyColumnNumber.begin();
- for ( ::std::vector<sal_Int16>::size_type i = 0; aOrderByIter != m_aOrderbyColumnNumber.end(); ++aOrderByIter,++i)
- {
- OSL_ENSURE((sal_Int32)m_aRow->get().size() > *aOrderByIter,"Invalid Index");
- switch ((m_aRow->get().begin()+*aOrderByIter)->getTypeKind())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- eKeyType[i] = SQL_ORDERBYKEY_STRING;
- break;
-
- case DataType::OTHER:
- case DataType::TINYINT:
- case DataType::SMALLINT:
- case DataType::INTEGER:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::REAL:
- case DataType::DOUBLE:
- case DataType::DATE:
- case DataType::TIME:
- case DataType::TIMESTAMP:
- case DataType::BIT:
- eKeyType[i] = SQL_ORDERBYKEY_DOUBLE;
- break;
-
- // Other types aren't implemented (so they are always FALSE)
- default:
- eKeyType[i] = SQL_ORDERBYKEY_NONE;
- OSL_FAIL("MResultSet::executeQuery: Order By Data Type not implemented");
- break;
- }
- }
-
- if (IsSorted())
- {
- // Implement Sorting
-
- // So that we can sort we need to wait until the executed
- // query to the mozilla addressbooks has returned all
- // values.
-
- OSL_TRACE("Query is to be sorted");
- if( ! m_aQuery.queryComplete() )
- if ( !m_aQuery.waitForQueryComplete() )
- {
- m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
- }
-
- OSL_ENSURE( m_aQuery.queryComplete(), "Query not complete!!");
-
- m_pSortIndex = new OSortIndex(eKeyType,m_aOrderbyAscending);
-
- OSL_TRACE("OrderbyColumnNumber->size() = %d",m_aOrderbyColumnNumber.size());
-#if OSL_DEBUG_LEVEL > 0
- for ( ::std::vector<sal_Int32>::size_type i = 0; i < m_aColMapping.size(); i++ )
- OSL_TRACE("Mapped: %d -> %d", i, m_aColMapping[i] );
-#endif
- for ( sal_Int32 nRow = 1; nRow <= m_aQuery.getRowCount(); nRow++ ) {
-
- OKeyValue* pKeyValue = OKeyValue::createKeyValue((nRow));
-
- ::std::vector<sal_Int32>::iterator aIter = m_aOrderbyColumnNumber.begin();
- for (;aIter != m_aOrderbyColumnNumber.end(); ++aIter)
- {
- const ORowSetValue& value = getValue(nRow, *aIter);
-
- OSL_TRACE( "Adding Value: (%d,%d) : %s", nRow, *aIter,OUtoCStr( value ));
-
- pKeyValue->pushKey(new ORowSetValueDecorator(value));
- }
-
- m_pSortIndex->AddKeyValue( pKeyValue );
- }
-
- m_pKeySet = m_pSortIndex->CreateKeySet();
- m_CurrentRowCount = m_pKeySet->get().size();
-#if OSL_DEBUG_LEVEL > 0
- for( OKeySet::Vector::size_type i = 0; i < m_pKeySet->get().size(); i++ )
- OSL_TRACE("Sorted: %d -> %d", i, (m_pKeySet->get())[i] );
-#endif
-
- m_pSortIndex = NULL;
- beforeFirst(); // Go back to start
- }
- else //we always need m_pKeySet now
- m_pKeySet = new OKeySet();
-
- // Handle the DISTINCT case
- if ( bDistinct && m_pKeySet.is() )
- {
- OValueRow aSearchRow = new OValueVector( m_aRow->get().size() );
-
- for( OKeySet::Vector::size_type i = 0; i < m_pKeySet->get().size(); i++ )
- {
- fetchRow( (m_pKeySet->get())[i] ); // Fills m_aRow
- if ( matchRow( m_aRow, aSearchRow ) )
- {
- (m_pKeySet->get())[i] = 0; // Marker for later to be removed
- }
- else
- {
- // They don't match, so it's not a duplicate.
- // Use the current Row as the next one to match against
- *aSearchRow = *m_aRow;
- }
- }
- // Now remove any keys marked with a 0
- m_pKeySet->get().erase(::std::remove_if(m_pKeySet->get().begin(),m_pKeySet->get().end()
- ,::std::bind2nd(::std::equal_to<sal_Int32>(),0))
- ,m_pKeySet->get().end());
-
- }
- }
- } break;
-
- case SQL_STATEMENT_UPDATE:
- case SQL_STATEMENT_DELETE:
- case SQL_STATEMENT_INSERT:
- break;
- default:
- m_pStatement->getOwnConnection()->throwSQLException( STR_STMT_TYPE_NOT_SUPPORTED, *this );
- break;
- }
-}
-
-// -----------------------------------------------------------------------------
-
-void OResultSet::setBoundedColumns(const OValueRow& _rRow,
- const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
- const Reference<XIndexAccess>& _xNames,
- sal_Bool _bSetColumnMapping,
- const Reference<XDatabaseMetaData>& _xMetaData,
- ::std::vector<sal_Int32>& _rColMapping)
-{
- ::comphelper::UStringMixEqual aCase(_xMetaData->supportsMixedCaseQuotedIdentifiers());
-
- Reference<XPropertySet> xTableColumn;
- ::rtl::OUString sTableColumnName, sSelectColumnRealName;
-
- const ::rtl::OUString sName = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME);
- const ::rtl::OUString sRealName = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME);
-
- ::std::vector< ::rtl::OUString> aColumnNames;
- aColumnNames.reserve(_rxColumns->get().size());
- OValueVector::Vector::iterator aRowIter = _rRow->get().begin()+1;
- for (sal_Int32 i=0; // the first column is the bookmark column
- aRowIter != _rRow->get().end();
- ++i, ++aRowIter
- )
- {
- try
- {
- // get the table column and it's name
- _xNames->getByIndex(i) >>= xTableColumn;
- OSL_ENSURE(xTableColumn.is(), "OResultSet::setBoundedColumns: invalid table column!");
- if (xTableColumn.is())
- xTableColumn->getPropertyValue(sName) >>= sTableColumnName;
- else
- sTableColumnName = ::rtl::OUString();
-
- // look if we have such a select column
- // TODO: would like to have a O(log n) search here ...
- sal_Int32 nColumnPos = 0;
- for ( OSQLColumns::Vector::iterator aIter = _rxColumns->get().begin();
- aIter != _rxColumns->get().end();
- ++aIter,++nColumnPos
- )
- {
- if ( nColumnPos < (sal_Int32)aColumnNames.size() )
- sSelectColumnRealName = aColumnNames[nColumnPos];
- else
- {
- if((*aIter)->getPropertySetInfo()->hasPropertyByName(sRealName))
- (*aIter)->getPropertyValue(sRealName) >>= sSelectColumnRealName;
- else
- (*aIter)->getPropertyValue(sName) >>= sSelectColumnRealName;
- aColumnNames.push_back(sSelectColumnRealName);
- }
-
- if (aCase(sTableColumnName, sSelectColumnRealName))
- {
- if(_bSetColumnMapping)
- {
- sal_Int32 nSelectColumnPos = aIter - _rxColumns->get().begin() + 1;
- // the getXXX methods are 1-based ...
- sal_Int32 nTableColumnPos = i + 1;
- // get first table column is the bookmark column
- // ...
-#if OSL_DEBUG_LEVEL > 0
- OSL_TRACE("Set Col Mapping: %d -> %d", nSelectColumnPos, nTableColumnPos );
-#endif
- _rColMapping[nSelectColumnPos] = nTableColumnPos;
- }
-
- aRowIter->setBound(sal_True);
- aRowIter->setTypeKind(DataType::VARCHAR);
- }
- }
- }
- catch (Exception&)
- {
- OSL_FAIL("OResultSet::setBoundedColumns: caught an Exception!");
- }
- }
-}
-
-
-// -----------------------------------------------------------------------------
-sal_Bool OResultSet::isCount() const
-{
- return (m_pParseTree &&
- m_pParseTree->count() > 2 &&
- SQL_ISRULE(m_pParseTree->getChild(2),scalar_exp_commalist) &&
- SQL_ISRULE(m_pParseTree->getChild(2)->getChild(0),derived_column) &&
- SQL_ISRULE(m_pParseTree->getChild(2)->getChild(0)->getChild(0),general_set_fct) &&
- m_pParseTree->getChild(2)->getChild(0)->getChild(0)->count() == 4
- );
-}
-
-// -----------------------------------------------------------------------------
-//
-// Check for valid row in m_aQuery
-//
-sal_Bool OResultSet::validRow( sal_uInt32 nRow )
-{
- sal_Int32 nNumberOfRecords = m_aQuery.getRealRowCount();
-
- while ( nRow > (sal_uInt32)nNumberOfRecords && !m_aQuery.queryComplete() ) {
-#if OSL_DEBUG_LEVEL > 0
- OSL_TRACE("validRow: waiting...");
-#endif
- m_aQuery.checkRowAvailable( nRow );
- if ( m_aQuery.hadError() )
- {
- m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
- }
- nNumberOfRecords = m_aQuery.getRealRowCount();
- }
-
- if (( nRow == 0 ) ||
- ( nRow > (sal_uInt32)nNumberOfRecords && m_aQuery.queryComplete()) ){
- OSL_TRACE("validRow(%u): return False", nRow);
- return sal_False;
- }
-#if OSL_DEBUG_LEVEL > 0
- OSL_TRACE("validRow(%u): return True", nRow);
-#endif
- return sal_True;
-}
-sal_Bool OResultSet::fillKeySet(sal_Int32 nMaxCardNumber)
-{
- impl_ensureKeySet();
- if (m_CurrentRowCount < nMaxCardNumber)
- {
- sal_Int32 nKeyValue;
- if ( (sal_Int32)m_pKeySet->get().capacity() < nMaxCardNumber )
- m_pKeySet->get().reserve(nMaxCardNumber + 20 );
-
- for (nKeyValue = m_CurrentRowCount+1; nKeyValue <= nMaxCardNumber; nKeyValue ++)
- m_pKeySet->get().push_back( nKeyValue );
- m_CurrentRowCount = nMaxCardNumber;
- }
- return sal_True;
-}
-
-sal_Int32 OResultSet::deletedCount()
-{
- impl_ensureKeySet();
- return m_CurrentRowCount - m_pKeySet->get().size();
-
-}
-// -----------------------------------------------------------------------------
-sal_Bool OResultSet::seekRow( eRowPosition pos, sal_Int32 nOffset )
-{
- ResultSetEntryGuard aGuard( *this );
- if ( !m_pKeySet.is() )
- m_pStatement->getOwnConnection()->throwSQLException( STR_ILLEGAL_MOVEMENT, *this );
-
- sal_Int32 nNumberOfRecords = m_aQuery.getRealRowCount();
- sal_Int32 nRetrivedRows = currentRowCount();
- sal_Int32 nCurPos = m_nRowPos;
-
- OSL_TRACE("seekRow: nCurPos = %d", nCurPos );
- switch( pos ) {
- case NEXT_POS:
- OSL_TRACE("seekRow: NEXT");
- nCurPos++;
- break;
- case PRIOR_POS:
- OSL_TRACE("seekRow: PRIOR");
- if ( nCurPos > 0 )
- nCurPos--;
- break;
-
- case FIRST_POS:
- OSL_TRACE("seekRow: FIRST");
- nCurPos = 1;
- break;
-
- case LAST_POS:
- OSL_TRACE("seekRow: LAST");
- nCurPos = nRetrivedRows;
- break;
- case ABSOLUTE_POS:
- OSL_TRACE("seekRow: ABSOLUTE : %d", nOffset);
- nCurPos = nOffset;
- break;
- case RELATIVE_POS:
- OSL_TRACE("seekRow: RELATIVE : %d", nOffset);
- nCurPos += sal_uInt32( nOffset );
- break;
- }
-
- if ( nCurPos <= 0 ) {
- m_nRowPos = 0;
- OSL_TRACE("seekRow: return False, m_nRowPos = %u", m_nRowPos );
- return sal_False;
- }
- sal_Int32 nCurCard = nCurPos;
- if ( nCurPos < (sal_Int32)m_pKeySet->get().size() ) //The requested row is exist in m_pKeySet, so we just use it
- {
- nCurCard = (m_pKeySet->get())[nCurPos-1];
- }
- else //The requested row has not been retrived until now. We should get the right card for it.
- nCurCard = nCurPos + deletedCount();
-
- while ( nCurCard > nNumberOfRecords && !m_aQuery.queryComplete() ) {
- m_aQuery.checkRowAvailable( nCurCard );
- if ( m_aQuery.hadError() )
- {
- m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
- }
- nNumberOfRecords = m_aQuery.getRealRowCount();
- }
-
- if ( nCurCard > nNumberOfRecords && m_aQuery.queryComplete()) {
- fillKeySet(nNumberOfRecords);
- m_nRowPos = m_pKeySet->get().size() + 1;
- OSL_TRACE("seekRow: return False, m_nRowPos = %u", m_nRowPos );
- return sal_False;
- }
- //Insert new retrived items for later use
- fillKeySet(nNumberOfRecords);
- m_nRowPos = (sal_uInt32)nCurPos;
- OSL_TRACE("seekRow: return True, m_nRowPos = %u", m_nRowPos );
- fetchCurrentRow();
- return sal_True;
-}
-// -----------------------------------------------------------------------------
-void OResultSet::setColumnMapping(const ::std::vector<sal_Int32>& _aColumnMapping)
-{
- m_aColMapping = _aColumnMapping;
-#if OSL_DEBUG_LEVEL > 0
- for ( sal_uInt32 i = 0; i < m_aColMapping.size(); i++ )
- OSL_TRACE("Set Mapped: %d -> %d", i, m_aColMapping[i] );
-#endif
-}
-// -----------------------------------------------------------------------------
-
-::com::sun::star::uno::Any OResultSet::getBookmark( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- OSL_TRACE("getBookmark, m_nRowPos = %u", m_nRowPos );
- ResultSetEntryGuard aGuard( *this );
- if ( fetchCurrentRow() == sal_False )
- m_pStatement->getOwnConnection()->throwSQLException( STR_ERROR_GET_ROW, *this );
-
- OSL_ENSURE((!m_aRow->isDeleted()),"getBookmark called for deleted row");
- return makeAny((sal_Int32)(m_aRow->get())[0]);
-}
-sal_Bool OResultSet::moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("moveToBookmark, bookmark = %u", comphelper::getINT32(bookmark) );
- sal_Int32 nCardNum = comphelper::getINT32(bookmark);
- m_nRowPos = getRowForCardNumber(nCardNum);
- fetchCurrentRow();
- return sal_True;
-}
-sal_Bool OResultSet::moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("moveRelativeToBookmark, bookmark = %u rows= %u", comphelper::getINT32(bookmark),rows );
- sal_Int32 nCardNum = comphelper::getINT32(bookmark);
- m_nRowPos = getRowForCardNumber(nCardNum);
- return seekRow(RELATIVE_POS,rows );
-}
-sal_Int32 OResultSet::compareBookmarks( const ::com::sun::star::uno::Any& lhs, const ::com::sun::star::uno::Any& rhs ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("compareBookmarks, m_nRowPos = %u", m_nRowPos );
- sal_Int32 nFirst=0;
- sal_Int32 nSecond=0;
- sal_Int32 nResult=0;
-
- if ( !( lhs >>= nFirst ) || !( rhs >>= nSecond ) )
- m_pStatement->getOwnConnection()->throwSQLException( STR_INVALID_BOOKMARK, *this );
-
- if(nFirst < nSecond)
- nResult = -1;
- else if(nFirst > nSecond)
- nResult = 1;
- else
- nResult = 0;
-
- return nResult;
-}
-sal_Bool OResultSet::hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("hasOrderedBookmarks, m_nRowPos = %u", m_nRowPos );
- return sal_True;
-}
-sal_Int32 OResultSet::hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("hashBookmark, m_nRowPos = %u", m_nRowPos );
- return comphelper::getINT32(bookmark);
-}
-
-sal_Int32 OResultSet::getCurrentCardNumber()
-{
- if ( ( m_nRowPos == 0 ) || !m_pKeySet.is() )
- return 0;
- if (m_pKeySet->get().size() < m_nRowPos)
- return 0;
- return (m_pKeySet->get())[m_nRowPos-1];
-}
-void OResultSet::checkPendingUpdate() throw(SQLException, RuntimeException)
-{
- OSL_TRACE("checkPendingUpdate, m_nRowPos = %u", m_nRowPos );
- const sal_Int32 nCurrentRow = getCurrentCardNumber();
-
- if ((m_nNewRow && nCurrentRow != m_nNewRow)
- || ( m_nUpdatedRow && m_nUpdatedRow != nCurrentRow))
- {
- const ::rtl::OUString sError( m_pStatement->getOwnConnection()->getResources().getResourceStringWithSubstitution(
- STR_COMMIT_ROW,
- "$position$", ::rtl::OUString::valueOf(nCurrentRow)
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
-
-}
-void OResultSet::updateValue(sal_Int32 columnIndex ,const ORowSetValue& x) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("updateValue, m_nRowPos = %u", m_nRowPos );
- ResultSetEntryGuard aGuard( *this );
- if ( fetchCurrentRow() == sal_False )
- m_pStatement->getOwnConnection()->throwSQLException( STR_ERROR_GET_ROW, *this );
-
-
- checkPendingUpdate();
-
- checkIndex(columnIndex );
- columnIndex = mapColumn(columnIndex);
-
- (m_aRow->get())[columnIndex].setBound(sal_True);
- (m_aRow->get())[columnIndex] = x;
- m_nUpdatedRow = getCurrentCardNumber();
- m_RowStates = m_RowStates | RowStates_Updated;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("updateNull, m_nRowPos = %u", m_nRowPos );
- ResultSetEntryGuard aGuard( *this );
- if ( fetchCurrentRow() == sal_False )
- m_pStatement->getOwnConnection()->throwSQLException( STR_ERROR_GET_ROW, *this );
-
- checkPendingUpdate();
- checkIndex(columnIndex );
- columnIndex = mapColumn(columnIndex);
-
- (m_aRow->get())[columnIndex].setBound(sal_True);
- (m_aRow->get())[columnIndex].setNull();
- m_nUpdatedRow = getCurrentCardNumber();
- m_RowStates = m_RowStates | RowStates_Updated;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateLong( sal_Int32 /*columnIndex*/, sal_Int64 /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XRowUpdate::updateLong", *this );
-}
-// -----------------------------------------------------------------------
-void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
-
- if(!x.is())
- ::dbtools::throwFunctionSequenceException(*this);
-
- Sequence<sal_Int8> aSeq;
- x->readBytes(aSeq,length);
- updateValue(columnIndex,aSeq);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- updateBinaryStream(columnIndex,x,length);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException)
-{
- if (!::dbtools::implUpdateObject(this, columnIndex, x))
- {
- const ::rtl::OUString sError( m_pStatement->getOwnConnection()->getResources().getResourceStringWithSubstitution(
- STR_COLUMN_NOT_UPDATEABLE,
- "$position$", ::rtl::OUString::valueOf(columnIndex)
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- } // if (!::dbtools::implUpdateObject(this, columnIndex, x))
- }
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 /*scale*/ ) throw(SQLException, RuntimeException)
-{
- if (!::dbtools::implUpdateObject(this, columnIndex, x))
- {
- const ::rtl::OUString sError( m_pStatement->getOwnConnection()->getResources().getResourceStringWithSubstitution(
- STR_COLUMN_NOT_UPDATEABLE,
- "$position$", ::rtl::OUString::valueOf(columnIndex)
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
-}
-
-// XResultSetUpdate
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("insertRow in, m_nRowPos = %u", m_nRowPos );
- m_RowStates = RowStates_Inserted;
- updateRow();
- m_nOldRowPos = 0;
- m_nNewRow = 0;
- m_aQuery.setRowStates(getCurrentCardNumber(),m_RowStates);
- OSL_TRACE("insertRow out, m_nRowPos = %u", m_nRowPos );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- OSL_TRACE("updateRow in, m_nRowPos = %u", m_nRowPos );
- ResultSetEntryGuard aGuard( *this );
- impl_ensureKeySet();
-
- if (!m_nRowPos || m_pKeySet->get().size() < m_nRowPos )
- m_pStatement->getOwnConnection()->throwSQLException( STR_INVALID_ROW_UPDATE, *this );
-
- const sal_Int32 nCurrentCard = getCurrentCardNumber();
-
- if (!pushCard(nCurrentCard))
- {
- m_RowStates = RowStates_Error;
- m_pStatement->getOwnConnection()->throwSQLException( STR_ROW_CAN_NOT_SAVE, *this );
- }
-
- if (!m_aQuery.commitRow(nCurrentCard))
- {
- m_RowStates = RowStates_Error;
- m_nUpdatedRow = 0;
- m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
- }
-
- m_nUpdatedRow = 0;
- fetchCurrentRow();
- OSL_TRACE("updateRow out, m_nRowPos = %u", m_nRowPos );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- OSL_TRACE("deleteRow, m_nRowPos = %u", m_nRowPos );
- ResultSetEntryGuard aGuard( *this );
- if (rowDeleted())
- m_pStatement->getOwnConnection()->throwSQLException( STR_ROW_ALREADY_DELETED, *this );
-
- const sal_Int32 nCurrentRow = getCurrentCardNumber();
- //fetchRow(nCurrentRow);
- if (!nCurrentRow)
- m_pStatement->getOwnConnection()->throwSQLException( STR_ERROR_GET_ROW, *this );
-
- sal_Bool m_bRowDeleted = ( m_aQuery.deleteRow( nCurrentRow ) > 0 );
- if (!m_bRowDeleted)
- m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
-
- m_aQuery.setRowStates(nCurrentRow,RowStates_Deleted);
- m_pKeySet->get().erase(m_pKeySet->get().begin() + m_nRowPos -1);
- m_RowStates = RowStates_Deleted;
- OSL_TRACE("deleteRow out, m_nRowPos = %u", m_nRowPos );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("cancelRowUpdates, m_nRowPos = %u", m_nRowPos );
- if (fetchRow(getCurrentCardNumber(),sal_True)) //force fetch current row will cause we lose all change to the current row
- m_pStatement->getOwnConnection()->throwSQLException( STR_CAN_NOT_CANCEL_ROW_UPDATE, *this );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- OSL_TRACE("moveToInsertRow in, m_nRowPos = %u", m_nRowPos );
- ResultSetEntryGuard aGuard( *this );
- m_nOldRowPos = m_nRowPos;
-
- if (!m_nNewRow) //no new row now, insert one
- {
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- checkPendingUpdate();
- if (rowUpdated())
- {
- if (m_nRowPos && !pushCard(getCurrentCardNumber()))
- throw SQLException();
- }
- m_nNewRow = m_aQuery.createNewCard();
- if (!m_nNewRow)
- m_pStatement->getOwnConnection()->throwSQLException( STR_CAN_NOT_CREATE_ROW, *this );
-
- m_RowStates = RowStates_Normal;
- fillKeySet(m_nNewRow);
- }
- else
- m_nUpdatedRow = 0;
-
- m_nRowPos = m_pKeySet->get().size();
- fetchCurrentRow();
- OSL_TRACE("moveToInsertRow out, m_nRowPos = %u", m_nRowPos );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ResultSetEntryGuard aGuard( *this );
- OSL_TRACE("moveToCurrentRow, m_nRowPos = %u", m_nRowPos );
- if (rowInserted())
- {
- m_nRowPos = m_nOldRowPos;
- fetchCurrentRow();
- }
-}
-
-sal_Bool OResultSet::determineReadOnly()
-{
- if (m_bIsReadOnly == -1)
- {
- OConnection* xConnection = static_cast<OConnection*>(m_pStatement->getConnection().get());
- m_bIsReadOnly = !m_aQuery.isWritable(xConnection) || m_bIsAlwaysFalseQuery;
- }
-
- return m_bIsReadOnly != 0;
-}
-
-void OResultSet::setTable(OTable* _rTable)
-{
- OSL_TRACE("In : setTable");
- m_pTable = _rTable;
- m_pTable->acquire();
- m_xTableColumns = m_pTable->getColumns();
- if(m_xTableColumns.is())
- m_aColumnNames = m_xTableColumns->getElementNames();
- OSL_TRACE("Out : setTable");
-}
-
-void OResultSet::setOrderByColumns(const ::std::vector<sal_Int32>& _aColumnOrderBy)
-{
- m_aOrderbyColumnNumber = _aColumnOrderBy;
-}
-
-void OResultSet::setOrderByAscending(const ::std::vector<TAscendingOrder>& _aOrderbyAsc)
-{
- m_aOrderbyAscending = _aOrderbyAsc;
-}
-Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& /*rows*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XDeleteRows::deleteRows", *this );
- return Sequence< sal_Int32 >();
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MResultSet.hxx b/connectivity/source/drivers/mozab/MResultSet.hxx
deleted file mode 100644
index 7f0f93985d..0000000000
--- a/connectivity/source/drivers/mozab/MResultSet.hxx
+++ /dev/null
@@ -1,369 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_SRESULTSET_HXX
-#define CONNECTIVITY_SRESULTSET_HXX
-
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
-#include <com/sun/star/sdbcx/XDeleteRows.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <cppuhelper/compbase12.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include "MStatement.hxx"
-#include "connectivity/CommonTools.hxx"
-#include "connectivity/FValue.hxx"
-#include "connectivity/sqliterator.hxx"
-#include "TSortIndex.hxx"
-#include "mozillasrc/MQuery.hxx"
-
-
-namespace connectivity
-{
- namespace mozab
- {
-
- /*
- ** java_sql_ResultSet
- */
- typedef ::cppu::WeakComponentImplHelper12< ::com::sun::star::sdbc::XResultSet,
- ::com::sun::star::sdbc::XRow,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XColumnLocate,
- ::com::sun::star::sdbc::XResultSetUpdate,
- ::com::sun::star::sdbc::XRowUpdate,
- ::com::sun::star::sdbcx::XRowLocate,
- ::com::sun::star::sdbcx::XDeleteRows,
- ::com::sun::star::lang::XServiceInfo> OResultSet_BASE;
-
-
- typedef sal_Int64 TVoidPtr;
- typedef ::std::allocator< TVoidPtr > TVoidAlloc;
- typedef ::std::vector<TVoidPtr> TVoidVector;
-
- class OResultSet : public comphelper::OBaseMutex,
- public OResultSet_BASE,
- public ::cppu::OPropertySetHelper,
- public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
- {
- protected:
- OCommonStatement* m_pStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
- sal_uInt32 m_nRowPos;
- sal_uInt32 m_nOldRowPos;
- sal_Bool m_bWasNull;
- sal_Int32 m_nFetchSize;
- sal_Int32 m_nResultSetType;
- sal_Int32 m_nFetchDirection;
- sal_Int32 m_nResultSetConcurrency;
-
-
-
- ::boost::shared_ptr< ::connectivity::OSQLParseTreeIterator >
- m_pSQLIterator;
- const connectivity::OSQLParseNode* m_pParseTree;
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- )
- throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle
- ) const;
-
- // you can't delete objects of this type
- virtual ~OResultSet();
- public:
- DECLARE_SERVICE_INFO();
-
- OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< ::connectivity::OSQLParseTreeIterator >& _pSQLIterator );
-
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
- {
- return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(*(OResultSet_BASE*)this);
- }
-
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XResultSet
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XColumnLocate
- virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XResultSetUpdate
- virtual void SAL_CALL insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRowUpdate
- virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRowLocate
- virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XDeleteRows
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
-protected:
- MQuery m_aQuery;
- OTable* m_pTable;
- sal_Int32 m_CurrentRowCount;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
- m_xTableColumns;
-
- ::std::vector<sal_Int32> m_aColMapping; // pos 0 is unused so we don't have to decrement 1 everytime
- ::std::vector<sal_Int32> m_aOrderbyColumnNumber;
- ::std::vector<TAscendingOrder> m_aOrderbyAscending;
- ::com::sun::star::uno::Sequence< ::rtl::OUString> m_aColumnNames;
- OValueRow m_aRow;
- OValueRow m_aParameterRow;
- ::std::vector< ::rtl::OUString> m_aAttributeStrings;
- sal_Int32 m_nParamIndex;
- sal_Bool m_bIsAlwaysFalseQuery;
- ::rtl::Reference<OKeySet> m_pKeySet;
- OSortIndex* m_pSortIndex;
- sal_Int32 m_nNewRow; //inserted row
- sal_Int32 m_nUpdatedRow; //updated row
- sal_Int32 m_RowStates;
- sal_Int32 m_bIsReadOnly;
- inline void resetParameters() { m_nParamIndex = 0; }
-
- ::rtl::Reference<connectivity::OSQLColumns> m_xColumns; // this are the select columns
- ::rtl::Reference<connectivity::OSQLColumns> m_xParamColumns;
-
- void parseParameter( const OSQLParseNode* pNode, rtl::OUString& rMatchString );
- void fillRowData() throw( ::com::sun::star::sdbc::SQLException );
- void initializeRow(OValueRow& _rRow,sal_Int32 _nColumnCount);
- void analyseWhereClause( const OSQLParseNode* parseTree,
- MQueryExpression &queryExpression);
-
- sal_Bool isCount() const;
-
- // XXX sal_Bool IsSorted() const { return !m_aOrderbyColumnNumber.empty() && m_aOrderbyColumnNumber[0] != STRING_NOTFOUND ;}
- sal_Bool IsSorted() const { return !m_aOrderbyColumnNumber.empty(); }
-
- enum eRowPosition {
- NEXT_POS, PRIOR_POS, FIRST_POS, LAST_POS, ABSOLUTE_POS, RELATIVE_POS
- };
-
- sal_uInt32 currentRowCount();
-
- sal_Bool fetchRow(sal_Int32 rowIndex,sal_Bool bForceReload=sal_False) throw( ::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- sal_Bool fetchCurrentRow() throw( ::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- sal_Bool pushCard(sal_uInt32 rowIndex) throw( ::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- sal_Bool validRow( sal_uInt32 nRow );
- sal_Bool seekRow( eRowPosition pos, sal_Int32 nOffset = 0 );
- sal_Int32 deletedCount();
- sal_Bool fillKeySet(sal_Int32 nMaxCardNumber); //When we get new rows, fill the m_pKeySet items for them
- sal_Int32 getRowForCardNumber(sal_Int32 nCardNum);
- const ORowSetValue& getValue(sal_Int32 rowIndex, sal_Int32 columnIndex)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- void updateValue(sal_Int32 columnIndex,const ORowSetValue& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void checkPendingUpdate() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getCurrentCardNumber();
-
-public:
- sal_Bool determineReadOnly();
- // MozAddressbook Specific methods
- void SAL_CALL executeQuery() throw( ::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
-
- void setTable(OTable* _rTable);
-
- void setParameterRow(const OValueRow& _rParaRow)
- { m_aParameterRow = _rParaRow; }
-
- void setParameterColumns(const ::rtl::Reference<connectivity::OSQLColumns>& _xParamColumns)
- { m_xParamColumns = _xParamColumns; }
-
- void setBindingRow(const OValueRow& _aRow)
- { m_aRow = _aRow; }
-
- void setColumnMapping(const ::std::vector<sal_Int32>& _aColumnMapping);
-
- void setOrderByColumns(const ::std::vector<sal_Int32>& _aColumnOrderBy);
-
- void setOrderByAscending(const ::std::vector<TAscendingOrder>& _aOrderbyAsc);
-
- inline sal_Int32 mapColumn(sal_Int32 column);
-
- void checkIndex(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException);
-
- static void setBoundedColumns(
- const OValueRow& _rRow,
- const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xNames,
- sal_Bool _bSetColumnMapping,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _xMetaData,
- ::std::vector<sal_Int32>& _rColMapping);
-
- ::osl::Mutex& getMutex() { return m_aMutex; }
- void methodEntry();
-
- private:
- inline void impl_ensureKeySet()
- {
- if ( !m_pKeySet.is() )
- m_pKeySet = new OKeySet();
- }
-
- protected:
- using OPropertySetHelper::getFastPropertyValue;
- };
-
- inline sal_Int32 OResultSet::mapColumn(sal_Int32 column)
- {
- sal_Int32 map = column;
-
- OSL_ENSURE(column > 0, "OResultSet::mapColumn: invalid column index!");
- // the first column (index 0) is for convenience only. The
- // first real select column is no 1.
- if ((column > 0) && (column < (sal_Int32)m_aColMapping.size()))
- map = m_aColMapping[column];
-
- return map;
- }
-
- class ResultSetEntryGuard : public ::osl::MutexGuard
- {
- public:
- ResultSetEntryGuard( OResultSet& _rRS ) : ::osl::MutexGuard( _rRS.getMutex() )
- {
- _rRS.methodEntry();
- }
- };
-
- }
-}
-#endif // CONNECTIVITY_SRESULTSET_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MResultSetMetaData.cxx b/connectivity/source/drivers/mozab/MResultSetMetaData.cxx
deleted file mode 100644
index 3ca9036c33..0000000000
--- a/connectivity/source/drivers/mozab/MResultSetMetaData.cxx
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/dbexception.hxx"
-#include "connectivity/dbtools.hxx"
-#include <comphelper/types.hxx>
-#include <comphelper/extract.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <tools/diagnose_ex.h>
-#include "MResultSetMetaData.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-
-using namespace connectivity::mozab;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::beans;
-using namespace ::dbtools;
-using namespace ::comphelper;
-
-// -------------------------------------------------------------------------
-OResultSetMetaData::~OResultSetMetaData()
-{
- m_xColumns = NULL;
-}
-
-// -----------------------------------------------------------------------------
-void OResultSetMetaData::checkColumnIndex(sal_Int32 column) throw(SQLException, RuntimeException)
-{
- if(column <= 0 || column > (sal_Int32)(sal_Int32)m_xColumns->get().size())
- throwInvalidIndexException(*this);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return getPrecision(column);
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSetMetaData::getColumnType( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return DataType::VARCHAR; // at the moment there exists only this type
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSetMetaData::getColumnCount( ) throw(SQLException, RuntimeException)
-{
- return (m_xColumns->get()).size();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL OResultSetMetaData::getSchemaName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- checkColumnIndex(column);
-
- ::rtl::OUString sColumnName;
- try
- {
- Reference< XPropertySet > xColumnProps( (m_xColumns->get())[column-1], UNO_QUERY_THROW );
- OSL_VERIFY( xColumnProps->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_NAME ) ) >>= sColumnName );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return sColumnName;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getTableName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return m_aTableName;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getCatalogName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnTypeName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- checkColumnIndex(column);
- return getString((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)));
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnLabel( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return getColumnName(column);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnServiceName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isCurrency( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- checkColumnIndex(column);
- return getBOOL((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)));
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isAutoIncrement( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSetMetaData::isSigned( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getPrecision( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- checkColumnIndex(column);
- return getINT32((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)));
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- checkColumnIndex(column);
- return getINT32((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)));
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- checkColumnIndex(column);
- return getINT32((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)));
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString sColumnName( getColumnName( column ) );
-
- if ( !m_pTable || !m_pTable->getConnection() )
- {
- OSL_FAIL( "OResultSetMetaData::isSearchable: suspicious: called without table or connection!" );
- return sal_False;
- }
-
- if ( m_pTable->getConnection()->isLDAP() )
- {
- const OColumnAlias& aAliases( m_pTable->getConnection()->getColumnAlias() );
- if ( !aAliases.isColumnSearchable( sColumnName ) )
- return sal_False;
- }
-
- return sal_True;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isReadOnly( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- checkColumnIndex(column);
- sal_Bool bReadOnly = (m_xColumns->get())[column-1]->getPropertySetInfo()->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION)) &&
- ::cppu::any2bool((m_xColumns->get())[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION)));
-
- return m_bReadOnly || bReadOnly || m_pTable->isReadOnly();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isDefinitelyWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return !isReadOnly(column);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSetMetaData::isWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return !isReadOnly(column);
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MResultSetMetaData.hxx b/connectivity/source/drivers/mozab/MResultSetMetaData.hxx
deleted file mode 100644
index 134089fb40..0000000000
--- a/connectivity/source/drivers/mozab/MResultSetMetaData.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_SRESULSETMETADATA_HXX
-#define CONNECTIVITY_SRESULSETMETADATA_HXX
-
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <vector>
-#include <rtl/ref.hxx>
-#include "MConnection.hxx"
-#include "MTable.hxx"
-
-namespace connectivity
-{
- namespace mozab
- {
- //**************************************************************
- //************ Class: ResultSetMetaData
- //**************************************************************
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> OResultSetMetaData_BASE;
-
- class OResultSetMetaData : public OResultSetMetaData_BASE
- {
- ::rtl::OUString m_aTableName;
- ::rtl::Reference<connectivity::OSQLColumns> m_xColumns;
- OTable* m_pTable;
- sal_Bool m_bReadOnly;
-
- protected:
- virtual ~OResultSetMetaData();
- public:
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- // OResultSetMetaData(OConnection* _pConnection) : m_pConnection(_pConnection){}
- OResultSetMetaData(const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
- const ::rtl::OUString& _aTableName,OTable* _pTable,sal_Bool aReadOnly
- )
- :m_aTableName(_aTableName)
- ,m_xColumns(_rxColumns)
- ,m_pTable(_pTable)
- ,m_bReadOnly(aReadOnly)
- {}
-
-
- /// Avoid ambigous cast error from the compiler.
- inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
- { return this; }
-
- void checkColumnIndex(sal_Int32 column) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // CONNECTIVITY_SRESULSETMETADATA_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MServices.cxx b/connectivity/source/drivers/mozab/MServices.cxx
deleted file mode 100644
index 5e5fc0162a..0000000000
--- a/connectivity/source/drivers/mozab/MServices.cxx
+++ /dev/null
@@ -1,160 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MDriver.hxx"
-#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
-#include <com/sun/star/mozilla/XMozillaBootstrap.hpp>
-#include "bootstrap/MMozillaBootstrap.hxx"
-#include <tools/solar.h>
-
-using namespace connectivity::mozab;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::mozilla::XMozillaBootstrap;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pTemp
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-typedef void* (SAL_CALL * OMozillaBootstrap_CreateInstanceFunction)(const Reference< XMultiServiceFactory >& _rxFactory );
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createMozillaBootstrap(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
-{
- const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM(SVLIBRARY( "mozabdrv" )));
-
- // load the dbtools library
- oslModule s_hModule = osl_loadModuleRelative(
- reinterpret_cast< oslGenericFunction >(&createMozillaBootstrap),
- sModuleName.pData, 0);
- OSL_ENSURE(NULL != s_hModule, "MozabDriver::registerClient: could not load the dbtools library!");
- if (NULL != s_hModule)
- {
-
- // get the symbol for the method creating the factory
- const ::rtl::OUString sFactoryCreationFunc = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OMozillaBootstrap_CreateInstance"));
- // reinterpret_cast<OMozabConnection_CreateInstanceFunction> removed GNU C
- OMozillaBootstrap_CreateInstanceFunction s_pCreationFunc = (OMozillaBootstrap_CreateInstanceFunction)osl_getFunctionSymbol(s_hModule, sFactoryCreationFunc.pData);
-
- if (NULL == s_pCreationFunc)
- { // did not find the symbol
- OSL_FAIL("MozabDriver::registerClient: could not find the symbol for creating the factory!");
- osl_unloadModule(s_hModule);
- s_hModule = NULL;
- }
- MozillaBootstrap * pBootstrap = reinterpret_cast<MozillaBootstrap*>((*s_pCreationFunc)(_rxFactory));
- return *pBootstrap;
- }
- return NULL;
-}
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- OUString aImplName( OUString::createFromAscii( pImplementationName ) );
- ProviderRequest aReq(pServiceManager,pImplementationName);
- if (aImplName.equals( MozabDriver::getImplementationName_Static() ))
- {
- aReq.CREATE_PROVIDER(
- MozabDriver::getImplementationName_Static(),
- MozabDriver::getSupportedServiceNames_Static(),
- MozabDriver_CreateInstance, ::cppu::createSingleFactory);
- }
- else if (aImplName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.mozilla.MozillaBootstrap")) ))
- {
- Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap"));
- aReq.CREATE_PROVIDER(
- aImplName,
- aSNS,
- createMozillaBootstrap, ::cppu::createSingleFactory);
- }
- if(aReq.xRet.is())
- aReq.xRet->acquire();
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MStatement.cxx b/connectivity/source/drivers/mozab/MStatement.cxx
deleted file mode 100644
index d0428c744e..0000000000
--- a/connectivity/source/drivers/mozab/MStatement.cxx
+++ /dev/null
@@ -1,564 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include <osl/diagnose.h>
-#include <comphelper/property.hxx>
-#include <comphelper/uno3.hxx>
-#include <osl/thread.h>
-#include <tools/diagnose_ex.h>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-#include <com/sun/star/container/XIndexAccess.hpp>
-
-#include <algorithm>
-
-#include "diagnose_ex.h"
-#include "MDriver.hxx"
-#include "MStatement.hxx"
-#include "MConnection.hxx"
-#include "MResultSet.hxx"
-#include "MDatabaseMetaData.hxx"
-#include "resource/mozab_res.hrc"
-#include "resource/common_res.hrc"
-
-#if OSL_DEBUG_LEVEL > 0
-# define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr())
-#else /* OSL_DEBUG_LEVEL */
-# define OUtoCStr( x ) ("dummy")
-#endif /* OSL_DEBUG_LEVEL */
-
-static ::osl::Mutex m_ThreadMutex;
-
-using namespace ::comphelper;
-using namespace connectivity::mozab;
-using namespace connectivity;
-//------------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-//------------------------------------------------------------------------------
-OCommonStatement::OCommonStatement(OConnection* _pConnection )
- :OCommonStatement_IBASE(m_aMutex)
- ,OPropertySetHelper(OCommonStatement_IBASE::rBHelper)
- ,OCommonStatement_SBASE((::cppu::OWeakObject*)_pConnection, this)
- ,m_xDBMetaData(_pConnection->getMetaData())
- ,m_pTable(NULL)
- ,m_pConnection(_pConnection)
- ,m_aParser(_pConnection->getDriver()->getMSFactory())
- ,m_pSQLIterator( new OSQLParseTreeIterator( _pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL ) )
- ,m_pParseTree(NULL)
- ,rBHelper(OCommonStatement_IBASE::rBHelper)
-{
- m_pConnection->acquire();
- OSL_TRACE("In/Out: OCommonStatement::OCommonStatement" );
-}
-// -----------------------------------------------------------------------------
-OCommonStatement::~OCommonStatement()
-{
-}
-
-//------------------------------------------------------------------------------
-void OCommonStatement::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- clearWarnings();
- clearCachedResultSet();
-
- if (m_pConnection)
- m_pConnection->release();
- m_pConnection = NULL;
-
- m_pSQLIterator->dispose();
-
- dispose_ChildImpl();
- OCommonStatement_IBASE::disposing();
-}
-//-----------------------------------------------------------------------------
-Any SAL_CALL OCommonStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OCommonStatement_IBASE::queryInterface(rType);
- if(!aRet.hasValue())
- aRet = OPropertySetHelper::queryInterface(rType);
- return aRet;
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OCommonStatement::getTypes( ) throw(RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const Reference< XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< XFastPropertySet > *)0 ),
- ::getCppuType( (const Reference< XPropertySet > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),OCommonStatement_IBASE::getTypes());
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OCommonStatement::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
- }
- dispose();
-}
-
-
-// -------------------------------------------------------------------------
-void OCommonStatement::createTable( ) throw ( SQLException, RuntimeException )
-{
- if(m_pParseTree)
- {
- ::rtl::Reference<connectivity::OSQLColumns> xCreateColumn;
- if (m_pSQLIterator->getStatementType() == SQL_STATEMENT_CREATE_TABLE)
- {
- const OSQLTables& xTabs = m_pSQLIterator->getTables();
- OSL_ENSURE( !xTabs.empty(), "Need a Table");
- ::rtl::OUString ouTableName=xTabs.begin()->first;
- xCreateColumn = m_pSQLIterator->getCreateColumns();
- OSL_ENSURE(xCreateColumn.is(), "Need the Columns!!");
-
- const OColumnAlias& aColumnAlias = m_pConnection->getColumnAlias();
-
- OSQLColumns::Vector::const_iterator aIter = xCreateColumn->get().begin();
- const ::rtl::OUString sProprtyName = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME);
- ::rtl::OUString sName;
- for (sal_Int32 i = 1; aIter != xCreateColumn->get().end();++aIter, i++)
- {
- (*aIter)->getPropertyValue(sProprtyName) >>= sName;
- if ( !aColumnAlias.hasAlias( sName ) )
- {
-
- const ::rtl::OUString sError( getOwnConnection()->getResources().getResourceStringWithSubstitution(
- STR_INVALID_COLUMNNAME,
- "$columnname$", sName
- ) );
- ::dbtools::throwGenericSQLException(sError,*this);
- }
- }
- MDatabaseMetaDataHelper _aDbHelper;
- if (!_aDbHelper.NewAddressBook(m_pConnection,ouTableName))
- {
- getOwnConnection()->throwSQLException( _aDbHelper.getError(), *this );
- }
- m_pSQLIterator.reset( new ::connectivity::OSQLParseTreeIterator(
- m_pConnection, m_pConnection->createCatalog()->getTables(), m_aParser, NULL ) );
- }
-
- }
- else
- getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
-}
-// -------------------------------------------------------------------------
-OCommonStatement::StatementType OCommonStatement::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted)
- throw ( SQLException, RuntimeException )
-{
- ::rtl::OUString aErr;
-
- m_pParseTree = m_aParser.parseTree(aErr,sql);
-
-#if OSL_DEBUG_LEVEL > 0
- {
- const char* str = OUtoCStr(sql);
- OSL_UNUSED( str );
- OSL_TRACE("ParseSQL: %s\n", OUtoCStr( sql ) );
- }
-#endif // OSL_DEBUG_LEVEL
-
- if(m_pParseTree)
- {
- m_pSQLIterator->setParseTree(m_pParseTree);
- m_pSQLIterator->traverseAll();
- const OSQLTables& xTabs = m_pSQLIterator->getTables();
- if(xTabs.empty())
- getOwnConnection()->throwSQLException( STR_QUERY_AT_LEAST_ONE_TABLES, *this );
-
-#if OSL_DEBUG_LEVEL > 0
- OSQLTables::const_iterator citer;
- for( citer = xTabs.begin(); citer != xTabs.end(); ++citer ) {
- OSL_TRACE("SELECT Table : %s\n", OUtoCStr(citer->first) );
- }
-#endif
-
- Reference<XIndexAccess> xNames;
- switch(m_pSQLIterator->getStatementType())
- {
- case SQL_STATEMENT_SELECT:
-
- // at this moment we support only one table per select statement
-
- OSL_ENSURE( xTabs.begin() != xTabs.end(), "Need a Table");
-
- m_pTable = static_cast< OTable* > (xTabs.begin()->second.get());
- m_xColNames = m_pTable->getColumns();
- xNames = Reference<XIndexAccess>(m_xColNames,UNO_QUERY);
- // set the binding of the resultrow
- m_aRow = new OValueVector(xNames->getCount());
- (m_aRow->get())[0].setBound(sal_True);
- ::std::for_each(m_aRow->get().begin()+1,m_aRow->get().end(),TSetBound(sal_False));
- // create the column mapping
- createColumnMapping();
-
- analyseSQL();
- return eSelect;
-
- case SQL_STATEMENT_CREATE_TABLE:
- createTable();
- return eCreateTable;
-
- default:
- break;
- }
- }
- else if(!bAdjusted) //Our sql parser does not support a statement like "create table foo"
- // So we append ("E-mail" varchar) to the last of it to make it work
- {
- return parseSql(sql + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("(""E-mail"" caracter)")),sal_True);
- }
-
- getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
- OSL_FAIL( "OCommonStatement::parseSql: unreachable!" );
- return eSelect;
-
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > OCommonStatement::impl_executeCurrentQuery()
-{
- clearCachedResultSet();
-
- ::rtl::Reference< OResultSet > pResult( new OResultSet( this, m_pSQLIterator ) );
- initializeResultSet( pResult.get() );
-
- pResult->executeQuery();
- cacheResultSet( pResult ); // only cache if we survived the execution
-
- return pResult.get();
-
-}
-
-// -------------------------------------------------------------------------
-void OCommonStatement::initializeResultSet( OResultSet* _pResult )
-{
- ENSURE_OR_THROW( _pResult, "invalid result set" );
-
- _pResult->setColumnMapping(m_aColMapping);
- _pResult->setOrderByColumns(m_aOrderbyColumnNumber);
- _pResult->setOrderByAscending(m_aOrderbyAscending);
- _pResult->setBindingRow(m_aRow);
- _pResult->setTable(m_pTable);
-}
-
-// -------------------------------------------------------------------------
-void OCommonStatement::clearCachedResultSet()
-{
- Reference< XResultSet > xResultSet( m_xResultSet.get(), UNO_QUERY );
- if ( !xResultSet.is() )
- return;
-
- try
- {
- Reference< XCloseable > xCloseable( xResultSet, UNO_QUERY_THROW );
- xCloseable->close();
- }
- catch( const DisposedException& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- m_xResultSet = Reference< XResultSet >();
-}
-
-// -------------------------------------------------------------------------
-void OCommonStatement::cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult )
-{
- ENSURE_OR_THROW( _pResult.is(), "invalid result set" );
- m_xResultSet = Reference< XResultSet >( _pResult.get() );
-}
-
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OCommonStatement::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
- OSL_TRACE("Statement::execute( %s )", OUtoCStr( sql ) );
-
- Reference< XResultSet > xRS = executeQuery( sql );
- // returns true when a resultset is available
- return xRS.is();
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL OCommonStatement::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_ThreadMutex );
- checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
- OSL_TRACE("Statement::executeQuery( %s )", OUtoCStr( sql ) );
-
- // parse the statement
- StatementType eStatementType = parseSql( sql );
- if ( eStatementType != eSelect )
- return NULL;
-
- return impl_executeCurrentQuery();
-}
-// -------------------------------------------------------------------------
-
-Reference< XConnection > SAL_CALL OCommonStatement::getConnection( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
- // just return our connection here
- return (Reference< XConnection >)m_pConnection;
-}
-// -----------------------------------------------------------------------------
-Any SAL_CALL OStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ::cppu::queryInterface(rType,static_cast< XServiceInfo*> (this));
- if(!aRet.hasValue())
- aRet = OCommonStatement::queryInterface(rType);
- return aRet;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OCommonStatement::executeUpdate( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XStatement::executeUpdate", *this );
- return 0;
-
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OCommonStatement::getWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
- return makeAny(m_aLastWarning);
-}
-// -------------------------------------------------------------------------
-
-// -------------------------------------------------------------------------
-void SAL_CALL OCommonStatement::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
-
-
- m_aLastWarning = SQLWarning();
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OCommonStatement::createArrayHelper( ) const
-{
- // this properties are define by the service resultset
- // they must in alphabetic order
- Sequence< Property > aProps(9);
- Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP0(CURSORNAME, ::rtl::OUString);
- DECL_BOOL_PROP0(ESCAPEPROCESSING);
- DECL_PROP0(FETCHDIRECTION,sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_PROP0(MAXFIELDSIZE,sal_Int32);
- DECL_PROP0(MAXROWS, sal_Int32);
- DECL_PROP0(QUERYTIMEOUT,sal_Int32);
- DECL_PROP0(RESULTSETCONCURRENCY,sal_Int32);
- DECL_PROP0(RESULTSETTYPE,sal_Int32);
-
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OCommonStatement::getInfoHelper()
-{
- return *const_cast<OCommonStatement*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool OCommonStatement::convertFastPropertyValue(
- Any & /*rConvertedValue*/,
- Any & /*rOldValue*/,
- sal_Int32 /*nHandle*/,
- const Any& /*rValue*/ )
- throw (::com::sun::star::lang::IllegalArgumentException)
-{
- sal_Bool bConverted = sal_False;
- // here we have to try to convert
- return bConverted;
-}
-// -------------------------------------------------------------------------
-void OCommonStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& /*rValue*/) throw (Exception)
-{
- // set the value to what ever is nescessary
- switch(nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- case PROPERTY_ID_MAXFIELDSIZE:
- case PROPERTY_ID_MAXROWS:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- case PROPERTY_ID_ESCAPEPROCESSING:
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-void OCommonStatement::getFastPropertyValue(Any& /*rValue*/,sal_Int32 nHandle) const
-{
- switch(nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- case PROPERTY_ID_MAXFIELDSIZE:
- case PROPERTY_ID_MAXROWS:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- case PROPERTY_ID_ESCAPEPROCESSING:
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OStatement,"com.sun.star.sdbcx.OStatement","com.sun.star.sdbc.Statement");
-// -----------------------------------------------------------------------------
-void SAL_CALL OCommonStatement::acquire() throw()
-{
- OCommonStatement_IBASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OCommonStatement::release() throw()
-{
- relase_ChildImpl();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement::acquire() throw()
-{
- OCommonStatement::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement::release() throw()
-{
- OCommonStatement::release();
-}
-// -----------------------------------------------------------------------------
-Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OCommonStatement::getPropertySetInfo( ) throw(RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-void OCommonStatement::createColumnMapping()
-{
- size_t i;
-
- // initialize the column index map (mapping select columns to table columns)
- ::rtl::Reference<connectivity::OSQLColumns> xColumns = m_pSQLIterator->getSelectColumns();
- m_aColMapping.resize(xColumns->get().size() + 1);
- for (i=0; i<m_aColMapping.size(); ++i)
- m_aColMapping[i] = i;
-
- Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
- // now check which columns are bound
-#if OSL_DEBUG_LEVEL > 0
- for ( i = 0; i < m_aColMapping.size(); i++ )
- OSL_TRACE("BEFORE Mapped: %d -> %d", i, m_aColMapping[i] );
-#endif
- OResultSet::setBoundedColumns(m_aRow,xColumns,xNames,sal_True,m_xDBMetaData,m_aColMapping);
-#if OSL_DEBUG_LEVEL > 0
- for ( i = 0; i < m_aColMapping.size(); i++ )
- OSL_TRACE("AFTER Mapped: %d -> %d", i, m_aColMapping[i] );
-#endif
-}
-// -----------------------------------------------------------------------------
-
-void OCommonStatement::analyseSQL()
-{
- const OSQLParseNode* pOrderbyClause = m_pSQLIterator->getOrderTree();
- if(pOrderbyClause)
- {
- OSQLParseNode * pOrderingSpecCommalist = pOrderbyClause->getChild(2);
- OSL_ENSURE(SQL_ISRULE(pOrderingSpecCommalist,ordering_spec_commalist),"OResultSet: Fehler im Parse Tree");
-
- for (sal_uInt32 m = 0; m < pOrderingSpecCommalist->count(); m++)
- {
- OSQLParseNode * pOrderingSpec = pOrderingSpecCommalist->getChild(m);
- OSL_ENSURE(SQL_ISRULE(pOrderingSpec,ordering_spec),"OResultSet: Fehler im Parse Tree");
- OSL_ENSURE(pOrderingSpec->count() == 2,"OResultSet: Fehler im Parse Tree");
-
- OSQLParseNode * pColumnRef = pOrderingSpec->getChild(0);
- if(!SQL_ISRULE(pColumnRef,column_ref))
- {
- throw SQLException();
- }
- OSQLParseNode * pAscendingDescending = pOrderingSpec->getChild(1);
- setOrderbyColumn(pColumnRef,pAscendingDescending);
- }
- }
-}
-//------------------------------------------------------------------
-void OCommonStatement::setOrderbyColumn( OSQLParseNode* pColumnRef,
- OSQLParseNode* pAscendingDescending)
-{
- ::rtl::OUString aColumnName;
- if (pColumnRef->count() == 1)
- aColumnName = pColumnRef->getChild(0)->getTokenValue();
- else if (pColumnRef->count() == 3)
- {
- pColumnRef->getChild(2)->parseNodeToStr( aColumnName, getOwnConnection(), NULL, sal_False, sal_False );
- }
- else
- {
- throw SQLException();
- }
-
- Reference<XColumnLocate> xColLocate(m_xColNames,UNO_QUERY);
- if(!xColLocate.is())
- return;
-
- m_aOrderbyColumnNumber.push_back(xColLocate->findColumn(aColumnName));
-
- // Ascending or Descending?
- m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? SQL_DESC : SQL_ASC);
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MStatement.hxx b/connectivity/source/drivers/mozab/MStatement.hxx
deleted file mode 100644
index 029615ba00..0000000000
--- a/connectivity/source/drivers/mozab/MStatement.hxx
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_SSTATEMENT_HXX
-#define CONNECTIVITY_SSTATEMENT_HXX
-
-#include <com/sun/star/sdbc/XStatement.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XBatchExecution.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <comphelper/proparrhlp.hxx>
-#include <cppuhelper/compbase3.hxx>
-#include <comphelper/uno3.hxx>
-#include "connectivity/CommonTools.hxx"
-#ifndef INCLUDED_LIST
-#include <list>
-#define INCLUDED_LIST
-#endif
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <comphelper/broadcasthelper.hxx>
-#include "connectivity/sqliterator.hxx"
-#include "connectivity/sqlparse.hxx"
-#include <connectivity/FValue.hxx>
-#include "TSortIndex.hxx"
-#include "MConnection.hxx"
-#include "MTable.hxx"
-
-#include <boost/shared_ptr.hpp>
-
-namespace connectivity
-{
- namespace mozab
- {
- class OResultSet;
-
- typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbc::XStatement,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XCloseable> OCommonStatement_IBASE;
-
- //**************************************************************
- //************ Class: OCommonStatement
- // is a base class for the normal statement and for the prepared statement
- //**************************************************************
- class OCommonStatement;
- typedef ::connectivity::OSubComponent< OCommonStatement, OCommonStatement_IBASE > OCommonStatement_SBASE;
-
- class OCommonStatement :public comphelper::OBaseMutex
- ,public OCommonStatement_IBASE
- ,public ::cppu::OPropertySetHelper
- ,public ::comphelper::OPropertyArrayUsageHelper< OCommonStatement >
- ,public OCommonStatement_SBASE
- {
- friend class ::connectivity::OSubComponent< OCommonStatement, OCommonStatement_IBASE >;
-
- private:
- ::com::sun::star::sdbc::SQLWarning m_aLastWarning;
-
- protected:
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet > m_xResultSet;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> m_xDBMetaData;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColNames; // table columns
-
- // for this Statement
-
- ::std::list< ::rtl::OUString> m_aBatchList;
-
- OTable* m_pTable;
- OConnection* m_pConnection; // The owning Connection object
-
- OValueRow m_aRow;
-
- connectivity::OSQLParser m_aParser;
- ::boost::shared_ptr< ::connectivity::OSQLParseTreeIterator >
- m_pSQLIterator;
-
- connectivity::OSQLParseNode* m_pParseTree;
-
- ::std::vector<sal_Int32> m_aColMapping;
- ::std::vector<sal_Int32> m_aOrderbyColumnNumber;
- ::std::vector<TAscendingOrder> m_aOrderbyAscending;
-
- ::cppu::OBroadcastHelper& rBHelper;
-
- protected:
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle) const;
- virtual ~OCommonStatement();
-
- protected:
- //
- // Driver Internal Methods
- //
- enum StatementType { eSelect, eCreateTable };
- /** called to do the parsing of a to-be-executed SQL statement, and set all members as needed
- */
- virtual StatementType
- parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
- /** called to initialize a result set, according to a previously parsed SQL statement
- */
- virtual void initializeResultSet( OResultSet* _pResult );
- /** called when a possible cached instance of our last result set should be cleared
- */
- virtual void clearCachedResultSet();
- /** caches a result set which has just been created by an execution of an SQL statement
- */
- virtual void cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult );
-
-
- /** executes the current query (the one which has been passed to the last parseSql call)
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
- impl_executeCurrentQuery();
-
- void createColumnMapping();
- void analyseSQL();
- void setOrderbyColumn( connectivity::OSQLParseNode* pColumnRef,
- connectivity::OSQLParseNode* pAscendingDescending);
- virtual void createTable( ) throw (
- ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
-
- public:
- // other methods
- OConnection* getOwnConnection() const { return m_pConnection;}
-
- OCommonStatement(OConnection* _pConnection );
- using OCommonStatement_IBASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- // XInterface
- virtual void SAL_CALL release() throw();
- virtual void SAL_CALL acquire() throw();
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Int32 SAL_CALL executeUpdate( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL execute( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- protected:
- using OPropertySetHelper::getFastPropertyValue;
- };
-
- class OStatement : public OCommonStatement,
- public ::com::sun::star::lang::XServiceInfo
- {
- protected:
- ~OStatement(){}
- public:
- // a constructor, for when the object needs to be returned:
- OStatement( OConnection* _pConnection) : OCommonStatement( _pConnection){}
- DECLARE_SERVICE_INFO();
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- };
- }
-}
-#endif // CONNECTIVITY_SSTATEMENT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MTable.cxx b/connectivity/source/drivers/mozab/MTable.cxx
deleted file mode 100644
index d122794a64..0000000000
--- a/connectivity/source/drivers/mozab/MTable.cxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "MTable.hxx"
-#include "MTables.hxx"
-#include "MColumns.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <comphelper/sequence.hxx>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/TKeys.hxx"
-#include "connectivity/TIndexes.hxx"
-#include "MCatalog.hxx"
-
-
-using namespace ::comphelper;
-using namespace connectivity::mozab;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-OTable::OTable( sdbcx::OCollection* _pTables, OConnection* _pConnection)
- :OTable_Base( _pTables, _pConnection, sal_True )
- ,m_pConnection( _pConnection )
-{
- construct();
-}
-// -------------------------------------------------------------------------
-OTable::OTable( sdbcx::OCollection* _pTables, OConnection* _pConnection,
- const ::rtl::OUString& _Name, const ::rtl::OUString& _Type, const ::rtl::OUString& _Description )
- :OTable_Base(_pTables, _pConnection, sal_True, _Name, _Type, _Description )
- ,m_pConnection( _pConnection )
-{
- construct();
-}
-
-//--------------------------------------------------------------------------
-sdbcx::OCollection* OTable::createColumns( const TStringVector& _rNames )
-{
- return new OColumns( this, m_aMutex, _rNames );
-}
-
-//--------------------------------------------------------------------------
-sdbcx::OCollection* OTable::createKeys(const TStringVector& _rNames)
-{
- return new OKeysHelper( this, m_aMutex, _rNames );
-}
-
-//--------------------------------------------------------------------------
-sdbcx::OCollection* OTable::createIndexes(const TStringVector& _rNames)
-{
- return new OIndexesHelper( this, m_aMutex, _rNames );
-}
-
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MTable.hxx b/connectivity/source/drivers/mozab/MTable.hxx
deleted file mode 100644
index 7f1826257f..0000000000
--- a/connectivity/source/drivers/mozab/MTable.hxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MOZAB_TABLE_HXX_
-#define _CONNECTIVITY_MOZAB_TABLE_HXX_
-
-#include "connectivity/TTableHelper.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include "MConnection.hxx"
-
-namespace connectivity
-{
- namespace mozab
- {
- typedef ::connectivity::OTableHelper OTable_Base;
-
- class OTable : public OTable_Base
- {
- OConnection* m_pConnection;
-
- public:
- OTable( sdbcx::OCollection* _pTables, OConnection* _pConnection);
- OTable( sdbcx::OCollection* _pTables,
- OConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description );
-
- OConnection* getConnection() { return m_pConnection;}
-
- sal_Bool isReadOnly() const { return sal_False; }
-
- ::rtl::OUString getTableName() const { return m_Name; }
- ::rtl::OUString getSchema() const { return m_SchemaName; }
-
- // OTableHelper overridables
- virtual sdbcx::OCollection* createColumns( const TStringVector& _rNames );
- virtual sdbcx::OCollection* createKeys(const TStringVector& _rNames);
- virtual sdbcx::OCollection* createIndexes(const TStringVector& _rNames);
- private:
- using OTable_Base::getConnection;
- };
- }
-}
-#endif // _CONNECTIVITY_MOZAB_TABLE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MTables.cxx b/connectivity/source/drivers/mozab/MTables.cxx
deleted file mode 100644
index ebc913845e..0000000000
--- a/connectivity/source/drivers/mozab/MTables.cxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "MTables.hxx"
-#include "MTable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include "MCatalog.hxx"
-#include "MConnection.hxx"
-#include <comphelper/extract.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include <cppuhelper/interfacecontainer.h>
-#include <comphelper/types.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace ::cppu;
-using namespace connectivity::mozab;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace dbtools;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OTables::createObject(const ::rtl::OUString& _rName)
-{
- ::rtl::OUString aName,aSchema;
- // sal_Int32 nLen = _rName.indexOf('.');
- // aSchema = _rName.copy(0,nLen);
- // aName = _rName.copy(nLen+1);
- aSchema = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%"));
- aName = _rName;
-
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%"));
- // aTypes[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TABLE"));
- // aTypes[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SYSTEMTABLE"));
- ::rtl::OUString sEmpty;
-
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),aSchema,aName,aTypes);
-
- sdbcx::ObjectType xRet = NULL;
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- if(xResult->next()) // there can be only one table with this name
- {
- OTable* pRet = new OTable( this, static_cast<OCatalog&>(m_rParent).getConnection(),
- aName,xRow->getString(4),xRow->getString(5));
- xRet = pRet;
- }
- }
- ::comphelper::disposeComponent(xResult);
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void OTables::impl_refresh( ) throw(RuntimeException)
-{
- static_cast<OCatalog&>(m_rParent).refreshTables();
-}
-// -------------------------------------------------------------------------
-void OTables::disposing(void)
-{
-m_xMetaData.clear();
- OCollection::disposing();
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/MTables.hxx b/connectivity/source/drivers/mozab/MTables.hxx
deleted file mode 100644
index 437bbbe6c5..0000000000
--- a/connectivity/source/drivers/mozab/MTables.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_MOZAB_TABLES_HXX_
-#define _CONNECTIVITY_MOZAB_TABLES_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-namespace connectivity
-{
- namespace mozab
- {
- class OTables : public sdbcx::OCollection
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- // OCatalog* m_pParent;
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- public:
- OTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector)
- ,m_xMetaData(_rMetaData)
- {}
-
- // only the name is identical to ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- };
- }
-}
-#endif // _CONNECTIVITY_MOZAB_TABLES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
deleted file mode 100644
index c7e19eb0e8..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
+++ /dev/null
@@ -1,283 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MMozillaBootstrap.hxx"
-
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::mozilla;
-using namespace connectivity::mozab;
-#include <MNSFolders.hxx>
-#include "MNSProfileDiscover.hxx"
-#ifndef MINIMAL_PROFILEDISCOVER
-# include "MNSProfileManager.hxx"
-# include "MNSRunnable.hxx"
-#endif
-#include <MNSInit.hxx>
-
-static MozillaBootstrap *pMozillaBootstrap=NULL;
-static Reference<XMozillaBootstrap> xMozillaBootstrap;
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL OMozillaBootstrap_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory)
-{
- if (!pMozillaBootstrap)
- {
- pMozillaBootstrap=new connectivity::mozab::MozillaBootstrap( _rxFactory );
- pMozillaBootstrap->Init();
- xMozillaBootstrap = pMozillaBootstrap;
- }
- return pMozillaBootstrap;
-}
-
-// --------------------------------------------------------------------------------
-
-
-// --------------------------------------------------------------------------------
-MozillaBootstrap::MozillaBootstrap(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory)
- : OMozillaBootstrap_BASE(m_aMutex), m_xMSFactory( _rxFactory )
-{
-}
-// -----------------------------------------------------------------------------
-MozillaBootstrap::~MozillaBootstrap()
-{
-}
-// -----------------------------------------------------------------------------
-void MozillaBootstrap::Init()
-{
- sal_Bool aProfileExists=sal_False;
-
-#ifndef MINIMAL_PROFILEDISCOVER
- //This must be call before any mozilla code
- MNS_Init(aProfileExists);
-
- m_ProfileManager = new ProfileManager();
-#else
- (void)aProfileExists; /* avoid warning about unused parameter */
-#endif
- m_ProfileAccess = new ProfileAccess();
- bootupProfile(::com::sun::star::mozilla::MozillaProductType_Mozilla,rtl::OUString());
-}
-
-// --------------------------------------------------------------------------------
-void MozillaBootstrap::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- OMozillaBootstrap_BASE::disposing();
-}
-
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString MozillaBootstrap::getImplementationName_Static( ) throw(RuntimeException)
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MOZAB_MozillaBootstrap_IMPL_NAME));
-}
-//------------------------------------------------------------------------------
-Sequence< ::rtl::OUString > MozillaBootstrap::getSupportedServiceNames_Static( ) throw (RuntimeException)
-{
- // which service is supported
- // for more information @see com.sun.star.mozilla.MozillaBootstrap
- Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap"));
- return aSNS;
-}
-
-//------------------------------------------------------------------
-::rtl::OUString SAL_CALL MozillaBootstrap::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-
-//------------------------------------------------------------------
-sal_Bool SAL_CALL MozillaBootstrap::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-
-//------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL MozillaBootstrap::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-
-
-// XProfileDiscover
-::sal_Int32 SAL_CALL MozillaBootstrap::getProfileCount( ::com::sun::star::mozilla::MozillaProductType product) throw (::com::sun::star::uno::RuntimeException)
-{
- return m_ProfileAccess->getProfileCount(product);
-}
-::sal_Int32 SAL_CALL MozillaBootstrap::getProfileList( ::com::sun::star::mozilla::MozillaProductType product, ::com::sun::star::uno::Sequence< ::rtl::OUString >& list ) throw (::com::sun::star::uno::RuntimeException)
-{
- return m_ProfileAccess->getProfileList(product,list);
-}
-::rtl::OUString SAL_CALL MozillaBootstrap::getDefaultProfile( ::com::sun::star::mozilla::MozillaProductType product ) throw (::com::sun::star::uno::RuntimeException)
-{
- return m_ProfileAccess->getDefaultProfile(product);
-}
-::rtl::OUString SAL_CALL MozillaBootstrap::getProfilePath( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException)
-{
- return m_ProfileAccess->getProfilePath(product,profileName);
-}
-::sal_Bool SAL_CALL MozillaBootstrap::isProfileLocked( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException)
-{
- return m_ProfileAccess->isProfileLocked(product,profileName);
-}
-::sal_Bool SAL_CALL MozillaBootstrap::getProfileExists( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException)
-{
- return m_ProfileAccess->getProfileExists(product,profileName);
-}
-
-// XProfileManager
-::sal_Int32 SAL_CALL MozillaBootstrap::bootupProfile( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException)
-{
-#ifndef MINIMAL_PROFILEDISCOVER
- return m_ProfileManager->bootupProfile(product,profileName);
-#else
- (void)product; /* avoid warning about unused parameter */
- (void)profileName; /* avoid warning about unused parameter */
- return -1;
-#endif
-}
-::sal_Int32 SAL_CALL MozillaBootstrap::shutdownProfile( ) throw (::com::sun::star::uno::RuntimeException)
-{
-#ifndef MINIMAL_PROFILEDISCOVER
- return m_ProfileManager->shutdownProfile();
-#else
- return -1;
-#endif
-}
-::com::sun::star::mozilla::MozillaProductType SAL_CALL MozillaBootstrap::getCurrentProduct( ) throw (::com::sun::star::uno::RuntimeException)
-{
-#ifndef MINIMAL_PROFILEDISCOVER
- return m_ProfileManager->getCurrentProduct();
-#else
- return ::com::sun::star::mozilla::MozillaProductType_Default;
-#endif
-}
-::rtl::OUString SAL_CALL MozillaBootstrap::getCurrentProfile( ) throw (::com::sun::star::uno::RuntimeException)
-{
-#ifndef MINIMAL_PROFILEDISCOVER
- return m_ProfileManager->getCurrentProfile();
-#else
- return ::rtl::OUString();
-#endif
-}
-::sal_Bool SAL_CALL MozillaBootstrap::isCurrentProfileLocked( ) throw (::com::sun::star::uno::RuntimeException)
-{
-#ifndef MINIMAL_PROFILEDISCOVER
- return isProfileLocked(getCurrentProduct(),m_ProfileManager->getCurrentProfile());
-#else
- return true;
-#endif
-}
-::rtl::OUString SAL_CALL MozillaBootstrap::setCurrentProfile( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException)
-{
-#ifndef MINIMAL_PROFILEDISCOVER
- return m_ProfileManager->setCurrentProfile(product,profileName);
-#else
- (void)product; /* avoid warning about unused parameter */
- (void)profileName; /* avoid warning about unused parameter */
- return ::rtl::OUString();
-#endif
-}
-
-// XProxyRunner
-::sal_Int32 SAL_CALL MozillaBootstrap::Run( const ::com::sun::star::uno::Reference< ::com::sun::star::mozilla::XCodeProxy >& aCode ) throw (::com::sun::star::uno::RuntimeException)
-{
-#ifndef MINIMAL_PROFILEDISCOVER
- ::rtl::OUString profileName = aCode->getProfileName();
- ::rtl::OUString currProfileName = getCurrentProfile();
- ::com::sun::star::mozilla::MozillaProductType currProduct = getCurrentProduct();
-
- //if client provides a profileName, we will use it
- if (profileName.getLength()
- && ( aCode->getProductType() != currProduct || !profileName.equals(currProfileName)) )
- setCurrentProfile(aCode->getProductType(),profileName);
- MNSRunnable xRunnable;
-
- return xRunnable.StartProxy(aCode);;
-#else
- (void)aCode; /* avoid warning about unused parameter */
- return -1;
-#endif
-}
-
-#ifdef MINIMAL_PROFILEDISCOVER
-#include <cppuhelper/factory.hxx>
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-static Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager )
-{
- MozillaBootstrap * pBootstrap = reinterpret_cast<MozillaBootstrap*>(OMozillaBootstrap_CreateInstance(rServiceManager));
- return *pBootstrap;
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
-
- if (pServiceManager)
- {
- ::rtl::OUString aImplName( ::rtl::OUString::createFromAscii( pImplementationName ) );
- Reference< XSingleServiceFactory > xFactory;
- if (aImplName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.mozilla.MozillaBootstrap")) ))
- {
- Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap"));
-
- xFactory = ::cppu::createSingleFactory(
- reinterpret_cast< XMultiServiceFactory* > ( pServiceManager),
- aImplName, createInstance, aSNS );
- }
- if ( xFactory.is() )
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
-
- return pRet;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.hxx b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.hxx
deleted file mode 100644
index d605d4bb0a..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.hxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_SMOZILLABOOTSTRAP_HXX
-#define CONNECTIVITY_SMOZILLABOOTSTRAP_HXX
-
-#include <com/sun/star/mozilla/XMozillaBootstrap.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/compbase2.hxx>
-#include <osl/module.h>
-
-
-#define MOZAB_MozillaBootstrap_IMPL_NAME "com.sun.star.comp.mozilla.MozillaBootstrap"
-
-namespace connectivity
-{
- namespace mozab
- {
- typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::mozilla::XMozillaBootstrap,
- ::com::sun::star::lang::XServiceInfo > OMozillaBootstrap_BASE;
- class ProfileAccess;
- class ProfileManager;
- class MozillaBootstrap : public OMozillaBootstrap_BASE
- {
- protected:
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xMSFactory;
-
- ::osl::Mutex m_aMutex; // mutex is need to control member access
- virtual ~MozillaBootstrap();
- protected:
- ProfileAccess * m_ProfileAccess;
- ProfileManager * m_ProfileManager;
- public:
-
- void Init();
- MozillaBootstrap(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XMozillaBootstrap
-
- // XProfileDiscover
- virtual ::sal_Int32 SAL_CALL getProfileCount( ::com::sun::star::mozilla::MozillaProductType product) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getProfileList( ::com::sun::star::mozilla::MozillaProductType product, ::com::sun::star::uno::Sequence< ::rtl::OUString >& list ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDefaultProfile( ::com::sun::star::mozilla::MozillaProductType product ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getProfilePath( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL isProfileLocked( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL getProfileExists( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException);
-
- // XProfileManager
- virtual ::sal_Int32 SAL_CALL bootupProfile( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL shutdownProfile( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::mozilla::MozillaProductType SAL_CALL getCurrentProduct( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCurrentProfile( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL isCurrentProfileLocked( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL setCurrentProfile( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException);
-
- // XProxyRunner
- virtual ::sal_Int32 SAL_CALL Run( const ::com::sun::star::uno::Reference< ::com::sun::star::mozilla::XCodeProxy >& aCode ) throw (::com::sun::star::uno::RuntimeException);
-
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- & getMSFactory(void) const { return m_xMSFactory; }
-
- };
- }
-
-}
-
-#endif // CONNECTIVITY_SMozillaBootstrap_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx
deleted file mode 100644
index 3dd647a9b4..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <MNSFolders.hxx>
-
-#ifdef UNIX
-#include <sys/types.h>
-#include <strings.h>
-#include <string.h>
-#endif // End UNIX
-
-#ifdef WNT
-#include "pre_include_windows.h"
-#include <windows.h>
-#include <stdlib.h>
-#include <shlobj.h>
-#include <objidl.h>
-#include "post_include_windows.h"
-#endif // End WNT
-#include <osl/security.hxx>
-#include <osl/file.hxx>
-#include <osl/thread.h>
-
-using namespace ::com::sun::star::mozilla;
-
-namespace
-{
- // -------------------------------------------------------------------
- static ::rtl::OUString lcl_getUserDataDirectory()
- {
- ::osl::Security aSecurity;
- ::rtl::OUString aConfigPath;
-
- aSecurity.getConfigDir( aConfigPath );
- return aConfigPath + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- }
-
- // -------------------------------------------------------------------
- static const char* DefaultProductDir[3][3] =
- {
- #if defined(XP_WIN)
- { "Mozilla/SeaMonkey/", NULL, NULL },
- { "Mozilla/Firefox/", NULL, NULL },
- { "Thunderbird/", "Mozilla/Thunderbird/", NULL }
- #elif(MACOSX)
- { "../Mozilla/SeaMonkey/", NULL, NULL },
- { "Firefox/", NULL, NULL },
- { "../Thunderbird/", NULL, NULL }
- #else
- { ".mozilla/seamonkey/", NULL, NULL },
- { ".mozilla/firefox/", NULL, NULL },
- { ".thunderbird/", ".mozilla-thunderbird/", ".mozilla/thunderbird/" }
- #endif
- };
-
- static const char* ProductRootEnvironmentVariable[3] =
- {
- "MOZILLA_PROFILE_ROOT",
- "MOZILLA_FIREFOX_PROFILE_ROOT",
- "MOZILLA_THUNDERBIRD_PROFILE_ROOT",
- };
-
- // -------------------------------------------------------------------
- static ::rtl::OUString lcl_guessProfileRoot( MozillaProductType _product )
- {
- size_t productIndex = _product - 1;
-
- static ::rtl::OUString s_productDirectories[3];
-
- if ( !s_productDirectories[ productIndex ].getLength() )
- {
- ::rtl::OUString sProductPath;
-
- // check whether we have an anevironment variable which helps us
- const char* pProfileByEnv = getenv( ProductRootEnvironmentVariable[ productIndex ] );
- if ( pProfileByEnv )
- {
- sProductPath = ::rtl::OUString( pProfileByEnv, rtl_str_getLength( pProfileByEnv ), osl_getThreadTextEncoding() );
- // asume that this is fine, no further checks
- }
- else
- {
- ::rtl::OUString sProductDirCandidate;
- const char* pProfileRegistry = "profiles.ini";
-
- // check all possible candidates
- for ( size_t i=0; i<3; ++i )
- {
- if ( NULL == DefaultProductDir[ productIndex ][ i ] )
- break;
-
- sProductDirCandidate = lcl_getUserDataDirectory() +
- ::rtl::OUString::createFromAscii( DefaultProductDir[ productIndex ][ i ] );
-
- // check existence
- ::osl::DirectoryItem aRegistryItem;
- ::osl::FileBase::RC result = ::osl::DirectoryItem::get( sProductDirCandidate + ::rtl::OUString::createFromAscii( pProfileRegistry ), aRegistryItem );
- if ( result == ::osl::FileBase::E_None )
- {
- ::osl::FileStatus aStatus( osl_FileStatus_Mask_Validate );
- result = aRegistryItem.getFileStatus( aStatus );
- if ( result == ::osl::FileBase::E_None )
- {
- // the registry file exists
- break;
- }
- }
- }
-
- ::osl::FileBase::getSystemPathFromFileURL( sProductDirCandidate, sProductPath );
- }
-
- s_productDirectories[ productIndex ] = sProductPath;
- }
-
- return s_productDirectories[ productIndex ];
- }
-}
-
-// -----------------------------------------------------------------------
-::rtl::OUString getRegistryDir(MozillaProductType product)
-{
- if (product == MozillaProductType_Default)
- return ::rtl::OUString();
-
- return lcl_guessProfileRoot( product );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx
deleted file mode 100644
index a3a52f68e8..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _MNSFOLDERS_HXX_
-#define _MNSFOLDERS_HXX_
-
-#include <sal/types.h>
-#include <osl/diagnose.h>
-#include <osl/conditn.hxx>
-#include <com/sun/star/mozilla/MozillaProductType.hpp>
-
-#include <rtl/ustring.hxx>
-
-::rtl::OUString getRegistryDir(::com::sun::star::mozilla::MozillaProductType product);
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
deleted file mode 100644
index b334bf6a85..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
+++ /dev/null
@@ -1,141 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <MNSINIParser.hxx>
-#include <rtl/byteseq.hxx>
-
-IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException )
-{
- OUString iniUrl;
- if (osl_File_E_None != osl_getFileURLFromSystemPath(rIniName.pData, &iniUrl.pData))
- return;
-
-
-#if OSL_DEBUG_LEVEL > 0
- OString sFile = OUStringToOString(iniUrl, RTL_TEXTENCODING_ASCII_US);
- OSL_TRACE(__FILE__" -- parser() - %s\n", sFile.getStr());
-#endif
- oslFileHandle handle=NULL;
- oslFileError fileError = osl_File_E_INVAL;
- try{
- if (iniUrl.getLength())
- fileError = osl_openFile(iniUrl.pData, &handle, osl_File_OpenFlag_Read);
- }
- catch(::com::sun::star::io::IOException&)
- {
-#if OSL_DEBUG_LEVEL > 0
- OString file_tmp = OUStringToOString(iniUrl, RTL_TEXTENCODING_ASCII_US);
- OSL_TRACE( __FILE__" -- couldn't open file: %s", file_tmp.getStr() );
-#endif
- }
-
- if (osl_File_E_None == fileError)
- {
- rtl::ByteSequence seq;
- sal_uInt64 nSize = 0;
-
- osl_getFileSize(handle, &nSize);
- OUString sectionName( RTL_CONSTASCII_USTRINGPARAM( "no name section" ));
- while (true)
- {
- sal_uInt64 nPos;
- if (osl_File_E_None != osl_getFilePos(handle, &nPos) || nPos >= nSize)
- break;
- if (osl_File_E_None != osl_readLine(handle , (sal_Sequence **) &seq))
- break;
- OString line( (const sal_Char *) seq.getConstArray(), seq.getLength() );
- sal_Int32 nIndex = line.indexOf('=');
- if (nIndex >= 1)
- {
- ini_Section *aSection = &mAllSection[sectionName];
- struct ini_NameValue nameValue;
- nameValue.sName = OStringToOUString(
- line.copy(0,nIndex).trim(), RTL_TEXTENCODING_ASCII_US );
- nameValue.sValue = OStringToOUString(
- line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 );
-
- aSection->lList.push_back(nameValue);
-
- }
- else
- {
- sal_Int32 nIndexStart = line.indexOf('[');
- sal_Int32 nIndexEnd = line.indexOf(']');
- if ( nIndexEnd > nIndexStart && nIndexStart >=0)
- {
- sectionName = OStringToOUString(
- line.copy(nIndexStart + 1,nIndexEnd - nIndexStart -1).trim(), RTL_TEXTENCODING_ASCII_US );
- if (!sectionName.getLength())
- sectionName = OUString(RTL_CONSTASCII_USTRINGPARAM("no name section"));
-
- ini_Section *aSection = &mAllSection[sectionName];
- aSection->sName = sectionName;
- }
- }
- }
- osl_closeFile(handle);
- }
-#if OSL_DEBUG_LEVEL > 0
- else
- {
- OString file_tmp = OUStringToOString(iniUrl, RTL_TEXTENCODING_ASCII_US);
- OSL_TRACE( __FILE__" -- couldn't open file: %s", file_tmp.getStr() );
- }
-#endif
-}
-#if OSL_DEBUG_LEVEL > 0
-void IniParser::Dump()
-{
- IniSectionMap::iterator iBegin = mAllSection.begin();
- IniSectionMap::iterator iEnd = mAllSection.end();
- for(;iBegin != iEnd;iBegin++)
- {
- ini_Section *aSection = &(*iBegin).second;
- OString sec_name_tmp = OUStringToOString(aSection->sName, RTL_TEXTENCODING_ASCII_US);
- for(NameValueList::iterator itor=aSection->lList.begin();
- itor != aSection->lList.end();
- itor++)
- {
- struct ini_NameValue * aValue = &(*itor);
- OString name_tmp = OUStringToOString(aValue->sName, RTL_TEXTENCODING_ASCII_US);
- OString value_tmp = OUStringToOString(aValue->sValue, RTL_TEXTENCODING_UTF8);
- OSL_TRACE(
- " section=%s name=%s value=%s\n",
- sec_name_tmp.getStr(),
- name_tmp.getStr(),
- value_tmp.getStr() );
-
- }
- }
-
-}
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
deleted file mode 100644
index 6cab8e3193..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef __MNSINIPARSER_HXX__
-#define __MNSINIPARSER_HXX__
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/io/IOException.hpp>
-#include <osl/process.h>
-
-#include <map>
-#include <list>
-
-#if OSL_DEBUG_LEVEL > 0
-#include <stdio.h>
-#endif
-
-using ::rtl::OUString;
-using ::rtl::OString;
-
-struct ini_NameValue
-{
- rtl::OUString sName;
- rtl::OUString sValue;
-
- inline ini_NameValue() SAL_THROW( () )
- {}
- inline ini_NameValue(
- OUString const & name, OUString const & value ) SAL_THROW( () )
- : sName( name ),
- sValue( value )
- {}
-};
-
-typedef std::list<
- ini_NameValue
-> NameValueList;
-
-struct ini_Section
-{
- rtl::OUString sName;
- NameValueList lList;
-};
-typedef std::map<rtl::OUString,
- ini_Section
- >IniSectionMap;
-
-
-class IniParser
-{
- IniSectionMap mAllSection;
-public:
- IniSectionMap * getAllSection(){return &mAllSection;};
- IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException );
-#if OSL_DEBUG_LEVEL > 0
- void Dump();
-#endif
-
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx
deleted file mode 100644
index 1cffe198ba..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx
+++ /dev/null
@@ -1,347 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <MNSInclude.hxx>
-
-#include "mozilla_nsinit.h"
-
-#include <MNSInit.hxx>
-
-#include <sal/types.h>
-#include <osl/diagnose.h>
-#include <osl/conditn.hxx>
-#include <osl/file.hxx>
-#include <rtl/bootstrap.hxx>
-
-#include "MConfigAccess.hxx"
-#include "MNSDeclares.hxx"
-#include <osl/thread.hxx>
-#include <MNSTerminateListener.hxx>
-
-static nsIServiceManager* sServiceManager = nsnull;
-static sal_Int32 sInitCounter = 0;
-static sal_Bool s_bProfilePresentAfterInitialized = sal_False;
-
-static NS_DEFINE_CID(kProfileCID, NS_PROFILE_CID);
-static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
-
-static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
-static oslThread m_Mozilla_UI_Thread;
-static PRBool aLive=1;
-static ::osl::Condition m_aUI_Thread_Condition;
-
-#define HACK_AROUND_THREADING_ISSUES
-#define HACK_AROUND_NONREENTRANT_INITXPCOM
-
-#ifdef HACK_AROUND_NONREENTRANT_INITXPCOM
-// XXX hack class to clean up XPCOM when this module is unloaded
-static PRBool sXPCOMInitializedFlag = PR_FALSE;
-#endif
-
-
-extern "C" void NS_SetupRegistry();
-
- const PRUnichar* determineProfile( PRUnichar const* const* _pValidProfiles, const PRUint32 _nValidProfiles )
-{
- // the fallback for the to-be-used user profile: the first profile
- const PRUnichar* pUsedProfile = *_pValidProfiles;
-
- // have a look what the configuration suggests as preferred profile
- // PRUnichar != sal_Unicode in mingw
- const PRUnichar* pPreferredProfile = reinterpret_cast_mingw_only< const PRUnichar* >( getUserProfile( ) );
- if ( pPreferredProfile && *pPreferredProfile )
- {
- PRUnichar const* const* pLoop = _pValidProfiles;
- PRUnichar const* const* pLoopEnd = pLoop + _nValidProfiles;
- for ( ; pLoop != pLoopEnd; ++pLoop )
- {
- // compare the current and the preferred profile
- // (by looping through the characters)
- const PRUnichar* pCurrent = *pLoop;
- const PRUnichar* pPref = pPreferredProfile;
- while ( *pCurrent && ( *pCurrent == *pPref ) ) // testing one of them against 0 is enough because of the second clause
- {
- ++pCurrent;
- ++pPref;
- }
- if ( *pCurrent == *pPref )
- // the are equal
- break;
- }
-
- if ( pLoop != pLoopEnd )
- pUsedProfile = *pLoop;
- return pUsedProfile;
- }
- else
- return NULL;
-}
-
-
-sal_Bool MNS_InitXPCOM(sal_Bool* aProfileExists)
-{
- nsresult rv;
- OSL_TRACE( "IN : MNS_InitXPCOM() \n" );
- // Reentrant calls to this method do nothing except increment a counter
-
-#ifdef HACK_AROUND_NONREENTRANT_INITXPCOM
- // The first time, add another increment so that it'll be left until exit
- // for the final cleanup to happen
- sInitCounter++;
-#endif // HACK_AROUND_NONREENTRANT_INITXPCOM
-
- // Initialise XPCOM
-#ifdef HACK_AROUND_NONREENTRANT_INITXPCOM
- // Can't call NS_InitXPCom more than once or things go boom!
- if (!sXPCOMInitializedFlag)
-#endif
- {
- nsCOMPtr<nsILocalFile> binDir;
- // Note: if path3 construction fails, mozilla will default to using MOZILLA_FIVE_HOME in the NS_InitXPCOM2()
- rtl::OUString path1(
-#if defined WNT
- RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program")
-#else
- RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/program")
-#endif
- );
- rtl::Bootstrap::expandMacros(path1);
- rtl::OString path2;
- if ((osl::FileBase::getSystemPathFromFileURL(path1, path1) ==
- osl::FileBase::E_None) &&
- path1.convertToString(
- &path2, osl_getThreadTextEncoding(),
- (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
- RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
- {
- nsDependentCString sPath(path2.getStr());
- rv = NS_NewNativeLocalFile(sPath, PR_TRUE, getter_AddRefs(binDir));
- if (NS_FAILED(rv))
- return sal_False;
- }
-
-
-
- // Initialise XPCOM
- NS_InitXPCOM2(&sServiceManager, binDir, NULL);
-
-// if (!sServiceManager)
-// return sal_False;
-
-#ifdef HACK_AROUND_NONREENTRANT_INITXPCOM
- sXPCOMInitializedFlag = PR_TRUE;
-#endif
- }
-
-
- // Create the Event Queue for the UI thread...
- //
- // If an event queue already exists for the thread, then
- // CreateThreadEventQueue(...) will fail...
- // CreateThread0ueue(...) will fail...
- nsCOMPtr<nsIEventQueueService> eventQService(
- do_GetService(NS_EVENTQUEUESERVICE_CONTRACTID, &rv));
- if (NS_FAILED(rv))
- return NS_SUCCEEDED( rv ) ? sal_True : sal_False;
-
- eventQService->CreateThreadEventQueue();
-
-// nsCOMPtr<nsIObserver> mStartupNotifier = do_CreateInstance(NS_APPSTARTUPNOTIFIER_CONTRACTID, &rv);
-// if(NS_FAILED(rv))
-// return rv;
-// mStartupNotifier->Observe(nsnull, APPSTARTUP_TOPIC, nsnull);
-
-#ifdef HACK_AROUND_THREADING_ISSUES
- // XXX force certain objects to be created on the main thread
- nsCOMPtr<nsIStringBundleService> sBundleService;
- sBundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
- if (NS_SUCCEEDED(rv))
- {
- nsCOMPtr<nsIStringBundle> stringBundle;
- const char* propertyURL = "chrome://necko/locale/necko.properties";
- rv = sBundleService->CreateBundle(propertyURL,
- getter_AddRefs(stringBundle));
- }
-#endif
-
- // Need to create a Pref Service
- nsCOMPtr< nsIPref > thePref = do_GetService( kPrefCID, &rv );
- if (NS_SUCCEEDED(rv) )
- {
- OSL_TRACE("Created an nsIPref i/f\n");
- thePref->ReadUserPrefs( nsnull );
- *aProfileExists = sal_True ;
- s_bProfilePresentAfterInitialized = sal_True;
- }
- OSL_TRACE( "OUT : MNS_InitXPCOM() - XPCOM Init\n" );
-
- return sal_True;
-}
-
-void MNS_XPCOM_EventLoop()
-{
- OSL_TRACE( "IN : MNS_XPCOM_EventLoop() \n" );
- nsresult rv;
- nsCOMPtr<nsIEventQueue> eventQ;
- nsCOMPtr<nsIEventQueueService> eventQService;
- rv=nsServiceManager::GetService(kEventQueueServiceCID,
- NS_GET_IID(nsIEventQueueService),
- getter_AddRefs(eventQService));
-
- if (NS_SUCCEEDED(rv))
- {
- rv = eventQService->GetThreadEventQueue(NS_CURRENT_THREAD , getter_AddRefs(eventQ));
- if (NS_FAILED(rv))
- {
- rv = eventQService->CreateThreadEventQueue();
- if (NS_FAILED(rv))
- return ;
- else
- rv = eventQService->GetThreadEventQueue(NS_CURRENT_THREAD, getter_AddRefs(eventQ));
- }
- }
-
- if (NS_FAILED(rv)) return ;
-
- PLEvent* event = nsnull;
- m_aUI_Thread_Condition.set(); //we are ready to recive event
- do
- {
- rv = eventQ->GetEvent(&event);
- if (NS_FAILED(rv))
- return ;
- if (event)
- eventQ->HandleEvent(event);
- }while ( PR_SUCCESS == PR_Sleep( PR_MillisecondsToInterval(1)) && aLive );
-
- eventQ->ProcessPendingEvents();
- OSL_TRACE( "OUT : MNS_XPCOM_EventLoop() \n" );
-}
-
-extern "C" void MNS_Mozilla_UI_Thread( void *arg )
-{
- aLive=1;
- OSL_TRACE( "IN : MNS_Mozilla_UI_Thread() \n" );
- UI_Thread_ARGS * args = (UI_Thread_ARGS*) arg;
- sal_Bool* aProfileExists=args->bProfileExists;
- delete args;
- args=NULL;
-
- //Init xpcom
- if (!MNS_InitXPCOM(aProfileExists))
- {
- m_aUI_Thread_Condition.set(); // error happened
- return;
- }
-
- //do the mozilla event loop
- MNS_XPCOM_EventLoop();
- //we are interupted
-
- if (sServiceManager)
- {
- NS_RELEASE(sServiceManager);
-
- // Terminate XPCOM & cleanup
-#ifndef HACK_AROUND_NONREENTRANT_INITXPCOM
- NS_ShutdownXPCOM(sServiceManager);
-#endif
- }
-
- m_aUI_Thread_Condition.set(); //release all blocks
-
- OSL_TRACE( "OUT : MNS_Mozilla_UI_Thread() \n" );
-
-}
-
-
-sal_Bool MNS_Init(sal_Bool& aProfileExists)
-{
- aProfileExists = sal_False ;
-
- OSL_TRACE( "IN : MNS_Init() \n" );
- // Reentrant calls to this method do nothing except increment a counter
- sInitCounter++;
- if (sInitCounter > 1) {
- OSL_TRACE( "IN : MNS_Init() wait for xpcom to be initted \n" );
- //wait for xpcom to be initted
- m_aUI_Thread_Condition.wait();
-
- OSL_TRACE( "OUT : MNS_Init() : counter = %d\n", sInitCounter );
- aProfileExists = s_bProfilePresentAfterInitialized;
- return sal_True;
- }
-
- UI_Thread_ARGS * args = new UI_Thread_ARGS;
- args->bProfileExists = &aProfileExists;
-
- m_aUI_Thread_Condition.reset();
- m_Mozilla_UI_Thread=osl_createThread(MNS_Mozilla_UI_Thread,
- (void*)args);
- if (!m_Mozilla_UI_Thread)
- {
- return sal_False;
- }
-
- //wait for xpcom to be initted
- m_aUI_Thread_Condition.wait();
-
- //Add Terminate Listener to XDesktop to get application exit event
- MNSTerminateListener::addTerminateListener();
-
- OSL_TRACE( "OUT : MNS_Init() - First Init\n" );
-
- return sal_True;
-}
-
-sal_Bool MNS_Term(sal_Bool aForce)
-{
- // Reentrant calls to this method do nothing except decrement a counter
- OSL_TRACE( "IN : MNS_Term() \n" );
- if (!aForce && sInitCounter > 1)
- {
- --sInitCounter;
- OSL_TRACE( "OUT : MNS_Term() : counter = %d\n", sInitCounter );
- return sal_True;
- }
- sInitCounter = 0;
-
- aLive=0;
-
- //wait for xpcom to be finished
- TimeValue timeValue = { 1, 0 };
- m_aUI_Thread_Condition.wait(&timeValue);
-
-
- OSL_TRACE( "OUT : MNS_Term() - Final Term\n" );
- return sal_True;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSInit.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSInit.hxx
deleted file mode 100644
index bfc141cc58..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSInit.hxx
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MAB_NS_INIT_HXX_
-#define _CONNECTIVITY_MAB_NS_INIT_HXX_ 1
-#include "MNSDeclares.hxx"
-
-#include <sal/types.h>
-
-sal_Bool MNS_Init(sal_Bool& aProfileExists);
-sal_Bool MNS_Term(sal_Bool aForce=sal_False);
-
-sal_Bool MNS_InitXPCOM(sal_Bool* aProfileExists);
-typedef struct UI_Thread_ARGS
-{
- sal_Bool* bProfileExists;
-}UI_Thread_ARGS;
-void MNS_XPCOM_EventLoop();
-
-#endif // _CONNECTIVITY_MAB_NS_INIT_HXX_ 1
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx
deleted file mode 100644
index a711b42230..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx
+++ /dev/null
@@ -1,635 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MNSProfile.hxx"
-#include "MNSProfileDirServiceProvider.hxx"
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <unotools/processfactory.hxx>
-#include <com/sun/star/mozilla/XMozillaBootstrap.hpp>
-
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::mozilla;
-
-using ::rtl::OUString;
-
-// Interfaces Needed
-
-static Reference<XMozillaBootstrap> xMozillaBootstrap;
-
-
-static PRInt32 gInstanceCount = 0;
-
-// Profile database to remember which profile has been
-// created with UILocale and contentLocale on profileManager
-static nsProfileDirServiceProvider *gDirServiceProvider = nsnull;
-
-
-
-
-/*
- * Constructor/Destructor
- */
-nsProfile::nsProfile()
-{
- mStartingUp = PR_FALSE;
- mCurrentProfileAvailable = PR_FALSE;
-
- mShutdownProfileToreDownNetwork = PR_FALSE;
-
- mProfileChangeVetoed = PR_FALSE;
- mProfileChangeFailed = PR_FALSE;
- Reference<XMultiServiceFactory> xFactory = ::comphelper::getProcessServiceFactory();
- OSL_ENSURE( xFactory.is(), "can't get service factory" );
-
- Reference<XInterface> xInstance = xFactory->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")) );
- OSL_ENSURE( xInstance.is(), "failed to create instance" );
- xMozillaBootstrap = Reference<XMozillaBootstrap>(xInstance,UNO_QUERY);
-
-
-}
-
-nsProfile::~nsProfile()
-{
-}
-
-
-nsresult
-nsProfile::Init()
-{
- nsresult rv = NS_OK;
- RegisterProfileManager(this);
- if (gInstanceCount++ == 0) {
- rv = NS_NewProfileDirServiceProvider( &gDirServiceProvider);
- if (NS_SUCCEEDED(rv))
- rv = gDirServiceProvider->Register();
- }
- return rv;
-}
-
-/*
- * nsISupports Implementation
- */
-NS_IMPL_THREADSAFE_ADDREF(nsProfile)
-NS_IMPL_THREADSAFE_RELEASE(nsProfile)
-
-NS_INTERFACE_MAP_BEGIN(nsProfile)
- NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIProfile)
- NS_INTERFACE_MAP_ENTRY(nsIProfile)
- NS_INTERFACE_MAP_ENTRY(nsIProfileInternal)
- NS_INTERFACE_MAP_ENTRY(nsIProfileChangeStatus)
- NS_INTERFACE_MAP_ENTRY(nsIFactory)
-NS_INTERFACE_MAP_END
-
-/*
- * nsIProfileChangeStatus Implementation
- */
-
-NS_IMETHODIMP nsProfile::VetoChange()
-{
- mProfileChangeVetoed = PR_TRUE;
- return NS_OK;
-}
-
-NS_IMETHODIMP nsProfile::ChangeFailed()
-{
- mProfileChangeFailed = PR_TRUE;
- return NS_OK;
-}
-/*
- * nsIProfile Implementation
- */
-
-NS_IMETHODIMP nsProfile::GetProfileCount(PRInt32 *numProfiles)
-{
- NS_ENSURE_ARG_POINTER(numProfiles);
-
- *numProfiles = 0;
-
- *numProfiles = xMozillaBootstrap->getProfileCount(xMozillaBootstrap->getCurrentProduct());
- return NS_OK;
-}
-NS_IMETHODIMP nsProfile::GetProfileList(PRUint32 *length, PRUnichar ***profileNames)
-{
- NS_ENSURE_ARG_POINTER(length);
- NS_ENSURE_ARG_POINTER(profileNames);
- *profileNames = nsnull;
-
- ::com::sun::star::uno::Sequence< ::rtl::OUString > list;
-
- *length = xMozillaBootstrap->getProfileList(xMozillaBootstrap->getCurrentProduct(),list);
-
- const OUString * pArray = list.getConstArray();
-
- nsresult rv = NS_OK;
- PRInt32 count = list.getLength();
- PRUnichar **outArray, **next;
-
- next = outArray = (PRUnichar **)nsMemory::Alloc(count * sizeof(PRUnichar *));
- if (!outArray)
- return NS_ERROR_OUT_OF_MEMORY;
-
- for (PRInt32 index=0; index < count; index++)
- {
- *next = (PRUnichar *)nsMemory::Clone(pArray[index].getStr(),(pArray[index].getLength()+1) * sizeof(PRUnichar ));
- if (*next == nsnull)
- {
- rv = NS_ERROR_OUT_OF_MEMORY;
- break;
- }
- next++;
- }
- *profileNames = outArray;
- return rv;
-}
-NS_IMETHODIMP nsProfile::ProfileExists(const PRUnichar *profileName, PRBool *exists)
-{
- NS_ENSURE_ARG_POINTER(profileName);
- NS_ENSURE_ARG_POINTER(exists);
-
- // PRUnichar != sal_Unicode in mingw
- *exists = xMozillaBootstrap->getProfileExists(xMozillaBootstrap->getCurrentProduct(),reinterpret_cast_mingw_only<const sal_Unicode *>(profileName));
- return NS_OK;
-}
-// Returns the name of the current profile i.e., the last used profile
-NS_IMETHODIMP
-nsProfile::GetCurrentProfile(PRUnichar **profileName)
-{
- NS_ENSURE_ARG_POINTER(profileName);
- *profileName = nsnull;
-
- if (mCurrentProfileName.Length())
- *profileName = (PRUnichar *)nsMemory::Clone(mCurrentProfileName.get(),(mCurrentProfileName.Length() + 1) * sizeof(PRUnichar ));
- else
- {
- rtl::OUString profile = xMozillaBootstrap->getDefaultProfile(xMozillaBootstrap->getCurrentProduct());
- *profileName = (PRUnichar *)nsMemory::Clone(profile.getStr(),( profile.getLength() + 1) * sizeof(PRUnichar ));
- SetCurrentProfile(*profileName);
- }
-
- return (*profileName == nsnull) ? NS_ERROR_FAILURE : NS_OK;
-}
-
-NS_IMETHODIMP
-nsProfile::SetCurrentProfile(const PRUnichar * aCurrentProfile)
-{
- NS_ENSURE_ARG(aCurrentProfile);
-
- nsresult rv;
- nsCOMPtr<nsIFile> profileDir;
- PRBool exists;
-
- // Ensure that the profile exists and its directory too.
- rv = GetProfileDir(aCurrentProfile, getter_AddRefs(profileDir));
- if (NS_FAILED(rv)) return rv;
- rv = profileDir->Exists(&exists);
- if (NS_FAILED(rv)) return rv;
- if (!exists) return NS_ERROR_FILE_NOT_FOUND;
-
- PRBool isSwitch = PRBool();
-
- if (mCurrentProfileAvailable)
- {
- nsXPIDLString currProfileName;
- rv = GetCurrentProfile(getter_Copies(currProfileName));
- if (NS_FAILED(rv)) return rv;
- if (nsCRT::strcmp(aCurrentProfile, currProfileName.get()) == 0)
- return NS_OK;
- else
- isSwitch = PR_TRUE;
- }
- else
- isSwitch = PR_FALSE;
-
-
- nsCOMPtr<nsIObserverService> observerService =
- do_GetService("@mozilla.org/observer-service;1", &rv);
- NS_ENSURE_TRUE(observerService, NS_ERROR_FAILURE);
-
- nsISupports *subject = (nsISupports *)((nsIProfile *)this);
- NS_NAMED_LITERAL_STRING(switchString, "switch");
- NS_NAMED_LITERAL_STRING(startupString, "startup");
- const nsAFlatString& context = isSwitch ? switchString : startupString;
-
- if (isSwitch)
- {
- rv = ShutDownCurrentProfile(nsIProfile::SHUTDOWN_PERSIST);
- if (NS_FAILED(rv)) return NS_ERROR_ABORT;
-
- // Phase 1: See if anybody objects to the profile being changed.
- mProfileChangeVetoed = PR_FALSE;
- observerService->NotifyObservers(subject, "profile-approve-change", context.get());
- if (mProfileChangeVetoed)
- return NS_OK;
-
- // Phase 2a: Send the network teardown notification
- observerService->NotifyObservers(subject, "profile-change-net-teardown", context.get());
- mShutdownProfileToreDownNetwork = PR_TRUE;
-
- // Phase 2b: Send the "teardown" notification
- observerService->NotifyObservers(subject, "profile-change-teardown", context.get());
- if (mProfileChangeVetoed)
- {
- // Notify we will not proceed with changing the profile
- observerService->NotifyObservers(subject, "profile-change-teardown-veto", context.get());
-
- // Bring network back online and return
- observerService->NotifyObservers(subject, "profile-change-net-restore", context.get());
- return NS_OK;
- }
-
- // Phase 3: Notify observers of a profile change
- observerService->NotifyObservers(subject, "profile-before-change", context.get());
- if (mProfileChangeFailed)
- return NS_ERROR_ABORT;
-
- }
-
-//
-// // Do the profile switch
- gDirServiceProvider->SetProfileDir(profileDir);
- mCurrentProfileName.Assign(aCurrentProfile);
-// gProfileDataAccess->SetCurrentProfile(aCurrentProfile);
-
- if (NS_FAILED(rv)) return rv;
- mCurrentProfileAvailable = PR_TRUE;
-
- if (!isSwitch)
- {
- // Ensure that the prefs service exists so it can respond to
- // the notifications we're about to send around. It needs to.
- nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
- NS_ASSERTION(NS_SUCCEEDED(rv), "Could not get prefs service");
- }
-
- if (mShutdownProfileToreDownNetwork)
- {
- // Bring network back online
- observerService->NotifyObservers(subject, "profile-change-net-restore", context.get());
- mShutdownProfileToreDownNetwork = PR_FALSE;
- if (mProfileChangeFailed)
- return NS_ERROR_ABORT;
- }
-
- // Phase 4: Notify observers that the profile has changed - Here they respond to new profile
- observerService->NotifyObservers(subject, "profile-do-change", context.get());
- if (mProfileChangeFailed)
- return NS_ERROR_ABORT;
-
- // Phase 5: Now observers can respond to something another observer did in phase 4
- observerService->NotifyObservers(subject, "profile-after-change", context.get());
- if (mProfileChangeFailed)
- return NS_ERROR_ABORT;
-
- // Phase 6: One last notification after the new profile is established
- observerService->NotifyObservers(subject, "profile-initial-state", context.get());
- if (mProfileChangeFailed)
- return NS_ERROR_ABORT;
-
- return NS_OK;
-}
-/* void shutDownCurrentProfile (in unsigned long shutDownType); */
-NS_IMETHODIMP nsProfile::ShutDownCurrentProfile(PRUint32 shutDownType)
-{
- nsresult rv;
-
- // if shutDownType is not a well know value, skip the notifications
- // see DoOnShutdown() in nsAppRunner.cpp for where we use this behaviour to our benefit
- if (shutDownType == (PRUint32)SHUTDOWN_PERSIST || shutDownType == (PRUint32)SHUTDOWN_CLEANSE ) {
- nsCOMPtr<nsIObserverService> observerService =
- do_GetService("@mozilla.org/observer-service;1", &rv);
- NS_ENSURE_TRUE(observerService, NS_ERROR_FAILURE);
-
- nsISupports *subject = (nsISupports *)((nsIProfile *)this);
-
- NS_NAMED_LITERAL_STRING(cleanseString, "shutdown-cleanse");
- NS_NAMED_LITERAL_STRING(persistString, "shutdown-persist");
- const nsAFlatString& context = (shutDownType == (PRUint32)SHUTDOWN_CLEANSE) ? cleanseString : persistString;
-
- // Phase 1: See if anybody objects to the profile being changed.
- mProfileChangeVetoed = PR_FALSE;
- observerService->NotifyObservers(subject, "profile-approve-change", context.get());
- if (mProfileChangeVetoed)
- return NS_OK;
-
- // Phase 2a: Send the network teardown notification
- observerService->NotifyObservers(subject, "profile-change-net-teardown", context.get());
- mShutdownProfileToreDownNetwork = PR_TRUE;
-
- // Phase 2b: Send the "teardown" notification
- observerService->NotifyObservers(subject, "profile-change-teardown", context.get());
-
-
- // Phase 3: Notify observers of a profile change
- observerService->NotifyObservers(subject, "profile-before-change", context.get());
- }
-
-
- gDirServiceProvider->SetProfileDir(nsnull);
- mCurrentProfileAvailable = PR_FALSE;
- mCurrentProfileName.Truncate(0);
-
- return NS_OK;
-}
-/* void createNewProfile (in wstring profileName, in wstring nativeProfileDir, in wstring langcode, in boolean useExistingDir); */
-NS_IMETHODIMP nsProfile::CreateNewProfile(const PRUnichar* /*profileName*/, const PRUnichar* /*nativeProfileDir*/, const PRUnichar* /*langcode*/, PRBool /*useExistingDir*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void renameProfile (in wstring oldName, in wstring newName); */
-NS_IMETHODIMP nsProfile::RenameProfile(const PRUnichar* /*oldName*/, const PRUnichar* /*newName*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void deleteProfile (in wstring name, in boolean canDeleteFiles); */
-NS_IMETHODIMP nsProfile::DeleteProfile(const PRUnichar* /*name*/, PRBool /*canDeleteFiles*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void cloneProfile (in wstring profileName); */
-NS_IMETHODIMP nsProfile::CloneProfile(const PRUnichar* /*profileName*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-//nsIProfileInternal Implementation
-
-/* [noscript] void startupWithArgs (in nsICmdLineService cmdLine, in boolean canInteract); */
-class nsICmdLineService;
-
-NS_IMETHODIMP nsProfile::StartupWithArgs(nsICmdLineService* /*cmdLineArgs*/, PRBool /*canInteract*/)
-{
- Init();
- return NS_OK;
-}
-
-/* [noscript] readonly attribute boolean isStartingUp; */
-NS_IMETHODIMP nsProfile::GetIsStartingUp(PRBool *aIsStartingUp)
-{
- NS_ENSURE_ARG_POINTER(aIsStartingUp);
- *aIsStartingUp = mStartingUp;
- return NS_OK;
-}
-
-/* long get4xProfileCount (); */
-NS_IMETHODIMP nsProfile::Get4xProfileCount(PRInt32* /*_retval*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void getProfileListX (in unsigned long which, out unsigned long length, [array, size_is (length), retval] out wstring profileNames); */
-NS_IMETHODIMP nsProfile::GetProfileListX(PRUint32 /*whichKind*/, PRUint32* /*length*/, PRUnichar*** /*profileNames*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void migrateProfileInfo (); */
-NS_IMETHODIMP nsProfile::MigrateProfileInfo()
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void migrateAllProfiles (); */
-NS_IMETHODIMP nsProfile::MigrateAllProfiles()
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void migrateProfile (in wstring profileName); */
-NS_IMETHODIMP nsProfile::MigrateProfile(const PRUnichar* /*profileName*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void remigrateProfile (in wstring profileName); */
-NS_IMETHODIMP nsProfile::RemigrateProfile(const PRUnichar* /*profileName*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void forgetCurrentProfile (); */
-NS_IMETHODIMP nsProfile::ForgetCurrentProfile()
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void createDefaultProfile (); */
-NS_IMETHODIMP nsProfile::CreateDefaultProfile()
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* nsIFile getProfileDir (in wstring profileName); */
-// Gets the profiles directory for a given profile
-// Sets the given profile to be a current profile
-NS_IMETHODIMP nsProfile::GetProfileDir(const PRUnichar *profileName, nsIFile **profileDir)
-{
- NS_ENSURE_ARG(profileName);
- NS_ENSURE_ARG_POINTER(profileDir);
- *profileDir = nsnull;
-
- nsresult rv = NS_OK;
-
- // PRUnichar != sal_Unicode in mingw
- rtl::OUString path = xMozillaBootstrap->getProfilePath(xMozillaBootstrap->getCurrentProduct(),reinterpret_cast_mingw_only<const sal_Unicode *>(profileName));
-
- nsCOMPtr<nsILocalFile> localFile;
- // PRUnichar != sal_Unicode in mingw
- nsAutoString filePath(reinterpret_cast_mingw_only<const PRUnichar *>(path.getStr()));
-
- rv = NS_NewLocalFile(filePath, PR_TRUE,
- getter_AddRefs(localFile));
- if (localFile && NS_SUCCEEDED(rv))
- return localFile->QueryInterface(NS_GET_IID(nsIFile), (void**)profileDir);
- return rv;
-}
-
-/* wstring getProfilePath (in wstring profileName); */
-NS_IMETHODIMP nsProfile::GetProfilePath(const PRUnichar* /*profileName*/, PRUnichar** /*_retval*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* nsILocalFile getOriginalProfileDir (in wstring profileName); */
-NS_IMETHODIMP nsProfile::GetOriginalProfileDir(const PRUnichar* /*profileName*/, nsILocalFile** /*originalDir*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* PRInt64 getProfileLastModTime (in wstring profileName); */
-NS_IMETHODIMP nsProfile::GetProfileLastModTime(const PRUnichar* /*profileName*/, PRInt64* /*_retval*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* attribute boolean automigrate; */
-NS_IMETHODIMP nsProfile::GetAutomigrate(PRBool* /*aAutomigrate*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-NS_IMETHODIMP nsProfile::SetAutomigrate(PRBool /*aAutomigrate*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* readonly attribute nsIFile defaultProfileParentDir; */
-NS_IMETHODIMP nsProfile::GetDefaultProfileParentDir(nsIFile** /*aDefaultProfileParentDir*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* readonly attribute wstring firstProfile; */
-NS_IMETHODIMP nsProfile::GetFirstProfile(PRUnichar **profileName)
-{
- NS_ENSURE_ARG_POINTER(profileName);
-
- return GetCurrentProfile(profileName);
-}
-
-/* attribute boolean startWithLastUsedProfile; */
-NS_IMETHODIMP nsProfile::GetStartWithLastUsedProfile(PRBool* /*aStartWithLastUsedProfile*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-NS_IMETHODIMP nsProfile::SetStartWithLastUsedProfile(PRBool /*aStartWithLastUsedProfile*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* [noscript] void updateRegistry (in nsIFile regName); */
-NS_IMETHODIMP nsProfile::UpdateRegistry(nsIFile* /*regName*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* [noscript] void getRegStrings (in wstring profileName, out wstring regString, out wstring regName, out wstring regEmail, out wstring regOption); */
-NS_IMETHODIMP nsProfile::GetRegStrings(const PRUnichar* /*profileName*/, PRUnichar** /*regString*/, PRUnichar** /*regName*/, PRUnichar** /*regEmail*/, PRUnichar** /*regOption*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* [noscript] void setRegStrings (in wstring profileName, in wstring regString, in wstring regName, in wstring regEmail, in wstring regOption); */
-NS_IMETHODIMP nsProfile::SetRegStrings(const PRUnichar* /*profileName*/, const PRUnichar* /*regString*/, const PRUnichar* /*regName*/, const PRUnichar* /*regEmail*/, const PRUnichar* /*regOption*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* [noscript] string isRegStringSet (in wstring profileName); */
-NS_IMETHODIMP nsProfile::IsRegStringSet(const PRUnichar* /*profileName*/, char** /*_retval*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void createNewProfileWithLocales (in wstring profileName, in wstring nativeProfileDir, in wstring UILocale, in wstring contentLocale, in boolean useExistingDir); */
-NS_IMETHODIMP nsProfile::CreateNewProfileWithLocales(const PRUnichar* /*profileName*/, const PRUnichar* /*nativeProfileDir*/, const PRUnichar* /*UILocale*/, const PRUnichar* /*contentLocale*/, PRBool /*useExistingDir*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* boolean isCurrentProfileAvailable (); */
-NS_IMETHODIMP nsProfile::IsCurrentProfileAvailable(PRBool *available)
-{
- NS_ENSURE_ARG_POINTER(available);
-
- *available = mCurrentProfileAvailable;
- return NS_OK;
-}
-
-/* [noscript] void getCurrentProfileDir (out nsIFile profileDir); */
-// Returns the name of the current profile directory
-NS_IMETHODIMP nsProfile::GetCurrentProfileDir(nsIFile **profileDir)
-{
- NS_ENSURE_ARG_POINTER(profileDir);
- nsresult rv;
-
- nsXPIDLString profileName;
- rv = GetCurrentProfile(getter_Copies(profileName));
- if (NS_FAILED(rv)) return rv;
-
- rv = GetProfileDir(profileName, profileDir);
- if (NS_FAILED(rv)) return rv;
-
- return NS_OK;
-}
-
-//Implementation nsIFactory
-NS_IMETHODIMP
-nsProfile::LockFactory(PRBool /*aVal*/)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsProfile::CreateInstance(nsISupports* aOuter, const nsID& aIID,
- void** aResult)
-{
- if (aOuter)
- return NS_ERROR_NO_AGGREGATION;
- // return this object
- return QueryInterface(aIID, aResult);
-}
-
-//Register profile manager
-#include "nsIComponentManager.h"
-#include "nsIComponentRegistrar.h"
-
-static const nsCID kProfileManagerCID = NS_PROFILE_CID;
-
-#define NS_PROFILE_CONTRACTID \
- "@mozilla.org/profile/manager;1"
-
-nsresult
-nsProfile::RegisterProfileManager(nsIProfile* aProfileService)
-{
- nsCOMPtr<nsIServiceManager> mgr;
- NS_GetServiceManager(getter_AddRefs(mgr));
-
- NS_ASSERTION(mgr, "Not initialized!");
-
- nsCOMPtr<nsIFactory> factory = do_QueryInterface(aProfileService);
- NS_ASSERTION(factory, "Supposed to be an nsIFactory!");
-
- nsCOMPtr<nsIComponentRegistrar> reg (do_QueryInterface(mgr));
- if (!reg)
- return NS_ERROR_NO_INTERFACE;
-
- return reg->RegisterFactory(kProfileManagerCID,
- "Profile Manager",
- NS_PROFILE_CONTRACTID,
- factory);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfile.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfile.hxx
deleted file mode 100644
index 37939c4acc..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfile.hxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "mozilla_nsprofile.h"
-
-#define _MAX_LENGTH 256
-
-class nsProfile: public nsIProfileInternal,
- public nsIProfileChangeStatus,
- public nsIFactory
-{
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPROFILE
- NS_DECL_NSIPROFILEINTERNAL
- NS_DECL_NSIPROFILECHANGESTATUS
- NS_DECL_NSIFACTORY
-
-private:
- PRBool mStartingUp;
- PRBool mProfileChangeVetoed;
- PRBool mProfileChangeFailed;
-
- nsString mCurrentProfileName;
- PRBool mCurrentProfileAvailable;
-
- PRBool mIsContentLocaleSpecified;
- nsCString mContentLocaleName;
-
- PRBool mShutdownProfileToreDownNetwork;
- nsresult Init();
-
-public:
- nsProfile();
- virtual ~nsProfile();
-
-public:
- //We register an factory for Mozilla profile service its CID and CONTRACTID are NS_PROFILE_CID and NS_PROFILE_CONTRACTID
- //After that, we does not need profile.dll/libprofile.so any more. Our profile service are diffrent from the orginal one in
- //these areas:
- //1. We do not lock Mozilla Profile,
- //2. We do not change Mozilla Profile settings. We do not change default profile, do not create new profiles and
- // do not write changes back to profile register
- //3. We support can load both Thunderbird profile and Mozilla profiles
- static nsresult RegisterProfileManager(nsIProfile* aProfileService);
-
-};
-
-extern nsresult ConvertStringToUnicode(nsCString& aCharset, const char* inString, nsAString& outString);
-extern nsresult GetPlatformCharset(nsCString& aCharset);
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDirServiceProvider.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDirServiceProvider.cxx
deleted file mode 100644
index ef6a88917b..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDirServiceProvider.cxx
+++ /dev/null
@@ -1,243 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#if defined _MSC_VER
- #pragma warning(disable:4710)
-#endif
-
-#include "pre_include_mozilla.h"
-#include "MNSProfileDirServiceProvider.hxx"
-#include "nsIAtom.h"
-#include "nsStaticAtom.h"
-#include "nsILocalFile.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsISupportsUtils.h"
-#include "post_include_mozilla.h"
-
-
-
-#define PREFS_FILE_50_NAME NS_LITERAL_CSTRING("prefs.js")
-
-
-nsIAtom* nsProfileDirServiceProvider::sApp_PrefsDirectory50;
-nsIAtom* nsProfileDirServiceProvider::sApp_PreferencesFile50;
-nsIAtom* nsProfileDirServiceProvider::sApp_UserProfileDirectory50;
-
-
-//*****************************************************************************
-// nsProfileDirServiceProvider::nsProfileDirServiceProvider
-//*****************************************************************************
-
-nsProfileDirServiceProvider::nsProfileDirServiceProvider()
-{
-}
-
-
-nsProfileDirServiceProvider::~nsProfileDirServiceProvider()
-{
-}
-
-nsresult
-nsProfileDirServiceProvider::SetProfileDir(nsIFile* aProfileDir)
-{
- if (mProfileDir) {
- PRBool isEqual;
- if (aProfileDir &&
- NS_SUCCEEDED(aProfileDir->Equals(mProfileDir, &isEqual)) && isEqual) {
- NS_WARNING("Setting profile dir to same as current");
- return NS_OK;
- }
- UndefineFileLocations();
- }
- mProfileDir = aProfileDir;
- if (!mProfileDir)
- return NS_OK;
-
- nsresult rv = EnsureProfileFileExists(mProfileDir);
- return rv;
-
-}
-
-nsresult
-nsProfileDirServiceProvider::Register()
-{
- nsCOMPtr<nsIDirectoryService> directoryService =
- do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID);
- if (!directoryService)
- return NS_ERROR_FAILURE;
- return directoryService->RegisterProvider(this);
-}
-
-nsresult
-nsProfileDirServiceProvider::Shutdown()
-{
- nsCOMPtr<nsIDirectoryService> directoryService =
- do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID);
- if (!directoryService)
- return NS_ERROR_FAILURE;
- return directoryService->UnregisterProvider(this);
-}
-
-// nsProfileDirServiceProvider::nsISupports
-
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsProfileDirServiceProvider,
- nsIDirectoryServiceProvider)
-
-// nsProfileDirServiceProvider::nsIDirectoryServiceProvider
-
-NS_IMETHODIMP
-nsProfileDirServiceProvider::GetFile(const char *prop, PRBool *persistant, nsIFile **_retval)
-{
- NS_ENSURE_ARG(prop);
- NS_ENSURE_ARG_POINTER(persistant);
- NS_ENSURE_ARG_POINTER(_retval);
-
- if (!mProfileDir)
- return NS_ERROR_FAILURE;
-
- *persistant = PR_TRUE;
- nsIFile* domainDir = mProfileDir;
-
-
- nsCOMPtr<nsIFile> localFile;
- nsresult rv = NS_ERROR_FAILURE;
-
- nsIAtom* inAtom = NS_NewAtom(prop);
- NS_ENSURE_TRUE(inAtom, NS_ERROR_OUT_OF_MEMORY);
-
- if (inAtom == sApp_PrefsDirectory50) {
- rv = domainDir->Clone(getter_AddRefs(localFile));
- }
- else if (inAtom == sApp_PreferencesFile50) {
- rv = domainDir->Clone(getter_AddRefs(localFile));
- if (NS_SUCCEEDED(rv))
- rv = localFile->AppendNative(PREFS_FILE_50_NAME);
- }
- else if (inAtom == sApp_UserProfileDirectory50) {
- rv = domainDir->Clone(getter_AddRefs(localFile));
- }
-
- NS_RELEASE(inAtom);
-
- if (localFile && NS_SUCCEEDED(rv))
- return CallQueryInterface(localFile, _retval);
-
- return rv;
-}
-
-//*****************************************************************************
-// Protected methods
-//*****************************************************************************
-
-nsresult
-nsProfileDirServiceProvider::Initialize()
-{
-
- static const nsStaticAtom provider_atoms[] = {
- { NS_APP_PREFS_50_DIR, &sApp_PrefsDirectory50 },
- { NS_APP_PREFS_50_FILE, &sApp_PreferencesFile50 },
- { NS_APP_USER_PROFILE_50_DIR, &sApp_UserProfileDirectory50 },
- { NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR, nsnull },
- };
-
- // Register our directory atoms
- NS_RegisterStaticAtoms(provider_atoms, NS_ARRAY_LENGTH(provider_atoms));
-
- return NS_OK;
-}
-
-nsresult
-nsProfileDirServiceProvider::EnsureProfileFileExists(nsIFile *aFile)
-{
- nsresult rv;
- PRBool exists;
-
- rv = aFile->Exists(&exists);
- if (NS_FAILED(rv))
- return rv;
- if (exists)
- return NS_OK;
-
- nsCOMPtr<nsIFile> defaultsFile;
-
- // Attempt first to get the localized subdir of the defaults
- rv = NS_GetSpecialDirectory(NS_APP_PROFILE_DEFAULTS_50_DIR, getter_AddRefs(defaultsFile));
- if (NS_FAILED(rv)) {
- // If that has not been defined, use the top level of the defaults
- rv = NS_GetSpecialDirectory(NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR, getter_AddRefs(defaultsFile));
- if (NS_FAILED(rv))
- return rv;
- }
-
- mProfileDir = defaultsFile;
- return rv;
-}
-
-
-nsresult
-nsProfileDirServiceProvider::UndefineFileLocations()
-{
- nsresult rv;
-
- nsCOMPtr<nsIProperties> directoryService =
- do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
- NS_ENSURE_TRUE(directoryService, NS_ERROR_FAILURE);
-
- (void) directoryService->Undefine(NS_APP_PREFS_50_DIR);
- (void) directoryService->Undefine(NS_APP_PREFS_50_FILE);
- (void) directoryService->Undefine(NS_APP_USER_PROFILE_50_DIR);
-
- return NS_OK;
-}
-
-//*****************************************************************************
-// Global creation function
-//*****************************************************************************
-
-nsresult NS_NewProfileDirServiceProvider(nsProfileDirServiceProvider** aProvider)
-{
- NS_ENSURE_ARG_POINTER(aProvider);
- *aProvider = nsnull;
-
- nsProfileDirServiceProvider *prov = new nsProfileDirServiceProvider();
- if (!prov)
- return NS_ERROR_OUT_OF_MEMORY;
- nsresult rv = prov->Initialize();
- if (NS_FAILED(rv)) {
- delete prov;
- return rv;
- }
- NS_ADDREF(*aProvider = prov);
- return NS_OK;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDirServiceProvider.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDirServiceProvider.hxx
deleted file mode 100644
index 2efe916233..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDirServiceProvider.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "mozilla_nsprofiledirserviceprovider.h"
-
-// Forward Declarations
-class nsIAtom;
-
-// --------------------------------------------------------------------------------------
-// nsProfileDirServiceProvider - The nsIDirectoryServiceProvider implementation used for
-// profile-relative file locations.
-// --------------------------------------------------------------------------------------
-
-class nsProfileDirServiceProvider: public nsIDirectoryServiceProvider
-{
- NS_DECL_ISUPPORTS
- NS_DECL_NSIDIRECTORYSERVICEPROVIDER
-
- friend nsresult NS_NewProfileDirServiceProvider( nsProfileDirServiceProvider**);
-
-public:
-
- virtual nsresult SetProfileDir(nsIFile* aProfileDir);
- virtual nsresult Register();
- virtual nsresult Shutdown();
-
-protected:
- nsProfileDirServiceProvider();
- virtual ~nsProfileDirServiceProvider();
-
- nsresult Initialize();
- nsresult EnsureProfileFileExists(nsIFile* profileDir);
- nsresult UndefineFileLocations();
-
-protected:
-
- // Atoms for file locations
- static nsIAtom* sApp_PrefsDirectory50;
- static nsIAtom* sApp_PreferencesFile50;
- static nsIAtom* sApp_UserProfileDirectory50;
-
- nsCOMPtr<nsIFile> mProfileDir;
-
-};
-
-
-// --------------------------------------------------------------------------------------
-
-/**
- * Global method to create an instance of nsProfileDirServiceProvider
- *
- * @param aNotifyObservers If true, will send out profile startup
- * notifications when the profile directory is set.
- * See nsIProfileChangeStatus.
- */
-
-nsresult NS_NewProfileDirServiceProvider( nsProfileDirServiceProvider** aProvider);
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
deleted file mode 100644
index 2ae687fdc1..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
+++ /dev/null
@@ -1,422 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MNSProfileDiscover.hxx"
-#ifndef MINIMAL_PROFILEDISCOVER
-#include "MNSProfile.hxx"
-
-#include "pratom.h"
-#include "prmem.h"
-#include "plstr.h"
-#include "prenv.h"
-
-#include "nsIEnumerator.h"
-#include "prprf.h"
-#include "nsCOMPtr.h"
-#include "nsIComponentManager.h"
-#include "nsEscape.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsILocalFile.h"
-#include "nsReadableUtils.h"
-
-
-#if defined(XP_MAC) || defined(XP_MACOSX)
-#include <Processes.h>
-#include <CFBundle.h>
-#include "nsILocalFileMac.h"
-#endif
-
-#ifdef XP_UNIX
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <signal.h>
-#include "prnetdb.h"
-#include "prsystem.h"
-#endif
-
-#ifdef VMS
-#include <rmsdef.h>
-#endif
-
-#include "nsICharsetConverterManager.h"
-#include "nsIPlatformCharset.h"
-
-
-#if defined (XP_UNIX)
-# define USER_ENVIRONMENT_VARIABLE "USER"
-# define LOGNAME_ENVIRONMENT_VARIABLE "LOGNAME"
-# define HOME_ENVIRONMENT_VARIABLE "HOME"
-# define PROFILE_NAME_ENVIRONMENT_VARIABLE "PROFILE_NAME"
-# define PROFILE_HOME_ENVIRONMENT_VARIABLE "PROFILE_HOME"
-# define DEFAULT_UNIX_PROFILE_NAME "default"
-# ifndef XP_MACOSX /* Don't use symlink-based locking on OS X */
-# define USE_SYMLINK_LOCKING
-# endif
-#endif
-
-// IID and CIDs of all the services needed
-static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
-#endif
-
-// Registry Keys
-
-static ::rtl::OUString szProfileSubtreeString( RTL_CONSTASCII_USTRINGPARAM( "Profiles" ));
-static ::rtl::OUString szCurrentProfileString( RTL_CONSTASCII_USTRINGPARAM( "CurrentProfile" ));
-static ::rtl::OUString szDirectoryString( RTL_CONSTASCII_USTRINGPARAM( "directory" ));
-
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 1024
-#endif
-#include <MNSFolders.hxx>
-#include <MNSINIParser.hxx>
-
-namespace connectivity
-{
- namespace mozab
- {
- ProfileStruct::ProfileStruct(MozillaProductType aProduct,::rtl::OUString aProfileName,
-#ifdef MINIMAL_PROFILEDISCOVER
- const ::rtl::OUString& aProfilePath
-#else
- nsILocalFile * aProfilePath
-#endif
- )
- {
- product=aProduct;
- profileName = aProfileName;
- profilePath = aProfilePath;
- }
- ::rtl::OUString ProfileStruct::getProfilePath()
- {
-#ifdef MINIMAL_PROFILEDISCOVER
- return profilePath;
-#else
- if (profilePath)
- {
- nsAutoString path;
- nsresult rv = profilePath->GetPath(path);
- NS_ENSURE_SUCCESS(rv, ::rtl::OUString());
- // PRUnichar != sal_Unicode in mingw
- return ::rtl::OUString(reinterpret_cast_mingw_only<const sal_Unicode *>(path.get()));
- }
- else
- return ::rtl::OUString();
-#endif
- }
-
- ProfileAccess::~ProfileAccess()
- {
- }
- ProfileAccess::ProfileAccess()
- {
- LoadProductsInfo();
- }
-
- sal_Int32 ProfileAccess::LoadProductsInfo()
- {
- //load SeaMonkey 2 profiles to m_ProductProfileList
- sal_Int32 count = LoadXPToolkitProfiles(MozillaProductType_Mozilla);
-
- //load thunderbird profiles to m_ProductProfileList
- count += LoadXPToolkitProfiles(MozillaProductType_Thunderbird);
-
- //load firefox profiles to m_ProductProfileList
- //firefox profile does not containt address book, but maybe others need them
- count += LoadXPToolkitProfiles(MozillaProductType_Firefox);
- return count;
- }
- //Thunderbird and firefox profiles are saved in profiles.ini
- sal_Int32 ProfileAccess::LoadXPToolkitProfiles(MozillaProductType product)
- {
- sal_Int32 index=product;
- ProductStruct &m_Product = m_ProductProfileList[index];
-
-#ifndef MINIMAL_PROFILEDISCOVER
- nsresult rv;
-#endif
- ::rtl::OUString regDir = getRegistryDir(product);
- ::rtl::OUString profilesIni( regDir );
- profilesIni += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("profiles.ini"));
- IniParser parser( profilesIni );
- IniSectionMap &mAllSection = *(parser.getAllSection());
-
- IniSectionMap::iterator iBegin = mAllSection.begin();
- IniSectionMap::iterator iEnd = mAllSection.end();
- for(;iBegin != iEnd;++iBegin)
- {
- ini_Section *aSection = &(*iBegin).second;
- ::rtl::OUString profileName;
- ::rtl::OUString profilePath;
- ::rtl::OUString sIsRelative;
- ::rtl::OUString sIsDefault;
-
- for(NameValueList::iterator itor=aSection->lList.begin();
- itor != aSection->lList.end();
- ++itor)
- {
- struct ini_NameValue * aValue = &(*itor);
- if (aValue->sName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name"))))
- {
- profileName = aValue->sValue;
- }
- else if (aValue->sName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsRelative"))))
- {
- sIsRelative = aValue->sValue;
- }
- else if (aValue->sName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Path"))))
- {
- profilePath = aValue->sValue;
- }
- else if (aValue->sName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Default"))))
- {
- sIsDefault = aValue->sValue;
- }
- }
- if (profileName.getLength() != 0 || profilePath.getLength() != 0)
- {
-#ifndef MINIMAL_PROFILEDISCOVER
- sal_Int32 isRelative = 0;
- if (sIsRelative.getLength() != 0)
- {
- isRelative = sIsRelative.toInt32();
- }
-
- nsCOMPtr<nsILocalFile> rootDir;
- rv = NS_NewLocalFile(EmptyString(), PR_TRUE,
- getter_AddRefs(rootDir));
- if (NS_FAILED(rv)) continue;
-
- OString sPath = OUStringToOString(profilePath, RTL_TEXTENCODING_UTF8);
- nsCAutoString filePath(sPath.getStr());
-
- if (isRelative) {
- // PRUnichar != sal_Unicode in mingw
- nsAutoString registryDir( reinterpret_cast_mingw_only<const PRUnichar *>(regDir.getStr()) );
- nsCOMPtr<nsILocalFile> mAppData;
- rv = NS_NewLocalFile(registryDir, PR_TRUE,
- getter_AddRefs(mAppData));
- if (NS_FAILED(rv)) continue;
- rv = rootDir->SetRelativeDescriptor(mAppData, filePath);
- } else {
- rv = rootDir->SetPersistentDescriptor(filePath);
- }
- if (NS_FAILED(rv)) continue;
-#endif
-
- ProfileStruct* profileItem = new ProfileStruct(product,profileName,
-#ifdef MINIMAL_PROFILEDISCOVER
- regDir + profilePath
-#else
- rootDir
-#endif
- );
- m_Product.mProfileList[profileName] = profileItem;
-
- sal_Int32 isDefault = 0;
- if (sIsDefault.getLength() != 0)
- {
- isDefault = sIsDefault.toInt32();
- }
- if (isDefault)
- m_Product.mCurrentProfileName = profileName;
-
- }
-
- }
- return static_cast< ::sal_Int32 >(m_Product.mProfileList.size());
- }
-
- ::rtl::OUString ProfileAccess::getProfilePath( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException)
- {
- sal_Int32 index=product;
- ProductStruct &m_Product = m_ProductProfileList[index];
- if (!m_Product.mProfileList.size() || m_Product.mProfileList.find(profileName) == m_Product.mProfileList.end())
- {
- //Profile not found
- return ::rtl::OUString();
- }
- else
- return m_Product.mProfileList[profileName]->getProfilePath();
- }
-
- ::sal_Int32 ProfileAccess::getProfileCount( ::com::sun::star::mozilla::MozillaProductType product) throw (::com::sun::star::uno::RuntimeException)
- {
- sal_Int32 index=product;
- ProductStruct &m_Product = m_ProductProfileList[index];
- return static_cast< ::sal_Int32 >(m_Product.mProfileList.size());
- }
- ::sal_Int32 ProfileAccess::getProfileList( ::com::sun::star::mozilla::MozillaProductType product, ::com::sun::star::uno::Sequence< ::rtl::OUString >& list ) throw (::com::sun::star::uno::RuntimeException)
- {
- sal_Int32 index=product;
- ProductStruct &m_Product = m_ProductProfileList[index];
- list.realloc(static_cast<sal_Int32>(m_Product.mProfileList.size()));
- sal_Int32 i=0;
- for(ProfileList::iterator itor=m_Product.mProfileList.begin();
- itor != m_Product.mProfileList.end();
- itor++)
- {
- ProfileStruct * aProfile = (*itor).second;
- list[i] = aProfile->getProfileName();
- i++;
- }
-
- return static_cast< ::sal_Int32 >(m_Product.mProfileList.size());
- }
-
- ::rtl::OUString ProfileAccess::getDefaultProfile( ::com::sun::star::mozilla::MozillaProductType product ) throw (::com::sun::star::uno::RuntimeException)
- {
- sal_Int32 index=product;
- ProductStruct &m_Product = m_ProductProfileList[index];
- if (m_Product.mCurrentProfileName.getLength() != 0)
- {
- //default profile setted in mozilla registry
- return m_Product.mCurrentProfileName;
- }
- if (m_Product.mProfileList.size() == 0)
- {
- //there are not any profiles
- return ::rtl::OUString();
- }
- ProfileStruct * aProfile = (*m_Product.mProfileList.begin()).second;
- return aProfile->getProfileName();
- }
-#ifndef MINIMAL_PROFILEDISCOVER
- nsresult ProfileAccess::isExistFileOrSymlink(nsILocalFile* aFile,PRBool *bExist)
- {
- nsresult rv;
- nsAutoString path;
- aFile->GetPath(path);
- rv = aFile->Exists(bExist);
- NS_ENSURE_SUCCESS(rv, rv);
- if (!*bExist)
- {
- rv = aFile->IsSymlink(bExist);
- NS_ENSURE_SUCCESS(rv, rv);
- }
- return rv;
- }
- nsresult ProfileAccess::isLockExist(nsILocalFile* aFile)
- {
-#if defined (XP_MACOSX)
- NS_NAMED_LITERAL_STRING(LOCKFILE_NAME, ".parentlock");
- NS_NAMED_LITERAL_STRING(OLD_LOCKFILE_NAME, "parent.lock");
-#elif defined (XP_UNIX)
- NS_ConvertASCIItoUTF16 OLD_LOCKFILE_NAME("lock");
- NS_ConvertASCIItoUTF16 LOCKFILE_NAME(".parentlock");
-#else
- NS_NAMED_LITERAL_STRING(OLD_LOCKFILE_NAME, "parent.lock");
- NS_NAMED_LITERAL_STRING(LOCKFILE_NAME, "parent.lock");
-#endif
-
- nsresult rv;
-
- PRBool isDir;
- rv = aFile->IsDirectory(&isDir);
- NS_ENSURE_SUCCESS(rv, rv);
- if (!isDir)
- return NS_ERROR_FILE_NOT_DIRECTORY;
-
- nsCOMPtr<nsILocalFile> lockFile;
- rv = aFile->Clone((nsIFile **)((void **)getter_AddRefs(lockFile)));
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = lockFile->Append(LOCKFILE_NAME);
- NS_ENSURE_SUCCESS(rv, rv);
- PRBool nExist=PR_FALSE;
- rv = isExistFileOrSymlink(lockFile,&nExist);
- NS_ENSURE_SUCCESS(rv, rv);
- if (!nExist) // Check OLD_LOCKFILE_NAME
- {
- nsCOMPtr<nsILocalFile> oldlockFile;
- rv = aFile->Clone((nsIFile **)((void **)getter_AddRefs(oldlockFile)));
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = oldlockFile->Append(OLD_LOCKFILE_NAME);
- NS_ENSURE_SUCCESS(rv, rv);
- rv = isExistFileOrSymlink(oldlockFile,&nExist);
- NS_ENSURE_SUCCESS(rv, rv);
- }
- return nExist;
- }
-
-#endif
- ::sal_Bool ProfileAccess::isProfileLocked( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException)
- {
-#ifdef MINIMAL_PROFILEDISCOVER
- (void)product; /* avoid warning about unused parameter */
- (void)profileName; /* avoid warning about unused parameter */
- return sal_True;
-#else
- ::rtl::OUString path = getProfilePath(product,profileName);
- if (!path.getLength())
- return sal_True;
-
- // PRUnichar != sal_Unicode in mingw
- nsAutoString filePath(reinterpret_cast_mingw_only<const PRUnichar *>(path.getStr()));
-
- nsresult rv;
- nsCOMPtr<nsILocalFile> localFile;
- rv = NS_NewLocalFile(filePath, PR_TRUE,
- getter_AddRefs(localFile));
- NS_ENSURE_SUCCESS(rv,sal_True);
-
- PRBool exists = PR_FALSE;
- rv = localFile->Exists(&exists);
- NS_ENSURE_SUCCESS(rv, sal_True);
- if (!exists)
- return sal_True;
-
- // If the profile is locked, we return true
- rv = isLockExist(localFile);
- if (rv)
- return sal_True;
- return sal_False;
-#endif
- }
-
- ::sal_Bool ProfileAccess::getProfileExists( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException)
- {
- sal_Int32 index=product;
- ProductStruct &m_Product = m_ProductProfileList[index];
- if (!m_Product.mProfileList.size() || m_Product.mProfileList.find(profileName) == m_Product.mProfileList.end())
- {
- return sal_False;
- }
- else
- return sal_True;
- }
- }
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx
deleted file mode 100644
index a99f335479..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef __MNSProfileDiscover_h___
-#define __MNSProfileDiscover_h___
-
-#ifndef MINIMAL_PROFILEDISCOVER
-#include "mozilla_profile_discover.h"
-#endif
-
-#include <sal/types.h>
-#include <osl/diagnose.h>
-#include <osl/conditn.hxx>
-#include <com/sun/star/mozilla/MozillaProductType.hpp>
-#include <com/sun/star/uno/RuntimeException.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <rtl/ustring.hxx>
-
-#include <vector>
-#include <map>
-
-using namespace com::sun::star::mozilla;
-namespace connectivity
-{
- namespace mozab
- {
- class ProfileStruct;
- }
-}
-typedef ::std::map < ::rtl::OUString, ::connectivity::mozab::ProfileStruct* > ProfileList;
-namespace connectivity
-{
- namespace mozab
- {
- class ProfileStruct
- {
- public:
- ProfileStruct(MozillaProductType aProduct,::rtl::OUString aProfileName,
-#ifdef MINIMAL_PROFILEDISCOVER
- const ::rtl::OUString &aProfilePath
-#else
- nsILocalFile * aProfilePath
-#endif
- );
- MozillaProductType getProductType() { return product;}
- ::rtl::OUString getProfileName(){ return profileName;}
- ::rtl::OUString getProfilePath() ;
-#ifndef MINIMAL_PROFILEDISCOVER
- nsILocalFile *getProfileLocal(){ return profilePath;}
-#endif
- protected:
- MozillaProductType product;
- ::rtl::OUString profileName;
-#ifdef MINIMAL_PROFILEDISCOVER
- ::rtl::OUString profilePath;
-#else
- nsCOMPtr<nsILocalFile> profilePath;
-#endif
- };
-
- class ProductStruct
- {
- public:
- void setCurrentProfile(::rtl::OUString aProfileName){mCurrentProfileName = aProfileName;}
-
- ::rtl::OUString mCurrentProfileName;
-
- ProfileList mProfileList;
- };
-
- //Used to query profiles information
- class ProfileAccess
- {
- public:
-
- virtual ~ProfileAccess();
- ProfileAccess();
- ::rtl::OUString getProfilePath( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException);
- ::sal_Int32 getProfileCount( ::com::sun::star::mozilla::MozillaProductType product ) throw (::com::sun::star::uno::RuntimeException);
- ::sal_Int32 getProfileList( ::com::sun::star::mozilla::MozillaProductType product, ::com::sun::star::uno::Sequence< ::rtl::OUString >& list ) throw (::com::sun::star::uno::RuntimeException);
- ::rtl::OUString getDefaultProfile( ::com::sun::star::mozilla::MozillaProductType product ) throw (::com::sun::star::uno::RuntimeException);
- ::sal_Bool SAL_CALL isProfileLocked( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException);
- ::sal_Bool SAL_CALL getProfileExists( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException);
- protected:
- ProductStruct m_ProductProfileList[4];
- sal_Int32 LoadProductsInfo();
- sal_Int32 LoadXPToolkitProfiles(MozillaProductType product);
-#ifndef MINIMAL_PROFILEDISCOVER
- //used by isProfileLocked
- nsresult isExistFileOrSymlink(nsILocalFile* aFile,PRBool *bExist);
- nsresult isLockExist(nsILocalFile* aFile);
-#endif
- };
-
- }
-}
-
-#endif // __MNSProfileDiscover_h___
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.cxx
deleted file mode 100644
index 2978c16fa1..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.cxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MNSProfileManager.hxx"
-#include "MNSProfile.hxx"
-
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 1024
-#endif
-#include <MNSFolders.hxx>
-#include <MNSINIParser.hxx>
-
-static ::sal_Int32 nInitCounter=0;
-namespace connectivity
-{
- namespace mozab
- {
-
- ProfileManager::~ProfileManager()
- {
- }
- ProfileManager::ProfileManager()
- :m_CurrentProduct(MozillaProductType_Mozilla)
- ,aProfile(NULL)
- {
- }
- ::sal_Int32 ProfileManager::bootupProfile( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException)
- {
- if (!aProfile)
- {
- aProfile=new nsProfile();
- aProfile->StartupWithArgs(NULL,sal_False);
- }
-
- setCurrentProfile(product,profileName);
- return ++nInitCounter;
- }
- ::sal_Int32 ProfileManager::shutdownProfile( ) throw (::com::sun::star::uno::RuntimeException)
- {
- return --nInitCounter;
- }
- ::com::sun::star::mozilla::MozillaProductType ProfileManager::getCurrentProduct( ) throw (::com::sun::star::uno::RuntimeException)
- {
- return m_CurrentProduct;
- }
- ::rtl::OUString ProfileManager::getCurrentProfile( ) throw (::com::sun::star::uno::RuntimeException)
- {
- nsresult rv;
- nsCOMPtr<nsIProfile> theProfile(do_GetService(NS_PROFILE_CONTRACTID,&rv));
- if (NS_FAILED(rv)) return ::rtl::OUString();
- nsXPIDLString currentProfileStr;
- //call GetCurrentProfile before call SetCurrentProfile will get the default profile
- rv = theProfile->GetCurrentProfile(getter_Copies(currentProfileStr));
- if (NS_FAILED(rv) || currentProfileStr.get() == nsnull)
- return ::rtl::OUString();
- // PRUnichar != sal_Unicode in mingw
- return ::rtl::OUString(reinterpret_cast_mingw_only<const sal_Unicode *>(currentProfileStr.get()));
- }
- ::rtl::OUString ProfileManager::setCurrentProfile( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException)
- {
- ::rtl::OUString currentProfile = getCurrentProfile();
- //if profileName not given, then skip and return curernt profile
- if (!profileName.getLength() && m_CurrentProduct == product)
- return currentProfile;
-
- if (m_CurrentProduct == product && profileName.equals(currentProfile))
- return currentProfile;
- //set current product
- m_CurrentProduct = product;
-
- //get profile mozilla profile service
- nsresult rv;
- nsCOMPtr<nsIProfile> theProfile(do_GetService(NS_PROFILE_CONTRACTID,&rv));
- if (NS_FAILED(rv)) return ::rtl::OUString();
-
- // PRUnichar != sal_Unicode in mingw
- const PRUnichar* pUsedProfile = reinterpret_cast_mingw_only<const PRUnichar *>(profileName.getStr());
- //set current profile
- rv = theProfile->SetCurrentProfile( pUsedProfile );
- if (NS_FAILED(rv)) return ::rtl::OUString();
- return currentProfile;
- }
-
-
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.hxx
deleted file mode 100644
index f7ff7e69a1..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef __MNSProfileManager_h___
-#define __MNSProfileManager_h___
-
-#include "mozilla_profilemanager.h"
-
-#include <sal/types.h>
-#include <osl/diagnose.h>
-#include <osl/conditn.hxx>
-#include <com/sun/star/mozilla/MozillaProductType.hpp>
-#include <com/sun/star/uno/RuntimeException.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#include <rtl/ustring.hxx>
-#include <vector>
-#include <map>
-
-using namespace com::sun::star::mozilla;
-class nsProfile;
-namespace connectivity
-{
- namespace mozab
- {
- class ProfileManager
- {
- public:
-
- virtual ~ProfileManager();
- ProfileManager();
-
- ::sal_Int32 SAL_CALL bootupProfile( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException) ;
- ::sal_Int32 SAL_CALL shutdownProfile( ) throw (::com::sun::star::uno::RuntimeException) ;
- ::com::sun::star::mozilla::MozillaProductType SAL_CALL getCurrentProduct( ) throw (::com::sun::star::uno::RuntimeException) ;
- ::rtl::OUString SAL_CALL getCurrentProfile( ) throw (::com::sun::star::uno::RuntimeException) ;
- ::rtl::OUString SAL_CALL setCurrentProfile( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException) ;
-
- protected:
- ::com::sun::star::mozilla::MozillaProductType m_CurrentProduct;
- nsProfile *aProfile;
- };
-
- }
-}
-
-#endif // __MNSProfileManager_h___
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSRunnable.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSRunnable.cxx
deleted file mode 100644
index 6461215532..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSRunnable.cxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "MNSRunnable.hxx"
-#include "MDatabaseMetaDataHelper.hxx"
-#include "MQuery.hxx"
-#include <osl/mutex.hxx>
-#include <osl/conditn.hxx>
-
-#include "pre_include_mozilla.h"
-#include <nsIProxyObjectManager.h>
-// More Mozilla includes for LDAP Connection Test
-#include "prprf.h"
-#include "nsILDAPURL.h"
-#include "nsILDAPMessage.h"
-#include "nsILDAPMessageListener.h"
-#include "nsILDAPErrors.h"
-#include "nsILDAPConnection.h"
-#include "nsILDAPOperation.h"
-#include "post_include_mozilla.h"
-
-using namespace connectivity::mozab;
-
-/* Implementation file */
-NS_IMPL_ISUPPORTS1(MNSRunnable, nsIRunnable)
-
-static ::osl::Mutex m_aThreadMutex;
-
-nsIRunnable * MNSRunnable::ProxiedObject()
-{
- if (!_ProxiedObject)
- {
-
- nsresult rv = NS_GetProxyForObject(NS_UI_THREAD_EVENTQ,
- NS_GET_IID(nsIRunnable),
- this,
- PROXY_SYNC,
- (void**)&_ProxiedObject);
- (void)rv;
-
- _ProxiedObject->AddRef();
- }
- return _ProxiedObject;
-}
-
-MNSRunnable::MNSRunnable()
-{
- NS_INIT_ISUPPORTS();
- _ProxiedObject=NULL;
-#if OSL_DEBUG_LEVEL > 0
- m_oThreadID = osl_getThreadIdentifier(NULL);
-#endif
- AddRef();
-}
-
-MNSRunnable::~MNSRunnable()
-{
-}
-sal_Int32 MNSRunnable::StartProxy(const ::com::sun::star::uno::Reference< ::com::sun::star::mozilla::XCodeProxy >& aCode)
-{
- OSL_TRACE( "IN : MNSRunnable::StartProxy() \n" );
- ::osl::MutexGuard aGuard(m_aThreadMutex);
- xCode = aCode;
- return ProxiedObject()->Run();
-}
-
-
-NS_IMETHODIMP MNSRunnable::Run()
-{
- return static_cast<nsresult>(xCode->run());
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSRunnable.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSRunnable.hxx
deleted file mode 100644
index 093e2d157c..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/MNSRunnable.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MAB_MOZAB_RUNNABLE_HXX_
-#define _CONNECTIVITY_MAB_MOZAB_RUNNABLE_HXX_
-#include "MNSDeclares.hxx"
-#include <osl/thread.hxx>
-
-#include <MNSInclude.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/mozilla/XCodeProxy.hpp>
-
-
-using namespace com::sun::star::uno;
-using namespace com::sun::star::mozilla;
-
-namespace connectivity
-{
- namespace mozab
- {
- class MNSRunnable : public nsIRunnable
- {
- public:
- nsIRunnable * ProxiedObject();
- MNSRunnable();
- virtual ~MNSRunnable();
- NS_DECL_ISUPPORTS
- NS_DECL_NSIRUNNABLE
-
- public:
- sal_Int32 StartProxy(const ::com::sun::star::uno::Reference< ::com::sun::star::mozilla::XCodeProxy >& aCode); //Call this to start proxy
-
- private:
- nsIRunnable* _ProxiedObject;
- Reference<XCodeProxy> xCode;
-#if OSL_DEBUG_LEVEL > 0
- oslThreadIdentifier m_oThreadID;
-#endif
- };
- }
-}
-#endif //_CONNECTIVITY_MAB_MOZABHELPER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
deleted file mode 100755
index c4c1d21106..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk
+++ /dev/null
@@ -1,95 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-CALL_CDECL=TRUE
-
-PRJ=..$/..$/..$/..
-PRJINC=..$/..$/..
-PRJNAME=connectivity
-TARGET=mozbootstrap
-
-# --- Settings ----------------------------------
-
-USE_DEFFILE=TRUE
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-# --- begin of mozilla specific stuff
-MOZ_LIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT)
-MOZ_INC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla
-# --- end of mozilla specific stuff
-
-.INCLUDE : settings.mk
-
-.INCLUDE : $(PRJ)$/version.mk
-
-.INCLUDE : ../makefile_mozab.mk
-
-INCPRE += -I../mozillasrc
-
-# --- Files -------------------------------------
-
-SLOFILES += \
- $(SLO)$/MNSINIParser.obj \
- $(SLO)$/MNSProfileDiscover.obj \
- $(SLO)$/MMozillaBootstrap.obj \
- $(SLO)$/MNSFolders.obj
-
-.IF ( "$(SYSTEM_MOZILLA)" == "YES" && "$(WITH_MOZILLA)" == "YES" ) || ( "$(WITH_MOZILLA)" == "NO" ) || ( "$(OS)" == "MACOSX" )
-CDEFS+=-DMINIMAL_PROFILEDISCOVER
-
-SHL1TARGET=$(TARGET)
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-SHL1OBJS=$(SLOFILES)
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-DEF1NAME=$(SHL1TARGET)
-
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB) \
- $(COMPHELPERLIB)
-
-ALLTAR : $(MISC)/mozbootstrap.component
-
-$(MISC)/mozbootstrap.component .ERRREMOVE : \
- $(SOLARENV)/bin/createcomponent.xslt mozbootstrap.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt mozbootstrap.component
-
-.ELSE
-SLOFILES += \
- $(SLO)$/MNSInit.obj \
- $(SLO)$/MNSProfileManager.obj \
- $(SLO)$/MNSRunnable.obj \
- $(SLO)$/MNSProfile.obj \
- $(SLO)$/MNSProfileDirServiceProvider.obj
-.ENDIF
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
diff --git a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component b/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component
deleted file mode 100755
index 5da158924a..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.mozilla.MozillaBootstrap">
- <service name="com.sun.star.mozilla.MozillaBootstrap"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/mozab/bootstrap/mozilla_nsinit.h b/connectivity/source/drivers/mozab/bootstrap/mozilla_nsinit.h
deleted file mode 100755
index e34bc21913..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/mozilla_nsinit.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "pre_include_mozilla.h"
-#if defined __GNUC__
- #pragma GCC system_header
-#endif
-
-#include "nsIServiceManager.h"
-#include "nsIEventQueueService.h"
-#include "nsIChromeRegistry.h"
-
-#include "nsIStringBundle.h"
-
-#include "nsIDirectoryService.h"
-#include "nsIProfile.h"
-#include "nsIProfileInternal.h"
-#include "nsIPref.h"
-#include "nsXPIDLString.h"
-
-#include "nsString.h"
-#if defined __SUNPRO_CC
-#pragma disable_warn
- // somewhere in the files included directly or indirectly in nsString.h, warnings are enabled, again
-#endif
-#include "nsEmbedAPI.h"
-
-#include "nsDirectoryService.h"
-
-#include "post_include_mozilla.h"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofile.h b/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofile.h
deleted file mode 100755
index 4d65bc3cb5..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofile.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "pre_include_mozilla.h"
-#if defined __GNUC__
- #pragma GCC system_header
-#endif
-
-#include "nscore.h"
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
-
-#include "pratom.h"
-#include "prmem.h"
-#include "plstr.h"
-#include "prenv.h"
-
-#include "nsIFactory.h"
-#include "nsIComponentManager.h"
-#include "nsIEnumerator.h"
-#include "nsXPIDLString.h"
-#include "nsEscape.h"
-#include "nsIURL.h"
-
-#include "prprf.h"
-
-#include "nsIProfile.h"
-#include "nsIProfileInternal.h"
-#include "nsIProfileStartupListener.h"
-#include "nsIProfileChangeStatus.h"
-#include "nsCOMPtr.h"
-#include "nsISupports.h"
-#include "nsIRegistry.h"
-#include "nsString.h"
-#if defined __SUNPRO_CC
-#pragma disable_warn
- // somewhere in the files included directly or indirectly in nsString.h, warnings are enabled, again
-#endif
-#include "nsIInterfaceRequestor.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsIDirectoryService.h"
-#include "nsIFactory.h"
-
-#include "nsIIOService.h"
-#include "nsNetUtil.h"
-#include "nsFileStream.h"
-#include "nsIStreamListener.h"
-#include "nsIServiceManager.h"
-#include "nsCOMPtr.h"
-#include "nsIModule.h"
-#include "nsIGenericFactory.h"
-#include "nsICategoryManager.h"
-#include "nsXPCOM.h"
-#include "nsISupportsPrimitives.h"
-#include "nsIDirectoryService.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsIChromeRegistry.h" // chromeReg
-#include "nsIStringBundle.h"
-#include "nsIObserverService.h"
-#include "nsHashtable.h"
-#include "nsIAtom.h"
-#include "nsCRT.h"
-
-#include "post_include_mozilla.h"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofiledirserviceprovider.h b/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofiledirserviceprovider.h
deleted file mode 100755
index 4bb836ed13..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofiledirserviceprovider.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "pre_include_mozilla.h"
-#if defined __GNUC__
- #pragma GCC system_header
-#endif
-
-#include "nsIDirectoryService.h"
-#include "nsILocalFile.h"
-#include "nsString.h"
-#if defined __SUNPRO_CC
-#pragma disable_warn
- // somewhere in the files included directly or indirectly in nsString.h, warnings are enabled, again
-#endif
-
-#include "post_include_mozilla.h"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/mozilla_profile_discover.h b/connectivity/source/drivers/mozab/bootstrap/mozilla_profile_discover.h
deleted file mode 100755
index 03198dcab8..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/mozilla_profile_discover.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "pre_include_mozilla.h"
-#if defined __GNUC__
- #pragma GCC system_header
-#endif
-
-#include "nsCOMPtr.h"
-#include "nsISupports.h"
-#include "nsString.h"
-#if defined __SUNPRO_CC
-#pragma disable_warn
- // somewhere in the files included directly or indirectly in nsString.h, warnings are enabled, again
-#endif
-#include "nsIRegistry.h"
-#include "nsXPIDLString.h"
-#include "nsVoidArray.h"
-#include "nsIFile.h"
-#include "nsILocalFile.h"
-
-#include "post_include_mozilla.h"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/mozilla_profilemanager.h b/connectivity/source/drivers/mozab/bootstrap/mozilla_profilemanager.h
deleted file mode 100755
index 1579b16947..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/mozilla_profilemanager.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "pre_include_mozilla.h"
-#if defined __GNUC__
- #pragma GCC system_header
-#endif
-
-#include "nsCOMPtr.h"
-#include "nsISupports.h"
-#include "nsString.h"
-#if defined __SUNPRO_CC
-#pragma disable_warn
- // somewhere in the files included directly or indirectly in nsString.h, warnings are enabled, again
-#endif
-#include "nsIRegistry.h"
-#include "nsXPIDLString.h"
-#include "nsVoidArray.h"
-#include "nsIFile.h"
-#include "nsILocalFile.h"
-
-#include "pratom.h"
-#include "prmem.h"
-#include "plstr.h"
-#include "prenv.h"
-
-#include "nsIEnumerator.h"
-#include "prprf.h"
-#include "nsCOMPtr.h"
-#include "nsIComponentManager.h"
-#include "nsEscape.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsILocalFile.h"
-#include "nsReadableUtils.h"
-
-
-#if defined(XP_MAC) || defined(XP_MACOSX)
-#include <Processes.h>
-#include <CFBundle.h>
-#include "nsILocalFileMac.h"
-#endif
-
-#ifdef XP_UNIX
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <signal.h>
-#include "prnetdb.h"
-#include "prsystem.h"
-#endif
-
-#ifdef VMS
-#include <rmsdef.h>
-#endif
-
-#include "nsIPlatformCharset.h"
-#include <MNSInit.hxx>
-
-#include "post_include_mozilla.h"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/post_include_windows.h b/connectivity/source/drivers/mozab/bootstrap/post_include_windows.h
deleted file mode 100755
index a33bd622ac..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/post_include_windows.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
- #pragma warning(pop)
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/bootstrap/pre_include_windows.h b/connectivity/source/drivers/mozab/bootstrap/pre_include_windows.h
deleted file mode 100755
index 792e8a34f4..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/pre_include_windows.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
- #pragma warning(push,1)
- #pragma warning(disable:4668 4917)
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/exports.dxp b/connectivity/source/drivers/mozab/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/drivers/mozab/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk
deleted file mode 100755
index cefb6f9fb9..0000000000
--- a/connectivity/source/drivers/mozab/makefile.mk
+++ /dev/null
@@ -1,194 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=mozab
-TARGET2=$(TARGET)drv
-VISIBILITY_HIDDEN=TRUE
-
-.IF ( "$(SYSTEM_MOZILLA)" == "YES" && "$(WITH_MOZILLA)" == "YES") || "$(WITH_MOZILLA)" == "NO" || ( "$(OS)" == "MACOSX" )
-all:
- @echo " Not building the mozilla address book driver"
- @echo " dependency to Mozilla developer snapshots not feasable at the moment"
- @echo " see http://bugzilla.mozilla.org/show_bug.cgi?id=135137"
- @echo " see http://www.mozilla.org/issues/show_bug.cgi?id=91209"
-.ENDIF
-
-# --- begin of mozilla specific stuff
-MOZ_LIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT)
-MOZ_INC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla
-
-.IF "$(OS)"=="WNT"
- MOZ_EMBED_LIB := $(shell @-test -f $(MOZ_LIB)$/embed_base_s.lib && echo $(MOZ_LIB)$/embed_base_s.lib )
- MOZ_REG_LIB := $(shell @-test -f $(MOZ_LIB)$/mozreg_s.lib && echo $(MOZ_LIB)$/mozreg_s.lib )
-
- MOZ_EMBED_LIB *:= $(MOZ_LIB)$/baseembed_s.lib
- MOZ_REG_LIB *:= $(MOZ_LIB)$/mozreg.lib
-
- .IF "$(COM)"=="GCC"
- MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom -lxpcom_core
- .ELSE
- LIB += $(MOZ_LIB)
- MOZ_LIB_XPCOM= $(MOZ_EMBED_LIB) $(MOZ_LIB)$/nspr4.lib $(MOZ_REG_LIB) $(MOZ_LIB)$/xpcom.lib $(MOZ_LIB)$/xpcom_core.lib
- .ENDIF
-
-.ELSE "$(OS)"=="WNT"
- MOZ_LIB_XPCOM = -L$(MOZ_LIB) -lnspr4 -lxpcom_core -lmozreg_s -lembed_base_s
-.ENDIF
-# --- end of mozilla specific stuff
-
-USE_DEFFILE=TRUE
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-.IF "$(OS)"!="WNT"
-COMPONENT_CONFIG_DATA=$(TARGET)2.xcu
-COMPONENT_CONFIG_SCHEMA=$(TARGET)2.xcs
-.ENDIF
-
-# --- Settings ----------------------------------
-
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-.INCLUDE : $(PRJ)$/version.mk
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/MDriver.obj \
- $(SLO)$/MServices.obj
-
-# --- MOZAB BASE Library -----------------------------------
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB) \
- $(DBTOOLSLIB)
-
-SHL1DEPN=
-SHL1IMPLIB= i$(TARGET)$(DLLPOSTFIX)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt \
- $(SLB)$/$(TARGET).lib
-DEFLIB1NAME=$(TARGET)
-
-
-# --- Files -------------------------------------
-MOZSLOFILES=\
- $(SLO)$/MNSInit.obj \
- $(SLO)$/MQueryHelper.obj \
- $(SLO)$/MDatabaseMetaDataHelper.obj \
- $(SLO)$/MQuery.obj \
- $(SLO)$/MTypeConverter.obj \
- $(SLO)$/MNameMapper.obj \
- $(SLO)$/MNSMozabProxy.obj \
- $(SLO)$/MNSTerminateListener.obj \
- $(SLO)$/MMozillaBootstrap.obj \
- $(SLO)$/MNSFolders.obj \
- $(SLO)$/MNSProfileDiscover.obj \
- $(SLO)$/MNSProfileManager.obj \
- $(SLO)$/MNSINIParser.obj \
- $(SLO)$/MNSRunnable.obj \
- $(SLO)$/MNSProfile.obj \
- $(SLO)$/MNSProfileDirServiceProvider.obj \
- $(SLO)$/MLdapAttributeMap.obj
-
-
-SLO2FILES=\
- $(SLO)$/MConfigAccess.obj \
- $(SLO)$/MCatalog.obj \
- $(SLO)$/MColumns.obj \
- $(SLO)$/MTable.obj \
- $(SLO)$/MTables.obj \
- $(SLO)$/MColumnAlias.obj \
- $(SLO)$/MPreparedStatement.obj \
- $(SLO)$/MStatement.obj \
- $(SLO)$/MResultSetMetaData.obj \
- $(SLO)$/MResultSet.obj \
- $(SLO)$/MDatabaseMetaData.obj \
- $(SLO)$/MConnection.obj \
- $(MOZSLOFILES)
-
-DEPOBJFILES=$(SLO2FILES)
-
-# --- MOZAB BASE Library -----------------------------------
-
-SHL2VERSIONMAP= $(TARGET2).map
-SHL2NOCHECK=TRUE
-SHL2TARGET= $(TARGET2)$(DLLPOSTFIX)
-SHL2OBJS=$(SLO2FILES)
-SHL2STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(DBTOOLSLIB) \
- $(COMPHELPERLIB) \
- $(MOZ_LIB_XPCOM)
-
-.IF "$(GUI)"=="WNT"
- SHL2STDLIBS += \
- $(SHELL32LIB)
-.ENDIF # "$(GUI)"=="WNT"
-
-SHL2DEPN=
-SHL2IMPLIB= i$(TARGET2)
-SHL2DEF= $(MISC)$/$(SHL2TARGET).def
-DEF2NAME= $(SHL2TARGET)
-
-# --- Targets ----------------------------------
-
-.INCLUDE : $(PRJ)$/target.pmk
-
-# --- filter file ------------------------------
-
-$(MISC)$/$(SHL1TARGET).flt: makefile.mk
- @echo ------------------------------
- @echo _TI >$@
- @echo _real >>$@
-
-$(MISC)$/$(SHL2TARGET).flt: makefile.mk
- @echo ------------------------------
- @echo _TI >$@
- @echo _real >>$@
-
-
-ALLTAR : $(MISC)/mozab.component
-
-$(MISC)/mozab.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- mozab.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt mozab.component
diff --git a/connectivity/source/drivers/mozab/makefile_mozab.mk b/connectivity/source/drivers/mozab/makefile_mozab.mk
deleted file mode 100755
index c984f121a2..0000000000
--- a/connectivity/source/drivers/mozab/makefile_mozab.mk
+++ /dev/null
@@ -1,127 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-CDEFS += -DMOZILLA_INTERNAL_API
-
-.IF "$(GUI)"=="UNX"
- .IF "$(COMNAME)"=="sunpro5"
- CFLAGS += -features=tmplife
- #This flag is needed to build mozilla 1.7 code
- .ENDIF # "$(COMNAME)"=="sunpro5"
-.ENDIF
-
-MOZINC = . \
- -I.. \
- -I$(MOZ_INC) \
- -I$(MOZ_INC)$/nspr \
- -I$(MOZ_INC)$/xpcom \
- -I$(MOZ_INC)$/string \
- -I$(MOZ_INC)$/rdf \
- -I$(MOZ_INC)$/msgbase \
- -I$(MOZ_INC)$/addrbook \
- -I$(MOZ_INC)$/mork \
- -I$(MOZ_INC)$/locale \
- -I$(MOZ_INC)$/pref \
- -I$(MOZ_INC)$/mime \
- -I$(MOZ_INC)$/chrome \
- -I$(MOZ_INC)$/necko \
- -I$(MOZ_INC)$/intl \
- -I$(MOZ_INC)$/profile \
- -I$(MOZ_INC)$/embed_base \
- -I$(MOZ_INC)$/mozldap \
- -I$(MOZ_INC)$/uconv \
- -I$(MOZ_INC)$/xpcom_obsolete \
- -I$(MOZ_INC)$/content
-
-.IF "$(GUI)" == "WNT"
- CDEFS += \
- -DMOZILLA_CLIENT \
- -DXP_PC \
- -DXP_WIN \
- -DXP_WIN32 \
- -DOJI \
- -DWIN32 \
- -D_WINDOWS \
- -DMOZ_XUL \
- -DMOZ_REFLOW_PERF \
- -DMOZ_REFLOW_PERF_DSP
- .IF "$(COM)" == "GCC"
- INCPOST += $(MOZINC)
- CFLAGSCXX += \
- -fno-rtti \
- -Wall \
- -Wconversion \
- -Wpointer-arith \
- -Wcast-align \
- -Woverloaded-virtual \
- -Wsynth \
- -Wno-long-long
- .ELSE # .IF "$(COM)" == "GCC"
- INCPRE += $(MOZINC)
- .IF "$(DBG_LEVEL)" != "0"
- .IF "$(CCNUMVER)" >= "001399999999"
- CDEFS += -D_STL_NOFORCE_MANIFEST
- .ENDIF # .IF "$(CCNUMVER)" >= "001399999999"
- .ENDIF # .IF "$(DBG_LEVEL)" != "0"
- .ENDIF # .IF "$(COM)" == "GCC"
-.ENDIF # .IF "$(GUI)" == "WNT"
-
-.IF "$(GUI)" == "UNX"
- INCPOST += $(MOZINC)
- CDEFS+= -DMOZILLA_CLIENT \
- -DXP_UNIX
- .IF "$(OS)" == "LINUX"
- CFLAGS += -fPIC -g
- CDEFS += -DOJI
- CFLAGSCXX += \
- -fno-rtti \
- -Wconversion \
- -Wpointer-arith \
- -Wcast-align \
- -Woverloaded-virtual \
- -Wsynth \
- -Wno-long-long \
- -pthread
- CDEFS += -DTRACING
- .ELIF "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX"
- CFLAGS += -fPIC
- CFLAGSCXX += \
- -fno-rtti \
- -Wconversion \
- -Wpointer-arith \
- -Wcast-align \
- -Woverloaded-virtual \
- -Wsynth \
- -Wno-long-long \
- -Wno-deprecated
- CDEFS += -DTRACING
- .ENDIF # "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX"
-
- SHL1TARGET_NAME=$(TARGET)$(MOZAB_MAJOR)
-
-.ENDIF # "$(GUI)" == "UNX"
-
diff --git a/connectivity/source/drivers/mozab/mozab.component b/connectivity/source/drivers/mozab/mozab.component
deleted file mode 100755
index 70f5da3bfe..0000000000
--- a/connectivity/source/drivers/mozab/mozab.component
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.mozilla.MozillaBootstrap">
- <service name="com.sun.star.mozilla.MozillaBootstrap"/>
- </implementation>
- <implementation name="com.sun.star.comp.sdbc.MozabDriver">
- <service name="com.sun.star.sdbc.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/mozab/mozab.xcu b/connectivity/source/drivers/mozab/mozab.xcu
deleted file mode 100644
index 638cbeb2c0..0000000000
--- a/connectivity/source/drivers/mozab/mozab.xcu
+++ /dev/null
@@ -1,154 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:address:outlook" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.MozabDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Microsoft Outlook Address Book</value>
- </prop>
- <node oor:name="Features">
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="sdbc:address:outlookexp" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.MozabDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Microsoft Windows Address Book</value>
- </prop>
- <node oor:name="Features">
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="sdbc:address:mozilla:" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.MozabDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">SeaMonkey Address Book</value>
- </prop>
- <node oor:name="Features">
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsBrowsing" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="sdbc:address:thunderbird:" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.MozabDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Thunderbird Address Book</value>
- </prop>
- <node oor:name="Features">
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsBrowsing" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="sdbc:address:ldap:*" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.MozabDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">LDAP Address Book</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="BaseDN" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="MaxRowCount" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:int">
- <value>100</value>
- </prop>
- </node>
- <node oor:name="PortNumber" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:int">
- <value>389</value>
- </prop>
- </node>
- <node oor:name="UseSSL" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- </node>
- <node oor:name="Features">
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsTableCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="Authentication" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>UserPassword</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/mozab/mozab.xml b/connectivity/source/drivers/mozab/mozab.xml
deleted file mode 100755
index 33e9219a16..0000000000
--- a/connectivity/source/drivers/mozab/mozab.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!DOCTYPE COMPONENTDESCRIPTION PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name> mozabdrv2 </module-name>
- <component-description>
- <Author>Your name</Author>
- <Name>com.sun.star.comp.sdbc.MozabDriver</Name>
- <Description>
- This is the implementation of the sdbc-mozab bridge.
- </Description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service> com.sun.star.sdbc.Driver </supported-service>
- <service-dependency> ... </service-dependency>
- </component-description>
- <component-description>
- <Author>Wind Li</Author>
- <Name>com.sun.star.comp.mozilla.MozillaBootstrap</Name>
- <Description>
- This is the implementation of the MozillaBootstrap for sdbc-mozab bridge and xmlsec.
- </Description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service> com.sun.star.mozilla.MozillaBootstrap</supported-service>
- <service-dependency> ... </service-dependency>
- </component-description>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
-
- <runtime-module-dependency> cppuhelper </runtime-module-dependency>
- <runtime-module-dependency> cppu1 </runtime-module-dependency>
- <runtime-module-dependency> sal1 </runtime-module-dependency>
-
-
-
- <type> com.sun.star.util.XCancellable </type>
- <type> com.sun.star.util.XNumberFormatter </type>
- <type> com.sun.star.uno.TypeClass </type>
- <type> com.sun.star.uno.XWeak </type>
- <type> com.sun.star.uno.XAggregation </type>
- <type> com.sun.star.beans.XPropertyState </type>
- <type> com.sun.star.beans.XPropertySet </type>
- <type> com.sun.star.beans.PropertyValue </type>
- <type> com.sun.star.beans.XMultiPropertySet </type>
- <type> com.sun.star.beans.XFastPropertySet </type>
- <type> com.sun.star.lang.XTypeProvider </type>
- <type> com.sun.star.lang.EventObject </type>
- <type> com.sun.star.lang.XComponent </type>
- <type> com.sun.star.lang.IllegalArgumentException </type>
- <type> com.sun.star.lang.XMultiServiceFactory </type>
- <type> com.sun.star.java.XJavaThreadRegister_11 </type>
- <type> com.sun.star.java.XJavaVM </type>
- <type> com.sun.star.sdbc.XConnection </type>
- <type> com.sun.star.sdbc.XStatement </type>
- <type> com.sun.star.sdbc.XResultSet </type>
- <type> com.sun.star.sdbc.XResultSetMetaDataSupplier</type>
- <type> com.sun.star.sdbc.XColumnLocate </type>
- <type> com.sun.star.sdbc.XResultSetUpdate </type>
- <type> com.sun.star.sdbc.XWarningsSupplier </type>
- <type> com.sun.star.sdbc.XRowUpdate </type>
- <type> com.sun.star.sdbc.XMultipleResults </type>
- <type> com.sun.star.sdbc.XBatchExecution </type>
- <type> com.sun.star.sdbc.XPreparedBatchExecution </type>
- <type> com.sun.star.sdbc.XParameters </type>
- <type> com.sun.star.sdbc.XOutParameters </type>
- <type> com.sun.star.sdbc.DriverPropertyInfo </type>
- <type> com.sun.star.sdbc.XRow </type>
- <type> com.sun.star.sdb.XColumnUpdate </type>
- <type> com.sun.star.sdb.XColumn </type>
- <type> com.sun.star.sdbc.XResultSetUpdate </type>
- <type> com.sun.star.sdbc.XRowUpdate </type>
- <type> com.sun.star.sdbcx.XRowLocate </type>
- <type> com.sun.star.sdbcx.XDeleteRows </type>
-
-</module-description>
-
-
diff --git a/connectivity/source/drivers/mozab/mozab2.xcu b/connectivity/source/drivers/mozab/mozab2.xcu
deleted file mode 100644
index 18cb3c1eaf..0000000000
--- a/connectivity/source/drivers/mozab/mozab2.xcu
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:address:mozilla:" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.MozabDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">SeaMonkey Address Book</value>
- </prop>
- <node oor:name="MetaData">
- <node oor:name="SupportsBrowsing" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="sdbc:address:thunderbird:" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.MozabDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">Thunderbird Address Book</value>
- </prop>
- <node oor:name="MetaData">
- <node oor:name="SupportsBrowsing" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="sdbc:address:ldap:*" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.MozabDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">LDAP Address Book</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="BaseDN" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="MaxRowCount" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:int">
- <value>100</value>
- </prop>
- </node>
- <node oor:name="PortNumber" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:int">
- <value>389</value>
- </prop>
- </node>
- <node oor:name="UseSSL" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsTableCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="Authentication" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>UserPassword</value>
- </prop>
- </node>
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/mozab/mozabdrv.map b/connectivity/source/drivers/mozab/mozabdrv.map
deleted file mode 100755
index a431a07377..0000000000
--- a/connectivity/source/drivers/mozab/mozabdrv.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- OMozabConnection_CreateInstance;
- OMozillaBootstrap_CreateInstance;
- setMozabServiceFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx b/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx
deleted file mode 100644
index 2e08d7754b..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx
+++ /dev/null
@@ -1,805 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-// Mozilla includes.
-#include <MNSInclude.hxx>
-
-#include "resource/mozab_res.hrc"
-#include "MDatabaseMetaDataHelper.hxx"
-#include "MTypeConverter.hxx"
-#include "MConfigAccess.hxx"
-#include <connectivity/dbexception.hxx>
-#include <comphelper/uno3.hxx>
-#include <comphelper/sequence.hxx>
-#include <osl/mutex.hxx>
-#include <osl/conditn.hxx>
-
-#include <nsIAbDirFactoryService.h>
-#include <MNSInit.hxx>
-#include <MNameMapper.hxx>
-#include "MNSMozabProxy.hxx"
-#include <MNSDeclares.hxx>
-
-static ::osl::Mutex m_aMetaMutex;
-
-#include <osl/diagnose.h>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/uno/Exception.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/beans/Property.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/sdb/ErrorCondition.hpp>
-#include <unotools/processfactory.hxx>
-#include <com/sun/star/mozilla/XMozillaBootstrap.hpp>
-
-
-#if OSL_DEBUG_LEVEL > 0
-# define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr())
-#else /* OSL_DEBUG_LEVEL */
-# define OUtoCStr( x ) ("dummy")
-#endif /* OSL_DEBUG_LEVEL */
-
-
-static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
-static NS_DEFINE_CID(kAbDirFactoryServiceCID, NS_ABDIRFACTORYSERVICE_CID);
-static NS_DEFINE_CID(kAddrBookSessionCID, NS_ADDRBOOKSESSION_CID);
-
-using namespace connectivity::mozab;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace com::sun::star::mozilla;
-using namespace com::sun::star::sdb;
-
-namespace connectivity
-{
- namespace mozab
- {
- static const char * const s_pADDRESSBOOKROOTDIR = "moz-abdirectory://";
- }
-}
-
-extern sal_Bool MNS_Init(sal_Bool& aProfileExists);
-
-// -------------------------------------------------------------------------
-MDatabaseMetaDataHelper::MDatabaseMetaDataHelper()
- :m_bProfileExists(sal_False)
-{
- OSL_TRACE( "IN MDatabaseMetaDataHelper::MDatabaseMetaDataHelper()\n" );
-
- OSL_TRACE( "\tOUT MDatabaseMetaDataHelper::MDatabaseMetaDataHelper()\n" );
-
-}
-// -------------------------------------------------------------------------
-MDatabaseMetaDataHelper::~MDatabaseMetaDataHelper()
-{
- m_aTableNames.clear();
- m_aTableTypes.clear();
-
- if (m_bProfileExists)
- {
- Reference<XMozillaBootstrap> xMozillaBootstrap;
- Reference<XMultiServiceFactory> xFactory = ::comphelper::getProcessServiceFactory();
- OSL_ENSURE( xFactory.is(), "can't get service factory" );
-
- Reference<XInterface> xInstance = xFactory->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")) );
- OSL_ENSURE( xInstance.is(), "failed to create instance" );
- xMozillaBootstrap = Reference<XMozillaBootstrap>(xInstance,UNO_QUERY);
- m_bProfileExists = xMozillaBootstrap->shutdownProfile() > 0;
- }
-
- OSL_TRACE( "IN/OUT MDatabaseMetaDataHelper::~MDatabaseMetaDataHelper()\n" );
-}
-
-static nsresult enumSubs(nsISimpleEnumerator * subDirs,nsISupportsArray * array);
-//enum all sub folders
-static nsresult enumSubs(nsIAbDirectory * parentDir,nsISupportsArray * array)
-{
- nsresult rv = NS_OK ;
- nsCOMPtr<nsISimpleEnumerator> subDirectories;
- rv = parentDir->GetChildNodes(getter_AddRefs(subDirectories));
- if (NS_FAILED(rv)) { return rv; }
-
- rv = enumSubs(subDirectories,array);
- return rv;
-}
-
-#include <prmem.h> //need for PR_FREEIF
-static nsresult insertPABDescription()
-{
- nsresult rv = NS_OK ;
- // mozilla loads the descriptions of pab and history from a file named addressbook.properties
- // we never deliver it with OOo,so mozab does not auot load personal addressbook and Collected addresses
- // If we want to deliver addressbook.properties with OOo,we have to deal with hole mozilla chrome mechanism.
- // So I insert the descriptiones as user prefes,they will cover the default value.
-
- //"Personal Address Book" "Collected Addresses" are loaded from officecfg
- nsCOMPtr<nsIPref> prefs = do_GetService(NS_PREF_CONTRACTID, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCAutoString pabPrefName(NS_LITERAL_CSTRING("ldap_2.servers.pab.description"));
-
- sal_Bool bSetted=sal_False;
- char *value = nsnull;
- if (0 == prefs->CopyCharPref(pabPrefName.get(), &value))
- {
- if (!(value == nsnull || value[0] == 0))
- {
- bSetted = sal_True;
- }
- }
- PR_FREEIF (value);
- value=nsnull;
- if (bSetted == sal_True)
- {
- const char* pPabDescription = static_cast< const char* >( getPabDescription( ) );
- rv = prefs->SetCharPref (pabPrefName.get(), pPabDescription);
- NS_ENSURE_SUCCESS(rv, rv);
- }
-
- nsCAutoString hisPrefName(NS_LITERAL_CSTRING("ldap_2.servers.history.description"));
-
- bSetted=sal_False;
- if (0 == prefs->CopyCharPref(hisPrefName.get(), &value))
- {
- if (!(value == nsnull || value[0] == 0))
- {
- bSetted = sal_True;
- }
- }
- PR_FREEIF (value);
- value=nsnull;
- if (bSetted == sal_True)
- {
- const char* pHisDescription = static_cast< const char* >( getHisDescription( ) );
-
- rv = prefs->SetCharPref (hisPrefName.get(), pHisDescription);
- NS_ENSURE_SUCCESS(rv, rv);
- }
- return rv;
-}
-//
-// nsAbDirectoryDataSource
-//
-#define NS_RDF_CONTRACTID "@mozilla.org/rdf"
-#define NS_RDF_DATASOURCE_CONTRACTID NS_RDF_CONTRACTID "/datasource;1"
-#define NS_RDF_DATASOURCE_CONTRACTID_PREFIX NS_RDF_DATASOURCE_CONTRACTID "?name="
-#define NS_ABDIRECTORYDATASOURCE_CONTRACTID \
- NS_RDF_DATASOURCE_CONTRACTID_PREFIX "addressdirectory"
-#define database_uri "@mozilla.org/rdf/datasource;1?name=addressdirectory"
-#define NS_ABDIRECTORYDATASOURCE_CID \
-{ /* 0A79186D-F754-11d2-A2DA-001083003D0C */ \
- 0xa79186d, 0xf754, 0x11d2, \
- {0xa2, 0xda, 0x0, 0x10, 0x83, 0x0, 0x3d, 0xc} \
-}
-
-// -------------------------------------------------------------------------
-// Case where we get a parent uri, and need to list its children.
-static nsresult getSubsFromParent(const rtl::OString& aParent, nsIEnumerator **aSubs)
-{
-
- if (aSubs == nsnull) { return NS_ERROR_NULL_POINTER ; }
- *aSubs = nsnull ;
- nsresult retCode = NS_OK ;
- nsCOMPtr<nsISupportsArray> array ;
-
- NS_NewISupportsArray(getter_AddRefs(array)) ;
-
- retCode = insertPABDescription();
- NS_ENSURE_SUCCESS(retCode, retCode) ;
-
- nsCOMPtr<nsIRDFService> rdfService(do_GetService(kRDFServiceCID, &retCode)) ;
- NS_ENSURE_SUCCESS(retCode, retCode) ;
- nsCOMPtr<nsIRDFResource> rdfResource ;
-
- nsCOMPtr<nsIRDFDataSource> rdfDirectory ;
-
- rtl::OString dir("rdf:addressdirectory");
- retCode = rdfService->GetDataSource(dir.getStr(),getter_AddRefs(rdfDirectory)) ;
-
-
-
- OSL_TRACE("uri: %s\n", aParent.getStr()) ;
- retCode = rdfService->GetResource(nsDependentCString(aParent.getStr(),aParent.getLength()), getter_AddRefs(rdfResource)) ;
- NS_ENSURE_SUCCESS(retCode, retCode) ;
- nsCOMPtr<nsIAbDirectory> directory = do_QueryInterface(rdfResource, &retCode) ;
- nsCOMPtr<nsISimpleEnumerator> tempEnum ;
-
- NS_ENSURE_SUCCESS(retCode, retCode) ;
- retCode = directory->GetChildNodes(getter_AddRefs(tempEnum)) ;
- NS_ENSURE_SUCCESS(retCode, retCode) ;
-
- PRBool hasMore = PR_TRUE ;
- while (NS_SUCCEEDED(tempEnum->HasMoreElements(&hasMore)) && hasMore) {
- nsCOMPtr<nsIAbDirectory> element ;
- retCode = tempEnum->GetNext(getter_AddRefs(element)) ;
- if (NS_SUCCEEDED(retCode))
- {
- array->AppendElement(element) ;
- enumSubs(element,array);
- }
- }
-
- array->Enumerate(aSubs) ;
- return retCode ;
-}
-
-static nsresult enumSubs(nsISimpleEnumerator * subDirs,nsISupportsArray * array)
-{
- PRBool hasMore = PR_TRUE ;
- nsresult rv = NS_OK ;
- while (NS_SUCCEEDED(subDirs->HasMoreElements(&hasMore)) && hasMore) {
- nsCOMPtr<nsISupports> newDirSupports ;
-
- rv = subDirs->GetNext(getter_AddRefs(newDirSupports)) ;
- NS_ENSURE_SUCCESS(rv, rv);
- nsCOMPtr<nsIAbDirectory> childDir = do_QueryInterface(newDirSupports, &rv) ;
- NS_ENSURE_SUCCESS(rv, rv);
- array->AppendElement(childDir);
-
- rv = enumSubs(childDir,array);
- }
- return rv;
-}
-
-// Case where we get a factory uri and need to have it build the directories.
-static nsresult getSubsFromFactory(const rtl::OString& aFactory, nsIEnumerator **aSubs)
-{
- if (aSubs == nsnull) { return NS_ERROR_NULL_POINTER ; }
- *aSubs = nsnull ;
- nsresult retCode = NS_OK ;
-
- nsCOMPtr<nsIAbDirFactoryService> dirFactoryService = do_GetService(NS_ABDIRFACTORYSERVICE_CONTRACTID, &retCode);
- NS_ENSURE_SUCCESS(retCode, retCode) ;
- nsCOMPtr<nsIAbDirFactory> dirFactory ;
-
- retCode = dirFactoryService->GetDirFactory(aFactory.getStr(), getter_AddRefs(dirFactory)) ;
- NS_ENSURE_SUCCESS (retCode, retCode) ;
- nsCOMPtr <nsIAbDirectoryProperties> properties;
- properties = do_CreateInstance(NS_ABDIRECTORYPROPERTIES_CONTRACTID, &retCode);
- NS_ENSURE_SUCCESS(retCode, retCode) ;
-
- retCode = properties->SetURI(aFactory.getStr());
- NS_ENSURE_SUCCESS(retCode,retCode);
-
- nsCOMPtr<nsISimpleEnumerator> subDirs ;
- retCode = dirFactory->CreateDirectory(properties, getter_AddRefs(subDirs));
- NS_ENSURE_SUCCESS(retCode, retCode) ;
- nsCOMPtr<nsISupportsArray> array ;
-
- NS_NewISupportsArray(getter_AddRefs(array)) ;
- retCode = enumSubs(subDirs,array);
- NS_ENSURE_SUCCESS(retCode, retCode) ;
- array->Enumerate(aSubs) ;
- return retCode ;
-}
-
-// Case where the uri itself is the directory we're looking for.
-static nsresult getSubsFromURI(const rtl::OString& aUri, nsIEnumerator **aSubs)
-{
- if (aSubs == nsnull) { return NS_ERROR_NULL_POINTER ; }
- *aSubs = nsnull ;
- nsresult retCode = NS_OK ;
-
- nsCOMPtr<nsIRDFService> rdfService(do_GetService(kRDFServiceCID, &retCode)) ;
- NS_ENSURE_SUCCESS(retCode, retCode) ;
- nsCOMPtr<nsIRDFResource> rdfResource ;
-
- retCode = rdfService->GetResource(nsDependentCString(aUri.getStr(),aUri.getLength()), getter_AddRefs(rdfResource)) ;
- NS_ENSURE_SUCCESS(retCode, retCode) ;
- retCode = rdfService->UnregisterResource(rdfResource) ;
- NS_ENSURE_SUCCESS(retCode, retCode) ;
-
- nsCOMPtr<nsIAbDirectory> directory = do_QueryInterface(rdfResource, &retCode) ;
-
- NS_ENSURE_SUCCESS(retCode, retCode) ;
- nsAutoString nameAB ;
-
- nameAB.AssignWithConversion("LDAP Directory") ;
- directory->SetDirName(nameAB.get()) ;
- nsCOMPtr<nsISupportsArray> array ;
-
- NS_NewISupportsArray(getter_AddRefs(array)) ;
- array->AppendElement(directory) ;
- array->Enumerate(aSubs) ;
- return retCode ;
-}
-
-namespace
-{
- static void lcl_setNoAddressBookFoundError( ErrorDescriptor& _rError, OConnection& _rCon, MozillaProductType _eProductType,
- sal_Bool bGivenURI )
- {
- sal_uInt16 nAddressBookNameRes = 0;
- if ( !bGivenURI && _eProductType == MozillaProductType_Mozilla)
- {
- nAddressBookNameRes = STR_MOZILLA_ADDRESSBOOKS;
- }
- else
- {
- if ( _eProductType == MozillaProductType_Thunderbird )
- {
- nAddressBookNameRes = STR_THUNDERBIRD_ADDRESSBOOKS;
- }
- else
- {
- if ( _rCon.usesFactory() )
- {
- if ( _rCon.isOutlookExpress() )
- {
- nAddressBookNameRes = STR_OE_ADDRESSBOOK;
- }
- else
- {
- nAddressBookNameRes = STR_OUTLOOK_MAPI_ADDRESSBOOK;
- }
- }
- else
- {
- OSL_ENSURE( !_rCon.isLDAP(), "lcl_setNoAddressBookFoundError: not to be called for LDAP connections!" );
- nAddressBookNameRes = STR_MOZILLA_ADDRESSBOOKS;
- }
- }
- }
- _rError.set( 0, ErrorCondition::AB_ADDRESSBOOK_NOT_FOUND, _rCon.getResources().getResourceString( nAddressBookNameRes ) );
- }
-}
-
-nsresult getTableStringsProxied(const sal_Char* sAbURI, sal_Int32 *nDirectoryType,MNameMapper *nmap,
- ::std::vector< ::rtl::OUString >* _rStrings,
- ::std::vector< ::rtl::OUString >* _rTypes,
- sal_Int32* pErrorId )
-{
- if (!sAbURI || !nmap || !_rStrings || !_rTypes || !pErrorId)
- {
- return NS_ERROR_NULL_POINTER;
- }
- OSL_TRACE("Using URI %s to getTables()\n",sAbURI );
-
- // Get the mozilla addressbooks from the base directory.
- nsresult rv = NS_OK;
- nsCOMPtr<nsIEnumerator> subDirectories;
-
- switch(*nDirectoryType)
- {
- case SDBCAddress::Mozilla:
- rv = getSubsFromParent(sAbURI, getter_AddRefs(subDirectories)) ;
- break;
- case SDBCAddress::Outlook:
- case SDBCAddress::OutlookExp:
- rv = getSubsFromFactory(sAbURI, getter_AddRefs(subDirectories)) ;
- break;
- case SDBCAddress::LDAP:
- rv = getSubsFromURI(sAbURI, getter_AddRefs(subDirectories)) ;
- break;
- default:
- rv = getSubsFromParent(sAbURI, getter_AddRefs(subDirectories));
- }
- NS_ENSURE_SUCCESS(rv, rv);
-
- // At this point we have a list containing the nsIAbDirectory we need to map as tables
- rv = subDirectories -> First();
- NS_ENSURE_SUCCESS(rv, rv);
-
- PRUnichar *name = nsnull;
- PRBool bIsMailList = PR_FALSE;
-
- ::rtl::OUString aTableName;
- nsCOMPtr<nsIRDFService> rdfService(do_GetService(kRDFServiceCID, &rv)) ;
- NS_ENSURE_SUCCESS(rv, rv) ;
-
- nmap->reset();
- do {
- nsCOMPtr<nsIAbDirectory> subDirectory;
-
- nsCOMPtr<nsISupports> item;
- rv = subDirectories -> CurrentItem(getter_AddRefs(item));
- if ( NS_FAILED( rv ) )
- {
- *pErrorId = STR_COULD_NOT_RETRIEVE_AB_ENTRY;
- return NS_ERROR_FAILURE;
- }
-
- subDirectory = do_QueryInterface(item, &rv);
-
- subDirectory -> GetIsMailList(&bIsMailList);
- // For now we're not interested in mailing lists.
- rv = subDirectory -> GetDirName(&name);
- if ( NS_FAILED( rv ) ) {
- *pErrorId = STR_COULD_NOT_GET_DIRECTORY_NAME;
- return NS_ERROR_FAILURE;
- }
- MTypeConverter::prUnicharToOUString(name, aTableName);
- OSL_TRACE("TableName = >%s<\n", OUtoCStr( aTableName ) );
-
- ODatabaseMetaDataResultSet::ORow aRow(3);
-
- // Insert table into map
- if ( aTableName.getLength() == 0 )
- aTableName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AddressBook"));
-
- OSL_TRACE("TableName = >%s<\n", OUtoCStr( aTableName ) );
-
- rv = nmap->add( aTableName, subDirectory);
- nsCOMPtr<nsIRDFResource> rdfResource = do_QueryInterface(subDirectory, &rv) ;
- if (!NS_FAILED(rv))
- rdfService->UnregisterResource(rdfResource);
-
- if (!NS_FAILED(rv)) //failed means we have added this directory
- {
- //map mailing lists as views
- _rStrings->push_back( aTableName ); // Table name
- if (!bIsMailList) {
- ::rtl::OUString aTableType(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TABLE")));
- _rTypes->push_back( aTableType ); // Table type
- }
- else
- {
- ::rtl::OUString aTableType(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VIEW")));
- _rTypes->push_back( aTableType ); // Table type
- }
- }
- rv = subDirectories -> Next();
- } while ( rv == NS_OK);
-
- return( NS_OK );
-}
-sal_Bool MDatabaseMetaDataHelper::getTableStrings( OConnection* _pCon,
- ::std::vector< ::rtl::OUString >& _rStrings,
- ::std::vector< ::rtl::OUString >& _rTypes)
-{
- sal_Bool bGivenURI;
- ::rtl::OUString sAbURI;
- ::rtl::OString sAbURIString;
-
- OSL_TRACE( "IN MDatabaseMetaDataHelper::getTableStrings( 0x%08X, %s)\n", _pCon, _pCon->getForceLoadTables()?"True":"False" );
-
- ::osl::MutexGuard aGuard( m_aMetaMutex );
- // Only do the query if we have to - performance degrades otherwise
- if ( ! _pCon->getForceLoadTables() && m_aTableNames.size() > 0 ) {
- _rStrings = m_aTableNames;
- _rTypes = m_aTableTypes;
- return( sal_True );
- }
-
- m_aTableNames.clear();
- m_aTableTypes.clear();
-
- sAbURI = _pCon->getMozURI();
-
- OSL_TRACE("AbURI = %s\n", OUtoCStr( sAbURI ) );
- if ( sAbURI.getLength() == 0 )
- bGivenURI = sal_False;
- else {
- sAbURIString = ::rtl::OUStringToOString( sAbURI,
- RTL_TEXTENCODING_ASCII_US);
- bGivenURI = sal_True;
- }
-
- if ( bGivenURI )
- OSL_TRACE("Using URI %s to getTables()\n", sAbURIString.getStr() );
- else
- OSL_TRACE("Using URI of ROOTDIR to getTables()\n");
-
- // Get the mozilla addressbooks from the base directory.
- nsresult rv = NS_OK;
- nsCOMPtr<nsIEnumerator> subDirectories;
- sal_Int32 nDirectoryType=0;
- m_ProductType = MozillaProductType_Mozilla;
- m_ProfileName = _pCon->getMozProfile();
-
-
- if (_pCon->isThunderbird())
- {
- if (!bGivenURI)
- sAbURIString = s_pADDRESSBOOKROOTDIR;
- nDirectoryType = SDBCAddress::ThunderBird;
- m_ProductType = MozillaProductType_Thunderbird;
- }
- else if (!bGivenURI)
- {
- sAbURIString = s_pADDRESSBOOKROOTDIR;
- nDirectoryType = SDBCAddress::Mozilla;
- }
- else
- {
- if (_pCon->usesFactory())
- {
- nDirectoryType = SDBCAddress::Outlook;
- }
- else
- {
- if (_pCon->isLDAP())
- {
- nDirectoryType = SDBCAddress::LDAP;
- }
- else
- {
- sAbURIString = s_pADDRESSBOOKROOTDIR;
- nDirectoryType = SDBCAddress::Mozilla;
- }
- }
- }
-
- if ( !_pCon->isLDAP() && !m_bProfileExists )
- { // no need to boot up a Mozilla profile for an LDAP connection
- Reference<XMozillaBootstrap> xMozillaBootstrap;
- Reference<XMultiServiceFactory> xFactory = ::comphelper::getProcessServiceFactory();
- OSL_ENSURE( xFactory.is(), "can't get service factory" );
- Reference<XInterface> xInstance = xFactory->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")) );
- OSL_ENSURE( xInstance.is(), "failed to create instance" );
- xMozillaBootstrap = Reference<XMozillaBootstrap>(xInstance,UNO_QUERY);
- m_bProfileExists = sal_False;
- //If there are no profiles for this product
- //Or the given profile name does not found
- //We will reaise a "No Addressbook Directories Exist" error
- if ( xMozillaBootstrap->getProfileCount(m_ProductType) == 0 ||
- ( m_ProfileName.getLength() && !(xMozillaBootstrap->getProfilePath(m_ProductType,m_ProfileName).getLength())))
- m_bProfileExists = sal_False;
- else
- if (xMozillaBootstrap->bootupProfile(m_ProductType,m_ProfileName) > 0)
- m_bProfileExists = sal_True;
-
- }
- if ( !m_bProfileExists
- && !_pCon->isLDAP()
- && ( ( nDirectoryType == SDBCAddress::Mozilla )
- || ( nDirectoryType == SDBCAddress::ThunderBird )
- )
- )
- {
- lcl_setNoAddressBookFoundError( m_aError, *_pCon, m_ProductType, bGivenURI );
- return sal_False;
- }
-
- MNameMapper *nmap = _pCon->getNameMapper();
- nmap->reset();
-
- sal_Int32 nErrorResourceId( 0 );
-
- MNSMozabProxy xMProxy;
- RunArgs args;
- args.funcIndex = ProxiedFunc::FUNC_GET_TABLE_STRINGS;
- args.argCount = 6;
- args.arg1 = (void*)sAbURIString.getStr();
- args.arg2 = (void*)&nDirectoryType;
- args.arg3 = (void*)nmap;
- args.arg4 = (void*)&m_aTableNames;
- args.arg5 = (void*)&m_aTableTypes;
- args.arg6 = (void*)&nErrorResourceId;
- rv = xMProxy.StartProxy(&args,m_ProductType,m_ProfileName);
- m_aError.setResId( static_cast<sal_uInt16>(nErrorResourceId) );
-
- if (NS_FAILED(rv))
- {
- if ( nErrorResourceId == 0 )
- m_aError.setResId( STR_UNSPECIFIED_ERROR );
- return sal_False;
- }
- OSL_TRACE( "\tOUT MDatabaseMetaDataHelper::getTableStrings()\n" );
- _rStrings = m_aTableNames;
- _rTypes = m_aTableTypes;
-
- _pCon->setForceLoadTables(sal_False);
- return( sal_True );
-}
-
-sal_Bool MDatabaseMetaDataHelper::getTables( OConnection* _pCon,
- const ::rtl::OUString& tableNamePattern,
- const Sequence< ::rtl::OUString >& types,
- ODatabaseMetaDataResultSet::ORows& _rRows)
-{
-
- static ODatabaseMetaDataResultSet::ORows aRows;
-
- OSL_TRACE( "IN MDatabaseMetaDataHelper::getTables()\n" );
- ::osl::MutexGuard aGuard( m_aMetaMutex );
-
- ODatabaseMetaDataResultSet::ORows().swap(aRows); // this makes real clear where memory is freed as well
- aRows.clear();
-
- ::std::vector< ::rtl::OUString > tables;
- ::std::vector< ::rtl::OUString > tabletypes;
- ::rtl::OUString matchAny = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%"));;
-
- if ( !getTableStrings( _pCon, tables,tabletypes ) )
- return sal_False;
-
- for ( size_t i = 0; i < tables.size(); i++ ) {
- ODatabaseMetaDataResultSet::ORow aRow(3);
-
- ::rtl::OUString aTableName = tables[i];
- ::rtl::OUString aTableType = tabletypes[i];
- OSL_TRACE("TableName = >%s<\n", OUtoCStr( aTableName ) );
-
-
- // return tables to caller
- if (match( tableNamePattern, aTableName, '\0' ) &&
- ( 0 == types.getLength() || //types is null or types include aTableType or types include "%"
- 0 != ::comphelper::findValue( types, aTableType, sal_True ).getLength() ||
- 0 != ::comphelper::findValue( types, matchAny, sal_True ).getLength())) {
- if ( aTableName.getLength() == 0 ) {
- aTableName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AddressBook"));
- }
-
- OSL_TRACE( "TableName = %s ; TableType = %s\n", OUtoCStr(aTableName), OUtoCStr(aTableType) );
-
- aRow.push_back( new ORowSetValueDecorator( aTableName ) ); // Table name
- aRow.push_back( new ORowSetValueDecorator( aTableType ) ); // Table type
- aRow.push_back( ODatabaseMetaDataResultSet::getEmptyValue() ); // Remarks
- aRows.push_back(aRow);
- }
- }
-
- OSL_TRACE( "\tOUT MDatabaseMetaDataHelper::getTables()\n" );
- _rRows = aRows;
- return(sal_True);
-}
-
-
-sal_Bool
-MDatabaseMetaDataHelper::testLDAPConnection( OConnection* _pCon )
-{
- const sal_Unicode QUERY_CHAR = '?';
- const sal_Char* MOZ_SCHEMA = "moz-abldapdirectory://";
- const sal_Char* LDAP_SCHEMA = "ldap://";
-
- rtl::OString sAbURI;
- rtl::OUString sAbBindDN;
- rtl::OUString sAbPassword;
- sal_Bool useSSL = _pCon->getUseSSL();
-
- nsresult rv(0);
-
- sAbURI = OUStringToOString( _pCon->getMozURI(), RTL_TEXTENCODING_ASCII_US );
- sAbBindDN = _pCon->getBindDN();
- sAbPassword = _pCon->getPassword();
-
-
- sal_Int32 pos = sAbURI.indexOf( MOZ_SCHEMA );
- if ( pos != -1 ) {
- sAbURI = sAbURI.replaceAt (pos, rtl_str_getLength( MOZ_SCHEMA ), ::rtl::OString(LDAP_SCHEMA) );
- }
-
- pos = sAbURI.indexOf( QUERY_CHAR );
- if ( pos != -1 ) {
- sal_Int32 len = sAbURI.getLength();
- sAbURI = sAbURI.replaceAt( pos, len - pos, ::rtl::OString("") );
- }
- const sal_Unicode* bindDN=nsnull;
- if (sAbBindDN.getLength() != 0)
- {
- bindDN = sAbBindDN.getStr();
- }
-
- RunArgs args;
- args.funcIndex = ProxiedFunc::FUNC_TESTLDAP_INIT_LDAP;
- args.argCount = 4;
- args.arg1 = (void*)sAbURI.getStr();
- args.arg2 = (void*)bindDN;
- args.arg3 = (void*)sAbPassword.getStr();
- args.arg4 = (void*)&useSSL;
-
- MNSMozabProxy xMProxy;
- rv = xMProxy.StartProxy( &args, m_ProductType, ::rtl::OUString() );
- if ( NS_SUCCEEDED( rv ) ) //Init LDAP,pass OUString() to StarProxy to ignore profile switch
- {
- args.funcIndex = ProxiedFunc::FUNC_TESTLDAP_IS_LDAP_CONNECTED;
- TimeValue timeValue = { 1, 0 }; // 1 * 30 Seconds timeout
- sal_Int32 times=0;
- while ( times++ < 30 )
- {
- rv = xMProxy.StartProxy( &args, m_ProductType, ::rtl::OUString() );
- if ( NS_SUCCEEDED( rv ) )
- // connected successfully
- break;
-
- if ( rv == (nsresult)PR_NOT_CONNECTED_ERROR )
- // connection failed
- break;
-
- // not yet decided - continue waiting
- osl_waitThread( &timeValue );
- }
- }
- m_aError.setResId( STR_COULD_NOT_CONNECT_LDAP );
- return NS_SUCCEEDED( rv ) ? sal_True : sal_False;
-}
-
-sal_Bool MDatabaseMetaDataHelper::NewAddressBook(OConnection* _pCon,const ::rtl::OUString & aTableName)
-{
- sal_Bool bIsMozillaAB;
-
- bIsMozillaAB = !_pCon->usesFactory() && ! _pCon->isLDAP();
-
- if ( !bIsMozillaAB )
- {
- m_aError.setResId( STR_NO_TABLE_CREATION_SUPPORT );
- return sal_False;
- }
- else
- OSL_TRACE("Create table\n");
-
- // Get the mozilla addressbooks from the base directory.
- nsresult rv = NS_OK;
-
- MNSMozabProxy xMProxy;
- RunArgs args;
- args.funcIndex = ProxiedFunc::FUNC_NEW_ADDRESS_BOOK;
- args.argCount = 1;
- args.arg1 = (void*)&aTableName;
- rv = xMProxy.StartProxy(&args,m_ProductType,m_ProfileName);
-
- _pCon->setForceLoadTables(sal_True); //force reload table next time
- if (rv == NS_ERROR_FILE_IS_LOCKED)
- {
- m_aError.setResId( STR_MOZILLA_IS_RUNNING );
- }
- else if (NS_FAILED(rv))
- {
- m_aError.set( STR_COULD_NOT_CREATE_ADDRESSBOOK, 0, ::rtl::OUString::valueOf( sal_Int32(rv), 16 ) );
- }
- OSL_TRACE( "OUT MDatabaseMetaDataHelper::NewAddressBook()\n" );
- return( NS_SUCCEEDED(rv) ? sal_True : sal_False );
-}
-nsresult NewAddressBook(const ::rtl::OUString * aName)
-{
- if (isProfileLocked(NULL))
- return NS_ERROR_FILE_IS_LOCKED;
- nsresult rv;
- nsCOMPtr<nsIAbDirectoryProperties> aProperties = do_CreateInstance(NS_ABDIRECTORYPROPERTIES_CONTRACTID, &rv);
- NS_ENSURE_ARG_POINTER(aProperties);
- const ::rtl::OUString& uName = *aName;
- nsString nsName;
- MTypeConverter::ouStringToNsString(uName,nsName);
- aProperties->SetDescription(nsName);
-
- nsCOMPtr<nsIRDFService> rdfService = do_GetService (kRDFServiceCID, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIRDFResource> parentResource;
- rv = rdfService->GetResource(NS_LITERAL_CSTRING(kAllDirectoryRoot), getter_AddRefs(parentResource));
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIAbDirectory> parentDir = do_QueryInterface(parentResource, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = parentDir->CreateNewDirectory(aProperties);
- return rv;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.hxx b/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.hxx
deleted file mode 100644
index 103903ac36..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.hxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MAB_DATABASEMETADATAHELPER_HXX_
-#define _CONNECTIVITY_MAB_DATABASEMETADATAHELPER_HXX_
-
-#include "MErrorResource.hxx"
-#include <comphelper/proparrhlp.hxx>
-#include <comphelper/propertycontainer.hxx>
-#include "FDatabaseMetaDataResultSet.hxx"
-
-#include <MConnection.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/mozilla/MozillaProductType.hpp>
-
-namespace connectivity
-{
- namespace mozab
- {
- class MDatabaseMetaDataHelper
- {
- private:
- sal_Bool m_bProfileExists ;
- ::std::vector< ::rtl::OUString > m_aTableNames;
- ::std::vector< ::rtl::OUString > m_aTableTypes;
- ::com::sun::star::mozilla::MozillaProductType m_ProductType;
- ::rtl::OUString m_ProfileName;
- ErrorDescriptor m_aError;
-
- public:
- MDatabaseMetaDataHelper();
- ~MDatabaseMetaDataHelper();
-
- //
- sal_Bool getTableStrings( OConnection* _pCon,
- ::std::vector< ::rtl::OUString >& _rStrings,
- ::std::vector< ::rtl::OUString >& _rTypes);
-
- sal_Bool getTables( OConnection* _pCon,
- const ::rtl::OUString& tableNamePattern,
- const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types,
- ODatabaseMetaDataResultSet::ORows& _rRows);
- sal_Bool testLDAPConnection( OConnection* _pCon );
- sal_Bool NewAddressBook( OConnection* _pCon,const ::rtl::OUString & aTableName);
-
- inline const ErrorDescriptor& getError() const { return m_aError; }
- };
- }
-
-}
-#endif // _CONNECTIVITY_MAB_DATABASEMETADATAHELPER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MErrorResource.hxx b/connectivity/source/drivers/mozab/mozillasrc/MErrorResource.hxx
deleted file mode 100644
index d6bfe02b23..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MErrorResource.hxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECITIVITY_MOZAB_ERROR_RESOURCE_HXX
-#define CONNECITIVITY_MOZAB_ERROR_RESOURCE_HXX
-
-#include <rtl/ustring.hxx>
-
-namespace connectivity
-{
- namespace mozab
- {
- class ErrorDescriptor
- {
- private:
- sal_uInt16 m_nErrorResourceId;
- sal_Int32 m_nErrorCondition;
- ::rtl::OUString m_sParameter;
-
- public:
- ErrorDescriptor()
- :m_nErrorResourceId(0)
- ,m_nErrorCondition(0)
- ,m_sParameter()
- {
- }
-
- inline void set( const sal_uInt16 _nErrorResourceId, const sal_Int32 _nErrorCondition, const ::rtl::OUString& _rParam )
- {
- m_nErrorResourceId = _nErrorResourceId;
- m_nErrorCondition = _nErrorCondition;
- m_sParameter = _rParam;
- }
- inline void setResId( const sal_uInt16 _nErrorResourceId )
- {
- m_nErrorResourceId = _nErrorResourceId;
- }
- inline void reset()
- {
- m_nErrorResourceId = 0;
- m_nErrorCondition = 0;
- }
-
- inline sal_uInt16 getResId() const { return m_nErrorResourceId; }
- inline sal_Int32 getErrorCondition() const { return m_nErrorCondition; }
- inline const ::rtl::OUString& getParameter() const { return m_sParameter; }
-
- inline bool is() const { return ( m_nErrorResourceId != 0 ) || ( m_nErrorCondition != 0 ); }
- };
- }
-}
-
-#endif // CONNECITIVITY_MOZAB_ERROR_RESOURCE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx
deleted file mode 100644
index 02f580a0f2..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx
+++ /dev/null
@@ -1,453 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <rtl/strbuf.hxx>
- // keep this include at the beginning. Some of the other includes seems to inject a symbol "l" into the
- // global namespace, which leads to a compiler warning in strbuf.hxx, about some parameters named "l"
- // hiding objects "in an outer scope".
-
-#include "MLdapAttributeMap.hxx"
-#include "MTypeConverter.hxx"
-#include "MQueryHelper.hxx"
-
-#include <tools/diagnose_ex.h>
-
-#include <boost/unordered_map.hpp>
-
-//........................................................................
-namespace connectivity { namespace mozab {
-//........................................................................
-
- //====================================================================
- //= helper
- //====================================================================
- namespace
- {
- typedef nsresult (NS_STDCALL nsIAbCard::*CardPropertyGetter)( PRUnichar** aFirstName );
- typedef nsresult (NS_STDCALL nsIAbCard::*CardPropertySetter)( const PRUnichar* aFirstName );
- struct CardPropertyData
- {
- const sal_Char* pLDAPAttributeList;
- CardPropertyGetter PropGetter;
- CardPropertySetter PropSetter;
-
- CardPropertyData()
- :pLDAPAttributeList( NULL )
- ,PropGetter( NULL )
- ,PropSetter( NULL )
- {
- }
- CardPropertyData( const sal_Char* _pLDAPAttributeList, CardPropertyGetter _PropGetter, CardPropertySetter _PropSetter )
- :pLDAPAttributeList( _pLDAPAttributeList )
- ,PropGetter( _PropGetter )
- ,PropSetter( _PropSetter )
- {
- }
- };
-
- typedef ::boost::unordered_map< ::rtl::OString, CardPropertyData, ::rtl::OStringHash > MapPropertiesToAttributes;
-
- #define DEF_CARD_ACCESS( PropertyName ) \
- &nsIAbCard::Get##PropertyName, &nsIAbCard::Set##PropertyName
-
- static const MapPropertiesToAttributes& lcl_getPropertyMap()
- {
- static MapPropertiesToAttributes aMap;
- if ( aMap.empty() )
- {
- struct MapEntry
- {
- const sal_Char* pAsciiPropertyName;
- const sal_Char* pAsciiAttrributeList;
- CardPropertyGetter PropGetter;
- CardPropertySetter PropSetter;
- };
- const MapEntry aEntries[] = {
- { "FirstName", "givenname", DEF_CARD_ACCESS( FirstName ) },
- { "LastName", "sn,surnname", DEF_CARD_ACCESS( LastName ) },
- { "DisplayName", "cn,commonname,displayname", DEF_CARD_ACCESS( DisplayName ) },
- { "NickName", "xmozillanickname", DEF_CARD_ACCESS( NickName ) },
- { "PrimaryEmail", "mail", DEF_CARD_ACCESS( PrimaryEmail ) },
- { "SecondEmail", "xmozillasecondemail", DEF_CARD_ACCESS( SecondEmail ) },
- { "WorkPhone", "telephonenumber", DEF_CARD_ACCESS( WorkPhone ) },
- { "HomePhone", "homephone", DEF_CARD_ACCESS( HomePhone ) },
- { "FaxNumber", "fax,facsimiletelephonenumber", DEF_CARD_ACCESS( FaxNumber ) },
- { "PagerNumber", "pager,pagerphone", DEF_CARD_ACCESS( PagerNumber ) },
- { "CellularNumber", "mobile,cellphone,carphone", DEF_CARD_ACCESS( CellularNumber ) },
- { "HomeAddress", "homepostaladdress,mozillaHomeStreet", DEF_CARD_ACCESS( HomeAddress ) },
- { "HomeAddress2", "mozillaHomeStreet2", DEF_CARD_ACCESS( HomeAddress2 ) },
- { "HomeCity", "homelocality,mozillaHomeLocalityName", DEF_CARD_ACCESS( HomeCity ) },
- { "HomeState", "homeregion,mozillaHomeState", DEF_CARD_ACCESS( HomeState ) },
- { "HomeZipCode", "homepostalcode,mozillaHomePostalCode", DEF_CARD_ACCESS( HomeZipCode ) },
- { "HomeCountry", "homecountryname,mozillaHomeCountryName", DEF_CARD_ACCESS( HomeCountry ) },
- { "WorkAddress", "postofficebox,streetaddress,streetaddress1", DEF_CARD_ACCESS( WorkAddress ) },
- { "WorkAddress2", "streetaddress2", DEF_CARD_ACCESS( WorkAddress2 ) },
- { "WorkCity", "l,locality", DEF_CARD_ACCESS( WorkCity ) },
- { "WorkState", "st,region", DEF_CARD_ACCESS( WorkState ) },
- { "WorkZipCode", "postalcode,zip", DEF_CARD_ACCESS( WorkZipCode ) },
- { "WorkCountry", "countryname", DEF_CARD_ACCESS( WorkCountry ) },
- { "JobTitle", "title", DEF_CARD_ACCESS( JobTitle ) },
- { "Department", "ou,orgunit,department,departmentnumber", DEF_CARD_ACCESS( Department ) },
- { "Company", "o,company", DEF_CARD_ACCESS( Company ) },
- { "WebPage1", "workurl", DEF_CARD_ACCESS( WebPage1 ) },
- { "WebPage2", "homeurl", DEF_CARD_ACCESS( WebPage2 ) },
- { "BirthYear", "birthyear", DEF_CARD_ACCESS( BirthYear ) },
- { "BirthMonth", "birthmonth", DEF_CARD_ACCESS( BirthMonth ) },
- { "BirthYear", "birthday", DEF_CARD_ACCESS( BirthDay ) },
- { "Custom1", "custom1", DEF_CARD_ACCESS( Custom1 ) },
- { "Custom2", "custom2", DEF_CARD_ACCESS( Custom2 ) },
- { "Custom3", "custom3", DEF_CARD_ACCESS( Custom3 ) },
- { "Custom4", "custom4", DEF_CARD_ACCESS( Custom4 ) },
- { "Notes", "notes,description", DEF_CARD_ACCESS( Notes ) },
- { "PreferMailFormat", "xmozillausehtmlmail", NULL, NULL },
- { NULL, NULL, NULL, NULL }
- };
- const MapEntry* loop = aEntries;
- while ( loop->pAsciiPropertyName )
- {
- aMap[ ::rtl::OString( loop->pAsciiPropertyName ) ] =
- CardPropertyData( loop->pAsciiAttrributeList, loop->PropGetter, loop->PropSetter );
- ++loop;
- }
- }
- return aMap;
- }
- }
-
- //====================================================================
- //= AttributeMap_Data
- //====================================================================
- struct AttributeMap_Data
- {
- };
-
- //====================================================================
- //= MLdapAttributeMap
- //====================================================================
- // -------------------------------------------------------------------
- MLdapAttributeMap::MLdapAttributeMap()
- :m_pData( new AttributeMap_Data )
- {
- }
-
- // -------------------------------------------------------------------
- MLdapAttributeMap::~MLdapAttributeMap()
- {
- }
-
- // -------------------------------------------------------------------
- NS_IMPL_THREADSAFE_ISUPPORTS1( MLdapAttributeMap, nsIAbLDAPAttributeMap )
-
- // -------------------------------------------------------------------
- NS_IMETHODIMP MLdapAttributeMap::GetAttributeList(const nsACString & aProperty, nsACString & _retval)
- {
- ::rtl::OString sProperty( MTypeConverter::nsACStringToOString( aProperty ) );
-
- const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
- MapPropertiesToAttributes::const_iterator pos = rPropertyMap.find( sProperty );
-
- if ( pos == rPropertyMap.end() )
- {
- _retval.SetIsVoid( PR_TRUE );
- }
- else
- {
- MTypeConverter::asciiToNsACString( pos->second.pLDAPAttributeList, _retval );
- }
-
- return NS_OK;
- }
-
- // -------------------------------------------------------------------
- NS_IMETHODIMP MLdapAttributeMap::GetAttributes(const nsACString & aProperty, PRUint32* aCount, char*** aAttrs)
- {
- OSL_FAIL( "MLdapAttributeMap::GetAttributes: not implemented!" );
- (void)aProperty;
- (void)aCount;
- (void)aAttrs;
- return NS_ERROR_NOT_IMPLEMENTED;
- }
-
- // -------------------------------------------------------------------
- NS_IMETHODIMP MLdapAttributeMap::GetFirstAttribute(const nsACString & aProperty, nsACString & _retval)
- {
- ::rtl::OString sProperty( MTypeConverter::nsACStringToOString( aProperty ) );
-
- const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
- MapPropertiesToAttributes::const_iterator pos = rPropertyMap.find( sProperty );
-
- if ( pos == rPropertyMap.end() )
- {
- _retval.SetIsVoid( PR_TRUE );
- }
- else
- {
- sal_Int32 tokenPos(0);
- ::rtl::OString sAttributeList( pos->second.pLDAPAttributeList );
- MTypeConverter::asciiToNsACString( sAttributeList.getToken( 0, ',', tokenPos ).getStr(), _retval );
- }
-
- return NS_OK;
- }
-
- // -------------------------------------------------------------------
- NS_IMETHODIMP MLdapAttributeMap::SetAttributeList(const nsACString & aProperty, const nsACString & aAttributeList, PRBool allowInconsistencies)
- {
- OSL_FAIL( "MLdapAttributeMap::SetAttributeList: not implemented!" );
- (void)aProperty;
- (void)aAttributeList;
- (void)allowInconsistencies;
- return NS_ERROR_NOT_IMPLEMENTED;
- }
-
- // -------------------------------------------------------------------
- NS_IMETHODIMP MLdapAttributeMap::GetProperty(const nsACString & aAttribute, nsACString & _retval)
- {
- OSL_FAIL( "MLdapAttributeMap::GetProperty: not implemented!" );
- (void)aAttribute;
- (void)_retval;
- return NS_ERROR_NOT_IMPLEMENTED;
- }
-
- // -------------------------------------------------------------------
- NS_IMETHODIMP MLdapAttributeMap::GetAllCardAttributes(nsACString & _retval)
- {
- const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
-
- ::rtl::OStringBuffer aAllAttributes;
- for ( MapPropertiesToAttributes::const_iterator loop = rPropertyMap.begin();
- loop != rPropertyMap.end();
- ++loop
- )
- {
- aAllAttributes.append( loop->second.pLDAPAttributeList );
- if ( loop != rPropertyMap.end() )
- aAllAttributes.append( ',' );
- }
-
- MTypeConverter::asciiToNsACString( aAllAttributes.getStr(), _retval );
- return NS_OK;
- }
-
- // -------------------------------------------------------------------
- NS_IMETHODIMP MLdapAttributeMap::CheckState(void)
- {
- // we do not allow modifying the map, so we're always in a valid state
- return NS_OK;
- }
-
- // -------------------------------------------------------------------
- NS_IMETHODIMP MLdapAttributeMap::SetFromPrefs(const nsACString & aPrefBranchName)
- {
- OSL_FAIL( "MLdapAttributeMap::SetFromPrefs: not implemented!" );
- (void)aPrefBranchName;
- return NS_ERROR_NOT_IMPLEMENTED;
- }
-
- // -------------------------------------------------------------------
- NS_IMETHODIMP MLdapAttributeMap::SetCardPropertiesFromLDAPMessage(nsILDAPMessage* aMessage, nsIAbCard* aCard)
- {
- NS_ENSURE_ARG_POINTER( aMessage );
- NS_ENSURE_ARG_POINTER( aCard );
-
- // in case that's not present in the LDAP message: set the "preferred mail format" to "none"
- aCard->SetPreferMailFormat( nsIAbPreferMailFormat::unknown );
-
- const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
- for ( MapPropertiesToAttributes::const_iterator prop = rPropertyMap.begin();
- prop != rPropertyMap.end();
- ++prop
- )
- {
- // split the list of attributes for the current property
- ::rtl::OString sAttributeList( prop->second.pLDAPAttributeList );
- ::rtl::OString sAttribute;
-
- sal_Int32 tokenPos = 0;
- while ( tokenPos != -1 )
- {
- sAttribute = sAttributeList.getToken( 0, ',', tokenPos );
-
- // retrieve the values for the current attribute
- PRUint32 valueCount = 0;
- PRUnichar** values = NULL;
- nsresult rv = aMessage->GetValues( sAttribute.getStr(), &valueCount, &values );
- if ( NS_FAILED( rv ) )
- // try the next attribute
- continue;
-
- if ( valueCount )
- {
- CardPropertySetter propSetter = prop->second.PropSetter;
- OSL_ENSURE( propSetter,
- "MLdapAttributeMap::SetCardPropertiesFromLDAPMessage: "
- "unexpected: could retrieve an attribute value, but have no setter for it!" );
- if ( propSetter )
- {
- (aCard->*propSetter)( values[0] );
- }
-
- // we're done with this property - no need to handle the remaining attributes which
- // map to it
- break;
- }
- }
- }
- return NS_OK;
- }
-
- // -------------------------------------------------------------------
- namespace
- {
- struct PreferMailFormatType
- {
- const sal_Char* description;
- PRUint32 formatType;
-
- PreferMailFormatType()
- :description( NULL )
- ,formatType( nsIAbPreferMailFormat::unknown )
- {
- }
-
- PreferMailFormatType( const sal_Char* _description, PRUint32 _formatType )
- :description( _description )
- ,formatType( _formatType )
- {
- }
- };
-
- static const PreferMailFormatType* lcl_getMailFormatTypes()
- {
- static const PreferMailFormatType aMailFormatTypes[] =
- {
- PreferMailFormatType( "text/plain", nsIAbPreferMailFormat::plaintext ),
- PreferMailFormatType( "text/html", nsIAbPreferMailFormat::html ),
- PreferMailFormatType( "unknown", nsIAbPreferMailFormat::unknown ),
- PreferMailFormatType()
- };
- return aMailFormatTypes;
- }
- }
-
- // -------------------------------------------------------------------
- void MLdapAttributeMap::fillCardFromResult( nsIAbCard& _card, const MQueryHelperResultEntry& _result )
- {
- _card.SetPreferMailFormat( nsIAbPreferMailFormat::unknown );
-
- ::rtl::OUString resultValue;
-
- const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
- for ( MapPropertiesToAttributes::const_iterator prop = rPropertyMap.begin();
- prop != rPropertyMap.end();
- ++prop
- )
- {
- resultValue = _result.getValue( prop->first );
-
- CardPropertySetter propSetter = prop->second.PropSetter;
- if ( propSetter )
- {
- // PRUnichar != sal_Unicode in mingw
- (_card.*propSetter)( reinterpret_cast_mingw_only<const PRUnichar *>(resultValue.getStr()) );
- }
- else
- {
- if ( prop->first.equals( "PreferMailFormat" ) )
- {
- unsigned int format = nsIAbPreferMailFormat::unknown;
- const PreferMailFormatType* pMailFormatType = lcl_getMailFormatTypes();
- while ( pMailFormatType->description )
- {
- if ( resultValue.equalsAscii( pMailFormatType->description ) )
- {
- format = pMailFormatType->formatType;
- break;
- }
- ++pMailFormatType;
- }
- _card.SetPreferMailFormat(format);
- }
- else
- OSL_FAIL( "MLdapAttributeMap::fillCardFromResult: unexpected property without default setters!" );
- }
- }
- }
-
- // -------------------------------------------------------------------
- void MLdapAttributeMap::fillResultFromCard( MQueryHelperResultEntry& _result, nsIAbCard& _card )
- {
- nsXPIDLString value;
- ::rtl::OUString resultValue;
-
- const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
- for ( MapPropertiesToAttributes::const_iterator prop = rPropertyMap.begin();
- prop != rPropertyMap.end();
- ++prop
- )
- {
- CardPropertyGetter propGetter = prop->second.PropGetter;
- if ( propGetter )
- {
- (_card.*propGetter)( getter_Copies( value ) );
-
- nsAutoString temp( value );
- MTypeConverter::nsStringToOUString( temp, resultValue );
- }
- else
- {
- if ( prop->first.equals( "PreferMailFormat" ) )
- {
- unsigned int format = nsIAbPreferMailFormat::unknown;
- _card.GetPreferMailFormat( &format );
- const PreferMailFormatType* pMailFormatType = lcl_getMailFormatTypes();
- while ( pMailFormatType->description )
- {
- if ( format == pMailFormatType->formatType )
- {
- resultValue = ::rtl::OUString::createFromAscii( pMailFormatType->description );
- break;
- }
- ++pMailFormatType;
- }
- }
- else
- OSL_FAIL( "MLdapAttributeMap::fillResultFromCard: unexpected property without default getters!" );
- }
-
- _result.insert( prop->first, resultValue );
- }
- }
-
-//........................................................................
-} } // namespace connectivity::mozab
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.hxx b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.hxx
deleted file mode 100644
index 54461bfc22..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.hxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-#ifndef CONNECTIVITY_MLDAPATTRIBUTEMAP_HXX
-#define CONNECTIVITY_MLDAPATTRIBUTEMAP_HXX
-
-#include <MNSInclude.hxx>
-
-#include <memory>
-
-//........................................................................
-namespace connectivity { namespace mozab {
-//........................................................................
-
- struct AttributeMap_Data;
- class MQueryHelperResultEntry;
-
- //====================================================================
- //= class MLdapAttributeMap
- //====================================================================
- /** implements the nsIAbLDAPAttributeMap interface
-
- Somewhere between Mozilla 1.7.5 and SeaMonkey 1.1.12, the LDAP address book
- implementation was changed to take the attribute mapping (from LDAP attributes
- to address book properties) not directly from the preferences. Instead, this mapping
- is now delivered by a dedicated implementation (supporting the nsIAbLDAPAttributeMap
- interface).
-
- */
- class MLdapAttributeMap : public nsIAbLDAPAttributeMap
- {
- public:
- MLdapAttributeMap();
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSIABLDAPATTRIBUTEMAP
-
- static void fillCardFromResult( nsIAbCard& _card, const MQueryHelperResultEntry& _result );
- static void fillResultFromCard( MQueryHelperResultEntry& _result, nsIAbCard& _card );
-
- protected:
- virtual ~MLdapAttributeMap();
-
- private:
- ::std::auto_ptr< AttributeMap_Data > m_pData;
- };
-
-//........................................................................
-} } // namespace connectivity::mozab
-//........................................................................
-
-#endif // CONNECTIVITY_MLDAPATTRIBUTEMAP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNSDeclares.hxx b/connectivity/source/drivers/mozab/mozillasrc/MNSDeclares.hxx
deleted file mode 100644
index de53040895..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MNSDeclares.hxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MAB_NS_DECLARES_HXX_
-#define _CONNECTIVITY_MAB_NS_DECLARES_HXX_
-
-#include <sal/types.h>
-
-
-const sal_Int32 RowStates_Normal = 0;
-const sal_Int32 RowStates_Inserted = 1;
-const sal_Int32 RowStates_Updated = 2;
-const sal_Int32 RowStates_Deleted = 4;
-const sal_Int32 RowStates_Error = 32;
-
-namespace connectivity{
- namespace mozab{
- class OConnection;
- }
-}
-sal_Bool isProfileLocked(connectivity::mozab::OConnection* _pCon);
-
-class nsIAbDirectory;
-sal_Int32 getDirectoryType(const nsIAbDirectory* directory);
-
-
-#endif // _CONNECTIVITY_MAB_NS_DECLARES_HXX_ 1
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx b/connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx
deleted file mode 100644
index 4dd1c511f1..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_MAB_NS_INCLUDE_HXX_
-#define _CONNECTIVITY_MAB_NS_INCLUDE_HXX_ 1
-
-//
-// Only include Mozilla include files once and using this file...
-//
-
-// moved this here and in first position due to "long l;" unxsoli4 warning
-#include <rtl/ustrbuf.hxx>
-
-#include "pre_include_mozilla.h"
-#if defined __GNUC__
- #pragma GCC system_header
-#endif
-
-#include <nsDebug.h>
-
-#include <nsCOMPtr.h>
-#include <nsISupportsArray.h>
-#include <nsString.h>
-
-#if defined __SUNPRO_CC
-#pragma disable_warn
- // somewhere in the files included directly or indirectly in nsString.h, warnings are enabled, again
-#endif
-#include <nsMemory.h>
-#include <prtypes.h>
-#include <nsRDFCID.h>
-#include <nsXPIDLString.h>
-#include <nsIRDFService.h>
-#include <nsIRDFResource.h>
-#include <nsReadableUtils.h>
-#include <msgCore.h>
-#include <nsIServiceManager.h>
-#include <nsIAbCard.h>
-#include <nsAbBaseCID.h>
-#include <nsAbAddressCollecter.h>
-#include <nsIPref.h>
-#include <nsIAddrBookSession.h>
-#include <nsIMsgHeaderParser.h>
-#include <nsIAddrBookSession.h>
-#include <nsIAbDirectory.h>
-#include <nsAbDirectoryQuery.h>
-#include <nsIAbDirectoryQuery.h>
-#include <nsIAbDirectoryQueryProxy.h>
-#include <nsIAbDirFactory.h>
-#include <nsIRunnable.h>
-#include <nsIAbLDAPAttributeMap.h>
-#include <nsILDAPMessage.h>
-
-#include <prerr.h>
-
-#include "post_include_mozilla.h"
-
-#endif // _CONNECTIVITY_MAB_NS_INCLUDE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.cxx b/connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.cxx
deleted file mode 100644
index 02cdcea1fe..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.cxx
+++ /dev/null
@@ -1,407 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "MNSMozabProxy.hxx"
-
-#include "resource/mozab_res.hrc"
-#include "MDatabaseMetaDataHelper.hxx"
-#include "MQuery.hxx"
-#include <osl/mutex.hxx>
-#include <osl/conditn.hxx>
-
-#include "pre_include_mozilla.h"
-#include <nsIProxyObjectManager.h>
-// More Mozilla includes for LDAP Connection Test
-#include "prprf.h"
-#include "nsILDAPURL.h"
-#include "nsILDAPMessage.h"
-#include "nsILDAPMessageListener.h"
-#include "nsILDAPErrors.h"
-#include "nsILDAPConnection.h"
-#include "nsILDAPOperation.h"
-#include "post_include_mozilla.h"
-#include "MQuery.hxx"
-#include <MQueryHelper.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include <unotools/processfactory.hxx>
-#include "com/sun/star/mozilla/XProxyRunner.hpp"
-
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::mozilla;
-
-
-#define TYPEASSERT(value,type) if (value != type) return !NS_OK;
-
-using namespace connectivity::mozab;
-
-/* Implementation file */
-
-static ::osl::Mutex m_aThreadMutex;
-extern nsresult NewAddressBook(const ::rtl::OUString * aName);
-
-
-MNSMozabProxy::MNSMozabProxy()
-{
- m_Args = NULL;
-#if OSL_DEBUG_LEVEL > 0
- m_oThreadID = osl_getThreadIdentifier(NULL);
-#endif
- acquire();
-}
-
-MNSMozabProxy::~MNSMozabProxy()
-{
-}
-
-sal_Int32 MNSMozabProxy::StartProxy(RunArgs * args,::com::sun::star::mozilla::MozillaProductType aProduct,const ::rtl::OUString &aProfile)
-{
- OSL_TRACE( "IN : MNSMozabProxy::StartProxy() \n" );
- ::osl::MutexGuard aGuard(m_aThreadMutex);
- m_Product = aProduct;
- m_Profile = aProfile;
- m_Args = args;
- if (!xRunner.is())
- {
- Reference<XMultiServiceFactory> xFactory = ::comphelper::getProcessServiceFactory();
- OSL_ENSURE( xFactory.is(), "can't get service factory" );
- ::com::sun::star::uno::Reference<XInterface> xInstance = xFactory->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")) );
- OSL_ENSURE( xInstance.is(), "failed to create instance" );
- xRunner = ::com::sun::star::uno::Reference< ::com::sun::star::mozilla::XProxyRunner >(xInstance,UNO_QUERY);
- }
- const ::com::sun::star::uno::Reference< ::com::sun::star::mozilla::XCodeProxy > aCode(this);
- return xRunner->Run(aCode);
-}
-
-extern nsresult getTableStringsProxied(const sal_Char* sAbURI, sal_Int32 *nDirectoryType,MNameMapper *nmap,
- ::std::vector< ::rtl::OUString >* _rStrings,
- ::std::vector< ::rtl::OUString >* _rTypes,
- sal_Int32* pErrorId );
-
-::com::sun::star::mozilla::MozillaProductType SAL_CALL MNSMozabProxy::getProductType( ) throw (::com::sun::star::uno::RuntimeException)
-{
- return m_Product;
-}
-::rtl::OUString SAL_CALL MNSMozabProxy::getProfileName( ) throw (::com::sun::star::uno::RuntimeException)
-{
- return m_Profile;
-}
-
-sal_Int32 SAL_CALL MNSMozabProxy::run( ) throw (::com::sun::star::uno::RuntimeException)
-{
-#if OSL_DEBUG_LEVEL > 0
- OSL_TRACE( "IN : MNSMozabProxy::Run() Caller thread :%4d \n" , m_oThreadID );
-#else
- OSL_TRACE( "IN : MNSMozabProxy::Run() \n" );
-#endif
- nsresult rv = NS_ERROR_INVALID_ARG;
- if (m_Args == NULL)
- return NS_ERROR_INVALID_ARG;
- switch(m_Args->funcIndex)
- {
- case ProxiedFunc::FUNC_TESTLDAP_INIT_LDAP:
- case ProxiedFunc::FUNC_TESTLDAP_IS_LDAP_CONNECTED:
- case ProxiedFunc::FUNC_TESTLDAP_RELEASE_RESOURCE:
- rv = testLDAPConnection();
- break;
- case ProxiedFunc::FUNC_GET_TABLE_STRINGS:
- rv = getTableStringsProxied((const sal_Char*)m_Args->arg1,
- (sal_Int32 *)m_Args->arg2,
- (MNameMapper *)m_Args->arg3,
- (::std::vector< ::rtl::OUString >*)m_Args->arg4,
- (::std::vector< ::rtl::OUString >*)m_Args->arg5,
- (sal_Int32 *)m_Args->arg6);
- break;
- case ProxiedFunc::FUNC_EXECUTE_QUERY:
- if (m_Args->arg1 && m_Args->arg2)
- {
- rv = ((MQuery*)m_Args->arg1)->executeQueryProxied((OConnection*)m_Args->arg2);
- }
- break;
- case ProxiedFunc::FUNC_QUERYHELPER_CREATE_NEW_CARD:
- case ProxiedFunc::FUNC_QUERYHELPER_DELETE_CARD:
- case ProxiedFunc::FUNC_QUERYHELPER_COMMIT_CARD:
- case ProxiedFunc::FUNC_QUERYHELPER_RESYNC_CARD:
- if (m_Args->arg1)
- {
- rv = QueryHelperStub();
- }
- break;
- case ProxiedFunc::FUNC_NEW_ADDRESS_BOOK:
- if (m_Args->arg1)
- {
- rv = NewAddressBook((const ::rtl::OUString*)m_Args->arg1 );
- }
- break;
- default:
- return NS_ERROR_INVALID_ARG;
- }
- return rv;
-}
-
-nsresult MNSMozabProxy::QueryHelperStub()
-{
- nsresult rv = NS_ERROR_INVALID_ARG;
- MQueryHelper * mHelper=(MQueryHelper*) m_Args->arg1;
- switch(m_Args->funcIndex)
- {
- case ProxiedFunc::FUNC_QUERYHELPER_CREATE_NEW_CARD:
- if (m_Args->arg2 ) //m_Args->arg2 used to return cord number
- {
- *((sal_Int32*)m_Args->arg2) = mHelper->createNewCard();
- rv = NS_OK;
- }
- break;
- case ProxiedFunc::FUNC_QUERYHELPER_DELETE_CARD:
- if (m_Args->arg2 && m_Args->arg3 ) //m_Args->arg2 used to get the cord number
- {
- rv = mHelper->deleteCard(*((sal_Int32*)m_Args->arg2),(nsIAbDirectory*)m_Args->arg3);
- }
- break;
- case ProxiedFunc::FUNC_QUERYHELPER_COMMIT_CARD:
- if (m_Args->arg2 && m_Args->arg3 ) //m_Args->arg2 used to get the cord number
- {
- rv = mHelper->commitCard(*((sal_Int32*)m_Args->arg2),(nsIAbDirectory*)m_Args->arg3);
- }
- break;
- case ProxiedFunc::FUNC_QUERYHELPER_RESYNC_CARD:
- if (m_Args->arg2) //m_Args->arg2 used to get the cord number
- {
- rv = mHelper->resyncRow(*((sal_Int32*)m_Args->arg2));
- }
- break;
- default:
- break;
- }
- return rv;
-}
-//-------------------------------------------------------------------
-
-#define NS_LDAPCONNECTION_CONTRACTID "@mozilla.org/network/ldap-connection;1"
-#define NS_LDAPOPERATION_CONTRACTID "@mozilla.org/network/ldap-operation;1"
-#define NS_LDAPMESSAGE_CONTRACTID "@mozilla.org/network/ldap-message;1"
-#define NS_LDAPURL_CONTRACTID "@mozilla.org/network/ldap-url;1"
-
-namespace connectivity {
- namespace mozab {
- class MLDAPMessageListener : public nsILDAPMessageListener
- {
- NS_DECL_ISUPPORTS
- NS_DECL_NSILDAPMESSAGELISTENER
-
- MLDAPMessageListener();
- virtual ~MLDAPMessageListener();
-
- sal_Bool initialized() const;
- sal_Bool goodConnection() const { return initialized() && m_GoodConnection; }
-
- protected:
-
- ::osl::Mutex m_aMutex;
- ::osl::Condition m_aCondition;
-
- sal_Bool m_IsComplete;
- sal_Bool m_GoodConnection;
-
- void setConnectionStatus( sal_Bool _good );
- };
- }
-}
-
-NS_IMPL_THREADSAFE_ISUPPORTS1(MLDAPMessageListener, nsILDAPMessageListener)
-
-MLDAPMessageListener::MLDAPMessageListener()
- : mRefCnt( 0 )
- , m_IsComplete( sal_False )
- , m_GoodConnection( sal_False )
-{
- m_aCondition.reset();
-}
-
-MLDAPMessageListener::~MLDAPMessageListener()
-{
-}
-
-sal_Bool MLDAPMessageListener::initialized() const
-{
- return const_cast< MLDAPMessageListener* >( this )->m_aCondition.check();
-}
-
-void MLDAPMessageListener::setConnectionStatus( sal_Bool _good )
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- m_IsComplete = sal_True;
- m_GoodConnection = _good;
-
- m_aCondition.set();
-}
-
-NS_IMETHODIMP MLDAPMessageListener::OnLDAPInit(nsILDAPConnection* /*aConn*/, nsresult aStatus )
-{
- setConnectionStatus( NS_SUCCEEDED( aStatus ) ? sal_True : sal_False );
- return aStatus;
-}
-
-NS_IMETHODIMP MLDAPMessageListener::OnLDAPMessage( nsILDAPMessage* aMessage )
-{
- nsresult rv;
-
- PRInt32 messageType;
- rv = aMessage->GetType(&messageType);
- NS_ENSURE_SUCCESS(rv, rv);
- PRInt32 errCode;
- switch (messageType)
- {
- case nsILDAPMessage::RES_BIND:
- rv = aMessage->GetErrorCode(&errCode);
- // if the login failed
- if (errCode != (PRInt32)nsILDAPErrors::SUCCESS) {
- setConnectionStatus( sal_False );
- }
- else
- setConnectionStatus( sal_True );
- break;
- case nsILDAPMessage::RES_SEARCH_RESULT:
- setConnectionStatus( sal_True );
- break;
- default:
- break;
- }
-
- return NS_OK;
-}
-
-//-------------------------------------------------------------------
-
-nsresult
-MNSMozabProxy::testLDAPConnection( )
-{
- nsresult rv=NS_ERROR_INVALID_ARG;
- switch(m_Args->funcIndex)
- {
- case ProxiedFunc::FUNC_TESTLDAP_INIT_LDAP:
- if (m_Args->arg1 && m_Args->arg4 )
- {
- rv = InitLDAP((sal_Char*)m_Args->arg1,(sal_Unicode*)m_Args->arg2,(sal_Unicode*)m_Args->arg3,(sal_Bool*)m_Args->arg4);
- }
- break;
- case ProxiedFunc::FUNC_TESTLDAP_IS_LDAP_CONNECTED:
- if (m_Args->arg5)
- {
- const MLDAPMessageListener* pListener( static_cast< const MLDAPMessageListener* >( m_Args->arg5 ) );
- if ( pListener->initialized() )
- rv = pListener->goodConnection() ? 0 : (nsresult)PR_NOT_CONNECTED_ERROR;
- else
- rv = (nsresult)PR_CONNECT_TIMEOUT_ERROR;
- }
- break;
- case ProxiedFunc::FUNC_TESTLDAP_RELEASE_RESOURCE:
- if (m_Args->arg5)
- {
- ((MLDAPMessageListener*)m_Args->arg5)->Release();
- delete (MLDAPMessageListener*)m_Args->arg5;
- m_Args->arg5 = NULL;
- rv = 0;
- }
- break;
- default:
- return NS_ERROR_INVALID_ARG;
- }
- return rv;
-}
-nsresult
-MNSMozabProxy::InitLDAP(sal_Char* sUri, sal_Unicode* sBindDN, sal_Unicode* pPasswd,sal_Bool * nUseSSL)
-{
- sal_Bool useSSL = *nUseSSL;
- nsresult rv;
-
- nsCOMPtr<nsILDAPURL> url;
- url = do_CreateInstance(NS_LDAPURL_CONTRACTID, &rv);
- if ( NS_FAILED(rv) )
- return NS_ERROR_INVALID_ARG;
-
- rv = url->SetSpec( nsDependentCString(sUri) );
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCAutoString host;
- rv = url->GetAsciiHost(host);
- NS_ENSURE_SUCCESS(rv, rv);
-
- PRInt32 port;
- rv = url->GetPort(&port);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCString dn;
- rv = url->GetDn(dn);
- NS_ENSURE_SUCCESS(rv, rv);
-
-
-
- // Get the ldap connection
- nsCOMPtr<nsILDAPConnection> ldapConnection;
- ldapConnection = do_CreateInstance(NS_LDAPCONNECTION_CONTRACTID, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- MLDAPMessageListener* messageListener =
- new MLDAPMessageListener ( );
- if (messageListener == NULL)
- return NS_ERROR_INVALID_ARG;
-
- messageListener->AddRef();
-
- nsCAutoString nsBind;
- // PRUnichar != sal_Unicode in mingw
- nsBind.AssignWithConversion(reinterpret_cast_mingw_only<const PRUnichar *>(sBindDN));
-
- // Now lets initialize the LDAP connection properly.
- rv = ldapConnection->Init(host.get(), port, useSSL, nsBind,
- messageListener,NULL,nsILDAPConnection::VERSION3);
- // Initiate the LDAP operation
- nsCOMPtr<nsILDAPOperation> ldapOperation =
- do_CreateInstance(NS_LDAPOPERATION_CONTRACTID, &rv);
-
- rv = ldapOperation->Init(ldapConnection, messageListener, nsnull);
- if (NS_FAILED(rv))
- return NS_ERROR_UNEXPECTED; // this should never happen
-
- if ( pPasswd && *pPasswd )
- {
- nsCAutoString nsPassword;
- // PRUnichar != sal_Unicode in mingw
- nsPassword.AssignWithConversion(reinterpret_cast_mingw_only<const PRUnichar *>(pPasswd));
- rv = ldapOperation->SimpleBind(nsPassword);
- }
-
- if (NS_SUCCEEDED(rv))
- m_Args->arg5 = messageListener;
- return rv;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.hxx b/connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.hxx
deleted file mode 100644
index 85d6337381..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.hxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MAB_MOZABHELPER_HXX_
-#define _CONNECTIVITY_MAB_MOZABHELPER_HXX_
-#include "MNSDeclares.hxx"
-#include <osl/thread.hxx>
-
-#include <MNSInclude.hxx>
-#include <cppuhelper/compbase1.hxx>
-#include <com/sun/star/mozilla/XCodeProxy.hpp>
-#include "com/sun/star/mozilla/XProxyRunner.hdl"
-
-namespace connectivity
-{
- namespace mozab
- {
- namespace ProxiedFunc
- {
- enum
- {
- FUNC_TESTLDAP_INIT_LDAP=1,
- FUNC_TESTLDAP_IS_LDAP_CONNECTED,
- FUNC_TESTLDAP_RELEASE_RESOURCE,
- FUNC_GET_TABLE_STRINGS,
- FUNC_EXECUTE_QUERY,
- FUNC_QUERYHELPER_CREATE_NEW_CARD,
- FUNC_QUERYHELPER_DELETE_CARD,
- FUNC_QUERYHELPER_COMMIT_CARD,
- FUNC_QUERYHELPER_RESYNC_CARD,
- FUNC_NEW_ADDRESS_BOOK
- };
- }
-
- struct RunArgs
- {
- sal_Int32 funcIndex; //Function Index
- sal_Int32 argCount; //parameter count
- void * arg1;
- void * arg2;
- void * arg3;
- void * arg4;
- void * arg5;
- void * arg6;
- RunArgs()
- {
- arg1 = NULL;
- arg2 = NULL;
- arg3 = NULL;
- arg4 = NULL;
- arg5 = NULL;
- arg6 = NULL;
- }
- };
- typedef RunArgs RunArgs;
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::mozilla::XCodeProxy > MNSMozabProxy_BASE;
-
-
- class MNSMozabProxy : public MNSMozabProxy_BASE
- {
- public:
- MNSMozabProxy();
- virtual ~MNSMozabProxy();
-
- //XCodeProxy
- virtual sal_Int32 SAL_CALL run( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::mozilla::MozillaProductType SAL_CALL getProductType( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getProfileName( ) throw (::com::sun::star::uno::RuntimeException);
-
- public:
- sal_Int32 StartProxy(RunArgs * args,::com::sun::star::mozilla::MozillaProductType aProduct,const ::rtl::OUString &aProfile); //Call this to start proxy
-
- protected:
- nsresult testLDAPConnection();
- nsresult InitLDAP(sal_Char* sUri, sal_Unicode* sBindDN, sal_Unicode* sPasswd,sal_Bool * nUseSSL);
- nsresult QueryHelperStub();
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::mozilla::XProxyRunner > xRunner;
-
- RunArgs * m_Args;
- ::com::sun::star::mozilla::MozillaProductType m_Product;
- ::rtl::OUString m_Profile;
-#if OSL_DEBUG_LEVEL > 0
- oslThreadIdentifier m_oThreadID;
-#endif
- };
- }
-}
-#endif //_CONNECTIVITY_MAB_MOZABHELPER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener.cxx b/connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener.cxx
deleted file mode 100644
index 6c2a2f5bc2..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <MNSTerminateListener.hxx>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/frame/XDesktop.hpp>
-#include <MNSInit.hxx>
-
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::frame;
-::com::sun::star::uno::Reference< ::com::sun::star::frame::XTerminateListener> MNSTerminateListener::mxTerminateListener = new MNSTerminateListener();
-
-// -----------------------------------------
-// - MNSTerminateListener -
-// -----------------------------------------
-
-MNSTerminateListener::MNSTerminateListener( )
-{
-}
-
-// -----------------------------------------------------------------------------
-
-MNSTerminateListener::~MNSTerminateListener()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-void SAL_CALL MNSTerminateListener::disposing( const EventObject& /*Source*/ ) throw( RuntimeException )
-{
-}
-
-// -----------------------------------------------------------------------------
-
-void SAL_CALL MNSTerminateListener::queryTermination( const EventObject& /*aEvent*/ ) throw( TerminationVetoException, RuntimeException )
-{
-}
-
-// -----------------------------------------------------------------------------
-
-void SAL_CALL MNSTerminateListener::notifyTermination( const EventObject& /*aEvent*/ ) throw( RuntimeException )
-{
- MNS_Term(sal_True); //Force XPCOM to shutdown
-}
-
-void MNSTerminateListener::addTerminateListener()
-{
- Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() );
-
- if( xFact.is() )
- {
- Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY );
-
- if( xDesktop.is() )
- xDesktop->addTerminateListener(mxTerminateListener);
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener.hxx b/connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener.hxx
deleted file mode 100644
index 16a27c7702..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _MNSTERMINATELISTENER_HXX
-#define _MNSTERMINATELISTENER_HXX
-
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/frame/XTerminateListener.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-
-//class to implement the XTerminateListener interface
-class MNSTerminateListener : public ::cppu::WeakImplHelper1< ::com::sun::star::frame::XTerminateListener >
-{
-
-private:
-
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException );
-
- // XTerminateListener
- virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw( ::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw( ::com::sun::star::uno::RuntimeException );
-
-
-public:
- MNSTerminateListener();
- virtual ~MNSTerminateListener();
-public:
- static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTerminateListener> mxTerminateListener;
- static void addTerminateListener();
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx b/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx
deleted file mode 100644
index 38310179d7..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx
+++ /dev/null
@@ -1,143 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include <MNameMapper.hxx>
-
-#if OSL_DEBUG_LEVEL > 0
-# define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr())
-#else /* OSL_DEBUG_LEVEL */
-# define OUtoCStr( x ) ("dummy")
-#endif /* OSL_DEBUG_LEVEL */
-
-
-using namespace connectivity::mozab;
-
-bool
-MNameMapper::ltstr::operator()( const ::rtl::OUString &s1, const ::rtl::OUString &s2) const
-{
- return s1.compareTo(s2) < 0;
-}
-
-MNameMapper::MNameMapper()
-{
- mDirMap = new MNameMapper::dirMap;
- mUriMap = new MNameMapper::uriMap;
-}
-MNameMapper::~MNameMapper()
-{
- clear();
-}
-
-void MNameMapper::reset()
-{
- clear();
- mDirMap = new MNameMapper::dirMap;
- mUriMap = new MNameMapper::uriMap;
-}
-void MNameMapper::clear()
-{
- if ( mUriMap != NULL ) {
- delete mUriMap;
- }
- if ( mDirMap != NULL ) {
- MNameMapper::dirMap::iterator iter;
- for (iter = mDirMap -> begin(); iter != mDirMap -> end(); ++iter) {
- NS_IF_RELEASE(((*iter).second));
- }
- delete mDirMap;
- }
-}
-const char * getURI(const nsIAbDirectory* directory)
-{
- nsresult retCode;
- nsCOMPtr<nsIRDFResource> rdfResource = do_QueryInterface((nsISupports *)directory, &retCode) ;
- if (NS_FAILED(retCode)) { return NULL; }
- const char * uri;
- retCode=rdfResource->GetValueConst(&uri);
- if (NS_FAILED(retCode)) { return NULL; }
- return uri;
-}
-
-// May modify the name passed in so that it's unique
-nsresult
-MNameMapper::add( ::rtl::OUString& str, nsIAbDirectory* abook )
-{
- MNameMapper::dirMap::iterator iter;
-
- OSL_TRACE( "IN MNameMapper::add()\n" );
-
- if ( abook == NULL ) {
- OSL_TRACE( "\tOUT MNameMapper::add() called with null abook\n" );
- return NS_ERROR_NULL_POINTER;
- }
-
- ::rtl::OUString ouUri=::rtl::OUString::createFromAscii(getURI(abook));
- if ( mUriMap->find (ouUri) != mUriMap->end() ) //There's already an entry with same uri
- {
- return NS_ERROR_FILE_NOT_FOUND;
- }
- mUriMap->insert( MNameMapper::uriMap::value_type( ouUri, abook ) );
-
- ::rtl::OUString tempStr=str;
- long count =1;
- while ( mDirMap->find( tempStr ) != mDirMap->end() ) {
-
- tempStr = str + ::rtl::OUString::valueOf(count);;
- count ++;
- }
- str = tempStr;
- NS_IF_ADDREF(abook);
- mDirMap->insert( MNameMapper::dirMap::value_type( str, abook ) );
- OSL_TRACE( "\tOUT MNameMapper::add()\n" );
- return 0;
-}
-
-bool
-MNameMapper::getDir( const ::rtl::OUString& str, nsIAbDirectory* *abook )
-{
- MNameMapper::dirMap::iterator iter;
-
- OSL_TRACE( "IN MNameMapper::getDir( %s )\n", OUtoCStr(str)?OUtoCStr(str):"NULL" );
-
- if ( (iter = mDirMap->find( str )) != mDirMap->end() ) {
- *abook = (*iter).second;
- NS_IF_ADDREF(*abook);
- } else {
- *abook = NULL;
- }
-
- OSL_TRACE( "\tOUT MNameMapper::getDir() : %s\n", (*abook)?"True":"False" );
-
- return( (*abook) != NULL );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.hxx b/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.hxx
deleted file mode 100644
index 46651383c4..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.hxx
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MAB_NAMEMAPPER_HXX_
-#define _CONNECTIVITY_MAB_NAMEMAPPER_HXX_ 1
-
-#include <map>
-
-// Mozilla includes
-#include <MNSInclude.hxx>
-
-// Star Includes
-#include <rtl/ustring.hxx>
-
-namespace connectivity
-{
- namespace mozab
- {
- class MNameMapper
- {
- private:
-
- struct ltstr
- {
- bool operator()( const ::rtl::OUString &s1, const ::rtl::OUString &s2) const;
- };
-
-
- typedef ::std::multimap< ::rtl::OUString, nsIAbDirectory *, ltstr > dirMap;
- typedef ::std::multimap< ::rtl::OUString, nsIAbDirectory *, ltstr > uriMap;
-
- static MNameMapper *instance;
- dirMap *mDirMap;
- uriMap *mUriMap;
-
- //clear dirs
- void clear();
-
- public:
- static MNameMapper* getInstance();
-
- MNameMapper();
- ~MNameMapper();
-
- // May modify the name passed in so that it's unique
- nsresult add( ::rtl::OUString& str, nsIAbDirectory* abook );
-
- //reset dirs
- void reset();
-
- // Get the directory corresponding to str
- bool getDir( const ::rtl::OUString& str, nsIAbDirectory* *abook );
-
- };
-
- }
-}
-
-#endif //_CONNECTIVITY_MAB_NAMEMAPPER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx b/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx
deleted file mode 100644
index 1e09198a87..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx
+++ /dev/null
@@ -1,826 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <MQueryHelper.hxx>
-#include <MNameMapper.hxx>
-#include <MConnection.hxx>
-#include <connectivity/dbexception.hxx>
-#include "MQuery.hxx"
-#include "MLdapAttributeMap.hxx"
-#include "MTypeConverter.hxx"
-#include "MNSMozabProxy.hxx"
-#include <com/sun/star/uno/Reference.hxx>
-#include <unotools/processfactory.hxx>
-#include <com/sun/star/mozilla/XMozillaBootstrap.hpp>
-
-#if OSL_DEBUG_LEVEL > 0
-# define OUtoCStr( x ) ( ::rtl::OUStringToOString ( (x), RTL_TEXTENCODING_ASCII_US).getStr())
-#else /* OSL_DEBUG_LEVEL */
-# define OUtoCStr( x ) ("dummy")
-#endif /* OSL_DEBUG_LEVEL */
-
-static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
-static NS_DEFINE_CID(kAbDirectoryQueryArgumentsCID, NS_ABDIRECTORYQUERYARGUMENTS_CID);
-static NS_DEFINE_CID(kBooleanConditionStringCID, NS_BOOLEANCONDITIONSTRING_CID);
-static NS_DEFINE_CID(kBooleanExpressionCID, NS_BOOLEANEXPRESSION_CID);
-static NS_DEFINE_CID(kAbDirectoryQueryProxyCID, NS_ABDIRECTORYQUERYPROXY_CID);
-static NS_DEFINE_CID(kAbLDAPAttributeMap, NS_IABLDAPATTRIBUTEMAP_IID);
-
-using namespace connectivity::mozab;
-using namespace connectivity;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace connectivity;
-
-// -------------------------------------------------------------------------
-// Used to store an nsIAbDirectoryQuery member without the need to use Mozilla
-// types in the MQuery.hxx file.
-//
-namespace connectivity {
- namespace mozab {
- struct MQueryDirectory {
- nsCOMPtr<nsIAbDirectory> directory;
- nsCOMPtr<nsIAbDirectoryQuery> directoryQuery;
- PRInt32 contextId;
- MQueryDirectory() : contextId(-1) {}
- };
- }
-}
-
-// -------------------------------------------------------------------------
-/*
-MQuery::MQuery()
-{
- OSL_TRACE( "IN MQuery::MQuery()\n" );
-
- construct();
-#if OSL_DEBUG_LEVEL > 0
- m_oThreadID = osl_getThreadIdentifier(NULL);
-#endif
-
- OSL_TRACE( "\tOUT MQuery::MQuery()\n" );
-}
-*/
-// -------------------------------------------------------------------------
-MQuery::MQuery( const OColumnAlias& _ca )
- :m_rColumnAlias( _ca )
-{
- OSL_TRACE( "IN MQuery::MQuery( ca )\n" );
-
- construct();
-
-#if OSL_DEBUG_LEVEL > 0
- m_oThreadID = osl_getThreadIdentifier(NULL);
-#endif
-
- OSL_TRACE( "\tOUT MQuery::MQuery( ca )\n" );
-}
-// -------------------------------------------------------------------------
-MQuery::~MQuery()
-{
- OSL_TRACE("IN MQuery::~MQuery()\n");
-
- // MQueryHelper is reference counted, so we need to decrement the
- // count here.
- //
- if ( m_aQueryDirectory->contextId != -1 && m_aQueryDirectory->directoryQuery !=
- NULL )
- m_aQueryDirectory->directoryQuery->StopQuery(m_aQueryDirectory->contextId);
-
- if ( m_aQueryDirectory )
- delete m_aQueryDirectory;
-
- NS_IF_RELEASE( m_aQueryHelper);
-
- OSL_TRACE("\tOUT MQuery::~MQuery()\n");
-}
-// -----------------------------------------------------------------------------
-void MQuery::construct()
-{
- // Set default values. (For now just as a reminder).
- m_aError.reset();
- m_bQuerySubDirs = sal_True; // LDAP Queryies require this to be set!
- m_nMaxNrOfReturns = -1; // Unlimited number of returns.
-
- m_aQueryDirectory = new MQueryDirectory();
- // MQueryHelper is reference counted, so we need to add to the
- // count here to prevent accidental deletion else where...
- //
- m_aQueryHelper = new MQueryHelper();
- NS_IF_ADDREF( m_aQueryHelper);
-}
-// -------------------------------------------------------------------------
-void MQuery::setAddressbook(::rtl::OUString &ab)
-{
- OSL_TRACE("IN MQuery::setAddressbook()\n");
- ::osl::MutexGuard aGuard(m_aMutex);
-
- m_aAddressbook = ab;
-
- OSL_TRACE("\tOUT MQuery::setAddressbook()\n");
-}
-// -------------------------------------------------------------------------
-::rtl::OUString MQuery::getAddressbook() const
-{
- OSL_TRACE("IN MQuery::getAddressbook()\n");
-
- OSL_TRACE("\tOUT MQuery::getAddressbook()\n");
-
- return(m_aAddressbook);
-}
-// -------------------------------------------------------------------------
-void MQuery::setMaxNrOfReturns(const sal_Int32 mnr)
-{
- OSL_TRACE( "IN MQuery::setMaxNrOfReturns()\n" );
- ::osl::MutexGuard aGuard(m_aMutex);
-
- m_nMaxNrOfReturns = mnr;
- OSL_TRACE("\tOUT MQuery::setMaxNrOfReturns()\n" );
-}
-// -------------------------------------------------------------------------
-sal_Int32 MQuery::getMaxNrOfReturns() const
-{
- OSL_TRACE("IN MQuery::getMaxNrOfReturns()\n");
-
- OSL_TRACE("\tOUT MQuery::getMaxNrOfReturns()\n");
-
- return(m_nMaxNrOfReturns);
-}
-// -------------------------------------------------------------------------
-void MQuery::setQuerySubDirs(sal_Bool &qsd)
-{
- OSL_TRACE("IN MQuery::setQuerySubDirs()\n");
- ::osl::MutexGuard aGuard(m_aMutex);
-
- m_bQuerySubDirs = qsd;
- OSL_TRACE("\tOUT MQuery::setQuerySubDirs()\n");
-}
-// -------------------------------------------------------------------------
-sal_Bool MQuery::getQuerySubDirs() const
-{
- OSL_TRACE("IN MQuery::getQuerySubDirs()\n");
-
- OSL_TRACE("\tOUT MQuery::getQuerySubDirs()\n");
-
- return(m_bQuerySubDirs);
-}
-// -------------------------------------------------------------------------
-void MQuery::setExpression( MQueryExpression &_expr )
-{
- OSL_TRACE("IN MQuery::setExpression()\n");
- ::osl::MutexGuard aGuard(m_aMutex);
-
- m_aExpr = _expr;
-
- OSL_TRACE("\tOUT MQuery::setExpression()\n");
-}
-// -------------------------------------------------------------------------
-static sal_Int32 generateExpression( MQuery* _aQuery, MQueryExpression* _aExpr,
- nsIAbBooleanExpression* queryExpression )
-{
- nsresult rv; // Store return values.
- // Array that holds all matchItems, to be passed to DoQuery().
- nsCOMPtr<nsISupportsArray> matchItems;
- NS_NewISupportsArray(getter_AddRefs(matchItems));
-
- // Add every individual boolString to matchItems array.
- nsString matchValue;
- // Initialise the matchItems container.
- MQueryExpression::ExprVector::iterator evIter;
- for( evIter = _aExpr->getExpressions().begin();
- evIter != _aExpr->getExpressions().end();
- ++evIter )
- {
- if ( (*evIter)->isStringExpr() ) {
- nsCOMPtr<nsIAbBooleanConditionString> boolString = do_CreateInstance (kBooleanConditionStringCID, &rv);
- NS_ENSURE_SUCCESS( rv, rv );
-
- MQueryExpressionString* evStr = static_cast<MQueryExpressionString*> (*evIter);
-
- // Set the 'name' property of the boolString.
- // Check if it's an alias first...
- rtl::OString attrName = _aQuery->getColumnAlias().getProgrammaticNameOrFallbackToUTF8Alias( evStr->getName() );
- boolString->SetName( strdup( attrName.getStr() ) );
- OSL_TRACE("Name = %s ;", attrName.getStr() );
- // Set the 'matchType' property of the boolString. Check for equal length.
- sal_Bool requiresValue = sal_True;
- switch(evStr->getCond()) {
- case MQueryOp::Exists:
- OSL_TRACE("MQueryOp::Exists; ");
- boolString->SetCondition(nsIAbBooleanConditionTypes::Exists);
- requiresValue = sal_False;
- break;
- case MQueryOp::DoesNotExist:
- OSL_TRACE("MQueryOp::DoesNotExist; ");
- boolString->SetCondition(nsIAbBooleanConditionTypes::DoesNotExist);
- requiresValue = sal_False;
- break;
- case MQueryOp::Contains:
- OSL_TRACE("MQueryOp::Contains; ");
- boolString->SetCondition(nsIAbBooleanConditionTypes::Contains);
- break;
- case MQueryOp::DoesNotContain:
- OSL_TRACE("MQueryOp::DoesNotContain; ");
- boolString->SetCondition(nsIAbBooleanConditionTypes::DoesNotContain);
- break;
- case MQueryOp::Is:
- OSL_TRACE("MQueryOp::Is; ");
- boolString->SetCondition(nsIAbBooleanConditionTypes::Is);
- break;
- case MQueryOp::IsNot:
- OSL_TRACE("MQueryOp::IsNot; ");
- boolString->SetCondition(nsIAbBooleanConditionTypes::IsNot);
- break;
- case MQueryOp::BeginsWith:
- OSL_TRACE("MQueryOp::BeginsWith; ");
- boolString->SetCondition(nsIAbBooleanConditionTypes::BeginsWith);
- break;
- case MQueryOp::EndsWith:
- OSL_TRACE("MQueryOp::EndsWith; ");
- boolString->SetCondition(nsIAbBooleanConditionTypes::EndsWith);
- break;
- case MQueryOp::SoundsLike:
- OSL_TRACE("MQueryOp::SoundsLike; ");
- boolString->SetCondition(nsIAbBooleanConditionTypes::SoundsLike);
- break;
- case MQueryOp::RegExp:
- OSL_TRACE("MQueryOp::RegExp; ");
- boolString->SetCondition(nsIAbBooleanConditionTypes::RegExp);
- break;
- default:
- OSL_TRACE("(default) MQueryOp::Is; ");
- boolString->SetCondition(nsIAbBooleanConditionTypes::Is);
- break;
- }
- // Set the 'matchValue' property of the boolString. Value returned in unicode.
- if ( requiresValue )
- {
- OSL_TRACE("Value = %s \n", OUtoCStr( evStr->getValue() ) );
- MTypeConverter::ouStringToNsString( evStr->getValue(), matchValue);
- boolString->SetValue(matchValue.get ());
- }
- // Add the individual boolString to the container of matchItems.
- matchItems->AppendElement(boolString);
- }
- else if ( (*evIter)->isExpr() ) {
- nsCOMPtr< nsIAbBooleanExpression > subQueryExpr = do_CreateInstance( kBooleanExpressionCID , &rv);
- NS_ENSURE_SUCCESS( rv, rv );
- rv = generateExpression( _aQuery, static_cast< MQueryExpression* >(*evIter),
- subQueryExpr );
- NS_ENSURE_SUCCESS( rv, rv );
- matchItems->AppendElement(subQueryExpr);
- }
- else {
- // Should never see this...
- OSL_FAIL("Unknown Expression Type!");
- return( NS_ERROR_UNEXPECTED );
- }
- }
-
- queryExpression->SetExpressions(matchItems);
- if ( _aExpr->getExpressionCondition() == MQueryExpression::AND )
- queryExpression->SetOperation(nsIAbBooleanOperationTypes::AND);
- else
- queryExpression->SetOperation(nsIAbBooleanOperationTypes::OR);
-
- return( NS_OK );
-}
-sal_uInt32 MQuery::InsertLoginInfo(OConnection* _pCon)
-{
- nsresult rv; // Store return values.
-
- rtl::OUString nameAB = _pCon->getHost().replace('.','_');
- rtl::OUString bindDN = _pCon->getBindDN();
- rtl::OUString password = _pCon->getPassword();
- sal_Bool useSSL = _pCon->getUseSSL();
-
- nsCOMPtr<nsIPref> prefs = do_GetService(NS_PREF_CONTRACTID, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // create the ldap maxHits entry for the preferences file.
- // Note: maxHits is applicable to LDAP only in mozilla.
- nsCAutoString prefName(NS_LITERAL_CSTRING("ldap_2.servers."));
- const char *pAddressBook = MTypeConverter::ouStringToCCharStringAscii(nameAB.getStr());
- prefName.Append(pAddressBook);
-
- if (bindDN.getLength())
- {
- nsCAutoString bindPrefName=prefName;
- bindPrefName.Append(NS_LITERAL_CSTRING(".auth.dn"));
- rv = prefs->SetCharPref (bindPrefName.get(),
- MTypeConverter::ouStringToCCharStringAscii( bindDN.getStr() ) );
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCAutoString pwdPrefName=prefName;
- pwdPrefName.Append(NS_LITERAL_CSTRING(".auth.pwd"));
- rv = prefs->SetCharPref (pwdPrefName.get(),
- MTypeConverter::ouStringToCCharStringAscii( password.getStr() ) );
- NS_ENSURE_SUCCESS(rv, rv);
- }
- if (useSSL)
- {
- nsCAutoString sslPrefName=prefName;
- sslPrefName.Append(NS_LITERAL_CSTRING(".UseSSL"));
- rv = prefs->SetBoolPref (sslPrefName.get(),useSSL);
- NS_ENSURE_SUCCESS(rv, rv);
- }
- return rv;
-}
-
-//determine whether current profile is locked,any error will lead to return true
-sal_Bool isProfileLocked(OConnection* _pCon)
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::mozilla::XMozillaBootstrap > xMozillaBootstrap;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
- OSL_ENSURE( xFactory.is(), "can't get service factory" );
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xInstance = xFactory->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")) );
- OSL_ENSURE( xInstance.is(), "failed to create instance" );
- xMozillaBootstrap = ::com::sun::star::uno::Reference< ::com::sun::star::mozilla::XMozillaBootstrap >(xInstance,::com::sun::star::uno::UNO_QUERY);
- if (_pCon)
- return xMozillaBootstrap->isProfileLocked(_pCon->getProduct(),_pCon->getMozProfile());
- else
- return xMozillaBootstrap->isCurrentProfileLocked();
-}
-
-
-// -------------------------------------------------------------------------
-sal_Int32 getDirectoryType(const nsIAbDirectory* directory)
-{
- nsresult retCode;
- nsCOMPtr<nsIRDFResource> rdfResource = do_QueryInterface((nsISupports *)directory, &retCode) ;
- if (NS_FAILED(retCode)) { return SDBCAddress::Unknown; }
- const char * uri;
- retCode=rdfResource->GetValueConst(&uri);
- if (NS_FAILED(retCode)) { return SDBCAddress::Unknown; }
- const sal_Char *sUriPrefix = ::connectivity::mozab::getSchemeURI( ::connectivity::mozab::SCHEME_LDAP );
- if (strncmp(uri,sUriPrefix,strlen(sUriPrefix)) == 0)
- {
- return SDBCAddress::LDAP;
- }
- sUriPrefix = ::connectivity::mozab::getSchemeURI( ::connectivity::mozab::SCHEME_MOZILLA );
- if (strncmp(uri,sUriPrefix,strlen(sUriPrefix)) == 0)
- {
- return SDBCAddress::Mozilla;
- }
- sUriPrefix = ::connectivity::mozab::getSchemeURI( ::connectivity::mozab::SCHEME_MOZILLA_MDB );
- if (strncmp(uri,sUriPrefix,strlen(sUriPrefix)) == 0)
- {
- return SDBCAddress::Mozilla;
- }
- sUriPrefix = ::connectivity::mozab::getSchemeURI( ::connectivity::mozab::SCHEME_OUTLOOK_EXPRESS );
- if (strncmp(uri,sUriPrefix,strlen(sUriPrefix)) == 0)
- {
- return SDBCAddress::OutlookExp;
- }
- sUriPrefix = ::connectivity::mozab::getSchemeURI( ::connectivity::mozab::SCHEME_OUTLOOK_MAPI );
- if (strncmp(uri,sUriPrefix,strlen(sUriPrefix)) == 0)
- {
- return SDBCAddress::Outlook;
- }
- return SDBCAddress::Unknown;
-
-}
-// -------------------------------------------------------------------------
-sal_Bool isForceQueryProxyUsed(const nsIAbDirectory* directory)
-{
- sal_Int32 nType = getDirectoryType(directory);
- if (nType == SDBCAddress::Outlook || nType == SDBCAddress::OutlookExp)
- return sal_True;
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 MQuery::commitRow(const sal_Int32 rowIndex)
-{
- if (!m_aQueryHelper || !m_aQueryDirectory || !m_aQueryDirectory->directoryQuery)
- return sal_False;
- MNSMozabProxy xMProxy;
- RunArgs args;
- args.funcIndex = ProxiedFunc::FUNC_QUERYHELPER_COMMIT_CARD;
- args.argCount = 3;
- args.arg1 = (void*)m_aQueryHelper;
- args.arg2 = (void*)&rowIndex;
- args.arg3 = (void*)m_aQueryDirectory->directory;
- nsresult rv = xMProxy.StartProxy(&args,m_Product,m_Profile);
- m_aError = m_aQueryHelper->getError();
- return rv;
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 MQuery::deleteRow(const sal_Int32 rowIndex)
-{
- if (!m_aQueryHelper || !m_aQueryDirectory || !m_aQueryDirectory->directoryQuery)
- return sal_False;
- MNSMozabProxy xMProxy;
- RunArgs args;
- args.funcIndex = ProxiedFunc::FUNC_QUERYHELPER_DELETE_CARD;
- args.argCount = 3;
- args.arg1 = (void*)m_aQueryHelper;
- args.arg2 = (void*)&rowIndex;
- args.arg3 = (void*)m_aQueryDirectory->directory;
- nsresult rv = xMProxy.StartProxy(&args,m_Product,m_Profile);
- m_aError = m_aQueryHelper->getError();
- return rv;
-
-}
-
-// -------------------------------------------------------------------------
-sal_Int32 MQuery::executeQuery(OConnection* _pCon)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- OSL_TRACE("IN MQuery::executeQuery()\n");
- m_Product = _pCon->getProduct();
- m_Profile = _pCon->getMozProfile();
-
- nsresult rv;
- MNSMozabProxy xMProxy;
- RunArgs args;
- args.funcIndex = ProxiedFunc::FUNC_EXECUTE_QUERY;
- args.argCount = 2;
- args.arg1 = (void*)this;
- args.arg2 = (void*)_pCon;
- rv = xMProxy.StartProxy(&args,m_Product,m_Profile);
- return rv;
-}
-// -------------------------------------------------------------------------
-sal_Int32 MQuery::executeQueryProxied(OConnection* _pCon)
-{
-#if OSL_DEBUG_LEVEL > 0
- OSL_TRACE("IN MQuery::executeQueryProxied() Caller thread: %4d \n", m_oThreadID);
-#endif
-
- nsresult rv; // Store return values.
- // MTypeConverter aTypeConverter;
- // Create a nsIAbDirectory object to initialise the nsIAbDirectoryQuery object.
- nsCOMPtr<nsIRDFService> rdfService(do_GetService(kRDFServiceCID, &rv)) ;
- if (NS_FAILED(rv))
- return(-1);
-
- nsCOMPtr<nsIAbDirectory> directory;
- MNameMapper *nmap = _pCon->getNameMapper();
-
-
- if ( nmap->getDir( m_aAddressbook, getter_AddRefs( directory ) ) == sal_False )
- return( -1 );
-
-
- //insert ldap bind info to mozilla profile(in memery,none saved),so we can use it in mozilla part codes
- if (_pCon->isLDAP())
- {
- rv = InsertLoginInfo(_pCon);
- NS_ENSURE_SUCCESS(rv, rv);
-
- }
- // Since Outlook Express and Outlook in OCL mode support a very limited query capability,
- // we use the following bool to judge whether we need bypass any use of a DirectoryQuery
- // interface and instead force the use of the QueryProxy.
- sal_Bool forceQueryProxyUse = isForceQueryProxyUsed(directory);
-
- m_aQueryDirectory->directory = directory;
- // Initialize directory in cases of LDAP and Mozilla
- if (!forceQueryProxyUse) m_aQueryDirectory->directoryQuery = do_QueryInterface(directory, &rv);
-
- if ( NS_FAILED(rv) || forceQueryProxyUse)
- {
- // Create a nsIAbDirectoryQuery object which eventually will execute
- // the query by calling DoQuery().
- nsCOMPtr< nsIAbDirectoryQueryProxy > directoryQueryProxy = do_CreateInstance( kAbDirectoryQueryProxyCID, &rv);
-
- // Need to turn this off for anything using the Query Proxy since it
- // treats Mailing Lists as directories!
-
- m_bQuerySubDirs = sal_False;
-
- rv = directoryQueryProxy->Initiate (directory);
- NS_ENSURE_SUCCESS(rv, rv);
-
- m_aQueryDirectory->directoryQuery = do_QueryInterface (directoryQueryProxy, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
- OSL_TRACE("Using the directoryQueryProxy\n");
- }
-#if OSL_DEBUG_LEVEL > 0
- else
- OSL_TRACE("Not using a Query Proxy, Query i/f supported by directory\n");
-#endif /* OSL_DEBUG_LEVEL */
-
- /*
- // The problem here is that an LDAP Address Book may exist as
- // a Mozilla Address Book. So we need to limit the number of
- // records returned by the Server:
- // 1. Determine if this is an LDAP Address Book
- // [LDAP overrides the default operations(write|read|search) of all types with search only].
- // 2. Determine if the limit is already set by us.
- // 3. Use the mozilla preferences to see if this value is set.
- // 4. Use value or else default to 100.
- */
- PRBool isWriteable;
- rv = directory->GetOperations (&isWriteable);
- NS_ENSURE_SUCCESS(rv, rv);
- if (!(isWriteable & nsIAbDirectory::opWrite))
- {
- if(m_nMaxNrOfReturns == -1)
- {
- // Determine if the limit maxHits has been set in the mozilla preferences
- // if set, then use the value otherwise default to 100
- nsCOMPtr<nsIPref> prefs = do_GetService(NS_PREF_CONTRACTID, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // create the ldap maxHits entry for the preferences file.
- // Note: maxHits is applicable to LDAP only in mozilla.
- nsCAutoString prefName(NS_LITERAL_CSTRING("ldap_2.servers."));
- const char *pAddressBook = MTypeConverter::ouStringToCCharStringAscii(m_aAddressbook);
- prefName.Append(pAddressBook);
- prefName.Append(NS_LITERAL_CSTRING(".maxHits"));
-
- PRInt32 maxHits;
- rv = prefs->GetIntPref(prefName.get(), &maxHits);
- if (NS_FAILED(rv))
- m_nMaxNrOfReturns = 100;
- else
- m_nMaxNrOfReturns = maxHits;
- }
- }
-
-
- nsCOMPtr< nsIAbBooleanExpression > queryExpression = do_CreateInstance( kBooleanExpressionCID , &rv);
- NS_ENSURE_SUCCESS( rv, rv );
- rv = generateExpression( this, &m_aExpr, queryExpression );
- NS_ENSURE_SUCCESS( rv, rv );
-
- // Use the nsIAbCard to return the card properties.
- const char *returnProperties[] = {"card:nsIAbCard"};
- PRInt32 count=1;
-
- nsCOMPtr< nsIAbDirectoryQueryArguments > arguments = do_CreateInstance( kAbDirectoryQueryArgumentsCID, &rv);
- NS_ENSURE_SUCCESS( rv, rv );
-
- rv = arguments->SetExpression(queryExpression);
- NS_ENSURE_SUCCESS( rv, rv );
-
- rv = arguments->SetReturnProperties(count, returnProperties);
- NS_ENSURE_SUCCESS( rv, rv );
-
- rv = arguments->SetQuerySubDirectories(m_bQuerySubDirs);
- NS_ENSURE_SUCCESS( rv, rv );
-
- nsCOMPtr< nsIAbLDAPAttributeMap > attributeMap( new MLdapAttributeMap );
- rv = arguments->SetTypeSpecificArg( attributeMap );
- NS_ENSURE_SUCCESS( rv, rv );
-
- // Execute the query.
- OSL_TRACE( "****** calling DoQuery\n");
-
- m_aError.reset();
-
- m_aQueryHelper->reset();
-
- rv = m_aQueryDirectory->directoryQuery->DoQuery(arguments, m_aQueryHelper, m_nMaxNrOfReturns, -1, &m_aQueryDirectory->contextId);
-
-
- if (NS_FAILED(rv)) {
- m_aQueryDirectory->contextId = -1;
- OSL_TRACE( "****** DoQuery failed\n");
- OSL_TRACE("\tOUT MQuery::executeQueryProxied()\n");
- m_aQueryHelper->notifyQueryError() ;
- return(-1);
- }
-#if OSL_DEBUG_LEVEL > 0
- else {
- OSL_TRACE( "****** DoQuery succeeded \n");
- }
-#endif
-
- OSL_TRACE("\tOUT MQuery::executeQueryProxied()\n");
-
- return(0);
-}
-
-// -------------------------------------------------------------------------
-//
-//
-// If the query executed is being done asynchronously then this may return
-// -1 as the count, ie. it's undetermined.
-//
-sal_Int32
-MQuery::getRowCount()
-{
- return( m_aQueryHelper->getResultCount() );
-}
-
-// -------------------------------------------------------------------------
-//
-//
-// As opposed to getRowCount() this returns the actual number of rows fetched
-// so far (if is an async query)
-//
-sal_uInt32
-MQuery::getRealRowCount()
-{
- return( m_aQueryHelper->getRealCount() );
-}
-
-//
-// If the query executed is being done asynchronously then this may be
-// false
-//
-sal_Bool
-MQuery::queryComplete( void )
-{
- return( hadError() || m_aQueryHelper->queryComplete() );
-}
-
-sal_Bool
-MQuery::waitForQueryComplete( void )
-{
- if( m_aQueryHelper->waitForQueryComplete( ) )
- return sal_True;
- m_aError = m_aQueryHelper->getError();
- return( sal_False );
-}
-
-// -------------------------------------------------------------------------
-
-sal_Bool
-MQuery::checkRowAvailable( sal_Int32 nDBRow )
-{
- while( !queryComplete() && m_aQueryHelper->getRealCount() <= (sal_uInt32)nDBRow )
- if ( !m_aQueryHelper->waitForRow( nDBRow ) ) {
- m_aError = m_aQueryHelper->getError();
- return( sal_False );
- }
-
- return( getRowCount() > nDBRow );
-}
-// -------------------------------------------------------------------------
-sal_Bool
-MQuery::setRowValue( ORowSetValue& rValue, sal_Int32 nDBRow,const rtl::OUString& aDBColumnName, sal_Int32 nType ) const
-{
- MQueryHelperResultEntry* xResEntry = m_aQueryHelper->getByIndex( nDBRow );
-
- OSL_ENSURE( xResEntry != NULL, "xResEntry == NULL");
- if (xResEntry == NULL )
- {
- const_cast< MQuery* >( this )->m_aError = m_aQueryHelper->getError();
- return sal_False;
- }
- switch ( nType )
- {
- case DataType::VARCHAR:
- xResEntry->setValue( m_rColumnAlias.getProgrammaticNameOrFallbackToUTF8Alias( aDBColumnName ), rValue.getString() );
- break;
- default:
- OSL_FAIL( "invalid data type!" );
- break;
- }
-
- return sal_True;
-}
-
-// -------------------------------------------------------------------------
-sal_Bool
-MQuery::getRowValue( ORowSetValue& rValue, sal_Int32 nDBRow,const rtl::OUString& aDBColumnName, sal_Int32 nType ) const
-{
- MQueryHelperResultEntry* xResEntry = m_aQueryHelper->getByIndex( nDBRow );
-
- OSL_ENSURE( xResEntry != NULL, "xResEntry == NULL");
- if (xResEntry == NULL )
- {
- const_cast< MQuery* >( this )->m_aError = m_aQueryHelper->getError();
- rValue.setNull();
- return sal_False;
- }
- switch ( nType )
- {
- case DataType::VARCHAR:
- rValue = xResEntry->getValue( m_rColumnAlias.getProgrammaticNameOrFallbackToUTF8Alias( aDBColumnName ) );
- break;
-
- default:
- rValue.setNull();
- break;
- }
-
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Int32
-MQuery::getRowStates(sal_Int32 nDBRow)
-{
- MQueryHelperResultEntry* xResEntry = m_aQueryHelper->getByIndex( nDBRow );
-
- OSL_ENSURE( xResEntry != NULL, "xResEntry == NULL");
- if (xResEntry == NULL )
- {
- m_aError = m_aQueryHelper->getError();
- return RowStates_Error;
- }
- return xResEntry->getRowStates();
-}
-sal_Bool
-MQuery::setRowStates(sal_Int32 nDBRow,sal_Int32 aState)
-{
- MQueryHelperResultEntry* xResEntry = m_aQueryHelper->getByIndex( nDBRow );
-
- OSL_ENSURE( xResEntry != NULL, "xResEntry == NULL");
- if (xResEntry == NULL )
- {
- m_aError = m_aQueryHelper->getError();
- return sal_False;
- }
- return xResEntry->setRowStates(aState);
-}
-
-sal_Bool
-MQuery::resyncRow(sal_Int32 nDBRow)
-{
- MNSMozabProxy xMProxy;
- RunArgs args;
- args.funcIndex = ProxiedFunc::FUNC_QUERYHELPER_RESYNC_CARD;
- args.argCount = 2;
- args.arg1 = (void*)m_aQueryHelper;
- args.arg2 = (void*)&nDBRow;
- nsresult rv = xMProxy.StartProxy(&args,m_Product,m_Profile);
- m_aError = m_aQueryHelper->getError();
- return NS_SUCCEEDED( rv ) ? sal_True : sal_False;
-}
-
-sal_Int32
-MQuery::createNewCard()
-{
- sal_Int32 nNumber = 0;
- MNSMozabProxy xMProxy;
- RunArgs args;
- args.funcIndex = ProxiedFunc::FUNC_QUERYHELPER_CREATE_NEW_CARD;
- args.argCount = 2;
- args.arg1 = (void*)m_aQueryHelper;
- args.arg2 = (void*)&nNumber;
- nsresult rv = xMProxy.StartProxy(&args,m_Product,m_Profile);
-
- m_aError = m_aQueryHelper->getError();
- NS_ENSURE_SUCCESS(rv,0);
- return nNumber;
-}
-// -------------------------------------------------------------------------
-
-MNameMapper*
-MQuery::CreateNameMapper()
-{
- return( new MNameMapper() );
-}
-
-// -------------------------------------------------------------------------
-void
-MQuery::FreeNameMapper( MNameMapper* _ptr )
-{
- delete _ptr;
-}
-// -------------------------------------------------------------------------
-sal_Bool MQuery::isWritable(OConnection* _pCon)
-{
- if ( !m_aQueryDirectory )
- return sal_False;
-
- nsresult rv; // Store return values.
- nsCOMPtr<nsIAbDirectory> directory = do_QueryInterface(m_aQueryDirectory->directory, &rv);;
- if (NS_FAILED(rv))
- return sal_False;
- if (getDirectoryType(directory) == SDBCAddress::Mozilla && isProfileLocked(_pCon))
- return sal_False;
-
- PRBool isWriteable;
- rv = directory->GetOperations (&isWriteable);
- if (NS_FAILED(rv))
- return sal_False;
- sal_Bool bWritable = ( isWriteable & nsIAbDirectory::opWrite ) == nsIAbDirectory::opWrite;
- return bWritable;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx b/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx
deleted file mode 100644
index 0495bf3cd6..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx
+++ /dev/null
@@ -1,282 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _CONNECTIVITY_MAB_QUERY_HXX_
-#define _CONNECTIVITY_MAB_QUERY_HXX_
-
-#include "MColumnAlias.hxx"
-#include "MErrorResource.hxx"
-#include <connectivity/FValue.hxx>
-#include "MNSDeclares.hxx"
-#include <osl/thread.hxx>
-#include <com/sun/star/mozilla/MozillaProductType.hpp>
-
-namespace connectivity
-{
- namespace mozab
- {
-
- class MQueryHelper;
- struct MQueryDirectory;
-
- namespace MQueryOp {
- typedef enum {
- Exists = 0,
- DoesNotExist = 1,
- Contains = 2,
- DoesNotContain = 3,
- Is = 4,
- IsNot = 5,
- BeginsWith = 6,
- EndsWith = 7,
- SoundsLike = 8,
- RegExp = 9
- } cond_type;
- }
-
- class MQueryExpressionBase {
- public:
- typedef enum {
- Unknown,
- StringExpr,
- Expr
- } node_type;
-
- protected:
- node_type m_eNodeType;
-
- MQueryExpressionBase() : m_eNodeType( Unknown ) {}
- MQueryExpressionBase( node_type _eNodeType ) : m_eNodeType( _eNodeType ) {}
-
- public:
- sal_Bool isUnknown( ) const { return m_eNodeType == Unknown; }
- sal_Bool isStringExpr( ) const { return m_eNodeType == StringExpr; }
- sal_Bool isExpr( ) const { return m_eNodeType == Expr; }
- };
-
- class MQueryExpressionString : public MQueryExpressionBase {
- protected:
- ::rtl::OUString m_aName; // LHS
- MQueryOp::cond_type m_aBooleanCondition;
- ::rtl::OUString m_aValue; // RHS
-
- public:
-
- MQueryExpressionString( ::rtl::OUString& lhs,
- MQueryOp::cond_type cond,
- ::rtl::OUString rhs )
- : MQueryExpressionBase( MQueryExpressionBase::StringExpr )
- , m_aName( lhs )
- , m_aBooleanCondition( cond )
- , m_aValue( rhs )
- {
- }
-
- MQueryExpressionString( ::rtl::OUString& lhs,
- MQueryOp::cond_type cond )
- : MQueryExpressionBase( MQueryExpressionBase::StringExpr )
- , m_aName( lhs )
- , m_aBooleanCondition( cond )
- , m_aValue( ::rtl::OUString() )
- {
- }
-
- const ::rtl::OUString& getName() const { return m_aName; }
- MQueryOp::cond_type getCond() const { return m_aBooleanCondition; }
- const ::rtl::OUString& getValue() const { return m_aValue; }
- };
-
- class MQuery;
-
- class MQueryExpression : public MQueryExpressionBase
- {
- friend class MQuery;
-
- public:
- typedef ::std::vector< MQueryExpressionBase* > ExprVector;
-
- typedef enum {
- AND,
- OR
- } bool_cond;
-
- void setExpressions( ExprVector& _exprVector )
- { m_aExprVector = _exprVector; }
-
- // All expressions on a peer level use same condition operator
- void setExpressionCondition( bool_cond _cond )
- { m_aExprCondType = _cond; }
-
- ExprVector& getExpressions( )
- { return m_aExprVector; }
-
- // All expressions on a peer level use same condition operator
- bool_cond getExpressionCondition( ) const
- { return m_aExprCondType; }
-
- MQueryExpression() : MQueryExpressionBase( MQueryExpressionBase::Expr ),
- m_aExprCondType( OR )
- { m_aExprVector.clear(); }
-
-
- protected:
- ExprVector m_aExprVector;
- bool_cond m_aExprCondType;
-
- };
-
-
- class MQuery
- {
- /*
- * A query resultset with a maximum limit of
- * m_nMaxNrOfReturns return items, is created from
- * the following SQL statement:
- *
- * -------------------------------------------------
- * SELECT m_aAttributes FROM m_aAddressbook
- * WHERE m_aMatchItems SQL_OPR m_aMatchValue
- * -------------------------------------------------
- *
- * We are\are not, depending on boolean m_bQuerySubDirs,
- * interested in querying the sub-directories of the
- * addressbook directory, if any.
- *
- * SQL_OPR:
- * m_aSqlOppr contains the SQL operations for every
- * attribute in m_aAttributes.
- * This member must be initialised together with
- * m_aAttributes.
- *
- * The SQL operations defined for 'SQL_OPR' are:
- * matchExists = 0,
- * matchDoesNotExist = 1,
- * matchContains = 2,
- * matchDoesNotContain = 3,
- * matchIs = 4,
- * matchIsNot = 5,
- * matchBeginsWith = 6,
- * matchEndsWith = 7,
- * matchSoundsLike = 8,
- * matchRegExp = 9.
- * There must be mapping to one of these values.
- *
- * The following members MUST be initialised before
- * a query is executed:
- * m_Attributes, m_aMapAttrOppr, m_aAddressbook,
- * m_aMatchItems and m_aMatchValue.
- *
- * m_bQuerySubDirs and m_nMaxNrReturns are set to a
- * default value in the constructor which can be
- * overridden. If (element of) m_aSqlOppr is not set,
- * the default SQL operation is 'matchIs'.
- *
- */
- private:
- MQueryDirectory *m_aQueryDirectory;
- MQueryHelper *m_aQueryHelper;
- ::rtl::OUString m_aAddressbook;
- sal_Int32 m_nMaxNrOfReturns;
- sal_Bool m_bQuerySubDirs;
- MQueryExpression m_aExpr;
- const OColumnAlias& m_rColumnAlias;
- ::com::sun::star::mozilla::MozillaProductType
- m_Product;
- ::rtl::OUString m_Profile;
- ErrorDescriptor m_aError;
-
- void construct();
- protected:
- ::osl::Mutex m_aMutex;
-#if OSL_DEBUG_LEVEL > 0
- oslThreadIdentifier m_oThreadID;
-#endif
-
- public:
- /*
- * - Contains accessors to the members of this class.
- * - executeQuery() initiates a non-blocking query.
- */
- sal_Int32 executeQuery(OConnection* _pCon);
- sal_Int32 executeQueryProxied(OConnection* _pCon); //Used only by MNSMozabProxy
-
- sal_Int32 createNewCard(); //return Row count number
- sal_Int32 deleteRow(const sal_Int32 rowIndex);
- sal_Int32 commitRow(const sal_Int32 rowIndex);
- sal_Bool resyncRow(sal_Int32 nDBRow);
-
- sal_Bool isWritable(OConnection* _pCon);
-
- sal_uInt32 InsertLoginInfo(OConnection* _pCon);
-
- void setAddressbook( ::rtl::OUString&);
- ::rtl::OUString getAddressbook(void) const;
-
- const OColumnAlias& getColumnAlias() const { return m_rColumnAlias; }
-
- void setExpression( MQueryExpression &_expr );
-
- void setMaxNrOfReturns( const sal_Int32);
- sal_Int32 getMaxNrOfReturns(void) const;
-
- void setQuerySubDirs( sal_Bool&);
- sal_Bool getQuerySubDirs(void) const;
-
- sal_Int32 getRowCount( void );
- sal_uInt32 getRealRowCount( void );
- sal_Bool queryComplete( void );
- sal_Bool waitForQueryComplete( void );
- sal_Bool checkRowAvailable( sal_Int32 nDBRow );
- sal_Bool getRowValue( connectivity::ORowSetValue& rValue,
- sal_Int32 nDBRow,
- const rtl::OUString& aDBColumnName,
- sal_Int32 nType ) const;
- sal_Bool setRowValue( connectivity::ORowSetValue& rValue,
- sal_Int32 nDBRow,
- const rtl::OUString& aDBColumnName,
- sal_Int32 nType ) const;
- sal_Int32 getRowStates(sal_Int32 nDBRow);
- sal_Bool setRowStates(sal_Int32 nDBRow,sal_Int32 aState);
-
- bool hadError() const { return m_aError.is(); }
- inline const ErrorDescriptor& getError() const { return m_aError; }
-
- public:
-// MQuery();
- MQuery( const OColumnAlias& _ca );
- virtual ~MQuery();
- static MNameMapper* CreateNameMapper();
- static void FreeNameMapper( MNameMapper* _ptr );
- };
- }
-}
-
-#endif // _CONNECTIVITY_MAB_QUERY_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx
deleted file mode 100644
index 4ea4daf8fa..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx
+++ /dev/null
@@ -1,637 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "MQueryHelper.hxx"
-#include "MTypeConverter.hxx"
-#include "MConnection.hxx"
-#include "MNSDeclares.hxx"
-#include "MLdapAttributeMap.hxx"
-
-#include <connectivity/dbexception.hxx>
-
-#include "resource/mozab_res.hrc"
-
-using namespace connectivity::mozab;
-
-
-NS_IMPL_THREADSAFE_ISUPPORTS1(connectivity::mozab::MQueryHelper,nsIAbDirectoryQueryResultListener)
-
-//
-// class MQueryHelperResultEntry
-//
-
-
-MQueryHelperResultEntry::MQueryHelperResultEntry()
-{
- m_Card = NULL;
- m_RowStates = 0;
-}
-
-MQueryHelperResultEntry::~MQueryHelperResultEntry()
-{
- OSL_TRACE("IN MQueryHelperResultEntry::~MQueryHelperResultEntry()\n");
- OSL_TRACE("OUT MQueryHelperResultEntry::~MQueryHelperResultEntry()\n");
-
-}
-void
-MQueryHelperResultEntry::setCard(nsIAbCard *card)
-{
- m_Card = card;
-}
-nsIAbCard *
-MQueryHelperResultEntry::getCard()
-{
- return m_Card;
-}
-void MQueryHelperResultEntry::insert( const rtl::OString &key, rtl::OUString &value )
-{
- m_Fields[ key ] = value;
-}
-
-rtl::OUString MQueryHelperResultEntry::getValue( const rtl::OString &key ) const
-{
- FieldMap::const_iterator iter = m_Fields.find( key );
- if ( iter == m_Fields.end() )
- {
- return rtl::OUString();
- }
- else
- {
- return iter->second;
- }
-}
-
-void MQueryHelperResultEntry::setValue( const rtl::OString &key, const rtl::OUString & rValue)
-{
- m_Fields[ key ] = rValue;
-}
-//
-// class MQueryHelper
-//
-MQueryHelper::MQueryHelper()
- :m_nIndex( 0 )
- ,m_bHasMore( sal_True )
- ,m_bAtEnd( sal_False )
- ,m_bErrorCondition( sal_False )
- ,m_bQueryComplete( sal_False )
- ,mRefCnt( 0 ) // NSISUPPORTS - Initialize RefCnt to 0
-{
- m_aResults.clear();
-#if OSL_DEBUG_LEVEL > 0
- m_oThreadID = osl_getThreadIdentifier(NULL);
-#endif
-}
-
-MQueryHelper::~MQueryHelper()
-{
- OSL_TRACE("IN MQueryHelper::~MQueryHelper()\n");
- clear_results();
- OSL_TRACE("OUT MQueryHelper::~MQueryHelper()\n");
-}
-
-void
-MQueryHelper::append(MQueryHelperResultEntry* resEnt )
-{
- if ( resEnt != NULL ) {
- m_aResults.push_back( resEnt );
- m_bAtEnd = sal_False;
- }
-}
-
-void
-MQueryHelper::clear_results()
-{
- resultsArray::iterator iter = m_aResults.begin();
- while ( iter != m_aResults.end() ) {
- delete (*iter);
- ++iter;
- }
- m_aResults.clear();
-}
-
-void
-MQueryHelper::rewind()
-{
- m_nIndex = 0;
-}
-
-void
-MQueryHelper::reset()
-{
- m_nIndex = 0;
- m_bHasMore = sal_True;
- m_bQueryComplete = sal_False;
- m_bAtEnd = sal_False;
- m_bErrorCondition = sal_False;
- clear_results();
-}
-
-void
-MQueryHelper::clearResultOrComplete()
-{
- // Don't use a Mutex, it should be called by a method already holding it.
- OSL_TRACE("In/Out : clearResultOrComplete()");
- m_aCondition.reset();
-}
-
-void
-MQueryHelper::notifyResultOrComplete()
-{
- OSL_TRACE("In/Out : notifyResultOrComplete()");
- m_aCondition.set();
-}
-
-sal_Bool
-MQueryHelper::waitForResultOrComplete( )
-{
- TimeValue timeValue = { 1, 0 }; // 20 Seconds 0 NanoSecond timeout
- sal_Int32 times=0;
- osl::Condition::Result rv = ::osl::Condition::result_ok;
-
- OSL_TRACE("In : waitForResultOrComplete()");
- // Can't hold mutex or condition would never get set...
- while( (m_aCondition.check() == sal_False || rv == ::osl::Condition::result_error) && times < 20) {
- rv = m_aCondition.wait( &timeValue );
- times ++;
- }
- if (times >= 20 && rv == ::osl::Condition::result_timeout ) {
- OSL_TRACE("waitForResultOrComplete() : Timeout!");
- m_aError.setResId( STR_TIMEOUT_WAITING );
- return sal_False;
- }
-
- if ( isError() ) {
- OSL_TRACE("waitForResultOrComplete() : Error returned!");
- m_aError.setResId( STR_ERR_EXECUTING_QUERY );
- return sal_False;
- }
- m_aError.reset();
- OSL_TRACE(" Out : waitForResultOrComplete()");
- return sal_True;
-}
-
-
-MQueryHelperResultEntry*
-MQueryHelper::next( )
-{
- MQueryHelperResultEntry* result;
- sal_Int32 index;
-
- m_aMutex.acquire();
- index = m_nIndex;
- m_aMutex.release();
-
- result = getByIndex( index + 1) ; // Add 1 as Row is numbered from 1 to N
-
- if ( result ) {
- m_aMutex.acquire();
- m_nIndex++;
- m_aMutex.release();
- }
-
- return( result );
-}
-
-MQueryHelperResultEntry*
-MQueryHelper::getByIndex( sal_uInt32 nRow )
-{
- // Row numbers are from 1 to N, need to ensure this, and then
- // substract 1
- if ( nRow < 1 ) {
- return( NULL );
- }
-
- do {
- // Obtain the Mutex - don't use a guard as we want to be able to release
- // and acquire again...
- m_aMutex.acquire();
- if ( nRow > m_aResults.size() )
- {
- if ( m_bQueryComplete )
- {
- m_bAtEnd = sal_True;
- m_aMutex.release();
- return( NULL );
- }
- else
- {
- clearResultOrComplete();
- m_aMutex.release();
- if ( !waitForResultOrComplete( ) )
- return( NULL );
- }
- }
- else
- {
- m_aMutex.release();
- return( m_aResults[ nRow -1 ] );
- }
- } while ( sal_True );
-}
-
-sal_Bool
-MQueryHelper::hasMore() const
-{
- return m_bHasMore;
-}
-
-sal_Bool
-MQueryHelper::atEnd() const
-{
- return m_bAtEnd;
-}
-
-sal_Bool
-MQueryHelper::isError() const
-{
- return m_bErrorCondition;
-}
-
-sal_Bool
-MQueryHelper::queryComplete() const
-{
- return m_bQueryComplete;
-}
-
-sal_Bool
-MQueryHelper::waitForQueryComplete( )
-{
- m_aMutex.acquire();
-
- OSL_TRACE("In : waitForQueryComplete()");
- if ( ! m_bQueryComplete ) {
- do
- {
- m_aMutex.release();
- clearResultOrComplete();
- if ( !waitForResultOrComplete( ) )
- return( sal_False );
- m_aMutex.acquire();
- }
- while ( !m_bQueryComplete );
- }
-
- m_aMutex.release();
- OSL_TRACE("Out : waitForQueryComplete()");
- return( sal_True );
-}
-
-sal_Bool
-MQueryHelper::waitForRow( sal_Int32 rowNum )
-{
- m_aMutex.acquire();
- do
- {
- m_aMutex.release();
- clearResultOrComplete();
- if ( !waitForResultOrComplete() )
- return( sal_False );
- m_aMutex.acquire();
- }
- while ( !m_bQueryComplete && m_aResults.size() < (size_t)rowNum );
-
- m_aMutex.release();
- return( sal_True );
-}
-
-// -------------------------------------------------------------------------
-
-sal_Int32
-MQueryHelper::getResultCount() const
-{
- OSL_TRACE( "IN MQueryHelper::getResultCount()" );
- if ( !m_bQueryComplete )
- {
- OSL_TRACE( "\tOUT MQueryHelper::getResultCount() = -1\n");
- return -1;
- }
- else
- {
- OSL_TRACE( "\tOUT MQueryHelper::getResultCount() = %d\n", m_aResults.size() );
- return static_cast<sal_Int32>(m_aResults.size());
- }
-}
-
-// -------------------------------------------------------------------------
-
-sal_uInt32
-MQueryHelper::getRealCount() const
-{
- OSL_TRACE( "IN/OUT MQueryHelper::getRealCount() = %d\n", m_aResults.size() );
- return static_cast<sal_Int32>(m_aResults.size());
-}
-
-// -------------------------------------------------------------------------
-NS_IMETHODIMP MQueryHelper::OnQueryItem(nsIAbDirectoryQueryResult *result)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-#if OSL_DEBUG_LEVEL > 0
- OSL_TRACE( "IN MQueryHelper::OnQueryItem() Caller thread: %4d \n",m_oThreadID );
-#endif
- nsresult rv;
- PRInt32 resultType;
-
- if ( result == NULL ) {
- OSL_TRACE("\tresult ptr is NULL\n");
- return NS_OK;
- }
-
- // Get return status of executeQuery() call.
- rv = result -> GetType(&resultType);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // Check for errors of the executeQuery() call.
- switch ( resultType ) {
- case nsIAbDirectoryQueryResult::queryResultError:
- OSL_TRACE("\tresultType == nsIAbDirectoryQueryResult::queryResultError\n");
- m_bQueryComplete = sal_True;
- m_bErrorCondition = sal_True;
- notifyResultOrComplete();
- return NS_OK;
- case nsIAbDirectoryQueryResult::queryResultStopped:
- OSL_TRACE("\tresultType == nsIAbDirectoryQueryResult::queryResultStopped\n");
- m_bQueryComplete = sal_True;
- notifyResultOrComplete();
- return NS_OK;
- case nsIAbDirectoryQueryResult::queryResultComplete:
- OSL_TRACE("\tresultType == nsIAbDirectoryQueryResult::queryResultComplete\n");
- m_bQueryComplete = sal_True;
- notifyResultOrComplete();
- return NS_OK;
- case nsIAbDirectoryQueryResult::queryResultMatch:
- OSL_TRACE("IN MQueryHelper::OnQueryItem --> queryResultMatch\n");
- // Don't return, continues onto rest of method.
- break;
- default:
- OSL_TRACE("\t******** Unexpected : resultType\n");
- m_bQueryComplete = sal_True;
- return NS_OK;
- }
-
- // Initialise an array that holds the resultset of the query.
- nsCOMPtr<nsISupportsArray> properties;
- rv = result -> GetResult(getter_AddRefs (properties));
- NS_ENSURE_SUCCESS(rv, rv);
-
-
- nsCOMPtr<nsISupports> item;
- rv = properties -> GetElementAt(0, getter_AddRefs(item));
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIAbDirectoryQueryPropertyValue> property(do_QueryInterface(item, &rv));
- NS_ENSURE_SUCCESS(rv, rv);
-
- char *name;
- rv = property -> GetName(&name);
- NS_ENSURE_SUCCESS(rv, rv);
- if ( !strcmp(name,"card:nsIAbCard") )
- {
- nsCOMPtr<nsISupports> cardSupports;
- property->GetValueISupports (getter_AddRefs (cardSupports));
- nsCOMPtr<nsIAbCard> card(do_QueryInterface(cardSupports, &rv));
- NS_ENSURE_SUCCESS(rv, rv);
-
- getCardValues(card);
- }
- nsMemory::Free(name);
-
- OSL_TRACE( "\tOUT MQueryHelper::OnQueryItem()\n" );
-
- notifyResultOrComplete();
-
- return(NS_OK);
-}
-
-// -----------------------------------------------------------------------------
-void MQueryHelper::notifyQueryError()
-{
- m_bQueryComplete = sal_True ;
- notifyResultOrComplete() ;
-}
-
-const char * getAddrURI(const nsIAbDirectory* directory)
-{
- nsresult retCode;
- nsCOMPtr<nsIRDFResource> rdfResource = do_QueryInterface((nsISupports *)directory, &retCode) ;
- if (NS_FAILED(retCode)) { return NULL; }
- const char * uri;
- retCode=rdfResource->GetValueConst(&uri);
- if (NS_FAILED(retCode)) { return NULL; }
- return uri;
- }
-
-#define ENSURE_GETUPDATECARD(x) \
- if (NS_FAILED(retCode)) \
- { \
- OSL_TRACE( x ); \
- return card; \
- }
-static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
-
-//Some address book does not support query uri on card
-//In this case, we can't resync the cards, we just return the old cards
-nsIAbCard * getUpdatedCard( nsIAbCard* card)
-{
- OSL_ENSURE(card != NULL, "getUpdatedCard for NULL");
- nsresult retCode;
- nsCOMPtr<nsIRDFResource> rdfResource = do_QueryInterface((nsISupports *)card, &retCode) ;
- ENSURE_GETUPDATECARD( "IN getUpdatedCard: Card does not support nsIRDFResource\n" );
-
- const char * uri;
- retCode=rdfResource->GetValueConst(&uri);
- ENSURE_GETUPDATECARD( "IN getUpdatedCard: Card does not has a uri\n" );
-
- nsCOMPtr<nsIRDFService> rdfService (do_GetService(kRDFServiceCID, &retCode)) ;
- ENSURE_GETUPDATECARD( "IN getUpdatedCard: Card does not has a uri\n" );
-
- nsCOMPtr<nsIRDFResource> rdfCard;
-
- retCode = rdfService->GetResource(nsDependentCString(uri), getter_AddRefs(rdfCard)) ;
- ENSURE_GETUPDATECARD( "IN getUpdatedCard: Can not get the updated card\n" );
-
- nsCOMPtr<nsIAbCard> aNewCard=do_QueryInterface((nsISupports *)rdfCard, &retCode);
- ENSURE_GETUPDATECARD( "IN getUpdatedCard: Error in get new card\n" );
-
- return aNewCard;
- }
-
-#define ENSURE_MOZAB_PROFILE_NOT_LOOKED(directory) \
- if (getDirectoryType(directory) == SDBCAddress::Mozilla && isProfileLocked(NULL)) \
- { \
- m_aError.setResId( STR_MOZILLA_IS_RUNNIG_NO_CHANGES ); \
- return sal_False; \
- }
-
-sal_Int32 MQueryHelper::commitCard(const sal_Int32 rowIndex,nsIAbDirectory * directory)
-{
- ENSURE_MOZAB_PROFILE_NOT_LOOKED(directory);
-
- MQueryHelperResultEntry *resEntry = getByIndex(rowIndex);
- if (!resEntry)
- {
- return sal_False;
- }
- nsIAbCard *card=resEntry->getCard();
- if (!card)
- {
- return sal_False;
- }
- nsresult rv;
- PRBool hasCard;
- rv = directory->HasCard(card,&hasCard);
- if (setCardValues(rowIndex) != sal_True)
- return sal_False;
-
- if (!NS_FAILED(rv) && hasCard)
- {
- rv = card->EditCardToDatabase(getAddrURI(directory));
- }
- else
- {
- nsIAbCard *addedCard=NULL;
- rv = directory->AddCard(card,&addedCard);
- if (!NS_FAILED(rv))
- resEntry->setCard(addedCard);
- }
- //We return NS_ERROR_FILE_ACCESS_DENIED in the case the mozillaAB has been changed out side of our process
- if (rv == NS_ERROR_FILE_ACCESS_DENIED )
- m_aError.setResId( STR_FOREIGN_PROCESS_CHANGED_AB );
-
- return !(NS_FAILED(rv));
-}
-
-sal_Int32 MQueryHelper::deleteCard(const sal_Int32 rowIndex,nsIAbDirectory * directory)
-{
- ENSURE_MOZAB_PROFILE_NOT_LOOKED(directory);
- MQueryHelperResultEntry *resEntry = getByIndex(rowIndex);
- if (!resEntry)
- {
- return sal_False;
- }
- nsIAbCard *card=resEntry->getCard();
- if (!card)
- {
- return sal_False;
- }
- nsresult rv;
- PRBool hasCard;
- if (resEntry->getRowStates() == RowStates_Inserted)
- {
- rv = 0;
- hasCard = sal_True;
- }
- else
- rv = directory->HasCard(card,&hasCard);
-
- if (!NS_FAILED(rv) && hasCard)
- {
- nsCOMPtr <nsISupportsArray> cardsToDelete;
- rv = NS_NewISupportsArray(getter_AddRefs(cardsToDelete));
- if (NS_SUCCEEDED(rv))
- {
- nsCOMPtr<nsISupports> supports = do_QueryInterface(card, &rv);
- if (NS_SUCCEEDED(rv))
- {
- rv = cardsToDelete->AppendElement(supports);
- if (NS_SUCCEEDED(rv))
- rv = directory->DeleteCards(cardsToDelete);
- }
- }
- }
-
- if (NS_SUCCEEDED(rv))
- resEntry->setRowStates(RowStates_Deleted);
- //We return NS_ERROR_FILE_ACCESS_DENIED in the case the mozillaAB has been changed out side of our process
- if (rv == NS_ERROR_FILE_ACCESS_DENIED )
- m_aError.setResId( STR_FOREIGN_PROCESS_CHANGED_AB );
- return !(NS_FAILED(rv));
-}
-
-sal_Bool MQueryHelper::setCardValues(const sal_Int32 rowIndex)
-{
- MQueryHelperResultEntry *resEntry = getByIndex(rowIndex);
- if (!resEntry)
- {
- m_aError.setResId( STR_CANT_FIND_ROW );
- return sal_False;
- }
- nsIAbCard *card=resEntry->getCard();
- if (!card)
- {
- m_aError.setResId( STR_CANT_FIND_CARD_FOR_ROW );
- return sal_False;
- }
-
- MLdapAttributeMap::fillCardFromResult( *card, *resEntry );
- return sal_True;
-}
-
-void MQueryHelper::getCardValues(nsIAbCard *card,sal_Int32 rowIndex)
-{
- MQueryHelperResultEntry *resEntry;
- if (rowIndex>0)
- {
- resEntry = getByIndex(rowIndex);
- }
- else
- resEntry = new MQueryHelperResultEntry();
-
- MLdapAttributeMap::fillResultFromCard( *resEntry, *card );
- resEntry->setCard(card);
- if (!rowIndex)
- append( resEntry );
-}
-sal_Bool MQueryHelper::resyncRow(sal_Int32 rowIndex)
-{
-
- MQueryHelperResultEntry *resEntry = getByIndex(rowIndex);
- if (!resEntry)
- {
- m_aError.setResId( STR_CANT_FIND_ROW );
- return sal_False;
- }
- nsIAbCard *card=resEntry->getCard();
- card = getUpdatedCard(card);
- getCardValues(card,rowIndex);
- return sal_True;
-}
-// -------------------------------------------------------------------------
-sal_Int32 MQueryHelper::createNewCard()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- nsresult rv;
- nsCOMPtr <nsIAbCard> card = do_CreateInstance(NS_ABCARDPROPERTY_CONTRACTID, &rv);
- //set default values
- getCardValues(card);
- return static_cast<sal_Int32>(m_aResults.size());
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx
deleted file mode 100644
index 3d81453f06..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MAB_QUERYHELPER_HXX_
-#define _CONNECTIVITY_MAB_QUERYHELPER_HXX_
-
-#include <MNSInclude.hxx>
-#include "MErrorResource.hxx"
-#include <sal/types.h>
-#include <rtl/ustring.hxx>
-#include <osl/mutex.hxx>
-#include <osl/conditn.hxx>
-#include <comphelper/stl_types.hxx>
-#include <osl/thread.hxx>
-
-#include <boost/unordered_map.hpp>
-
-namespace connectivity
-{
- namespace mozab
- {
- class MQueryHelperResultEntry
- {
- private:
- typedef ::boost::unordered_map< ::rtl::OString, ::rtl::OUString, ::rtl::OStringHash > FieldMap;
-
- mutable ::osl::Mutex m_aMutex;
- FieldMap m_Fields;
- nsCOMPtr<nsIAbCard> m_Card;
- sal_Int32 m_RowStates;
-
- public:
- MQueryHelperResultEntry();
- ~MQueryHelperResultEntry();
-
- void insert( const rtl::OString &key, rtl::OUString &value );
- rtl::OUString getValue( const rtl::OString &key ) const;
- void setValue( const rtl::OString &key, const rtl::OUString & rValue);
-
- void setCard(nsIAbCard *card);
- nsIAbCard *getCard();
- sal_Bool setRowStates(sal_Int32 state){m_RowStates = state; return sal_True;};
- sal_Int32 getRowStates() const { return m_RowStates;};
- };
-
- class MQueryHelper : public nsIAbDirectoryQueryResultListener
- {
- private:
- typedef std::vector< MQueryHelperResultEntry* > resultsArray;
-
- mutable ::osl::Mutex m_aMutex;
- ::osl::Condition m_aCondition;
- resultsArray m_aResults;
- sal_Int32 m_nIndex;
- sal_Bool m_bHasMore;
- sal_Bool m_bAtEnd;
- sal_Bool m_bErrorCondition;
- sal_Bool m_bQueryComplete;
- ErrorDescriptor m_aError;
-
- void append(MQueryHelperResultEntry* resEnt );
-
- void clear_results();
-
- void clearResultOrComplete();
- void notifyResultOrComplete();
- sal_Bool waitForResultOrComplete( );
- void getCardValues(nsIAbCard *card,sal_Int32 rowIndex=0);
-#if OSL_DEBUG_LEVEL > 0
- oslThreadIdentifier m_oThreadID;
-#endif
-
- public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIABDIRECTORYQUERYRESULTLISTENER
-
- MQueryHelper();
- virtual ~MQueryHelper();
-
- void reset();
- void rewind();
-
- MQueryHelperResultEntry* next( );
-
- MQueryHelperResultEntry* getByIndex( sal_uInt32 nRow );
-
- const ErrorDescriptor& getError() const { return m_aError; }
-
- sal_Bool isError() const;
- sal_Bool hasMore() const;
- sal_Bool atEnd() const;
-
- sal_Bool queryComplete() const;
-
- sal_Bool waitForQueryComplete( );
- sal_Bool waitForRow( sal_Int32 rowNum );
-
- sal_Int32 getResultCount() const;
- sal_uInt32 getRealCount() const;
- sal_Int32 createNewCard(); //return Row count number
- sal_Bool resyncRow(sal_Int32 rowIndex);
-
- void notifyQueryError() ;
- sal_Bool setCardValues(const sal_Int32 rowIndex);
- sal_Int32 commitCard(const sal_Int32 rowIndex, nsIAbDirectory * directory);
- sal_Int32 deleteCard(const sal_Int32 rowIndex, nsIAbDirectory * directory);
- };
- }
-}
-#endif // _CONNECTIVITY_MAB_QUERYHELPER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx
deleted file mode 100644
index 42517f5515..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx
+++ /dev/null
@@ -1,134 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <MNSInclude.hxx>
-#include "MTypeConverter.hxx"
-#include <ucbhelper/content.hxx>
-
-using namespace connectivity::mozab;
-
-// -------------------------------------------------------------------------
-void MTypeConverter::ouStringToNsString(::rtl::OUString const &ous, nsString &nss)
-{
- // Convert to ::rtl::OString (utf-8 encoding).
- ::rtl::OString os(rtl::OUStringToOString(ous, RTL_TEXTENCODING_UTF8));
-
- const char *cs = os.getStr();
- PRUint32 csLen = os.getLength();
-
- NS_ConvertUTF8toUCS2 mozString(cs, csLen);
- //const PRUnichar* uniMozString = (const PRUnichar*) mozString;
- nss = mozString; // temp.
-}
-// -------------------------------------------------------------------------
-::rtl::OUString MTypeConverter::nsACStringToOUString( const nsACString& _source )
-{
- const char* buffer = _source.BeginReading();
- const char* bufferEnd = _source.EndReading();
- return ::rtl::OUString( buffer, static_cast<sal_Int32>(bufferEnd - buffer), RTL_TEXTENCODING_ASCII_US );
-}
-// -------------------------------------------------------------------------
-::rtl::OString MTypeConverter::nsACStringToOString( const nsACString& _source )
-{
- const char* buffer = _source.BeginReading();
- const char* bufferEnd = _source.EndReading();
- return ::rtl::OString( buffer, static_cast<sal_Int32>(bufferEnd - buffer) );
-}
-// -------------------------------------------------------------------------
-void MTypeConverter::asciiOUStringToNsACString( const ::rtl::OUString& _asciiString, nsACString& _dest )
-{
- ::rtl::OString sAsciiVersion( _asciiString.getStr(), _asciiString.getLength(), RTL_TEXTENCODING_ASCII_US );
- asciiToNsACString( sAsciiVersion.getStr(), _dest );
-}
-// -------------------------------------------------------------------------
-void MTypeConverter::asciiToNsACString( const sal_Char* _asciiString, nsACString& _dest )
-{
- _dest.Truncate();
- _dest.AppendASCII( _asciiString );
-}
-// -------------------------------------------------------------------------
-void MTypeConverter::nsStringToOUString(nsString const &nss, ::rtl::OUString &ous)
-{
- // Get clone of buffer.
- PRUnichar *uc = ToNewUnicode(nss);
- sal_Int32 nssLen = nss.Length();
-
- // TODO check if this is ok.
- // PRUnichar != sal_Unicode in mingw
- ::rtl::OUString _ous(reinterpret_cast_mingw_only<sal_Unicode *>(uc), nssLen);
- ous = _ous;
-
- nsMemory::Free(uc);
-}
-// -------------------------------------------------------------------------
-void MTypeConverter::prUnicharToOUString(PRUnichar const *pru, ::rtl::OUString &ous)
-{
- // TODO, specify length.
- // PRUnichar != sal_Unicode in mingw
- ::rtl::OUString _ous(reinterpret_cast_mingw_only<const sal_Unicode *>(pru));
- ous = _ous;
-}
-// -------------------------------------------------------------------------
-char *MTypeConverter::ouStringToCCharStringUtf8(::rtl::OUString const &ous)
-{
- // Convert to ::rtl::OString,
- ::rtl::OString os(rtl::OUStringToOString(ous, RTL_TEXTENCODING_UTF8));
-
- const char *cs = os.getStr();
-
- return(strdup(cs));
-}
-// -------------------------------------------------------------------------
-char *MTypeConverter::ouStringToCCharStringAscii(::rtl::OUString const &ous)
-{
- // Convert ::rtl::OUString to ::rtl::OString,
- ::rtl::OString os(rtl::OUStringToOString(ous, RTL_TEXTENCODING_ASCII_US));
-
- return(strdup(os.getStr()));
-}
-// -------------------------------------------------------------------------
-char *MTypeConverter::nsStringToCCharStringAscii(nsString const &nss)
-{
- char cs[1024];
- nss.ToCString(cs, 1024);
-
- return(strdup(cs));
-}
-// -------------------------------------------------------------------------
-::std::string MTypeConverter::ouStringToStlString(::rtl::OUString const &ous)
-{
- // Convert ::rtl::OUString to ::rtl::OString.
- ::rtl::OString os(rtl::OUStringToOString(ous,RTL_TEXTENCODING_ASCII_US));
- return( ::std::string(os.getStr()));
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.hxx b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.hxx
deleted file mode 100644
index 55c1246d43..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _CONNECTIVITY_MAB_TYPECONVERTER_HXX_
-#define _CONNECTIVITY_MAB_TYPECONVERTER_HXX_
-
-#include <rtl/ustring.hxx>
-
-#include<string>
-
-namespace connectivity
-{
- namespace mozab
- {
- class MTypeConverter
- {
- public:
- static void ouStringToNsString(const ::rtl::OUString&, nsString&);
- static void nsStringToOUString(const nsString&, ::rtl::OUString&);
- static void prUnicharToOUString(const PRUnichar*, ::rtl::OUString&);
- // Use free() for the following 3 calls.
- static char *ouStringToCCharStringAscii(const ::rtl::OUString&);
- static char *nsStringToCCharStringAscii(const nsString&);
- static char *ouStringToCCharStringUtf8(const ::rtl::OUString&);
- // Convert to stl-string.
- static ::std::string ouStringToStlString(const ::rtl::OUString&);
- static ::std::string nsStringToStlString(const nsString&);
-
- static ::rtl::OUString nsACStringToOUString( const nsACString& _source );
- static ::rtl::OString nsACStringToOString( const nsACString& _source );
- static void asciiOUStringToNsACString( const ::rtl::OUString& _asciiString, nsACString& _dest );
- static void asciiToNsACString( const sal_Char* _asciiString, nsACString& _dest );
-
- private:
- MTypeConverter() {};
- };
- }
-}
-
-#endif // _CONNECTIVITY_MAB_TYPECONVERTER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
deleted file mode 100755
index 810be9bcb4..0000000000
--- a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
+++ /dev/null
@@ -1,77 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-CALL_CDECL=TRUE
-
-#mozilla specific stuff.
-MOZ_LIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT)
-MOZ_INC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla
-#End of mozilla specific stuff.
-
-PRJ=..$/..$/..$/..
-PRJINC=..$/..$/..
-PRJNAME=connectivity
-TARGET=mozabsrc
-
-# --- Settings ----------------------------------
-
-USE_DEFFILE=TRUE
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-.INCLUDE : settings.mk
-
-.IF ("$(SYSTEM_MOZILLA)" == "YES" && "$(WITH_MOZILLA)" == "YES") || "$(WITH_MOZILLA)" == "NO"
-dummy:
- @echo " Not building the mozillasrc stuff in LibreOffice build"
- @echo " dependency to Mozilla developer snapshots not feasable at the moment"
- @echo " see http://bugzilla.mozilla.org/show_bug.cgi?id=135137"
-.ELSE
-
-.INCLUDE : $(PRJ)$/version.mk
-
-.INCLUDE : ../makefile_mozab.mk
-
-INCPRE += -I../bootstrap
-
-# --- Files -------------------------------------
-
-SLOFILES = \
- $(SLO)$/MQueryHelper.obj \
- $(SLO)$/MDatabaseMetaDataHelper.obj \
- $(SLO)$/MQuery.obj \
- $(SLO)$/MTypeConverter.obj \
- $(SLO)$/MNameMapper.obj \
- $(SLO)$/MNSMozabProxy.obj \
- $(SLO)$/MNSTerminateListener.obj \
- $(SLO)$/MLdapAttributeMap.obj \
-
-.ENDIF
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/connectivity/source/drivers/mozab/post_include_mozilla.h b/connectivity/source/drivers/mozab/post_include_mozilla.h
deleted file mode 100755
index cf365e1008..0000000000
--- a/connectivity/source/drivers/mozab/post_include_mozilla.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#if defined __SUNPRO_CC
-#pragma enable_warn
-#elif defined _MSC_VER
-#pragma warning(pop)
-#endif
-
-#ifdef MOZ_BOOL
-# undef BOOL
-# undef Bool
-#endif
-
-#ifdef DEBUG_WAS_DEFINED
- #define DEBUG DEBUG_WAS_DEFINED
-#endif
-
-#ifdef _DEBUG_WAS_DEFINED
- #define _DEBUG _DEBUG_WAS_DEFINED
-#endif
-
-#ifndef _CONNECTIVITY_MOZILLA_REINTERPRET_CAST_MINGW_ONLY_
-#define _CONNECTIVITY_MOZILLA_REINTERPRET_CAST_MINGW_ONLY_
-
-#ifdef __cplusplus
-#ifdef __MINGW32__
-template<class T1, class T2> T1 inline reinterpret_cast_mingw_only(T2 p) { return reinterpret_cast<T1>(p); }
-#else
-template<class T1, class T2> T1 inline reinterpret_cast_mingw_only(T2 p) { return p; }
-#endif
-#endif
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mozab/pre_include_mozilla.h b/connectivity/source/drivers/mozab/pre_include_mozilla.h
deleted file mode 100755
index e518d820dc..0000000000
--- a/connectivity/source/drivers/mozab/pre_include_mozilla.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// Turn off DEBUG Assertions
-#ifdef _DEBUG
- #define _DEBUG_WAS_DEFINED _DEBUG
- #ifndef MOZILLA_ENABLE_DEBUG
- #undef _DEBUG
- #endif
-#else
- #undef _DEBUG_WAS_DEFINED
- #ifdef MOZILLA_ENABLE_DEBUG
- #define _DEBUG 1
- #endif
-#endif
-
-// and turn off the additional virtual methods which are part of some interfaces when compiled
-// with debug
-#ifdef DEBUG
- #define DEBUG_WAS_DEFINED DEBUG
- #ifndef MOZILLA_ENABLE_DEBUG
- #undef DEBUG
- #endif
-#else
- #undef DEBUG_WAS_DEFINED
- #ifdef MOZILLA_ENABLE_DEBUG
- #define DEBUG 1
- #endif
-#endif
-
-#if defined __GNUC__
- #pragma GCC system_header
-#elif defined __SUNPRO_CC
- #pragma disable_warn
-#elif defined _MSC_VER
- #pragma warning(push, 1)
- #pragma warning(disable:4946 4710)
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mysql/YCatalog.cxx b/connectivity/source/drivers/mysql/YCatalog.cxx
deleted file mode 100644
index 3aeff3344a..0000000000
--- a/connectivity/source/drivers/mysql/YCatalog.cxx
+++ /dev/null
@@ -1,176 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "mysql/YCatalog.hxx"
-#include "mysql/YUsers.hxx"
-#include "mysql/YTables.hxx"
-#include "mysql/YViews.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <comphelper/types.hxx>
-
-
-// -------------------------------------------------------------------------
-using namespace connectivity;
-using namespace connectivity::mysql;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -------------------------------------------------------------------------
-OMySQLCatalog::OMySQLCatalog(const Reference< XConnection >& _xConnection) : OCatalog(_xConnection)
- ,m_xConnection(_xConnection)
-{
-}
-// -----------------------------------------------------------------------------
-void OMySQLCatalog::refreshObjects(const Sequence< ::rtl::OUString >& _sKindOfObject,TStringVector& _rNames)
-{
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),
- _sKindOfObject);
- fillNames(xResult,_rNames);
-}
-// -------------------------------------------------------------------------
-void OMySQLCatalog::refreshTables()
-{
- TStringVector aVector;
- static const ::rtl::OUString s_sTableTypeView(RTL_CONSTASCII_USTRINGPARAM("VIEW"));
- static const ::rtl::OUString s_sTableTypeTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
- static const ::rtl::OUString s_sAll(RTL_CONSTASCII_USTRINGPARAM("%"));
-
- Sequence< ::rtl::OUString > sTableTypes(3);
- sTableTypes[0] = s_sTableTypeView;
- sTableTypes[1] = s_sTableTypeTable;
- sTableTypes[2] = s_sAll; // just to be sure to include anything else ....
-
- refreshObjects(sTableTypes,aVector);
-
- if ( m_pTables )
- m_pTables->reFill(aVector);
- else
- m_pTables = new OTables(m_xMetaData,*this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void OMySQLCatalog::refreshViews()
-{
- Sequence< ::rtl::OUString > aTypes(1);
- aTypes[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW"));
-
-/*
- sal_Bool bSupportsViews = sal_False;
- try
- {
- Reference<XResultSet> xRes = m_xMetaData->getTableTypes();
- Reference<XRow> xRow(xRes,UNO_QUERY);
- while ( !bSupportsViews && xRow.is() && xRes->next() )
- {
- ::rtl::OUString sTableType( xRow->getString( 1 ) );
- bSupportsViews = sTableType.equalsIgnoreAsciiCase( aTypes[0] );
- }
- }
- catch(const SQLException&)
- {
- }
-*/
- // let's simply assume the server is new enough to support views. Current drivers
- // as of this writing might not return the proper information in getTableTypes, so
- // don't rely on it.
- // during #73245# / 2007-10-26 / frank.schoenheit@sun.com
- bool bSupportsViews = sal_True;
-
- TStringVector aVector;
- if ( bSupportsViews )
- refreshObjects(aTypes,aVector);
-
- if ( m_pViews )
- m_pViews->reFill(aVector);
- else
- m_pViews = new OViews(m_xMetaData,*this,m_aMutex,aVector);
-}
-// -------------------------------------------------------------------------
-void OMySQLCatalog::refreshGroups()
-{
-}
-// -------------------------------------------------------------------------
-void OMySQLCatalog::refreshUsers()
-{
- TStringVector aVector;
- Reference< XStatement > xStmt = m_xConnection->createStatement( );
- Reference< XResultSet > xResult = xStmt->executeQuery(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("select User from mysql.user group by User")));
- if ( xResult.is() )
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- TString2IntMap aMap;
- while( xResult->next() )
- aVector.push_back(xRow->getString(1));
- ::comphelper::disposeComponent(xResult);
- }
- ::comphelper::disposeComponent(xStmt);
-
- if(m_pUsers)
- m_pUsers->reFill(aVector);
- else
- m_pUsers = new OUsers(*this,m_aMutex,aVector,m_xConnection,this);
-}
-// -----------------------------------------------------------------------------
-Any SAL_CALL OMySQLCatalog::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- if ( rType == ::getCppuType((const Reference<XGroupsSupplier>*)0) )
- return Any();
-
-
- return OCatalog::queryInterface(rType);
-}
-// -----------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OMySQLCatalog::getTypes( ) throw(RuntimeException)
-{
- Sequence< Type > aTypes = OCatalog::getTypes();
- ::std::vector<Type> aOwnTypes;
- aOwnTypes.reserve(aTypes.getLength());
- const Type* pBegin = aTypes.getConstArray();
- const Type* pEnd = pBegin + aTypes.getLength();
- for(;pBegin != pEnd;++pBegin)
- {
- if ( !(*pBegin == ::getCppuType((const Reference<XGroupsSupplier>*)0)))
- {
- aOwnTypes.push_back(*pBegin);
- }
- }
- const Type* pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mysql/YColumns.cxx b/connectivity/source/drivers/mysql/YColumns.cxx
deleted file mode 100644
index effe4d3653..0000000000
--- a/connectivity/source/drivers/mysql/YColumns.cxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "mysql/YColumns.hxx"
-#include "TConnection.hxx"
-
-
-using namespace ::comphelper;
-using namespace connectivity::mysql;
-using namespace connectivity::sdbcx;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-OMySQLColumns::OMySQLColumns( ::cppu::OWeakObject& _rParent
- ,sal_Bool _bCase
- ,::osl::Mutex& _rMutex
- ,const TStringVector &_rVector
- ,sal_Bool _bUseHardRef
- ) : OColumnsHelper(_rParent,_bCase,_rMutex,_rVector,_bUseHardRef)
-{
-}
-// -----------------------------------------------------------------------------
-Reference< XPropertySet > OMySQLColumns::createDescriptor()
-{
- return new OMySQLColumn(sal_True);
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-OMySQLColumn::OMySQLColumn( sal_Bool _bCase)
- : connectivity::sdbcx::OColumn( _bCase )
-{
- construct();
-}
-// -------------------------------------------------------------------------
-void OMySQLColumn::construct()
-{
- m_sAutoIncrement = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("auto_increment"));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION),PROPERTY_ID_AUTOINCREMENTCREATION,0,&m_sAutoIncrement, ::getCppuType(&m_sAutoIncrement));
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OMySQLColumn::createArrayHelper( sal_Int32 /*_nId*/ ) const
-{
- return doCreateArrayHelper();
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & SAL_CALL OMySQLColumn::getInfoHelper()
-{
- return *OMySQLColumn_PROP::getArrayHelper(isNew() ? 1 : 0);
-}
-// -----------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL OMySQLColumn::getSupportedServiceNames( ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(1);
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Column"));
-
- return aSupported;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mysql/YDriver.cxx b/connectivity/source/drivers/mysql/YDriver.cxx
deleted file mode 100644
index 40b1e171a2..0000000000
--- a/connectivity/source/drivers/mysql/YDriver.cxx
+++ /dev/null
@@ -1,484 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "mysql/YDriver.hxx"
-#include "mysql/YCatalog.hxx"
-#include <osl/diagnose.h>
-#include <comphelper/namedvaluecollection.hxx>
-#include "connectivity/dbexception.hxx"
-#include <connectivity/dbcharset.hxx>
-#include <com/sun/star/sdbc/XDriverAccess.hpp>
-#include "TConnection.hxx"
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
- using namespace mysql;
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::sdbcx;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::lang;
-
- namespace mysql
- {
- Reference< XInterface > SAL_CALL ODriverDelegator_CreateInstance(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFac) throw( Exception )
- {
- return *(new ODriverDelegator(_rxFac));
- }
- }
-
-
- //====================================================================
- //= ODriverDelegator
- //====================================================================
- //--------------------------------------------------------------------
- ODriverDelegator::ODriverDelegator(const Reference< XMultiServiceFactory >& _rxFactory)
- : ODriverDelegator_BASE(m_aMutex)
- ,m_xFactory(_rxFactory)
- ,m_eDriverType(D_ODBC)
- {
- }
-
- //--------------------------------------------------------------------
- ODriverDelegator::~ODriverDelegator()
- {
- try
- {
- ::comphelper::disposeComponent(m_xODBCDriver);
- ::comphelper::disposeComponent(m_xNativeDriver);
- TJDBCDrivers::iterator aIter = m_aJdbcDrivers.begin();
- TJDBCDrivers::iterator aEnd = m_aJdbcDrivers.end();
- for ( ;aIter != aEnd;++aIter )
- ::comphelper::disposeComponent(aIter->second);
- }
- catch(const Exception&)
- {
- }
- }
-
- // --------------------------------------------------------------------------------
- void ODriverDelegator::disposing()
- {
- ::osl::MutexGuard aGuard(m_aMutex);
-
-
- for (TWeakPairVector::iterator i = m_aConnections.begin(); m_aConnections.end() != i; ++i)
- {
- Reference<XInterface > xTemp = i->first.get();
- ::comphelper::disposeComponent(xTemp);
- }
- m_aConnections.clear();
- TWeakPairVector().swap(m_aConnections);
-
- ODriverDelegator_BASE::disposing();
- }
-
- namespace
- {
- sal_Bool isOdbcUrl(const ::rtl::OUString& _sUrl)
- {
- return _sUrl.copy(0,16).equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sdbc:mysql:odbc:"));
- }
- //--------------------------------------------------------------------
- sal_Bool isNativeUrl(const ::rtl::OUString& _sUrl)
- {
- return (!_sUrl.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:mysql:mysqlc:")), sizeof("sdbc:mysql:mysqlc:")-1));
- }
- //--------------------------------------------------------------------
- T_DRIVERTYPE lcl_getDriverType(const ::rtl::OUString& _sUrl)
- {
- T_DRIVERTYPE eRet = D_JDBC;
- if ( isOdbcUrl(_sUrl ) )
- eRet = D_ODBC;
- else if ( isNativeUrl(_sUrl ) )
- eRet = D_NATIVE;
- return eRet;
- }
- //--------------------------------------------------------------------
- ::rtl::OUString transformUrl(const ::rtl::OUString& _sUrl)
- {
- ::rtl::OUString sNewUrl = _sUrl.copy(11);
- if ( isOdbcUrl( _sUrl ) )
- sNewUrl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:")) + sNewUrl;
- else if ( isNativeUrl( _sUrl ) )
- sNewUrl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:")) + sNewUrl;
- else
- {
- sNewUrl = sNewUrl.copy(5);
-
- ::rtl::OUString sTempUrl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("jdbc:mysql://"));
-
- sTempUrl += sNewUrl;
- sNewUrl = sTempUrl;
- }
- return sNewUrl;
- }
- //--------------------------------------------------------------------
- Reference< XDriver > lcl_loadDriver(const Reference< XMultiServiceFactory >& _rxFactory,const ::rtl::OUString& _sUrl)
- {
- Reference<XDriverAccess> xDriverAccess(_rxFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.DriverManager")) ),UNO_QUERY);
- OSL_ENSURE(xDriverAccess.is(),"Could not load driver manager!");
- Reference< XDriver > xDriver;
- if ( xDriverAccess.is() )
- xDriver = xDriverAccess->getDriverByURL(_sUrl);
- return xDriver;
- }
- //--------------------------------------------------------------------
- Sequence< PropertyValue > lcl_convertProperties(T_DRIVERTYPE _eType,const Sequence< PropertyValue >& info,const ::rtl::OUString& _sUrl)
- {
- ::std::vector<PropertyValue> aProps;
- const PropertyValue* pSupported = info.getConstArray();
- const PropertyValue* pEnd = pSupported + info.getLength();
-
- aProps.reserve(info.getLength() + 5);
- for (;pSupported != pEnd; ++pSupported)
- {
- aProps.push_back( *pSupported );
- }
-
- if ( _eType == D_ODBC )
- {
- aProps.push_back( PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Silent"))
- ,0
- ,makeAny(sal_True)
- ,PropertyState_DIRECT_VALUE) );
- aProps.push_back( PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreventGetVersionColumns"))
- ,0
- ,makeAny(sal_True)
- ,PropertyState_DIRECT_VALUE) );
- }
- else if ( _eType == D_JDBC )
- {
- aProps.push_back( PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClass"))
- ,0
- ,makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.mysql.jdbc.Driver")))
- ,PropertyState_DIRECT_VALUE) );
- }
- else
- {
- aProps.push_back( PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PublicConnectionURL"))
- ,0
- ,makeAny(_sUrl)
- ,PropertyState_DIRECT_VALUE) );
- }
- aProps.push_back( PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsAutoRetrievingEnabled"))
- ,0
- ,makeAny(sal_True)
- ,PropertyState_DIRECT_VALUE) );
- aProps.push_back( PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoRetrievingStatement"))
- ,0
- ,makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT LAST_INSERT_ID()")))
- ,PropertyState_DIRECT_VALUE) );
- aProps.push_back( PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParameterNameSubstitution"))
- ,0
- ,makeAny(sal_True)
- ,PropertyState_DIRECT_VALUE) );
- PropertyValue* pProps = aProps.empty() ? 0 : &aProps[0];
- return Sequence< PropertyValue >(pProps, aProps.size());
- }
- }
- //--------------------------------------------------------------------
- Reference< XDriver > ODriverDelegator::loadDriver( const ::rtl::OUString& url, const Sequence< PropertyValue >& info )
- {
- Reference< XDriver > xDriver;
- const ::rtl::OUString sCuttedUrl = transformUrl(url);
- const T_DRIVERTYPE eType = lcl_getDriverType( url );
- if ( eType == D_ODBC )
- {
- if ( !m_xODBCDriver.is() )
- m_xODBCDriver = lcl_loadDriver(m_xFactory,sCuttedUrl);
- xDriver = m_xODBCDriver;
- } // if ( bIsODBC )
- else if ( eType == D_NATIVE )
- {
- if ( !m_xNativeDriver.is() )
- m_xNativeDriver = lcl_loadDriver(m_xFactory,sCuttedUrl);
- xDriver = m_xNativeDriver;
- }
- else
- {
- ::comphelper::NamedValueCollection aSettings( info );
- ::rtl::OUString sDriverClass(RTL_CONSTASCII_USTRINGPARAM("com.mysql.jdbc.Driver"));
- sDriverClass = aSettings.getOrDefault( "JavaDriverClass", sDriverClass );
-
- TJDBCDrivers::iterator aFind = m_aJdbcDrivers.find(sDriverClass);
- if ( aFind == m_aJdbcDrivers.end() )
- aFind = m_aJdbcDrivers.insert(TJDBCDrivers::value_type(sDriverClass,lcl_loadDriver(m_xFactory,sCuttedUrl))).first;
- xDriver = aFind->second;
- }
-
- return xDriver;
- }
-
- //--------------------------------------------------------------------
- Reference< XConnection > SAL_CALL ODriverDelegator::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw (SQLException, RuntimeException)
- {
- Reference< XConnection > xConnection;
- if ( acceptsURL(url) )
- {
- Reference< XDriver > xDriver;
- xDriver = loadDriver(url,info);
- if ( xDriver.is() )
- {
- ::rtl::OUString sCuttedUrl = transformUrl(url);
- const T_DRIVERTYPE eType = lcl_getDriverType( url );
- Sequence< PropertyValue > aConvertedProperties = lcl_convertProperties(eType,info,url);
- if ( eType == D_JDBC )
- {
- ::comphelper::NamedValueCollection aSettings( info );
- ::rtl::OUString sIanaName = aSettings.getOrDefault( "CharSet", ::rtl::OUString() );
- if ( sIanaName.getLength() )
- {
- ::dbtools::OCharsetMap aLookupIanaName;
- ::dbtools::OCharsetMap::const_iterator aLookup = aLookupIanaName.find(sIanaName, ::dbtools::OCharsetMap::IANA());
- if (aLookup != aLookupIanaName.end() )
- {
- ::rtl::OUString sAdd;
- if ( RTL_TEXTENCODING_UTF8 == (*aLookup).getEncoding() )
- {
- static const ::rtl::OUString s_sCharSetOp(RTL_CONSTASCII_USTRINGPARAM("useUnicode=true&"));
- if ( !sCuttedUrl.matchIgnoreAsciiCase(s_sCharSetOp) )
- {
- sAdd = s_sCharSetOp;
- } // if ( !sCuttedUrl.matchIgnoreAsciiCase(s_sCharSetOp) )
- } // if ( RTL_TEXTENCODING_UTF8 == (*aLookup).getEncoding() )
- if ( sCuttedUrl.indexOf('?') == -1 )
- sCuttedUrl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("?"));
- else
- sCuttedUrl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("&"));
- sCuttedUrl += sAdd;
- sCuttedUrl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("characterEncoding="));
- sCuttedUrl += sIanaName;
- }
- }
- } // if ( !bIsODBC )
-
- xConnection = xDriver->connect( sCuttedUrl, aConvertedProperties );
- if ( xConnection.is() )
- {
- OMetaConnection* pMetaConnection = NULL;
- // now we have to set the URL to get the correct answer for metadata()->getURL()
- Reference< XUnoTunnel> xTunnel(xConnection,UNO_QUERY);
- if ( xTunnel.is() )
- {
- pMetaConnection = reinterpret_cast<OMetaConnection*>(xTunnel->getSomething( OMetaConnection::getUnoTunnelImplementationId() ));
- if ( pMetaConnection )
- pMetaConnection->setURL(url);
- }
- m_aConnections.push_back(TWeakPair(WeakReferenceHelper(xConnection),TWeakConnectionPair(WeakReferenceHelper(),pMetaConnection)));
- }
- }
- }
- return xConnection;
- }
-
- //--------------------------------------------------------------------
- sal_Bool SAL_CALL ODriverDelegator::acceptsURL( const ::rtl::OUString& url ) throw (SQLException, RuntimeException)
- {
- Sequence< PropertyValue > info;
-
- sal_Bool bOK = url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:odbc:" ) )
- || url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:jdbc:" ) )
- || ( url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:mysqlc:" ) )
- && loadDriver( url, info ).is()
- );
- return bOK;
- }
-
- //--------------------------------------------------------------------
- Sequence< DriverPropertyInfo > SAL_CALL ODriverDelegator::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw (SQLException, RuntimeException)
- {
- ::std::vector< DriverPropertyInfo > aDriverInfo;
- if ( !acceptsURL(url) )
- return Sequence< DriverPropertyInfo >();
-
- Sequence< ::rtl::OUString > aBoolean(2);
- aBoolean[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"));
- aBoolean[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1"));
-
-
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet of the database."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SuppressVersionColumns"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Display version columns (when available)."))
- ,sal_False
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0"))
- ,aBoolean)
- );
- const T_DRIVERTYPE eType = lcl_getDriverType( url );
- if ( eType == D_JDBC )
- {
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClass"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The JDBC driver class name."))
- ,sal_True
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.mysql.jdbc.Driver"))
- ,Sequence< ::rtl::OUString >())
- );
- }
-
- return Sequence< DriverPropertyInfo >(&aDriverInfo[0],aDriverInfo.size());
- }
-
- //--------------------------------------------------------------------
- sal_Int32 SAL_CALL ODriverDelegator::getMajorVersion( ) throw (RuntimeException)
- {
- return 1;
- }
-
- //--------------------------------------------------------------------
- sal_Int32 SAL_CALL ODriverDelegator::getMinorVersion( ) throw (RuntimeException)
- {
- return 0;
- }
-
- //--------------------------------------------------------------------
- Reference< XTablesSupplier > SAL_CALL ODriverDelegator::getDataDefinitionByConnection( const Reference< XConnection >& connection ) throw (SQLException, RuntimeException)
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(ODriverDelegator_BASE::rBHelper.bDisposed);
-
- Reference< XTablesSupplier > xTab;
- Reference< XUnoTunnel> xTunnel(connection,UNO_QUERY);
- if ( xTunnel.is() )
- {
- OMetaConnection* pConnection = reinterpret_cast<OMetaConnection*>(xTunnel->getSomething( OMetaConnection::getUnoTunnelImplementationId() ));
- if ( pConnection )
- {
- TWeakPairVector::iterator aEnd = m_aConnections.end();
- for (TWeakPairVector::iterator i = m_aConnections.begin(); aEnd != i; ++i)
- {
- if ( i->second.second == pConnection )
- {
- xTab = Reference< XTablesSupplier >(i->second.first.get().get(),UNO_QUERY);
- if ( !xTab.is() )
- {
- xTab = new OMySQLCatalog(connection);
- i->second.first = WeakReferenceHelper(xTab);
- }
- break;
- }
- }
- }
- } // if ( xTunnel.is() )
- if ( !xTab.is() )
- {
- TWeakPairVector::iterator aEnd = m_aConnections.end();
- for (TWeakPairVector::iterator i = m_aConnections.begin(); aEnd != i; ++i)
- {
- Reference< XConnection > xTemp(i->first.get(),UNO_QUERY);
- if ( xTemp == connection )
- {
- xTab = Reference< XTablesSupplier >(i->second.first.get().get(),UNO_QUERY);
- if ( !xTab.is() )
- {
- xTab = new OMySQLCatalog(connection);
- i->second.first = WeakReferenceHelper(xTab);
- }
- break;
- }
- }
- }
- return xTab;
- }
-
- //--------------------------------------------------------------------
- Reference< XTablesSupplier > SAL_CALL ODriverDelegator::getDataDefinitionByURL( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw (SQLException, RuntimeException)
- {
- if ( ! acceptsURL(url) )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- } // if ( ! acceptsURL(url) )
-
- return getDataDefinitionByConnection(connect(url,info));
- }
-
- // XServiceInfo
- // --------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- rtl::OUString ODriverDelegator::getImplementationName_Static( ) throw(RuntimeException)
- {
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.drivers.MySQL.Driver"));
- }
- //------------------------------------------------------------------------------
- Sequence< ::rtl::OUString > ODriverDelegator::getSupportedServiceNames_Static( ) throw (RuntimeException)
- {
- Sequence< ::rtl::OUString > aSNS( 2 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"));
- aSNS[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Driver"));
- return aSNS;
- }
- //------------------------------------------------------------------
- ::rtl::OUString SAL_CALL ODriverDelegator::getImplementationName( ) throw(RuntimeException)
- {
- return getImplementationName_Static();
- }
-
- //------------------------------------------------------------------
- sal_Bool SAL_CALL ODriverDelegator::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
- {
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
- }
- //------------------------------------------------------------------
- Sequence< ::rtl::OUString > SAL_CALL ODriverDelegator::getSupportedServiceNames( ) throw(RuntimeException)
- {
- return getSupportedServiceNames_Static();
- }
- //------------------------------------------------------------------
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mysql/YTable.cxx b/connectivity/source/drivers/mysql/YTable.cxx
deleted file mode 100644
index a9c97aaeea..0000000000
--- a/connectivity/source/drivers/mysql/YTable.cxx
+++ /dev/null
@@ -1,387 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "mysql/YTable.hxx"
-#include "mysql/YTables.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <comphelper/property.hxx>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "connectivity/TKeys.hxx"
-#include "connectivity/TIndexes.hxx"
-#include "connectivity/TColumnsHelper.hxx"
-#include "mysql/YCatalog.hxx"
-#include "mysql/YColumns.hxx"
-#include "TConnection.hxx"
-
-
-using namespace ::comphelper;
-using namespace connectivity::mysql;
-using namespace connectivity::sdbcx;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-namespace connectivity
-{
- namespace mysql
- {
- class OMySQLKeysHelper : public OKeysHelper
- {
- protected:
- // -----------------------------------------------------------------------------
- virtual ::rtl::OUString getDropForeignKey() const
- {
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP FOREIGN KEY "));
- }
- public:
- OMySQLKeysHelper( OTableHelper* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector& _rVector
- ) : OKeysHelper(_pTable,_rMutex,_rVector){}
-
- };
- }
-}
-
-OMySQLTable::OMySQLTable( sdbcx::OCollection* _pTables,
- const Reference< XConnection >& _xConnection)
- :OTableHelper(_pTables,_xConnection,sal_True)
-{
- // we create a new table here, so we should have all the rights or ;-)
- m_nPrivileges = Privilege::DROP |
- Privilege::REFERENCE |
- Privilege::ALTER |
- Privilege::CREATE |
- Privilege::READ |
- Privilege::DELETE |
- Privilege::UPDATE |
- Privilege::INSERT |
- Privilege::SELECT;
- construct();
-}
-// -------------------------------------------------------------------------
-OMySQLTable::OMySQLTable( sdbcx::OCollection* _pTables,
- const Reference< XConnection >& _xConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description ,
- const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName,
- sal_Int32 _nPrivileges
- ) : OTableHelper( _pTables,
- _xConnection,
- sal_True,
- _Name,
- _Type,
- _Description,
- _SchemaName,
- _CatalogName)
- , m_nPrivileges(_nPrivileges)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-void OMySQLTable::construct()
-{
- OTableHelper::construct();
- if ( !isNew() )
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRIVILEGES), PROPERTY_ID_PRIVILEGES,PropertyAttribute::READONLY,&m_nPrivileges, ::getCppuType(&m_nPrivileges));
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OMySQLTable::createArrayHelper( sal_Int32 /*_nId*/ ) const
-{
- return doCreateArrayHelper();
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OMySQLTable::getInfoHelper()
-{
- return *static_cast<OMySQLTable_PROP*>(const_cast<OMySQLTable*>(this))->getArrayHelper(isNew() ? 1 : 0);
-}
-// -----------------------------------------------------------------------------
-sdbcx::OCollection* OMySQLTable::createColumns(const TStringVector& _rNames)
-{
- OMySQLColumns* pColumns = new OMySQLColumns(*this,sal_True,m_aMutex,_rNames);
- pColumns->setParent(this);
- return pColumns;
-}
-// -----------------------------------------------------------------------------
-sdbcx::OCollection* OMySQLTable::createKeys(const TStringVector& _rNames)
-{
- return new OMySQLKeysHelper(this,m_aMutex,_rNames);
-}
-// -----------------------------------------------------------------------------
-sdbcx::OCollection* OMySQLTable::createIndexes(const TStringVector& _rNames)
-{
- return new OIndexesHelper(this,m_aMutex,_rNames);
-}
-//--------------------------------------------------------------------------
-Sequence< sal_Int8 > OMySQLTable::getUnoTunnelImplementationId()
-{
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
-}
-
-// com::sun::star::lang::XUnoTunnel
-//------------------------------------------------------------------
-sal_Int64 OMySQLTable::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException)
-{
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : OTable_TYPEDEF::getSomething(rId);
-}
-// -------------------------------------------------------------------------
-// XAlterTable
-void SAL_CALL OMySQLTable::alterColumnByName( const ::rtl::OUString& colName, const Reference< XPropertySet >& descriptor ) throw(SQLException, NoSuchElementException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(
-#ifdef GCC
- ::connectivity::sdbcx::OTableDescriptor_BASE::rBHelper.bDisposed
-#else
- rBHelper.bDisposed
-#endif
- );
-
- if ( m_pColumns && !m_pColumns->hasByName(colName) )
- throw NoSuchElementException(colName,*this);
-
-
- if ( !isNew() )
- {
- // first we have to check what should be altered
- Reference<XPropertySet> xProp;
- m_pColumns->getByName(colName) >>= xProp;
- // first check the types
- sal_Int32 nOldType = 0,nNewType = 0,nOldPrec = 0,nNewPrec = 0,nOldScale = 0,nNewScale = 0;
-
- ::dbtools::OPropertyMap& rProp = OMetaConnection::getPropMap();
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_TYPE)) >>= nOldType;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_TYPE)) >>= nNewType;
- // and precsions and scale
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_PRECISION)) >>= nOldPrec;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_PRECISION))>>= nNewPrec;
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_SCALE)) >>= nOldScale;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_SCALE)) >>= nNewScale;
- // second: check the "is nullable" value
- sal_Int32 nOldNullable = 0,nNewNullable = 0;
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISNULLABLE)) >>= nOldNullable;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISNULLABLE)) >>= nNewNullable;
-
- // check also the auto_increment
- sal_Bool bOldAutoIncrement = sal_False,bAutoIncrement = sal_False;
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bOldAutoIncrement;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bAutoIncrement;
- bool bColumnNameChanged = false;
- ::rtl::OUString sOldDesc,sNewDesc;
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_DESCRIPTION)) >>= sOldDesc;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_DESCRIPTION)) >>= sNewDesc;
-
- if ( nOldType != nNewType
- || nOldPrec != nNewPrec
- || nOldScale != nNewScale
- || nNewNullable != nOldNullable
- || bOldAutoIncrement != bAutoIncrement
- || sOldDesc != sNewDesc )
- {
- // special handling because they change dthe type names to distinguish
- // if a column should be an auto_incmrement one
- if ( bOldAutoIncrement != bAutoIncrement )
- {
- ::rtl::OUString sTypeName;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_TYPENAME)) >>= sTypeName;
-
- static ::rtl::OUString s_sAutoIncrement(RTL_CONSTASCII_USTRINGPARAM("auto_increment"));
- if ( bAutoIncrement )
- {
- if ( sTypeName.indexOf(s_sAutoIncrement) == -1 )
- {
- sTypeName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
- sTypeName += s_sAutoIncrement;
- }
- }
- else
- {
- sal_Int32 nIndex = 0;
- if ( sTypeName.getLength() && (nIndex = sTypeName.indexOf(s_sAutoIncrement)) != -1 )
- {
- sTypeName = sTypeName.copy(0,nIndex);
- descriptor->setPropertyValue(rProp.getNameByIndex(PROPERTY_ID_TYPENAME),makeAny(sTypeName));
- }
- }
- }
- alterColumnType(nNewType,colName,descriptor);
- bColumnNameChanged = true;
- }
-
- // third: check the default values
- ::rtl::OUString sNewDefault,sOldDefault;
- xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_DEFAULTVALUE)) >>= sOldDefault;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_DEFAULTVALUE)) >>= sNewDefault;
-
- if(sOldDefault.getLength())
- {
- dropDefaultValue(colName);
- if(sNewDefault.getLength() && sOldDefault != sNewDefault)
- alterDefaultValue(sNewDefault,colName);
- }
- else if(!sOldDefault.getLength() && sNewDefault.getLength())
- alterDefaultValue(sNewDefault,colName);
-
- // now we should look if the name of the column changed
- ::rtl::OUString sNewColumnName;
- descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_NAME)) >>= sNewColumnName;
- if ( !sNewColumnName.equalsIgnoreAsciiCase(colName) && !bColumnNameChanged )
- {
- ::rtl::OUString sSql = getAlterTableColumnPart();
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" CHANGE "));
- const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- sSql += ::dbtools::quoteName(sQuote,colName);
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
- sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(descriptor,getConnection(),static_cast<OTables*>(m_pTables),getTypeCreatePattern()));
- executeStatement(sSql);
- }
- m_pColumns->refresh();
- }
- else
- {
- if(m_pColumns)
- {
- m_pColumns->dropByName(colName);
- m_pColumns->appendByDescriptor(descriptor);
- }
- }
-
-}
-// -----------------------------------------------------------------------------
-void OMySQLTable::alterColumnType(sal_Int32 nNewType,const ::rtl::OUString& _rColName, const Reference<XPropertySet>& _xDescriptor)
-{
- ::rtl::OUString sSql = getAlterTableColumnPart();
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" CHANGE "));
- const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- sSql += ::dbtools::quoteName(sQuote,_rColName);
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
-
- OColumn* pColumn = new OColumn(sal_True);
- Reference<XPropertySet> xProp = pColumn;
- ::comphelper::copyProperties(_xDescriptor,xProp);
- xProp->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE),makeAny(nNewType));
-
- sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(xProp,getConnection(),static_cast<OTables*>(m_pTables),getTypeCreatePattern()));
- executeStatement(sSql);
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OMySQLTable::getTypeCreatePattern() const
-{
- static const ::rtl::OUString s_sCreatePattern(RTL_CONSTASCII_USTRINGPARAM("(M,D)"));
- return s_sCreatePattern;
-}
-// -----------------------------------------------------------------------------
-void OMySQLTable::alterDefaultValue(const ::rtl::OUString& _sNewDefault,const ::rtl::OUString& _rColName)
-{
- ::rtl::OUString sSql = getAlterTableColumnPart();
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ALTER "));
-
- const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- sSql += ::dbtools::quoteName(sQuote,_rColName);
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" SET DEFAULT '")) + _sNewDefault;
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
-
- executeStatement(sSql);
-}
-// -----------------------------------------------------------------------------
-void OMySQLTable::dropDefaultValue(const ::rtl::OUString& _rColName)
-{
- ::rtl::OUString sSql = getAlterTableColumnPart();
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ALTER "));
-
- const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- sSql += ::dbtools::quoteName(sQuote,_rColName);
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP DEFAULT"));
-
- executeStatement(sSql);
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OMySQLTable::getAlterTableColumnPart()
-{
- ::rtl::OUString sSql( RTL_CONSTASCII_USTRINGPARAM( "ALTER TABLE " ));
- const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
-
- ::rtl::OUString sComposedName(
- ::dbtools::composeTableName( getMetaData(), m_CatalogName, m_SchemaName, m_Name, sal_True, ::dbtools::eInTableDefinitions ) );
- sSql += sComposedName;
-
- return sSql;
-}
-// -----------------------------------------------------------------------------
-void OMySQLTable::executeStatement(const ::rtl::OUString& _rStatement )
-{
- ::rtl::OUString sSQL = _rStatement;
- if(sSQL.lastIndexOf(',') == (sSQL.getLength()-1))
- sSQL = sSQL.replaceAt(sSQL.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
-
- Reference< XStatement > xStmt = getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(sSQL);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OMySQLTable::getRenameStart() const
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RENAME TABLE "));
-}
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx
deleted file mode 100644
index aac4f5c3f3..0000000000
--- a/connectivity/source/drivers/mysql/YTables.cxx
+++ /dev/null
@@ -1,246 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "mysql/YTables.hxx"
-#include "mysql/YViews.hxx"
-#include "mysql/YTable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include "mysql/YCatalog.hxx"
-#include <comphelper/extract.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include <cppuhelper/interfacecontainer.h>
-#include <comphelper/types.hxx>
-#include "TConnection.hxx"
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace ::cppu;
-using namespace connectivity::mysql;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace dbtools;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OTables::createObject(const ::rtl::OUString& _rName)
-{
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(m_xMetaData,_rName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
-
- static const ::rtl::OUString s_sTableTypeView(RTL_CONSTASCII_USTRINGPARAM("VIEW"));
- static const ::rtl::OUString s_sTableTypeTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
- static const ::rtl::OUString s_sAll(RTL_CONSTASCII_USTRINGPARAM("%"));
-
- Sequence< ::rtl::OUString > sTableTypes(3);
- sTableTypes[0] = s_sTableTypeView;
- sTableTypes[1] = s_sTableTypeTable;
- sTableTypes[2] = s_sAll; // just to be sure to include anything else ....
-
- Any aCatalog;
- if ( sCatalog.getLength() )
- aCatalog <<= sCatalog;
- Reference< XResultSet > xResult = m_xMetaData->getTables(aCatalog,sSchema,sTable,sTableTypes);
-
- sdbcx::ObjectType xRet = NULL;
- if ( xResult.is() )
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- if ( xResult->next() ) // there can be only one table with this name
- {
-// Reference<XStatement> xStmt = m_xConnection->createStatement();
-// if ( xStmt.is() )
-// {
-// Reference< XResultSet > xPrivRes = xStmt->executeQuery();
-// Reference< XRow > xPrivRow(xPrivRes,UNO_QUERY);
-// while ( xPrivRes.is() && xPrivRes->next() )
-// {
-// if ( xPrivRow->getString(1) )
-// {
-// }
-// }
-// }
- sal_Int32 nPrivileges = Privilege::DROP |
- Privilege::REFERENCE |
- Privilege::ALTER |
- Privilege::CREATE |
- Privilege::READ |
- Privilege::DELETE |
- Privilege::UPDATE |
- Privilege::INSERT |
- Privilege::SELECT;
-
- OMySQLTable* pRet = new OMySQLTable( this
- ,static_cast<OMySQLCatalog&>(m_rParent).getConnection()
- ,sTable
- ,xRow->getString(4)
- ,xRow->getString(5)
- ,sSchema
- ,sCatalog
- ,nPrivileges);
- xRet = pRet;
- }
- ::comphelper::disposeComponent(xResult);
- }
-
- return xRet;
-}
-// -------------------------------------------------------------------------
-void OTables::impl_refresh( ) throw(RuntimeException)
-{
- static_cast<OMySQLCatalog&>(m_rParent).refreshTables();
-}
-// -------------------------------------------------------------------------
-void OTables::disposing(void)
-{
-m_xMetaData.clear();
- OCollection::disposing();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OTables::createDescriptor()
-{
- return new OMySQLTable(this,static_cast<OMySQLCatalog&>(m_rParent).getConnection());
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OTables::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- createTable(descriptor);
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OTables::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName)
-{
- Reference< XInterface > xObject( getObject( _nPos ) );
- sal_Bool bIsNew = connectivity::sdbcx::ODescriptor::isNew( xObject );
- if (!bIsNew)
- {
- Reference< XConnection > xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection();
-
-
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(m_xMetaData,_sElementName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
-
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "DROP " ));
-
- Reference<XPropertySet> xProp(xObject,UNO_QUERY);
- sal_Bool bIsView = xProp.is() && ::comphelper::getString(xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))) == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW"));
- if(bIsView) // here we have a view
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW "));
- else
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE "));
-
- ::rtl::OUString sComposedName(
- ::dbtools::composeTableName( m_xMetaData, sCatalog, sSchema, sTable, sal_True, ::dbtools::eInDataManipulation ) );
- aSql += sComposedName;
- Reference< XStatement > xStmt = xConnection->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
- // if no exception was thrown we must delete it from the views
- if ( bIsView )
- {
- OViews* pViews = static_cast<OViews*>(static_cast<OMySQLCatalog&>(m_rParent).getPrivateViews());
- if ( pViews && pViews->hasByName(_sElementName) )
- pViews->dropByNameImpl(_sElementName);
- }
- }
-}
-// -------------------------------------------------------------------------
-::rtl::OUString OTables::adjustSQL(const ::rtl::OUString& _sSql)
-{
- ::rtl::OUString sSQL = _sSql;
- static const ::rtl::OUString s_sUNSIGNED(RTL_CONSTASCII_USTRINGPARAM("UNSIGNED"));
- sal_Int32 nIndex = sSQL.indexOf(s_sUNSIGNED);
- while(nIndex != -1 )
- {
- sal_Int32 nParen = sSQL.indexOf(')',nIndex);
- sal_Int32 nPos = nIndex + s_sUNSIGNED.getLength();
- ::rtl::OUString sNewUnsigned( sSQL.copy(nPos,nParen - nPos + 1));
- sSQL = sSQL.replaceAt(nIndex,s_sUNSIGNED.getLength()+sNewUnsigned.getLength(),sNewUnsigned + s_sUNSIGNED);
- nIndex = sSQL.indexOf(s_sUNSIGNED,nIndex + s_sUNSIGNED.getLength()+sNewUnsigned.getLength());
- }
- return sSQL;
-}
-// -------------------------------------------------------------------------
-void OTables::createTable( const Reference< XPropertySet >& descriptor )
-{
- const Reference< XConnection > xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection();
- static const ::rtl::OUString s_sCreatePattern(RTL_CONSTASCII_USTRINGPARAM("(M,D)"));
- const ::rtl::OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection,this,s_sCreatePattern));
- Reference< XStatement > xStmt = xConnection->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-void OTables::appendNew(const ::rtl::OUString& _rsNewTable)
-{
- insertElement(_rsNewTable,NULL);
-
- // notify our container listeners
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rsNewTable), Any(), Any());
- OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
- while (aListenerLoop.hasMoreElements())
- static_cast<XContainerListener*>(aListenerLoop.next())->elementInserted(aEvent);
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OTables::getNameForObject(const sdbcx::ObjectType& _xObject)
-{
- OSL_ENSURE(_xObject.is(),"OTables::getNameForObject: Object is NULL!");
- return ::dbtools::composeTableName( m_xMetaData, _xObject, ::dbtools::eInDataManipulation, false, false, false );
-}
-// -----------------------------------------------------------------------------
-void OTables::addComment(const Reference< XPropertySet >& descriptor,::rtl::OUStringBuffer& _rOut)
-{
- ::rtl::OUString sDesc;
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)) >>= sDesc;
- if ( sDesc.getLength() )
- {
- _rOut.appendAscii(" COMMENT '");
- _rOut.append(sDesc);
- _rOut.appendAscii("'");
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mysql/YUser.cxx b/connectivity/source/drivers/mysql/YUser.cxx
deleted file mode 100644
index 50949d5cab..0000000000
--- a/connectivity/source/drivers/mysql/YUser.cxx
+++ /dev/null
@@ -1,352 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "mysql/YUser.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbcx/PrivilegeObject.hpp>
-#include "TConnection.hxx"
-#include "resource/common_res.hrc"
-
-using namespace connectivity;
-using namespace connectivity::mysql;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-// -------------------------------------------------------------------------
-OMySQLUser::OMySQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection) : connectivity::sdbcx::OUser(sal_True)
- ,m_xConnection(_xConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-OMySQLUser::OMySQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
- const ::rtl::OUString& _Name
- ) : connectivity::sdbcx::OUser(_Name,sal_True)
- ,m_xConnection(_xConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-void OMySQLUser::refreshGroups()
-{
-}
-// -------------------------------------------------------------------------
-OUserExtend::OUserExtend( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection) : OMySQLUser(_xConnection)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-typedef connectivity::sdbcx::OUser OUser_TYPEDEF;
-void OUserExtend::construct()
-{
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD), PROPERTY_ID_PASSWORD,0,&m_Password,::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
-}
-// -----------------------------------------------------------------------------
-cppu::IPropertyArrayHelper* OUserExtend::createArrayHelper() const
-{
- Sequence< Property > aProps;
- describeProperties(aProps);
- return new cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-cppu::IPropertyArrayHelper & OUserExtend::getInfoHelper()
-{
- return *OUserExtend_PROP::getArrayHelper();
-}
-typedef connectivity::sdbcx::OUser_BASE OUser_BASE_RBHELPER;
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OMySQLUser::getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
-
- sal_Int32 nRights,nRightsWithGrant;
- findPrivilegesAndGrantPrivileges(objName,objType,nRights,nRightsWithGrant);
- return nRights;
-}
-// -----------------------------------------------------------------------------
-void OMySQLUser::findPrivilegesAndGrantPrivileges(const ::rtl::OUString& objName, sal_Int32 objType,sal_Int32& nRights,sal_Int32& nRightsWithGrant) throw(SQLException, RuntimeException)
-{
- nRightsWithGrant = nRights = 0;
- // first we need to create the sql stmt to select the privs
- Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(xMeta,objName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
- Reference<XResultSet> xRes;
- switch(objType)
- {
- case PrivilegeObject::TABLE:
- case PrivilegeObject::VIEW:
- {
- Any aCatalog;
- if ( sCatalog.getLength() )
- aCatalog <<= sCatalog;
- xRes = xMeta->getTablePrivileges(aCatalog,sSchema,sTable);
- }
- break;
-
- case PrivilegeObject::COLUMN:
- {
- Any aCatalog;
- if ( sCatalog.getLength() )
- aCatalog <<= sCatalog;
- xRes = xMeta->getColumnPrivileges(aCatalog,sSchema,sTable,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")));
- }
- break;
- }
-
- if ( xRes.is() )
- {
- static const ::rtl::OUString sSELECT( RTL_CONSTASCII_USTRINGPARAM( "SELECT" ));
- static const ::rtl::OUString sINSERT( RTL_CONSTASCII_USTRINGPARAM( "INSERT" ));
- static const ::rtl::OUString sUPDATE( RTL_CONSTASCII_USTRINGPARAM( "UPDATE" ));
- static const ::rtl::OUString sDELETE( RTL_CONSTASCII_USTRINGPARAM( "DELETE" ));
- static const ::rtl::OUString sREAD( RTL_CONSTASCII_USTRINGPARAM( "READ" ));
- static const ::rtl::OUString sCREATE( RTL_CONSTASCII_USTRINGPARAM( "CREATE" ));
- static const ::rtl::OUString sALTER( RTL_CONSTASCII_USTRINGPARAM( "ALTER" ));
- static const ::rtl::OUString sREFERENCE( RTL_CONSTASCII_USTRINGPARAM( "REFERENCE" ));
- static const ::rtl::OUString sDROP( RTL_CONSTASCII_USTRINGPARAM( "DROP" ));
- static const ::rtl::OUString sYes( RTL_CONSTASCII_USTRINGPARAM( "YES" ));
-
- nRightsWithGrant = nRights = 0;
-
- Reference<XRow> xCurrentRow(xRes,UNO_QUERY);
- while( xCurrentRow.is() && xRes->next() )
- {
- ::rtl::OUString sGrantee = xCurrentRow->getString(5);
- ::rtl::OUString sPrivilege = xCurrentRow->getString(6);
- ::rtl::OUString sGrantable = xCurrentRow->getString(7);
-
- if (!m_Name.equalsIgnoreAsciiCase(sGrantee))
- continue;
-
- if (sPrivilege.equalsIgnoreAsciiCase(sSELECT))
- {
- nRights |= Privilege::SELECT;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::SELECT;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sINSERT))
- {
- nRights |= Privilege::INSERT;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::INSERT;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sUPDATE))
- {
- nRights |= Privilege::UPDATE;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::UPDATE;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sDELETE))
- {
- nRights |= Privilege::DELETE;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::DELETE;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sREAD))
- {
- nRights |= Privilege::READ;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::READ;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sCREATE))
- {
- nRights |= Privilege::CREATE;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::CREATE;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sALTER))
- {
- nRights |= Privilege::ALTER;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::ALTER;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sREFERENCE))
- {
- nRights |= Privilege::REFERENCE;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::REFERENCE;
- }
- else if (sPrivilege.equalsIgnoreAsciiCase(sDROP))
- {
- nRights |= Privilege::DROP;
- if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
- nRightsWithGrant |= Privilege::DROP;
- }
- }
- ::comphelper::disposeComponent(xRes);
- }
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OMySQLUser::getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
-
- sal_Int32 nRights,nRightsWithGrant;
- findPrivilegesAndGrantPrivileges(objName,objType,nRights,nRightsWithGrant);
- return nRightsWithGrant;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OMySQLUser::grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(SQLException, RuntimeException)
-{
- if ( objType != PrivilegeObject::TABLE )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(STR_PRIVILEGE_NOT_GRANTED));
- ::dbtools::throwGenericSQLException(sError,*this);
- } // if ( objType != PrivilegeObject::TABLE )
-
- ::osl::MutexGuard aGuard(m_aMutex);
-
- ::rtl::OUString sPrivs = getPrivilegeString(objPrivileges);
- if(sPrivs.getLength())
- {
- ::rtl::OUString sGrant;
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GRANT "));
- sGrant += sPrivs;
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "));
- Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- sGrant += ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation);
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" TO "));
- sGrant += m_Name;
-
- Reference<XStatement> xStmt = m_xConnection->createStatement();
- if(xStmt.is())
- xStmt->execute(sGrant);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OMySQLUser::revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(SQLException, RuntimeException)
-{
- if ( objType != PrivilegeObject::TABLE )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(STR_PRIVILEGE_NOT_REVOKED));
- ::dbtools::throwGenericSQLException(sError,*this);
- }
-
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
- ::rtl::OUString sPrivs = getPrivilegeString(objPrivileges);
- if(sPrivs.getLength())
- {
- ::rtl::OUString sGrant;
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REVOKE "));
- sGrant += sPrivs;
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "));
- Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- sGrant += ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation);
- sGrant += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FROM "));
- sGrant += m_Name;
-
- Reference<XStatement> xStmt = m_xConnection->createStatement();
- if(xStmt.is())
- xStmt->execute(sGrant);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-// XUser
-void SAL_CALL OMySQLUser::changePassword( const ::rtl::OUString& /*oldPassword*/, const ::rtl::OUString& newPassword ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed);
- ::rtl::OUString sAlterPwd;
- sAlterPwd = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SET PASSWORD FOR "));
- sAlterPwd += m_Name;
- sAlterPwd += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("@\"%\" = PASSWORD('")) ;
- sAlterPwd += newPassword;
- sAlterPwd += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("')")) ;
-
-
- Reference<XStatement> xStmt = m_xConnection->createStatement();
- if ( xStmt.is() )
- {
- xStmt->execute(sAlterPwd);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OMySQLUser::getPrivilegeString(sal_Int32 nRights) const
-{
- ::rtl::OUString sPrivs;
- if((nRights & Privilege::INSERT) == Privilege::INSERT)
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INSERT"));
-
- if((nRights & Privilege::DELETE) == Privilege::DELETE)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DELETE"));
- }
-
- if((nRights & Privilege::UPDATE) == Privilege::UPDATE)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UPDATE"));
- }
-
- if((nRights & Privilege::ALTER) == Privilege::ALTER)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER"));
- }
-
- if((nRights & Privilege::SELECT) == Privilege::SELECT)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT"));
- }
-
- if((nRights & Privilege::REFERENCE) == Privilege::REFERENCE)
- {
- if(sPrivs.getLength())
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sPrivs += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("REFERENCES"));
- }
-
- return sPrivs;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mysql/YUsers.cxx b/connectivity/source/drivers/mysql/YUsers.cxx
deleted file mode 100644
index 17b46179c9..0000000000
--- a/connectivity/source/drivers/mysql/YUsers.cxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "mysql/YUsers.hxx"
-#include "mysql/YUser.hxx"
-#include "mysql/YTable.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include "connectivity/sdbcx/IRefreshable.hxx"
-#include <comphelper/types.hxx>
-#include "connectivity/dbexception.hxx"
-#include "connectivity/dbtools.hxx"
-#include "TConnection.hxx"
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::mysql;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-OUsers::OUsers( ::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
- connectivity::sdbcx::IRefreshableUsers* _pParent)
- : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector)
- ,m_xConnection(_xConnection)
- ,m_pParent(_pParent)
-{
-}
-// -----------------------------------------------------------------------------
-
-sdbcx::ObjectType OUsers::createObject(const ::rtl::OUString& _rName)
-{
- return new OMySQLUser(m_xConnection,_rName);
-}
-// -------------------------------------------------------------------------
-void OUsers::impl_refresh() throw(RuntimeException)
-{
- m_pParent->refreshUsers();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OUsers::createDescriptor()
-{
- OUserExtend* pNew = new OUserExtend(m_xConnection);
- return pNew;
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OUsers::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "GRANT USAGE ON * TO " ));
- ::rtl::OUString aQuote = m_xConnection->getMetaData()->getIdentifierQuoteString( );
- ::rtl::OUString sUserName( _rForName );
- aSql += ::dbtools::quoteName(aQuote,sUserName)
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" @\"%\" "));
- ::rtl::OUString sPassword;
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD)) >>= sPassword;
- if ( sPassword.getLength() )
- {
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" IDENTIFIED BY '"));
- aSql += sPassword;
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- }
-
- Reference< XStatement > xStmt = m_xConnection->createStatement( );
- if(xStmt.is())
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
-
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OUsers::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
-{
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "REVOKE ALL ON * FROM " ));
- ::rtl::OUString aQuote = m_xConnection->getMetaData()->getIdentifierQuoteString( );
- aSql += ::dbtools::quoteName(aQuote,_sElementName);
-
- Reference< XStatement > xStmt = m_xConnection->createStatement( );
- if(xStmt.is())
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
-}
-
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mysql/YViews.cxx b/connectivity/source/drivers/mysql/YViews.cxx
deleted file mode 100644
index 8184a7af1d..0000000000
--- a/connectivity/source/drivers/mysql/YViews.cxx
+++ /dev/null
@@ -1,165 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "mysql/YViews.hxx"
-#include "mysql/YTables.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbcx/CheckOption.hpp>
-#include "mysql/YCatalog.hxx"
-#include <comphelper/extract.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include <cppuhelper/interfacecontainer.h>
-#include "connectivity/sdbcx/VView.hxx"
-#include <comphelper/types.hxx>
-#include "TConnection.hxx"
-
-using namespace ::comphelper;
-
-using namespace ::cppu;
-using namespace connectivity;
-using namespace connectivity::mysql;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace dbtools;
-typedef connectivity::sdbcx::OCollection OCollection_TYPE;
-
-sdbcx::ObjectType OViews::createObject(const ::rtl::OUString& _rName)
-{
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(m_xMetaData,
- _rName,
- sCatalog,
- sSchema,
- sTable,
- ::dbtools::eInDataManipulation);
- return new ::connectivity::sdbcx::OView(isCaseSensitive(),
- sTable,
- m_xMetaData,
- 0,
- ::rtl::OUString(),
- sSchema,
- sCatalog
- );
-}
-// -------------------------------------------------------------------------
-void OViews::impl_refresh( ) throw(RuntimeException)
-{
- static_cast<OMySQLCatalog&>(m_rParent).refreshTables();
-}
-// -------------------------------------------------------------------------
-void OViews::disposing(void)
-{
-m_xMetaData.clear();
- OCollection::disposing();
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > OViews::createDescriptor()
-{
- Reference<XConnection> xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection();
- connectivity::sdbcx::OView* pNew = new connectivity::sdbcx::OView(sal_True,xConnection->getMetaData());
- return pNew;
-}
-// -------------------------------------------------------------------------
-// XAppend
-sdbcx::ObjectType OViews::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor )
-{
- createView(descriptor);
- return createObject( _rForName );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void OViews::dropObject(sal_Int32 _nPos,const ::rtl::OUString /*_sElementName*/)
-{
- if ( m_bInDrop )
- return;
-
- Reference< XInterface > xObject( getObject( _nPos ) );
- sal_Bool bIsNew = connectivity::sdbcx::ODescriptor::isNew( xObject );
- if (!bIsNew)
- {
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "DROP VIEW" ));
-
- Reference<XPropertySet> xProp(xObject,UNO_QUERY);
- aSql += ::dbtools::composeTableName( m_xMetaData, xProp, ::dbtools::eInTableDefinitions, false, false, true );
-
- Reference<XConnection> xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection();
- Reference< XStatement > xStmt = xConnection->createStatement( );
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
-}
-// -----------------------------------------------------------------------------
-void OViews::dropByNameImpl(const ::rtl::OUString& elementName)
-{
- m_bInDrop = sal_True;
- OCollection_TYPE::dropByName(elementName);
- m_bInDrop = sal_False;
-}
-// -----------------------------------------------------------------------------
-void OViews::createView( const Reference< XPropertySet >& descriptor )
-{
- Reference<XConnection> xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection();
-
- ::rtl::OUString aSql( RTL_CONSTASCII_USTRINGPARAM( "CREATE VIEW " ));
- ::rtl::OUString aQuote = xConnection->getMetaData()->getIdentifierQuoteString( );
- ::rtl::OUString sSchema,sCommand;
-
- aSql += ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::eInTableDefinitions, false, false, true );
-
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" AS "));
- descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_COMMAND)) >>= sCommand;
- aSql += sCommand;
-
- Reference< XStatement > xStmt = xConnection->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
-
- // insert the new view also in the tables collection
- OTables* pTables = static_cast<OTables*>(static_cast<OMySQLCatalog&>(m_rParent).getPrivateTables());
- if ( pTables )
- {
- ::rtl::OUString sName = ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::eInDataManipulation, false, false, false );
- pTables->appendNew(sName);
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mysql/Yservices.cxx b/connectivity/source/drivers/mysql/Yservices.cxx
deleted file mode 100644
index f875abac30..0000000000
--- a/connectivity/source/drivers/mysql/Yservices.cxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "mysql/YDriver.hxx"
-#include <cppuhelper/factory.hxx>
-
-using namespace connectivity::mysql;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pT
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- ODriverDelegator::getImplementationName_Static(),
- ODriverDelegator::getSupportedServiceNames_Static(),
- ODriverDelegator_CreateInstance, ::cppu::createSingleFactory)
- ;
-
- if(aReq.xRet.is())
- aReq.xRet->acquire();
-
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mysql/exports.dxp b/connectivity/source/drivers/mysql/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/drivers/mysql/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/drivers/mysql/makefile.mk b/connectivity/source/drivers/mysql/makefile.mk
deleted file mode 100755
index 453f4b652f..0000000000
--- a/connectivity/source/drivers/mysql/makefile.mk
+++ /dev/null
@@ -1,92 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=mysql
-
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/YDriver.obj \
- $(SLO)$/YTables.obj \
- $(SLO)$/YTable.obj \
- $(SLO)$/YViews.obj \
- $(SLO)$/YCatalog.obj \
- $(SLO)$/YColumns.obj \
- $(SLO)$/YUser.obj \
- $(SLO)$/YUsers.obj \
- $(SLO)$/Yservices.obj
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-
-# --- Library -----------------------------------
-
-SHL1TARGET= $(MYSQL_TARGET)$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB) \
- $(DBTOOLSLIB) \
- $(COMPHELPERLIB)
-
-
-SHL1DEPN=
-SHL1IMPLIB= i$(MYSQL_TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-# --- Targets ----------------------------------
-
-.INCLUDE : $(PRJ)$/target.pmk
-
-
-
-ALLTAR : $(MISC)/mysql.component
-
-$(MISC)/mysql.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- mysql.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt mysql.component
diff --git a/connectivity/source/drivers/mysql/mysql.component b/connectivity/source/drivers/mysql/mysql.component
deleted file mode 100755
index ced2297fa0..0000000000
--- a/connectivity/source/drivers/mysql/mysql.component
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="org.openoffice.comp.drivers.MySQL.Driver">
- <service name="com.sun.star.sdbc.Driver"/>
- <service name="com.sun.star.sdbcx.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/mysql/mysql.xcu b/connectivity/source/drivers/mysql/mysql.xcu
deleted file mode 100644
index 16e3c82031..0000000000
--- a/connectivity/source/drivers/mysql/mysql.xcu
+++ /dev/null
@@ -1,258 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:mysql:jdbc:*" oor:op="replace">
- <prop oor:name="Driver">
- <value>org.openoffice.comp.drivers.MySQL.Driver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">MySQL (JDBC)</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="CharSet" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="JavaDriverClass" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>com.mysql.jdbc.Driver</value>
- </prop>
- </node>
- <node oor:name="AddIndexAppendix" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="Features">
- <node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="IgnoreDriverPrivileges" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="DisplayVersionColumns" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseDOSLineEnds" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="BooleanComparisonMode" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FormsCheckRequiredFields" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsTableCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseJava" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="Authentication" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>UserPassword</value>
- </prop>
- </node>
- <node oor:name="SupportsColumnDescription" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="sdbc:mysql:odbc:*" oor:op="replace">
- <prop oor:name="Driver">
- <value>org.openoffice.comp.drivers.MySQL.Driver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">MySQL (ODBC)</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="CharSet" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="AddIndexAppendix" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="Features">
- <node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="IgnoreDriverPrivileges" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="DisplayVersionColumns" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseDOSLineEnds" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="BooleanComparisonMode" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FormsCheckRequiredFields" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsTableCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="SupportsBrowsing" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="Authentication" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>UserPassword</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="sdbc:mysql:mysqlc:*" oor:op="replace">
- <prop oor:name="Driver">
- <value>org.openoffice.comp.drivers.MySQL.Driver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">MySQL (Native)</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="CharSet" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="LocalSocket" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="NamedPipe" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="AddIndexAppendix" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="Features">
- <node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="IgnoreDriverPrivileges" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="DisplayVersionColumns" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseDOSLineEnds" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="BooleanComparisonMode" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FormsCheckRequiredFields" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsTableCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="Authentication" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>UserPassword</value>
- </prop>
- </node>
- <node oor:name="SupportsColumnDescription" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/mysql/mysql.xml b/connectivity/source/drivers/mysql/mysql.xml
deleted file mode 100755
index 93cb83d0ab..0000000000
--- a/connectivity/source/drivers/mysql/mysql.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>odbc</module-name>
- <component-description>
- <author>Ocke Janssen</author>
- <name>org.openoffice.comp.drivers.MySQL.Driver</name>
- <description>
- This is the implementation of the MySQL driver.
- </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service>com.sun.star.sdbc.Driver</supported-service>
- <supported-service>com.sun.star.sdbcx.Driver</supported-service>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>dbtools</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
-
-
diff --git a/connectivity/source/drivers/odbc/OFunctions.cxx b/connectivity/source/drivers/odbc/OFunctions.cxx
deleted file mode 100644
index 13454de964..0000000000
--- a/connectivity/source/drivers/odbc/OFunctions.cxx
+++ /dev/null
@@ -1,249 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-//--------------------------------------------------------------------------
-#include "odbc/OFunctions.hxx"
-#include <osl/process.h>
-
-// Implib-Definitionen fuer ODBC-DLL/shared library:
-
-namespace connectivity
-{
- T3SQLAllocHandle pODBC3SQLAllocHandle;
-T3SQLConnect pODBC3SQLConnect;
-T3SQLDriverConnect pODBC3SQLDriverConnect;
-T3SQLBrowseConnect pODBC3SQLBrowseConnect;
-T3SQLDataSources pODBC3SQLDataSources;
-T3SQLDrivers pODBC3SQLDrivers;
-T3SQLGetInfo pODBC3SQLGetInfo;
-T3SQLGetFunctions pODBC3SQLGetFunctions;
-T3SQLGetTypeInfo pODBC3SQLGetTypeInfo;
-T3SQLSetConnectAttr pODBC3SQLSetConnectAttr;
-T3SQLGetConnectAttr pODBC3SQLGetConnectAttr;
-T3SQLSetEnvAttr pODBC3SQLSetEnvAttr;
-T3SQLGetEnvAttr pODBC3SQLGetEnvAttr;
-T3SQLSetStmtAttr pODBC3SQLSetStmtAttr;
-T3SQLGetStmtAttr pODBC3SQLGetStmtAttr;
-T3SQLPrepare pODBC3SQLPrepare;
-T3SQLBindParameter pODBC3SQLBindParameter;
-T3SQLSetCursorName pODBC3SQLSetCursorName;
-T3SQLExecute pODBC3SQLExecute;
-T3SQLExecDirect pODBC3SQLExecDirect;
-T3SQLDescribeParam pODBC3SQLDescribeParam;
-T3SQLNumParams pODBC3SQLNumParams;
-T3SQLParamData pODBC3SQLParamData;
-T3SQLPutData pODBC3SQLPutData;
-T3SQLRowCount pODBC3SQLRowCount;
-T3SQLNumResultCols pODBC3SQLNumResultCols;
-T3SQLDescribeCol pODBC3SQLDescribeCol;
-T3SQLColAttribute pODBC3SQLColAttribute;
-T3SQLBindCol pODBC3SQLBindCol;
-T3SQLFetch pODBC3SQLFetch;
-T3SQLFetchScroll pODBC3SQLFetchScroll;
-T3SQLGetData pODBC3SQLGetData;
-T3SQLSetPos pODBC3SQLSetPos;
-T3SQLBulkOperations pODBC3SQLBulkOperations;
-T3SQLMoreResults pODBC3SQLMoreResults;
-T3SQLGetDiagRec pODBC3SQLGetDiagRec;
-T3SQLColumnPrivileges pODBC3SQLColumnPrivileges;
-T3SQLColumns pODBC3SQLColumns;
-T3SQLForeignKeys pODBC3SQLForeignKeys;
-T3SQLPrimaryKeys pODBC3SQLPrimaryKeys;
-T3SQLProcedureColumns pODBC3SQLProcedureColumns;
-T3SQLProcedures pODBC3SQLProcedures;
-T3SQLSpecialColumns pODBC3SQLSpecialColumns;
-T3SQLStatistics pODBC3SQLStatistics;
-T3SQLTablePrivileges pODBC3SQLTablePrivileges;
-T3SQLTables pODBC3SQLTables;
-T3SQLFreeStmt pODBC3SQLFreeStmt;
-T3SQLCloseCursor pODBC3SQLCloseCursor;
-T3SQLCancel pODBC3SQLCancel;
-T3SQLEndTran pODBC3SQLEndTran;
-T3SQLDisconnect pODBC3SQLDisconnect;
-T3SQLFreeHandle pODBC3SQLFreeHandle;
-T3SQLGetCursorName pODBC3SQLGetCursorName;
-T3SQLNativeSql pODBC3SQLNativeSql;
-
-sal_Bool LoadFunctions(oslModule pODBCso);
-// -------------------------------------------------------------------------
-// Take care of Dynamicly loading of the DLL/shared lib and Addresses:
-// Returns sal_True at success
-sal_Bool LoadLibrary_ODBC3(::rtl::OUString &_rPath)
-{
- static sal_Bool bLoaded = sal_False;
- static oslModule pODBCso = NULL;
-
- if (bLoaded)
- return sal_True;
-#ifdef WNT
- _rPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODBC32.DLL"));
-#endif
-#ifdef UNX
- #ifdef MACOSX
- _rPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("libiodbc.dylib"));
- #else
- _rPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("libodbc.so.1"));
- pODBCso = osl_loadModule( _rPath.pData,SAL_LOADMODULE_NOW );
- if ( !pODBCso )
- _rPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("libodbc.so"));
- #endif /* MACOSX */
-#endif
-
- if ( !pODBCso )
- pODBCso = osl_loadModule( _rPath.pData,SAL_LOADMODULE_NOW );
- if( !pODBCso)
- return sal_False;
-
- return bLoaded = LoadFunctions(pODBCso);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool LoadFunctions(oslModule pODBCso)
-{
-
- if( ( pODBC3SQLAllocHandle = (T3SQLAllocHandle)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLAllocHandle")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLConnect = (T3SQLConnect)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLConnect")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLDriverConnect = (T3SQLDriverConnect)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLDriverConnect")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLBrowseConnect = (T3SQLBrowseConnect)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLBrowseConnect")).pData )) == NULL )
- return sal_False;
- if(( pODBC3SQLDataSources = (T3SQLDataSources)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLDataSources")).pData )) == NULL )
- return sal_False;
- if(( pODBC3SQLDrivers = (T3SQLDrivers)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLDrivers")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetInfo = (T3SQLGetInfo)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetInfo")).pData )) == NULL )
- return sal_False;
- if(( pODBC3SQLGetFunctions = (T3SQLGetFunctions)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetFunctions")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetTypeInfo = (T3SQLGetTypeInfo)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetTypeInfo")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLSetConnectAttr = (T3SQLSetConnectAttr)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLSetConnectAttr")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetConnectAttr = (T3SQLGetConnectAttr)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetConnectAttr")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLSetEnvAttr = (T3SQLSetEnvAttr)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLSetEnvAttr")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetEnvAttr = (T3SQLGetEnvAttr)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetEnvAttr")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLSetStmtAttr = (T3SQLSetStmtAttr)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLSetStmtAttr")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetStmtAttr = (T3SQLGetStmtAttr)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetStmtAttr")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLPrepare = (T3SQLPrepare)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLPrepare")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLBindParameter = (T3SQLBindParameter)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLBindParameter")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLSetCursorName = (T3SQLSetCursorName)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLSetCursorName")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLExecute = (T3SQLExecute)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLExecute")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLExecDirect = (T3SQLExecDirect)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLExecDirect")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLDescribeParam = (T3SQLDescribeParam)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLDescribeParam")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLNumParams = (T3SQLNumParams)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLNumParams")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLParamData = (T3SQLParamData)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLParamData")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLPutData = (T3SQLPutData)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLPutData")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLRowCount = (T3SQLRowCount)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLRowCount")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLNumResultCols = (T3SQLNumResultCols)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLNumResultCols")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLDescribeCol = (T3SQLDescribeCol)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLDescribeCol")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLColAttribute = (T3SQLColAttribute)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLColAttribute")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLBindCol = (T3SQLBindCol)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLBindCol")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLFetch = (T3SQLFetch)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLFetch")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLFetchScroll = (T3SQLFetchScroll)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLFetchScroll")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetData = (T3SQLGetData)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetData")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLSetPos = (T3SQLSetPos)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLSetPos")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLBulkOperations = (T3SQLBulkOperations)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLBulkOperations")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLMoreResults = (T3SQLMoreResults)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLMoreResults")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetDiagRec = (T3SQLGetDiagRec)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetDiagRec")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLColumnPrivileges = (T3SQLColumnPrivileges)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLColumnPrivileges")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLColumns = (T3SQLColumns)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLColumns")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLForeignKeys = (T3SQLForeignKeys)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLForeignKeys")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLPrimaryKeys = (T3SQLPrimaryKeys)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLPrimaryKeys")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLProcedureColumns = (T3SQLProcedureColumns)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLProcedureColumns")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLProcedures = (T3SQLProcedures)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLProcedures")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLSpecialColumns = (T3SQLSpecialColumns)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLSpecialColumns")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLStatistics = (T3SQLStatistics)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLStatistics")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLTablePrivileges = (T3SQLTablePrivileges)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLTablePrivileges")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLTables = (T3SQLTables)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLTables")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLFreeStmt = (T3SQLFreeStmt)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLFreeStmt")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLCloseCursor = (T3SQLCloseCursor)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLCloseCursor")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLCancel = (T3SQLCancel)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLCancel")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLEndTran = (T3SQLEndTran)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLEndTran")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLDisconnect = (T3SQLDisconnect)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLDisconnect")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLFreeHandle = (T3SQLFreeHandle)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLFreeHandle")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLGetCursorName = (T3SQLGetCursorName)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLGetCursorName")).pData )) == NULL )
- return sal_False;
- if( ( pODBC3SQLNativeSql = (T3SQLNativeSql)osl_getFunctionSymbol(pODBCso, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQLNativeSql")).pData )) == NULL )
- return sal_False;
-
- return sal_True;
-}
-// -------------------------------------------------------------------------
-
-}
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbc/ORealDriver.cxx b/connectivity/source/drivers/odbc/ORealDriver.cxx
deleted file mode 100644
index 12b3b42973..0000000000
--- a/connectivity/source/drivers/odbc/ORealDriver.cxx
+++ /dev/null
@@ -1,371 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ORealDriver.hxx"
-#include "odbc/ODriver.hxx"
-#include "odbc/OTools.hxx"
-#include "odbc/OFunctions.hxx"
-#include "diagnose_ex.h"
-
-namespace connectivity
-{
- sal_Bool LoadFunctions(oslModule pODBCso);
- sal_Bool LoadLibrary_ODBC3(::rtl::OUString &_rPath);
- // extern declaration of the function pointer
- extern T3SQLAllocHandle pODBC3SQLAllocHandle;
- extern T3SQLConnect pODBC3SQLConnect;
- extern T3SQLDriverConnect pODBC3SQLDriverConnect;
- extern T3SQLBrowseConnect pODBC3SQLBrowseConnect;
- extern T3SQLDataSources pODBC3SQLDataSources;
- extern T3SQLDrivers pODBC3SQLDrivers;
- extern T3SQLGetInfo pODBC3SQLGetInfo;
- extern T3SQLGetFunctions pODBC3SQLGetFunctions;
- extern T3SQLGetTypeInfo pODBC3SQLGetTypeInfo;
- extern T3SQLSetConnectAttr pODBC3SQLSetConnectAttr;
- extern T3SQLGetConnectAttr pODBC3SQLGetConnectAttr;
- extern T3SQLSetEnvAttr pODBC3SQLSetEnvAttr;
- extern T3SQLGetEnvAttr pODBC3SQLGetEnvAttr;
- extern T3SQLSetStmtAttr pODBC3SQLSetStmtAttr;
- extern T3SQLGetStmtAttr pODBC3SQLGetStmtAttr;
- //extern T3SQLSetDescField pODBC3SQLSetDescField;
- //extern T3SQLGetDescField pODBC3SQLGetDescField;
- //extern T3SQLGetDescRec pODBC3SQLGetDescRec;
- //extern T3SQLSetDescRec pODBC3SQLSetDescRec;
- extern T3SQLPrepare pODBC3SQLPrepare;
- extern T3SQLBindParameter pODBC3SQLBindParameter;
- //extern T3SQLGetCursorName pODBC3SQLGetCursorName;
- extern T3SQLSetCursorName pODBC3SQLSetCursorName;
- extern T3SQLExecute pODBC3SQLExecute;
- extern T3SQLExecDirect pODBC3SQLExecDirect;
- //extern T3SQLNativeSql pODBC3SQLNativeSql;
- extern T3SQLDescribeParam pODBC3SQLDescribeParam;
- extern T3SQLNumParams pODBC3SQLNumParams;
- extern T3SQLParamData pODBC3SQLParamData;
- extern T3SQLPutData pODBC3SQLPutData;
- extern T3SQLRowCount pODBC3SQLRowCount;
- extern T3SQLNumResultCols pODBC3SQLNumResultCols;
- extern T3SQLDescribeCol pODBC3SQLDescribeCol;
- extern T3SQLColAttribute pODBC3SQLColAttribute;
- extern T3SQLBindCol pODBC3SQLBindCol;
- extern T3SQLFetch pODBC3SQLFetch;
- extern T3SQLFetchScroll pODBC3SQLFetchScroll;
- extern T3SQLGetData pODBC3SQLGetData;
- extern T3SQLSetPos pODBC3SQLSetPos;
- extern T3SQLBulkOperations pODBC3SQLBulkOperations;
- extern T3SQLMoreResults pODBC3SQLMoreResults;
- //extern T3SQLGetDiagField pODBC3SQLGetDiagField;
- extern T3SQLGetDiagRec pODBC3SQLGetDiagRec;
- extern T3SQLColumnPrivileges pODBC3SQLColumnPrivileges;
- extern T3SQLColumns pODBC3SQLColumns;
- extern T3SQLForeignKeys pODBC3SQLForeignKeys;
- extern T3SQLPrimaryKeys pODBC3SQLPrimaryKeys;
- extern T3SQLProcedureColumns pODBC3SQLProcedureColumns;
- extern T3SQLProcedures pODBC3SQLProcedures;
- extern T3SQLSpecialColumns pODBC3SQLSpecialColumns;
- extern T3SQLStatistics pODBC3SQLStatistics;
- extern T3SQLTablePrivileges pODBC3SQLTablePrivileges;
- extern T3SQLTables pODBC3SQLTables;
- extern T3SQLFreeStmt pODBC3SQLFreeStmt;
- extern T3SQLCloseCursor pODBC3SQLCloseCursor;
- extern T3SQLCancel pODBC3SQLCancel;
- extern T3SQLEndTran pODBC3SQLEndTran;
- extern T3SQLDisconnect pODBC3SQLDisconnect;
- extern T3SQLFreeHandle pODBC3SQLFreeHandle;
- extern T3SQLGetCursorName pODBC3SQLGetCursorName;
- extern T3SQLNativeSql pODBC3SQLNativeSql;
-
-
- namespace odbc
- {
- class ORealObdcDriver : public ODBCDriver
- {
- protected:
- virtual oslGenericFunction getOdbcFunction(sal_Int32 _nIndex) const;
- virtual SQLHANDLE EnvironmentHandle(::rtl::OUString &_rPath);
- public:
- ORealObdcDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) : ODBCDriver(_rxFactory) {}
- };
-
- //------------------------------------------------------------------
-oslGenericFunction ORealObdcDriver::getOdbcFunction(sal_Int32 _nIndex) const
-{
- oslGenericFunction pFunction = NULL;
- switch(_nIndex)
- {
- case ODBC3SQLAllocHandle:
- pFunction = (oslGenericFunction)pODBC3SQLAllocHandle;
- break;
- case ODBC3SQLConnect:
- pFunction = (oslGenericFunction)pODBC3SQLConnect;
- break;
- case ODBC3SQLDriverConnect:
- pFunction = (oslGenericFunction)pODBC3SQLDriverConnect;
- break;
- case ODBC3SQLBrowseConnect:
- pFunction = (oslGenericFunction)pODBC3SQLBrowseConnect;
- break;
- case ODBC3SQLDataSources:
- pFunction = (oslGenericFunction)pODBC3SQLDataSources;
- break;
- case ODBC3SQLDrivers:
- pFunction = (oslGenericFunction)pODBC3SQLDrivers;
- break;
- case ODBC3SQLGetInfo:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetInfo;
- break;
- case ODBC3SQLGetFunctions:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetFunctions;
- break;
- case ODBC3SQLGetTypeInfo:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetTypeInfo;
- break;
- case ODBC3SQLSetConnectAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetConnectAttr;
- break;
- case ODBC3SQLGetConnectAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetConnectAttr;
- break;
- case ODBC3SQLSetEnvAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetEnvAttr;
- break;
- case ODBC3SQLGetEnvAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetEnvAttr;
- break;
- case ODBC3SQLSetStmtAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetStmtAttr;
- break;
- case ODBC3SQLGetStmtAttr:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetStmtAttr;
- break;
- case ODBC3SQLPrepare:
-
- pFunction = (oslGenericFunction)pODBC3SQLPrepare;
- break;
- case ODBC3SQLBindParameter:
-
- pFunction = (oslGenericFunction)pODBC3SQLBindParameter;
- break;
- case ODBC3SQLSetCursorName:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetCursorName;
- break;
- case ODBC3SQLExecute:
-
- pFunction = (oslGenericFunction)pODBC3SQLExecute;
- break;
- case ODBC3SQLExecDirect:
-
- pFunction = (oslGenericFunction)pODBC3SQLExecDirect;
- break;
- case ODBC3SQLDescribeParam:
-
- pFunction = (oslGenericFunction)pODBC3SQLDescribeParam;
- break;
- case ODBC3SQLNumParams:
-
- pFunction = (oslGenericFunction)pODBC3SQLNumParams;
- break;
- case ODBC3SQLParamData:
-
- pFunction = (oslGenericFunction)pODBC3SQLParamData;
- break;
- case ODBC3SQLPutData:
-
- pFunction = (oslGenericFunction)pODBC3SQLPutData;
- break;
- case ODBC3SQLRowCount:
-
- pFunction = (oslGenericFunction)pODBC3SQLRowCount;
- break;
- case ODBC3SQLNumResultCols:
-
- pFunction = (oslGenericFunction)pODBC3SQLNumResultCols;
- break;
- case ODBC3SQLDescribeCol:
-
- pFunction = (oslGenericFunction)pODBC3SQLDescribeCol;
- break;
- case ODBC3SQLColAttribute:
-
- pFunction = (oslGenericFunction)pODBC3SQLColAttribute;
- break;
- case ODBC3SQLBindCol:
-
- pFunction = (oslGenericFunction)pODBC3SQLBindCol;
- break;
- case ODBC3SQLFetch:
-
- pFunction = (oslGenericFunction)pODBC3SQLFetch;
- break;
- case ODBC3SQLFetchScroll:
-
- pFunction = (oslGenericFunction)pODBC3SQLFetchScroll;
- break;
- case ODBC3SQLGetData:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetData;
- break;
- case ODBC3SQLSetPos:
-
- pFunction = (oslGenericFunction)pODBC3SQLSetPos;
- break;
- case ODBC3SQLBulkOperations:
-
- pFunction = (oslGenericFunction)pODBC3SQLBulkOperations;
- break;
- case ODBC3SQLMoreResults:
-
- pFunction = (oslGenericFunction)pODBC3SQLMoreResults;
- break;
- case ODBC3SQLGetDiagRec:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetDiagRec;
- break;
- case ODBC3SQLColumnPrivileges:
-
- pFunction = (oslGenericFunction)pODBC3SQLColumnPrivileges;
- break;
- case ODBC3SQLColumns:
-
- pFunction = (oslGenericFunction)pODBC3SQLColumns;
- break;
- case ODBC3SQLForeignKeys:
-
- pFunction = (oslGenericFunction)pODBC3SQLForeignKeys;
- break;
- case ODBC3SQLPrimaryKeys:
-
- pFunction = (oslGenericFunction)pODBC3SQLPrimaryKeys;
- break;
- case ODBC3SQLProcedureColumns:
-
- pFunction = (oslGenericFunction)pODBC3SQLProcedureColumns;
- break;
- case ODBC3SQLProcedures:
-
- pFunction = (oslGenericFunction)pODBC3SQLProcedures;
- break;
- case ODBC3SQLSpecialColumns:
-
- pFunction = (oslGenericFunction)pODBC3SQLSpecialColumns;
- break;
- case ODBC3SQLStatistics:
-
- pFunction = (oslGenericFunction)pODBC3SQLStatistics;
- break;
- case ODBC3SQLTablePrivileges:
-
- pFunction = (oslGenericFunction)pODBC3SQLTablePrivileges;
- break;
- case ODBC3SQLTables:
-
- pFunction = (oslGenericFunction)pODBC3SQLTables;
- break;
- case ODBC3SQLFreeStmt:
-
- pFunction = (oslGenericFunction)pODBC3SQLFreeStmt;
- break;
- case ODBC3SQLCloseCursor:
-
- pFunction = (oslGenericFunction)pODBC3SQLCloseCursor;
- break;
- case ODBC3SQLCancel:
-
- pFunction = (oslGenericFunction)pODBC3SQLCancel;
- break;
- case ODBC3SQLEndTran:
-
- pFunction = (oslGenericFunction)pODBC3SQLEndTran;
- break;
- case ODBC3SQLDisconnect:
-
- pFunction = (oslGenericFunction)pODBC3SQLDisconnect;
- break;
- case ODBC3SQLFreeHandle:
-
- pFunction = (oslGenericFunction)pODBC3SQLFreeHandle;
- break;
- case ODBC3SQLGetCursorName:
-
- pFunction = (oslGenericFunction)pODBC3SQLGetCursorName;
- break;
- case ODBC3SQLNativeSql:
-
- pFunction = (oslGenericFunction)pODBC3SQLNativeSql;
- break;
- default:
- OSL_FAIL("Function unknown!");
- }
- return pFunction;
-}
-
-//------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ODBCDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
-{
- return *(new ORealObdcDriver(_rxFactory));
-}
-// -----------------------------------------------------------------------------
-// ODBC Environment (common for all Connections):
-SQLHANDLE ORealObdcDriver::EnvironmentHandle(::rtl::OUString &_rPath)
-{
- // Is (for this instance) already a Enviroment made?
- if (!m_pDriverHandle)
- {
- SQLHANDLE h = SQL_NULL_HANDLE;
- // allocate Environment
-
- // load ODBC-DLL now:
- if (!LoadLibrary_ODBC3(_rPath) || N3SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&h) != SQL_SUCCESS)
- return SQL_NULL_HANDLE;
-
- // Save in global Structure
- m_pDriverHandle = h;
- SQLRETURN nError = N3SQLSetEnvAttr(h, SQL_ATTR_ODBC_VERSION,(SQLPOINTER) SQL_OV_ODBC3, SQL_IS_UINTEGER);
- OSL_UNUSED( nError );
- //N3SQLSetEnvAttr(h, SQL_ATTR_CONNECTION_POOLING,(SQLPOINTER) SQL_CP_ONE_PER_HENV, SQL_IS_INTEGER);
- }
-
- return m_pDriverHandle;
-}
-// -----------------------------------------------------------------------------
-
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbc/ORealDriver.hxx b/connectivity/source/drivers/odbc/ORealDriver.hxx
deleted file mode 100644
index 9b1939335a..0000000000
--- a/connectivity/source/drivers/odbc/ORealDriver.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-#ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_ODBC_OREALDRIVER_HXX
-#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_ODBC_OREALDRIVER_HXX
-
-#include "sal/config.h"
-
-#include "com/sun/star/uno/Exception.hpp"
-#include "com/sun/star/uno/Reference.hxx"
-
-namespace com { namespace sun { namespace star {
- namespace lang { class XMultiServiceFactory; }
- namespace uno { class XInterface; }
-} } }
-
-namespace connectivity { namespace odbc {
-
-com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
-ODBCDriver_CreateInstance(
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- const & factory)
- throw (com::sun::star::uno::Exception);
-
-} }
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbc/makefile.mk b/connectivity/source/drivers/odbc/makefile.mk
deleted file mode 100755
index 6d701b87c5..0000000000
--- a/connectivity/source/drivers/odbc/makefile.mk
+++ /dev/null
@@ -1,87 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=odbc
-
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-USE_DEFFILE=TRUE
-LDUMP=ldump2.exe
-
-# --- Settings ----------------------------------
-
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-.IF "$(SYSTEM_ODBC_HEADERS)" == "YES"
-CFLAGS+=-DSYSTEM_ODBC_HEADERS
-.ENDIF
-
-# --- ODBC Library -----------------------------------
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/oservices.obj \
- $(SLO)$/ORealDriver.obj \
- $(SLO)$/OFunctions.obj
-
-# --- ODBC Library -----------------------------------
-
-SHL1TARGET= $(ODBC_TARGET)$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(ODBCBASELIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB) \
- $(SALHELPERLIB)
-
-SHL1IMPLIB= i$(ODBC_TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-
-# --- Targets ----------------------------------
-
-.INCLUDE : $(PRJ)$/target.pmk
-
-ALLTAR : $(MISC)/odbc.component
-
-$(MISC)/odbc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- odbc.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt odbc.component
diff --git a/connectivity/source/drivers/odbc/odbc.component b/connectivity/source/drivers/odbc/odbc.component
deleted file mode 100755
index d4e6bc127d..0000000000
--- a/connectivity/source/drivers/odbc/odbc.component
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.sdbc.ODBCDriver">
- <service name="com.sun.star.sdbc.Driver"/>
- </implementation>
-</component>
diff --git a/connectivity/source/drivers/odbc/odbc.xcu b/connectivity/source/drivers/odbc/odbc.xcu
deleted file mode 100644
index b664b38977..0000000000
--- a/connectivity/source/drivers/odbc/odbc.xcu
+++ /dev/null
@@ -1,180 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <node oor:name="Installed">
- <node oor:name="sdbc:odbc:*" oor:op="replace">
- <prop oor:name="Driver">
- <value>com.sun.star.comp.sdbc.ODBCDriver</value>
- </prop>
- <prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
- <value xml:lang="en-US">ODBC</value>
- </prop>
- <node oor:name="Properties">
- <node oor:name="CharSet" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="SystemDriverSettings" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="UseCatalog" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="AutoIncrementCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="AutoRetrievingStatement" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value></value>
- </prop>
- </node>
- <node oor:name="IsAutoRetrievingEnabled" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="AddIndexAppendix" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="Features">
- <node oor:name="GeneratedValues" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseSQL92NamingConstraints" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="AppendTableAliasInSelect" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseBracketedOuterJoinSyntax" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="IgnoreDriverPrivileges" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="ParameterNameSubstitution" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="DisplayVersionColumns" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseCatalogInSelect" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseSchemaInSelect" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseIndexDirectionKeyword" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="UseDOSLineEnds" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="BooleanComparisonMode" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="FormsCheckRequiredFields" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="EscapeDateTime" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="PrimaryKeySupport" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="RespectDriverResultSetType" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- </node>
- <node oor:name="MetaData">
- <node oor:name="SupportsTableCreation" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="SupportsBrowsing" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="Authentication" oor:op="replace">
- <prop oor:name="Value" oor:type="xs:string">
- <value>UserPassword</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/connectivity/source/drivers/odbc/odbc.xml b/connectivity/source/drivers/odbc/odbc.xml
deleted file mode 100755
index eae2d3f3e1..0000000000
--- a/connectivity/source/drivers/odbc/odbc.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//W3C//DTD HTML 3.2//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>odbc</module-name>
- <component-description>
- <author>Ocke Janssen</author>
- <name>com.sun.star.comp.sdbc.ODBCDriver</name>
- <description>
- This is the implementation of the sdbc-odbc bridge.
- </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="final"/>
- <supported-service>com.sun.star.sdbc.Driver</supported-service>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper</runtime-module-dependency>
- <runtime-module-dependency>cppu</runtime-module-dependency>
- <runtime-module-dependency>sal</runtime-module-dependency>
- <runtime-module-dependency>dbtools</runtime-module-dependency>
- <runtime-module-dependency>comphelper</runtime-module-dependency>
-</module-description>
-
-
diff --git a/connectivity/source/drivers/odbc/oservices.cxx b/connectivity/source/drivers/odbc/oservices.cxx
deleted file mode 100644
index b35877b7fa..0000000000
--- a/connectivity/source/drivers/odbc/oservices.cxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "ORealDriver.hxx"
-#include "odbc/ODriver.hxx"
-#include <cppuhelper/factory.hxx>
-
-using namespace connectivity::odbc;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::XSingleServiceFactory;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
- (
- const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
- ::cppu::ComponentInstantiation pCreateFunction,
- const Sequence< OUString > & rServiceNames,
- rtl_ModuleCount* _pTemp
- );
-
-//---------------------------------------------------------------------------------------
-struct ProviderRequest
-{
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > const xServiceManager;
- OUString const sImplementationName;
-
- ProviderRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : xServiceManager(reinterpret_cast<XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(OUString::createFromAscii(pImplementationName))
- {
- }
-
- inline
- sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
- ::cppu::ComponentInstantiation Factory,
- createFactoryFunc creator
- )
- {
- if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
- }
- catch(...)
- {
- }
- return xRet.is();
- }
-
- void* getProvider() const { return xRet.get(); }
-};
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ProviderRequest aReq(pServiceManager,pImplementationName);
-
- aReq.CREATE_PROVIDER(
- ODBCDriver::getImplementationName_Static(),
- ODBCDriver::getSupportedServiceNames_Static(),
- ODBCDriver_CreateInstance, ::cppu::createSingleFactory)
- ;
-
- if(aReq.xRet.is())
- aReq.xRet->acquire();
-
- pRet = aReq.getProvider();
- }
-
- return pRet;
-};
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbcbase/OConnection.cxx b/connectivity/source/drivers/odbcbase/OConnection.cxx
deleted file mode 100644
index 3a9a50dbb8..0000000000
--- a/connectivity/source/drivers/odbcbase/OConnection.cxx
+++ /dev/null
@@ -1,672 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "odbc/OTools.hxx"
-#include "odbc/OConnection.hxx"
-#include "odbc/ODatabaseMetaData.hxx"
-#include "odbc/OFunctions.hxx"
-#include "odbc/ODriver.hxx"
-#include "odbc/OStatement.hxx"
-#include "odbc/OPreparedStatement.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <connectivity/dbcharset.hxx>
-#include <connectivity/FValue.hxx>
-#include <comphelper/extract.hxx>
-#include "diagnose_ex.h"
-#include <connectivity/dbexception.hxx>
-
-#include <string.h>
-
-using namespace connectivity::odbc;
-using namespace connectivity;
-using namespace dbtools;
-
-//------------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-// --------------------------------------------------------------------------------
-OConnection::OConnection(const SQLHANDLE _pDriverHandle,ODBCDriver* _pDriver)
- : OSubComponent<OConnection, OConnection_BASE>((::cppu::OWeakObject*)_pDriver, this)
- ,m_pDriver(_pDriver)
- ,m_pDriverHandleCopy(_pDriverHandle)
- ,m_nStatementCount(0)
- ,m_bClosed(sal_True)
- ,m_bUseCatalog(sal_False)
- ,m_bUseOldDateFormat(sal_False)
- ,m_bParameterSubstitution(sal_False)
- ,m_bIgnoreDriverPrivileges(sal_False)
- ,m_bPreventGetVersionColumns(sal_False)
- ,m_bReadOnly(sal_True)
-{
- m_pDriver->acquire();
-}
-//-----------------------------------------------------------------------------
-OConnection::~OConnection()
-{
- if(!isClosed( ))
- close();
-
- if ( SQL_NULL_HANDLE != m_aConnectionHandle )
- N3SQLFreeHandle( SQL_HANDLE_DBC, m_aConnectionHandle );
- m_aConnectionHandle = SQL_NULL_HANDLE;
-
- m_pDriver->release();
- m_pDriver = NULL;
-}
-//-----------------------------------------------------------------------------
-void SAL_CALL OConnection::release() throw()
-{
- relase_ChildImpl();
-}
-// -----------------------------------------------------------------------------
-oslGenericFunction OConnection::getOdbcFunction(sal_Int32 _nIndex) const
-{
- OSL_ENSURE(m_pDriver,"OConnection::getOdbcFunction: m_pDriver is null!");
- return m_pDriver->getOdbcFunction(_nIndex);
-}
-//-----------------------------------------------------------------------------
-SQLRETURN OConnection::OpenConnection(const ::rtl::OUString& aConnectStr,sal_Int32 nTimeOut, sal_Bool bSilent)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if (m_aConnectionHandle == SQL_NULL_HANDLE)
- return -1;
-
- SQLRETURN nSQLRETURN = 0;
- SDB_ODBC_CHAR szConnStrOut[4096];
- SDB_ODBC_CHAR szConnStrIn[2048];
- SQLSMALLINT cbConnStrOut;
- memset(szConnStrOut,'\0',4096);
- memset(szConnStrIn,'\0',2048);
- ::rtl::OString aConStr(::rtl::OUStringToOString(aConnectStr,getTextEncoding()));
- memcpy(szConnStrIn, (SDB_ODBC_CHAR*) aConStr.getStr(), ::std::min<sal_Int32>((sal_Int32)2048,aConStr.getLength()));
-
-#ifndef MACOSX
- N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_LOGIN_TIMEOUT,(SQLPOINTER)(sal_IntPtr)nTimeOut,SQL_IS_UINTEGER);
- // Verbindung aufbauen
-#endif
-
-#ifdef LINUX
- OSL_UNUSED( bSilent );
- nSQLRETURN = N3SQLDriverConnect(m_aConnectionHandle,
- NULL,
- szConnStrIn,
- (SQLSMALLINT) ::std::min((sal_Int32)2048,aConStr.getLength()),
- szConnStrOut,
- (SQLSMALLINT) (sizeof(szConnStrOut)/sizeof(SDB_ODBC_CHAR)) -1,
- &cbConnStrOut,
- SQL_DRIVER_NOPROMPT);
- if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA || SQL_SUCCESS_WITH_INFO == nSQLRETURN)
- return nSQLRETURN;
-#else
-
- SQLUSMALLINT nSilent = bSilent ? SQL_DRIVER_NOPROMPT : SQL_DRIVER_COMPLETE;
- nSQLRETURN = N3SQLDriverConnect(m_aConnectionHandle,
- NULL,
- szConnStrIn,
- (SQLSMALLINT) ::std::min<sal_Int32>((sal_Int32)2048,aConStr.getLength()),
- szConnStrOut,
- (SQLSMALLINT) sizeof szConnStrOut,
- &cbConnStrOut,
- nSilent);
- if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA)
- return nSQLRETURN;
-
- m_bClosed = sal_False;
-
-#endif //LINUX
-
- try
- {
- ::rtl::OUString aVal;
- OTools::GetInfo(this,m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,aVal,*this,getTextEncoding());
- m_bReadOnly = !aVal.compareToAscii("Y");
- }
- catch(Exception&)
- {
- m_bReadOnly = sal_True;
- }
- try
- {
- ::rtl::OUString sVersion;
- OTools::GetInfo(this,m_aConnectionHandle,SQL_DRIVER_ODBC_VER,sVersion,*this,getTextEncoding());
- m_bUseOldDateFormat = sVersion == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("02.50")) || sVersion == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("02.00"));
- }
- catch(Exception&)
- {
- }
-
-
- // autocoomit ist immer default
-
- if (!m_bReadOnly)
- N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_AUTOCOMMIT,(SQLPOINTER)SQL_AUTOCOMMIT_ON,SQL_IS_INTEGER);
-
- return nSQLRETURN;
-}
-//-----------------------------------------------------------------------------
-SQLRETURN OConnection::Construct(const ::rtl::OUString& url,const Sequence< PropertyValue >& info) throw(SQLException)
-{
- m_aConnectionHandle = SQL_NULL_HANDLE;
- m_sURL = url;
- setConnectionInfo(info);
-
- // Connection allozieren
- N3SQLAllocHandle(SQL_HANDLE_DBC,m_pDriverHandleCopy,&m_aConnectionHandle);
- if(m_aConnectionHandle == SQL_NULL_HANDLE)
- throw SQLException();
-
- sal_Int32 nLen = url.indexOf(':');
- nLen = url.indexOf(':',nLen+1);
- ::rtl::OUString aDSN(RTL_CONSTASCII_USTRINGPARAM("DSN=")), aUID, aPWD, aSysDrvSettings;
- aDSN += url.copy(nLen+1);
-
- const char* pUser = "user";
- const char* pTimeout = "Timeout";
- const char* pSilent = "Silent";
- const char* pPwd = "password";
- const char* pUseCatalog = "UseCatalog";
- const char* pSysDrv = "SystemDriverSettings";
- const char* pCharSet = "CharSet";
- const char* pParaName = "ParameterNameSubstitution";
- const char* pPrivName = "IgnoreDriverPrivileges";
- const char* pVerColName = "PreventGetVersionColumns"; // #i60273#
- const char* pRetrieving = "IsAutoRetrievingEnabled";
- const char* pRetriStmt = "AutoRetrievingStatement";
-
- sal_Int32 nTimeout = 20;
- sal_Bool bSilent = sal_True;
- const PropertyValue *pBegin = info.getConstArray();
- const PropertyValue *pEnd = pBegin + info.getLength();
- for(;pBegin != pEnd;++pBegin)
- {
- if(!pBegin->Name.compareToAscii(pTimeout))
- OSL_VERIFY( pBegin->Value >>= nTimeout );
- else if(!pBegin->Name.compareToAscii(pSilent))
- OSL_VERIFY( pBegin->Value >>= bSilent );
- else if(!pBegin->Name.compareToAscii(pPrivName))
- OSL_VERIFY( pBegin->Value >>= m_bIgnoreDriverPrivileges );
- else if(!pBegin->Name.compareToAscii(pVerColName))
- OSL_VERIFY( pBegin->Value >>= m_bPreventGetVersionColumns );
- else if(!pBegin->Name.compareToAscii(pParaName))
- OSL_VERIFY( pBegin->Value >>= m_bParameterSubstitution );
- else if(!pBegin->Name.compareToAscii(pRetrieving))
- {
- sal_Bool bAutoRetrievingEnabled = sal_False;
- OSL_VERIFY( pBegin->Value >>= bAutoRetrievingEnabled );
- enableAutoRetrievingEnabled(bAutoRetrievingEnabled);
- }
- else if(!pBegin->Name.compareToAscii(pRetriStmt))
- {
- ::rtl::OUString sGeneratedValueStatement;
- OSL_VERIFY( pBegin->Value >>= sGeneratedValueStatement );
- setAutoRetrievingStatement(sGeneratedValueStatement);
- }
- else if(!pBegin->Name.compareToAscii(pUser))
- {
- OSL_VERIFY( pBegin->Value >>= aUID );
- aDSN = aDSN + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";UID=")) + aUID;
- }
- else if(!pBegin->Name.compareToAscii(pPwd))
- {
- OSL_VERIFY( pBegin->Value >>= aPWD );
- aDSN = aDSN + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";PWD=")) + aPWD;
- }
- else if(!pBegin->Name.compareToAscii(pUseCatalog))
- {
- OSL_VERIFY( pBegin->Value >>= m_bUseCatalog );
- }
- else if(!pBegin->Name.compareToAscii(pSysDrv))
- {
- OSL_VERIFY( pBegin->Value >>= aSysDrvSettings );
- aDSN += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";"));
- aDSN += aSysDrvSettings;
- }
- else if(0 == pBegin->Name.compareToAscii(pCharSet))
- {
- ::rtl::OUString sIanaName;
- OSL_VERIFY( pBegin->Value >>= sIanaName );
-
- ::dbtools::OCharsetMap aLookupIanaName;
- ::dbtools::OCharsetMap::const_iterator aLookup = aLookupIanaName.find(sIanaName, ::dbtools::OCharsetMap::IANA());
- if (aLookup != aLookupIanaName.end())
- m_nTextEncoding = (*aLookup).getEncoding();
- else
- m_nTextEncoding = RTL_TEXTENCODING_DONTKNOW;
- if(m_nTextEncoding == RTL_TEXTENCODING_DONTKNOW)
- m_nTextEncoding = osl_getThreadTextEncoding();
- }
- }
- m_sUser = aUID;
-
- SQLRETURN nSQLRETURN = OpenConnection(aDSN,nTimeout, bSilent);
- if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA)
- {
- OTools::ThrowException(this,nSQLRETURN,m_aConnectionHandle,SQL_HANDLE_DBC,*this,sal_False);
- }
- return nSQLRETURN;
-}
-// XServiceInfo
-// --------------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OConnection, "com.sun.star.sdbc.drivers.odbc.OConnection", "com.sun.star.sdbc.Connection")
-
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL OConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- Reference< XStatement > xReturn = new OStatement(this);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- Reference< XPreparedStatement > xReturn = new OPreparedStatement(this,sql);
- m_aStatements.push_back(WeakReferenceHelper(xReturn));
- return xReturn;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::prepareCall", *this );
- return NULL;
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConnection::nativeSQL( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ::rtl::OString aSql(::rtl::OUStringToOString(sql.getStr(),getTextEncoding()));
- char pOut[2048];
- SQLINTEGER nOutLen;
- OTools::ThrowException(this,N3SQLNativeSql(m_aConnectionHandle,(SDB_ODBC_CHAR*)aSql.getStr(),aSql.getLength(),(SDB_ODBC_CHAR*)pOut,sizeof pOut - 1,&nOutLen),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
- return ::rtl::OUString(pOut,nOutLen,getTextEncoding());
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setAutoCommit( sal_Bool autoCommit ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- OTools::ThrowException(this,N3SQLSetConnectAttr(m_aConnectionHandle,
- SQL_ATTR_AUTOCOMMIT,
- (SQLPOINTER)((autoCommit) ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF) ,SQL_IS_INTEGER),
- m_aConnectionHandle,SQL_HANDLE_DBC,*this);
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::getAutoCommit( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- sal_uInt32 nOption = 0;
- OTools::ThrowException(this,N3SQLGetConnectAttr(m_aConnectionHandle,
- SQL_ATTR_AUTOCOMMIT, &nOption,0,0),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
- return nOption == SQL_AUTOCOMMIT_ON ;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::commit( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- OTools::ThrowException(this,N3SQLEndTran(SQL_HANDLE_DBC,m_aConnectionHandle,SQL_COMMIT),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::rollback( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- OTools::ThrowException(this,N3SQLEndTran(SQL_HANDLE_DBC,m_aConnectionHandle,SQL_ROLLBACK),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::isClosed( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- return OConnection_BASE::rBHelper.bDisposed;
-}
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL OConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if(!xMetaData.is())
- {
- xMetaData = new ODatabaseMetaData(m_aConnectionHandle,this);
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- OTools::ThrowException(this,
- N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_ACCESS_MODE,reinterpret_cast< SQLPOINTER >( readOnly ),SQL_IS_INTEGER),
- m_aConnectionHandle,SQL_HANDLE_DBC,*this);
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OConnection::isReadOnly() throw(SQLException, RuntimeException)
-{
- // const member which will initialized only once
- return m_bReadOnly;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- ::rtl::OString aCat(::rtl::OUStringToOString(catalog.getStr(),getTextEncoding()));
- OTools::ThrowException(this,
- N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_CURRENT_CATALOG,(SDB_ODBC_CHAR*)aCat.getStr(),SQL_NTS),
- m_aConnectionHandle,SQL_HANDLE_DBC,*this);
-}
-// --------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConnection::getCatalog( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- sal_Int32 nValueLen;
- char pCat[1024];
- OTools::ThrowException(this,
- N3SQLGetConnectAttr(m_aConnectionHandle,SQL_ATTR_CURRENT_CATALOG,(SDB_ODBC_CHAR*)pCat,(sizeof pCat)-1,&nValueLen),
- m_aConnectionHandle,SQL_HANDLE_DBC,*this);
-
- return ::rtl::OUString(pCat,nValueLen,getTextEncoding());
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 level ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- OTools::ThrowException(this,N3SQLSetConnectAttr(m_aConnectionHandle,
- SQL_ATTR_TXN_ISOLATION,
- (SQLPOINTER)(sal_IntPtr)level,SQL_IS_INTEGER),
- m_aConnectionHandle,SQL_HANDLE_DBC,*this);
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OConnection::getTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- sal_Int32 nTxn = 0;
- SQLINTEGER nValueLen;
- OTools::ThrowException(this,
- N3SQLGetConnectAttr(m_aConnectionHandle,SQL_ATTR_TXN_ISOLATION,&nTxn,sizeof nTxn,&nValueLen),
- m_aConnectionHandle,SQL_HANDLE_DBC,*this);
- return nTxn;
-}
-// --------------------------------------------------------------------------------
-Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OConnection::getTypeMap( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
-
- return NULL;
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::setTypeMap( const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::setTypeMap", *this );
-}
-// --------------------------------------------------------------------------------
-// XCloseable
-void SAL_CALL OConnection::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-}
-// --------------------------------------------------------------------------------
-// XWarningsSupplier
-Any SAL_CALL OConnection::getWarnings( ) throw(SQLException, RuntimeException)
-{
- return Any();
-}
-// --------------------------------------------------------------------------------
-void SAL_CALL OConnection::clearWarnings( ) throw(SQLException, RuntimeException)
-{
-}
-//--------------------------------------------------------------------
-void OConnection::buildTypeInfo() throw( SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- Reference< XResultSet> xRs = getMetaData ()->getTypeInfo ();
- if(xRs.is())
- {
- Reference< XRow> xRow(xRs,UNO_QUERY);
- // Information for a single SQL type
-
- ::connectivity::ORowSetValue aValue;
- ::std::vector<sal_Int32> aTypes;
- Reference<XResultSetMetaData> xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(xRs,UNO_QUERY)->getMetaData();
- sal_Int32 nCount = xResultSetMetaData->getColumnCount();
- // Loop on the result set until we reach end of file
- while (xRs->next ())
- {
- OTypeInfo aInfo;
- sal_Int32 nPos = 1;
- if ( aTypes.empty() )
- {
- if ( nCount < 1 )
- nCount = 18;
- aTypes.reserve(nCount+1);
- aTypes.push_back(-1);
- for (sal_Int32 j = 1; j <= nCount ; ++j)
- aTypes.push_back(xResultSetMetaData->getColumnType(j));
- }
-
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.aTypeName = aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.nType = aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.nPrecision = aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.aLiteralPrefix = aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.aLiteralSuffix = aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.aCreateParams = aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.bNullable = (sal_Int32)aValue == ColumnValue::NULLABLE;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.bCaseSensitive = (sal_Bool)aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.nSearchType = aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.bUnsigned = (sal_Bool)aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.bCurrency = (sal_Bool)aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.bAutoIncrement = (sal_Bool)aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.aLocalTypeName = aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.nMinimumScale = aValue;
- ++nPos;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.nMaximumScale = aValue;
- if ( nCount >= 18 )
- {
- nPos = 18;
- aValue.fill(nPos,aTypes[nPos],xRow);
- aInfo.nNumPrecRadix = aValue;
- }
-
- // check if values are less than zero like it happens in a oracle jdbc driver
- if( aInfo.nPrecision < 0)
- aInfo.nPrecision = 0;
- if( aInfo.nMinimumScale < 0)
- aInfo.nMinimumScale = 0;
- if( aInfo.nMaximumScale < 0)
- aInfo.nMaximumScale = 0;
- if( aInfo.nNumPrecRadix < 0)
- aInfo.nNumPrecRadix = 10;
-
- // Now that we have the type info, save it
- // in the Hashtable if we don't already have an
- // entry for this SQL type.
-
- m_aTypeInfo.push_back(aInfo);
- }
-
- // Close the result set/statement.
-
- Reference< XCloseable> xClose(xRs,UNO_QUERY);
- if(xClose.is())
- xClose->close();
- }
-}
-//------------------------------------------------------------------------------
-void OConnection::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- OConnection_BASE::disposing();
-
- for (::std::map< SQLHANDLE,OConnection*>::iterator aConIter = m_aConnections.begin();aConIter != m_aConnections.end();++aConIter )
- aConIter->second->dispose();
-
- ::std::map< SQLHANDLE,OConnection*>().swap(m_aConnections);
-
- if(!m_bClosed)
- N3SQLDisconnect(m_aConnectionHandle);
- m_bClosed = sal_True;
-
- dispose_ChildImpl();
-}
-// -----------------------------------------------------------------------------
-OConnection* OConnection::cloneConnection()
-{
- return new OConnection(m_pDriverHandleCopy,m_pDriver);
-}
-// -----------------------------------------------------------------------------
-SQLHANDLE OConnection::createStatementHandle()
-{
- OConnection* pConnectionTemp = this;
- sal_Bool bNew = sal_False;
- try
- {
- sal_Int32 nMaxStatements = getMetaData()->getMaxStatements();
- if(nMaxStatements && nMaxStatements <= m_nStatementCount)
- {
- OConnection* pConnection = cloneConnection();
- pConnection->acquire();
- pConnection->Construct(m_sURL,getConnectionInfo());
- pConnectionTemp = pConnection;
- bNew = sal_True;
- }
- }
- catch(SQLException&)
- {
- }
-
- SQLHANDLE aStatementHandle = SQL_NULL_HANDLE;
- SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,pConnectionTemp->getConnection(),&aStatementHandle);
- OSL_UNUSED( nRetcode );
- ++m_nStatementCount;
- if(bNew)
- m_aConnections.insert(::std::map< SQLHANDLE,OConnection*>::value_type(aStatementHandle,pConnectionTemp));
-
- return aStatementHandle;
-
-}
-// -----------------------------------------------------------------------------
-void OConnection::freeStatementHandle(SQLHANDLE& _pHandle)
-{
- ::std::map< SQLHANDLE,OConnection*>::iterator aFind = m_aConnections.find(_pHandle);
-
- N3SQLFreeStmt(_pHandle,SQL_RESET_PARAMS);
- N3SQLFreeStmt(_pHandle,SQL_UNBIND);
- N3SQLFreeStmt(_pHandle,SQL_CLOSE);
- N3SQLFreeHandle(SQL_HANDLE_STMT,_pHandle);
-
- _pHandle = SQL_NULL_HANDLE;
-
- if(aFind != m_aConnections.end())
- {
- aFind->second->dispose();
- m_aConnections.erase(aFind);
- }
- --m_nStatementCount;
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx
deleted file mode 100644
index c374447c6f..0000000000
--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx
+++ /dev/null
@@ -1,1744 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "odbc/ODatabaseMetaData.hxx"
-#include "odbc/OTools.hxx"
-#include "odbc/ODatabaseMetaDataResultSet.hxx"
-#include "FDatabaseMetaDataResultSet.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include "odbc/OFunctiondefs.hxx"
-#include "stdio.h"
-#include "TPrivilegesResultSet.hxx"
-#include <connectivity/dbexception.hxx>
-#include <rtl/ustrbuf.hxx>
-
-using namespace connectivity::odbc;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-
-ODatabaseMetaData::ODatabaseMetaData(const SQLHANDLE _pHandle,OConnection* _pCon)
- : ::connectivity::ODatabaseMetaDataBase(_pCon,_pCon->getConnectionInfo())
- ,m_aConnectionHandle(_pHandle)
- ,m_pConnection(_pCon)
- ,m_bUseCatalog(sal_True)
- ,m_bOdbc3(sal_True)
-{
- OSL_ENSURE(m_pConnection,"ODatabaseMetaData::ODatabaseMetaData: No connection set!");
- if(!m_pConnection->isCatalogUsed())
- {
- osl_incrementInterlockedCount( &m_refCount );
- try
- {
- m_bUseCatalog = !(usesLocalFiles() || usesLocalFilePerTable());
- ::rtl::OUString sVersion = getDriverVersion();
- m_bOdbc3 = sVersion != ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("02.50")) && sVersion != ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("02.00"));
- }
- catch(SQLException& )
- { // doesn't matter here
- }
- osl_decrementInterlockedCount( &m_refCount );
- }
-}
-// -------------------------------------------------------------------------
-ODatabaseMetaData::~ODatabaseMetaData()
-{
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > ODatabaseMetaData::impl_getTypeInfo_throw( )
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openTypeInfo();
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
- }
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs( ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- if(!m_bUseCatalog)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCatalogs);
- }
- else
- {
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openCatalogs();
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCatalogs);
- }
- }
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaData::impl_getCatalogSeparator_throw( )
-{
- ::rtl::OUString aVal;
- if ( m_bUseCatalog )
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_NAME_SEPARATOR,aVal,*this,m_pConnection->getTextEncoding());
-
- return aVal;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas( ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openSchemas();
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eSchemas);
- }
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
- const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openColumnPrivileges(m_bUseCatalog ? catalog : Any(),schema,table,columnNamePattern);
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumnPrivileges);
- }
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
- const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern,
- const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openColumns(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern,columnNamePattern);
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns);
- }
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
- const Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openTables(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern,types);
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTables);
- }
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns(
- const Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openProcedureColumns(m_bUseCatalog ? catalog : Any(),schemaPattern,procedureNamePattern,columnNamePattern);
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eProcedureColumns);
- }
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
- const Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& procedureNamePattern ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openProcedures(m_bUseCatalog ? catalog : Any(),schemaPattern,procedureNamePattern);
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eProcedures);
- }
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- bool bSuccess = false;
- try
- {
- if ( !m_pConnection->preventGetVersionColumns() )
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openVersionColumns(m_bUseCatalog ? catalog : Any(),schema,table);
- bSuccess = true;
- }
- }
- catch(SQLException&)
- {
- }
-
- if ( !bSuccess )
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eVersionColumns);
- }
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_BINARY_LITERAL_LEN,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_ROW_SIZE,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CATALOG_NAME_LEN,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CHAR_LITERAL_LEN,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMN_NAME_LEN,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_INDEX,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CURSOR_NAME_LEN,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_DRIVER_CONNECTIONS/*SQL_ACTIVE_CONNECTIONS*/,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_TABLE,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_STATEMENT_LEN,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_TABLE_NAME_LEN,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaData::impl_getMaxTablesInSelect_throw( )
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_TABLES_IN_SELECT,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openExportedKeys(m_bUseCatalog ? catalog : Any(),schema,table);
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eExportedKeys);
- }
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openImportedKeys(m_bUseCatalog ? catalog : Any(),schema,table);
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eImportedKeys);
- }
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openPrimaryKeys(m_bUseCatalog ? catalog : Any(),schema,table);
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::ePrimaryKeys);
- }
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
- sal_Bool unique, sal_Bool approximate ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openIndexInfo(m_bUseCatalog ? catalog : Any(),schema,table,unique,approximate);
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eIndexInfo);
- }
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getBestRowIdentifier(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope,
- sal_Bool nullable ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openBestRowIdentifier(m_bUseCatalog ? catalog : Any(),schema,table,scope,nullable);
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eBestRowIdentifier);
- }
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
- const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException)
-{
- if ( m_pConnection->isIgnoreDriverPrivilegesEnabled() )
- {
- return new OResultSetPrivileges(this,catalog,schemaPattern,tableNamePattern);
- }
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- Reference< XResultSet > xRef = pResult;
- pResult->openTablePrivileges(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
- const Any& primaryCatalog, const ::rtl::OUString& primarySchema,
- const ::rtl::OUString& primaryTable, const Any& foreignCatalog,
- const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(SQLException, RuntimeException)
-{
- Reference< XResultSet > xRef;
- try
- {
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
- xRef = pResult;
- pResult->openForeignKeys(m_bUseCatalog ? primaryCatalog : Any(),primarySchema.toChar() == '%' ? &primarySchema : NULL,&primaryTable,
- m_bUseCatalog ? foreignCatalog : Any(), foreignSchema.toChar() == '%' ? &foreignSchema : NULL,&foreignTable);
- }
- catch(SQLException&)
- {
- xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCrossReference);
- }
- return xRef;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_ROW_SIZE_INCLUDES_LONG,aVal,*this,m_pConnection->getTextEncoding());
- return aVal.toChar() == 'Y';
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
- return nValue == SQL_IC_LOWER;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
- return nValue == SQL_IC_LOWER;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
- return nValue == SQL_IC_MIXED;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
- return nValue == SQL_IC_MIXED;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
- return nValue == SQL_IC_UPPER;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
- return nValue == SQL_IC_UPPER;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( )
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ALTER_TABLE,nValue,*this);
- return (nValue & SQL_AT_ADD_COLUMN) == SQL_AT_ADD_COLUMN;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( )
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ALTER_TABLE,nValue,*this);
- return ((nValue & SQL_AT_DROP_COLUMN) == SQL_AT_DROP_COLUMN) ||
- ((nValue & SQL_AT_DROP_COLUMN_CASCADE) == SQL_AT_DROP_COLUMN_CASCADE) ||
- ((nValue & SQL_AT_DROP_COLUMN_RESTRICT) == SQL_AT_DROP_COLUMN_RESTRICT);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_INDEX_SIZE,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NON_NULLABLE_COLUMNS,nValue,*this);
- return nValue == SQL_NNC_NON_NULL;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- if(m_bUseCatalog)
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_TERM,aVal,*this,m_pConnection->getTextEncoding());
- return aVal;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaData::impl_getIdentifierQuoteString_throw( )
-{
- ::rtl::OUString aVal;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_QUOTE_CHAR,aVal,*this,m_pConnection->getTextEncoding());
- return aVal;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aVal;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SPECIAL_CHARACTERS,aVal,*this,m_pConnection->getTextEncoding());
- return aVal;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
- return nValue != SQL_CN_NONE;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_isCatalogAtStart_throw( )
-{
- SQLUSMALLINT nValue=0;
- if ( m_bUseCatalog )
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_LOCATION,nValue,*this);
- return nValue == SQL_CL_START;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
- return nValue == SQL_TC_DDL_IGNORE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
- return nValue == SQL_TC_DDL_COMMIT;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
- return nValue == SQL_TC_DML;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
- return nValue == SQL_TC_ALL;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
- return (nValue & SQL_CA1_POS_DELETE) == SQL_CA1_POS_DELETE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
- return (nValue & SQL_CA1_POS_UPDATE) == SQL_CA1_POS_UPDATE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_ROLLBACK_BEHAVIOR,nValue,*this);
- return nValue == SQL_CB_PRESERVE || nValue == SQL_CB_CLOSE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_COMMIT_BEHAVIOR,nValue,*this);
- return nValue == SQL_CB_PRESERVE || nValue == SQL_CB_CLOSE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_COMMIT_BEHAVIOR,nValue,*this);
- return nValue == SQL_CB_PRESERVE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_ROLLBACK_BEHAVIOR,nValue,*this);
- return nValue == SQL_CB_PRESERVE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_ISOLATION_OPTION,nValue,*this);
- return (nValue & static_cast<SQLUINTEGER>(level)) == static_cast<SQLUINTEGER>(level);
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( )
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
- return (nValue & SQL_SU_DML_STATEMENTS) == SQL_SU_DML_STATEMENTS;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
- return nValue == SQL_SC_SQL92_FULL;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
- return nValue == SQL_SC_SQL92_ENTRY;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aStr;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_INTEGRITY,aStr,*this,m_pConnection->getTextEncoding());
- return aStr.toChar() == 'Y';
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
- return (nValue & SQL_SU_INDEX_DEFINITION) == SQL_SU_INDEX_DEFINITION;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( )
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
- return (nValue & SQL_SU_TABLE_DEFINITION) == SQL_SU_TABLE_DEFINITION;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( )
-{
- SQLUINTEGER nValue=0;
- if(m_bUseCatalog)
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
- return (nValue & SQL_CU_TABLE_DEFINITION) == SQL_CU_TABLE_DEFINITION;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue=0;
- if(m_bUseCatalog)
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
- return (nValue & SQL_CU_INDEX_DEFINITION) == SQL_CU_INDEX_DEFINITION;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( )
-{
- SQLUINTEGER nValue=0;
- if(m_bUseCatalog)
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
- return (nValue & SQL_CU_DML_STATEMENTS) == SQL_CU_DML_STATEMENTS;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_OJ_CAPABILITIES,nValue,*this);
- return ((nValue & (SQL_OJ_FULL|SQL_OJ_LEFT|SQL_OJ_RIGHT|SQL_OJ_NESTED|SQL_OJ_NOT_ORDERED|SQL_OJ_ALL_COMPARISON_OPS|SQL_OJ_INNER)) != 0);
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException)
-{
-
- // there exists no possibility to get table types so we have to check
- static ::rtl::OUString sTableTypes[] =
- {
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SYSTEM TABLE")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GLOBAL TEMPORARY")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LOCAL TEMPORARY")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALIAS")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SYNONYM"))
- };
- sal_Int32 nSize = sizeof(sTableTypes) / sizeof(::rtl::OUString);
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTableTypes);
- Reference< XResultSet > xRef = pResult;
- SQLUINTEGER nValue = 0;
- try
- {
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CREATE_VIEW,nValue,*this);
- }
- catch(const Exception&)
- {
- }
- sal_Bool bViewsSupported = (nValue & SQL_CV_CREATE_VIEW) == SQL_CV_CREATE_VIEW;
-
- ::connectivity::ODatabaseMetaDataResultSet::ORows aRows;
- for(sal_Int32 i=0;i < nSize;++i)
- {
- if( !bViewsSupported && i == 1)
- continue; // no views supported
- ::connectivity::ODatabaseMetaDataResultSet::ORow aRow;
- aRow.push_back(::connectivity::ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ::connectivity::ORowSetValueDecorator(sTableTypes[i]));
- aRows.push_back(aRow);
- }
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaData::impl_getMaxStatements_throw( )
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CONCURRENT_ACTIVITIES,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_PROCEDURE_NAME_LEN,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_SCHEMA_NAME_LEN,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
- return nValue != SQL_TC_NONE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ACCESSIBLE_PROCEDURES,aValue,*this,m_pConnection->getTextEncoding());
- return aValue.toChar() == 'Y';
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_PROCEDURES,aValue,*this,m_pConnection->getTextEncoding());
- return aValue.toChar() == 'Y';
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
- return (nValue & SQL_CA1_POSITIONED_UPDATE) == SQL_CA1_POSITIONED_UPDATE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ACCESSIBLE_TABLES,aValue,*this,m_pConnection->getTextEncoding());
- return aValue.toChar() == 'Y';
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
-{
- return m_pConnection->isReadOnly();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_FILE_USAGE,nValue,*this);
- return nValue == SQL_FILE_CATALOG;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_FILE_USAGE,nValue,*this);
- return nValue == SQL_FILE_TABLE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_FUNCTIONS,nValue,*this);
- return (nValue & SQL_FN_CVT_CONVERT) == SQL_FN_CVT_CONVERT;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONCAT_NULL_BEHAVIOR,nValue,*this);
- return nValue == SQL_CB_NULL;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_COLUMN_ALIAS,aValue,*this,m_pConnection->getTextEncoding());
- return aValue.toChar() == 'Y';
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
- return nValue != SQL_CN_NONE;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(SQLException, RuntimeException)
-{
- if(fromType == toType)
- return sal_True;
-
- SQLUINTEGER nValue=0;
- switch(fromType)
- {
- case DataType::BIT:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BIT,nValue,*this);
- break;
- case DataType::TINYINT:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TINYINT,nValue,*this);
- break;
- case DataType::SMALLINT:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_SMALLINT,nValue,*this);
- break;
- case DataType::INTEGER:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_INTEGER,nValue,*this);
- break;
- case DataType::BIGINT:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BIGINT,nValue,*this);
- break;
- case DataType::FLOAT:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_FLOAT,nValue,*this);
- break;
- case DataType::REAL:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_REAL,nValue,*this);
- break;
- case DataType::DOUBLE:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DOUBLE,nValue,*this);
- break;
- case DataType::NUMERIC:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_NUMERIC,nValue,*this);
- break;
- case DataType::DECIMAL:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DECIMAL,nValue,*this);
- break;
- case DataType::CHAR:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_CHAR,nValue,*this);
- break;
- case DataType::VARCHAR:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_VARCHAR,nValue,*this);
- break;
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_LONGVARCHAR,nValue,*this);
- break;
- case DataType::DATE:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DATE,nValue,*this);
- break;
- case DataType::TIME:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TIME,nValue,*this);
- break;
- case DataType::TIMESTAMP:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TIMESTAMP,nValue,*this);
- break;
- case DataType::BINARY:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BINARY,nValue,*this);
- break;
- case DataType::VARBINARY:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_VARBINARY,nValue,*this);
- break;
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_LONGVARBINARY,nValue,*this);
- break;
- case DataType::SQLNULL:
- // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
- break;
- case DataType::OTHER:
- // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
- break;
- case DataType::OBJECT:
- // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
- break;
- case DataType::DISTINCT:
- // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
- break;
- case DataType::STRUCT:
- // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
- break;
- case DataType::ARRAY:
- // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
- break;
- case DataType::REF:
- // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
- break;
- }
- sal_Bool bConvert = sal_False;
- switch(toType)
- {
- case DataType::BIT:
- bConvert = (nValue & SQL_CVT_BIT) == SQL_CVT_BIT;
- break;
- case DataType::TINYINT:
- bConvert = (nValue & SQL_CVT_TINYINT) == SQL_CVT_TINYINT;
- break;
- case DataType::SMALLINT:
- bConvert = (nValue & SQL_CVT_SMALLINT) == SQL_CVT_SMALLINT;
- break;
- case DataType::INTEGER:
- bConvert = (nValue & SQL_CVT_INTEGER) == SQL_CVT_INTEGER;
- break;
- case DataType::BIGINT:
- bConvert = (nValue & SQL_CVT_BIGINT) == SQL_CVT_BIGINT;
- break;
- case DataType::FLOAT:
- bConvert = (nValue & SQL_CVT_FLOAT) == SQL_CVT_FLOAT;
- break;
- case DataType::REAL:
- bConvert = (nValue & SQL_CVT_REAL) == SQL_CVT_REAL;
- break;
- case DataType::DOUBLE:
- bConvert = (nValue & SQL_CVT_DOUBLE) == SQL_CVT_DOUBLE;
- break;
- case DataType::NUMERIC:
- bConvert = (nValue & SQL_CVT_NUMERIC) == SQL_CVT_NUMERIC;
- break;
- case DataType::DECIMAL:
- bConvert = (nValue & SQL_CVT_DECIMAL) == SQL_CVT_DECIMAL;
- break;
- case DataType::CHAR:
- bConvert = (nValue & SQL_CVT_CHAR) == SQL_CVT_CHAR;
- break;
- case DataType::VARCHAR:
- bConvert = (nValue & SQL_CVT_VARCHAR) == SQL_CVT_VARCHAR;
- break;
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- bConvert = (nValue & SQL_CVT_LONGVARCHAR) == SQL_CVT_LONGVARCHAR;
- break;
- case DataType::DATE:
- bConvert = (nValue & SQL_CVT_DATE) == SQL_CVT_DATE;
- break;
- case DataType::TIME:
- bConvert = (nValue & SQL_CVT_TIME) == SQL_CVT_TIME;
- break;
- case DataType::TIMESTAMP:
- bConvert = (nValue & SQL_CVT_TIMESTAMP) == SQL_CVT_TIMESTAMP;
- break;
- case DataType::BINARY:
- bConvert = (nValue & SQL_CVT_BINARY) == SQL_CVT_BINARY;
- break;
- case DataType::VARBINARY:
- bConvert = (nValue & SQL_CVT_VARBINARY) == SQL_CVT_VARBINARY;
- break;
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- bConvert = (nValue & SQL_CVT_LONGVARBINARY) == SQL_CVT_LONGVARBINARY;
- break;
- }
-
- return bConvert;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_EXPRESSIONS_IN_ORDERBY,aValue,*this,m_pConnection->getTextEncoding());
- return aValue.toChar() == 'Y';
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
- return nValue != SQL_GB_NOT_SUPPORTED;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
- return nValue != SQL_GB_GROUP_BY_CONTAINS_SELECT;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
- return nValue == SQL_GB_NO_RELATION;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MULTIPLE_ACTIVE_TXN,aValue,*this,m_pConnection->getTextEncoding());
- return aValue.toChar() == 'Y';
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MULT_RESULT_SETS,aValue,*this,m_pConnection->getTextEncoding());
- return aValue.toChar() == 'Y';
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_LIKE_ESCAPE_CLAUSE,aValue,*this,m_pConnection->getTextEncoding());
- return aValue.toChar() == 'Y';
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ORDER_BY_COLUMNS_IN_SELECT,aValue,*this,m_pConnection->getTextEncoding());
- return aValue.toChar() == 'N';
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_UNION,nValue,*this);
- return (nValue & SQL_U_UNION) == SQL_U_UNION;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_UNION,nValue,*this);
- return (nValue & SQL_U_UNION_ALL) == SQL_U_UNION_ALL;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
- return nValue == SQL_IC_MIXED;
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
- return nValue == SQL_IC_MIXED;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
- return nValue == SQL_NC_END;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
- return nValue == SQL_NC_START;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
- return nValue == SQL_NC_HIGH;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
- return nValue == SQL_NC_LOW;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
- return (nValue & SQL_SU_PROCEDURE_INVOCATION) == SQL_SU_PROCEDURE_INVOCATION;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
- return (nValue & SQL_SU_PRIVILEGE_DEFINITION) == SQL_SU_PRIVILEGE_DEFINITION;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue=0;
- if(m_bUseCatalog)
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
- return (nValue & SQL_CU_PROCEDURE_INVOCATION) == SQL_CU_PROCEDURE_INVOCATION;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue=0;
- if(m_bUseCatalog)
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
- return (nValue & SQL_CU_PRIVILEGE_DEFINITION) == SQL_CU_PRIVILEGE_DEFINITION;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
- return (nValue & SQL_SQ_CORRELATED_SUBQUERIES) == SQL_SQ_CORRELATED_SUBQUERIES;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
- return (nValue & SQL_SQ_COMPARISON) == SQL_SQ_COMPARISON;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
- return (nValue & SQL_SQ_EXISTS) == SQL_SQ_EXISTS;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
- return (nValue & SQL_SQ_IN) == SQL_SQ_IN;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
- return (nValue & SQL_SQ_QUANTIFIED) == SQL_SQ_QUANTIFIED;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
- return nValue == SQL_SC_SQL92_INTERMEDIATE;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaData::getURLImpl()
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DATA_SOURCE_NAME,aValue,*this,m_pConnection->getTextEncoding());
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue = m_pConnection->getURL();
- if ( !aValue.getLength() )
- {
- aValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:odbc:"));
- aValue += getURLImpl();
- }
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_USER_NAME,aValue,*this,m_pConnection->getTextEncoding());
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_NAME,aValue,*this,m_pConnection->getTextEncoding());
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverVersion() throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_ODBC_VER,aValue,*this,m_pConnection->getTextEncoding());
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DBMS_NAME,aValue,*this,m_pConnection->getTextEncoding());
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_PROCEDURE_TERM,aValue,*this,m_pConnection->getTextEncoding());
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_TERM,aValue,*this,m_pConnection->getTextEncoding());
- return aValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
- return aValue.copy(0,aValue.indexOf('.')).toInt32();
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
- return aValue.copy(0,aValue.lastIndexOf('.')).toInt32();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_KEYWORDS,aValue,*this,m_pConnection->getTextEncoding());
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException)
-{
- ::rtl::OUString aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SEARCH_PATTERN_ESCAPE,aValue,*this,m_pConnection->getTextEncoding());
- return aValue;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- ::rtl::OUStringBuffer aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_STRING_FUNCTIONS,nValue,*this);
- if(nValue & SQL_FN_STR_ASCII)
- aValue.appendAscii("ASCII,");
- if(nValue & SQL_FN_STR_BIT_LENGTH)
- aValue.appendAscii("BIT_LENGTH,");
- if(nValue & SQL_FN_STR_CHAR)
- aValue.appendAscii("CHAR,");
- if(nValue & SQL_FN_STR_CHAR_LENGTH)
- aValue.appendAscii("CHAR_LENGTH,");
- if(nValue & SQL_FN_STR_CHARACTER_LENGTH)
- aValue.appendAscii("CHARACTER_LENGTH,");
- if(nValue & SQL_FN_STR_CONCAT)
- aValue.appendAscii("CONCAT,");
- if(nValue & SQL_FN_STR_DIFFERENCE)
- aValue.appendAscii("DIFFERENCE,");
- if(nValue & SQL_FN_STR_INSERT)
- aValue.appendAscii("INSERT,");
- if(nValue & SQL_FN_STR_LCASE)
- aValue.appendAscii("LCASE,");
- if(nValue & SQL_FN_STR_LEFT)
- aValue.appendAscii("LEFT,");
- if(nValue & SQL_FN_STR_LENGTH)
- aValue.appendAscii("LENGTH,");
- if(nValue & SQL_FN_STR_LOCATE)
- aValue.appendAscii("LOCATE,");
- if(nValue & SQL_FN_STR_LOCATE_2)
- aValue.appendAscii("LOCATE_2,");
- if(nValue & SQL_FN_STR_LTRIM)
- aValue.appendAscii("LTRIM,");
- if(nValue & SQL_FN_STR_OCTET_LENGTH)
- aValue.appendAscii("OCTET_LENGTH,");
- if(nValue & SQL_FN_STR_POSITION)
- aValue.appendAscii("POSITION,");
- if(nValue & SQL_FN_STR_REPEAT)
- aValue.appendAscii("REPEAT,");
- if(nValue & SQL_FN_STR_REPLACE)
- aValue.appendAscii("REPLACE,");
- if(nValue & SQL_FN_STR_RIGHT)
- aValue.appendAscii("RIGHT,");
- if(nValue & SQL_FN_STR_RTRIM)
- aValue.appendAscii("RTRIM,");
- if(nValue & SQL_FN_STR_SOUNDEX)
- aValue.appendAscii("SOUNDEX,");
- if(nValue & SQL_FN_STR_SPACE)
- aValue.appendAscii("SPACE,");
- if(nValue & SQL_FN_STR_SUBSTRING)
- aValue.appendAscii("SUBSTRING,");
- if(nValue & SQL_FN_STR_UCASE)
- aValue.appendAscii("UCASE,");
-
-
- if ( aValue.getLength() )
- aValue.setLength(aValue.getLength()-1);
-
- return aValue.makeStringAndClear();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- ::rtl::OUStringBuffer aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TIMEDATE_FUNCTIONS,nValue,*this);
-
- if(nValue & SQL_FN_TD_CURRENT_DATE)
- aValue.appendAscii("CURRENT_DATE,");
- if(nValue & SQL_FN_TD_CURRENT_TIME)
- aValue.appendAscii("CURRENT_TIME,");
- if(nValue & SQL_FN_TD_CURRENT_TIMESTAMP)
- aValue.appendAscii("CURRENT_TIMESTAMP,");
- if(nValue & SQL_FN_TD_CURDATE)
- aValue.appendAscii("CURDATE,");
- if(nValue & SQL_FN_TD_CURTIME)
- aValue.appendAscii("CURTIME,");
- if(nValue & SQL_FN_TD_DAYNAME)
- aValue.appendAscii("DAYNAME,");
- if(nValue & SQL_FN_TD_DAYOFMONTH)
- aValue.appendAscii("DAYOFMONTH,");
- if(nValue & SQL_FN_TD_DAYOFWEEK)
- aValue.appendAscii("DAYOFWEEK,");
- if(nValue & SQL_FN_TD_DAYOFYEAR)
- aValue.appendAscii("DAYOFYEAR,");
- if(nValue & SQL_FN_TD_EXTRACT)
- aValue.appendAscii("EXTRACT,");
- if(nValue & SQL_FN_TD_HOUR)
- aValue.appendAscii("HOUR,");
- if(nValue & SQL_FN_TD_MINUTE)
- aValue.appendAscii("MINUTE,");
- if(nValue & SQL_FN_TD_MONTH)
- aValue.appendAscii("MONTH,");
- if(nValue & SQL_FN_TD_MONTHNAME)
- aValue.appendAscii("MONTHNAME,");
- if(nValue & SQL_FN_TD_NOW)
- aValue.appendAscii("NOW,");
- if(nValue & SQL_FN_TD_QUARTER)
- aValue.appendAscii("QUARTER,");
- if(nValue & SQL_FN_TD_SECOND)
- aValue.appendAscii("SECOND,");
- if(nValue & SQL_FN_TD_TIMESTAMPADD)
- aValue.appendAscii("TIMESTAMPADD,");
- if(nValue & SQL_FN_TD_TIMESTAMPDIFF)
- aValue.appendAscii("TIMESTAMPDIFF,");
- if(nValue & SQL_FN_TD_WEEK)
- aValue.appendAscii("WEEK,");
- if(nValue & SQL_FN_TD_YEAR)
- aValue.appendAscii("YEAR,");
-
- if ( aValue.getLength() )
- aValue.setLength(aValue.getLength()-1);
-
- return aValue.makeStringAndClear();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- ::rtl::OUStringBuffer aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SYSTEM_FUNCTIONS,nValue,*this);
-
- if(nValue & SQL_FN_SYS_DBNAME)
- aValue.appendAscii("DBNAME,");
- if(nValue & SQL_FN_SYS_IFNULL)
- aValue.appendAscii("IFNULL,");
- if(nValue & SQL_FN_SYS_USERNAME)
- aValue.appendAscii("USERNAME,");
-
- if ( aValue.getLength() )
- aValue.setLength(aValue.getLength()-1);
-
- return aValue.makeStringAndClear();
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- ::rtl::OUStringBuffer aValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NUMERIC_FUNCTIONS,nValue,*this);
-
- if(nValue & SQL_FN_NUM_ABS)
- aValue.appendAscii("ABS,");
- if(nValue & SQL_FN_NUM_ACOS)
- aValue.appendAscii("ACOS,");
- if(nValue & SQL_FN_NUM_ASIN)
- aValue.appendAscii("ASIN,");
- if(nValue & SQL_FN_NUM_ATAN)
- aValue.appendAscii("ATAN,");
- if(nValue & SQL_FN_NUM_ATAN2)
- aValue.appendAscii("ATAN2,");
- if(nValue & SQL_FN_NUM_CEILING)
- aValue.appendAscii("CEILING,");
- if(nValue & SQL_FN_NUM_COS)
- aValue.appendAscii("COS,");
- if(nValue & SQL_FN_NUM_COT)
- aValue.appendAscii("COT,");
- if(nValue & SQL_FN_NUM_DEGREES)
- aValue.appendAscii("DEGREES,");
- if(nValue & SQL_FN_NUM_EXP)
- aValue.appendAscii("EXP,");
- if(nValue & SQL_FN_NUM_FLOOR)
- aValue.appendAscii("FLOOR,");
- if(nValue & SQL_FN_NUM_LOG)
- aValue.appendAscii("LOGF,");
- if(nValue & SQL_FN_NUM_LOG10)
- aValue.appendAscii("LOG10,");
- if(nValue & SQL_FN_NUM_MOD)
- aValue.appendAscii("MOD,");
- if(nValue & SQL_FN_NUM_PI)
- aValue.appendAscii("PI,");
- if(nValue & SQL_FN_NUM_POWER)
- aValue.appendAscii("POWER,");
- if(nValue & SQL_FN_NUM_RADIANS)
- aValue.appendAscii("RADIANS,");
- if(nValue & SQL_FN_NUM_RAND)
- aValue.appendAscii("RAND,");
- if(nValue & SQL_FN_NUM_ROUND)
- aValue.appendAscii("ROUND,");
- if(nValue & SQL_FN_NUM_SIGN)
- aValue.appendAscii("SIGN,");
- if(nValue & SQL_FN_NUM_SIN)
- aValue.appendAscii("SIN,");
- if(nValue & SQL_FN_NUM_SQRT)
- aValue.appendAscii("SQRT,");
- if(nValue & SQL_FN_NUM_TAN)
- aValue.appendAscii("TAN,");
- if(nValue & SQL_FN_NUM_TRUNCATE)
- aValue.appendAscii("TRUNCATE,");
-
- if ( aValue.getLength() )
- aValue.setLength(aValue.getLength()-1);
-
- return aValue.makeStringAndClear();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- if(m_bOdbc3)
- {
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
- return nValue == SQL_OIC_LEVEL2;
- }
- else
- {
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
- return nValue == SQL_OAC_LEVEL2;
- }
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- if(m_bOdbc3)
- {
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
- return nValue == SQL_OIC_CORE || nValue == SQL_OIC_LEVEL2 || nValue == SQL_OIC_LEVEL1;
- }
- else
- {
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_SQL_CONFORMANCE,nValue,*this);
- return nValue == SQL_OSC_CORE || nValue == SQL_OAC_LEVEL1 || nValue == SQL_OAC_LEVEL2;
- }
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- if(m_bOdbc3)
- {
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
- return nValue == SQL_OIC_LEVEL1 || nValue == SQL_OIC_LEVEL2;
- }
- else
- {
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
- return nValue == SQL_OAC_LEVEL1 || nValue == SQL_OAC_LEVEL2;
- }
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_OJ_CAPABILITIES,nValue,*this);
- return (nValue & SQL_OJ_FULL) == SQL_OJ_FULL;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException)
-{
- return supportsFullOuterJoins( );
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_GROUP_BY,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_ORDER_BY,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_SELECT,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException)
-{
- SQLUSMALLINT nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_USER_NAME_LEN,nValue,*this);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_SENSITIVITY,nValue,*this);
- return (nValue & static_cast<SQLUINTEGER>(setType)) == static_cast<SQLUINTEGER>(setType);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 );
- switch(setType)
- {
- default:
- case ResultSetType::FORWARD_ONLY:
- nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
- break;
- case ResultSetType::SCROLL_INSENSITIVE:
- nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2;
- break;
- case ResultSetType::SCROLL_SENSITIVE:
- nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
- break;
- }
-
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
- sal_Bool bRet = sal_False;
- switch(concurrency)
- {
- case ResultSetConcurrency::READ_ONLY:
- bRet = (nValue & SQL_CA2_READ_ONLY_CONCURRENCY) == SQL_CA2_READ_ONLY_CONCURRENCY;
- break;
- case ResultSetConcurrency::UPDATABLE:
- bRet = (nValue & SQL_CA2_OPT_VALUES_CONCURRENCY) == SQL_CA2_OPT_VALUES_CONCURRENCY;
- break;
- }
- return bRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 );
- switch(setType)
- {
- default:
- case ResultSetType::FORWARD_ONLY:
- nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
- break;
- case ResultSetType::SCROLL_INSENSITIVE:
- nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2;
- break;
- case ResultSetType::SCROLL_SENSITIVE:
- nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
- break;
- }
-
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
- return (nValue & SQL_CA2_SENSITIVITY_UPDATES) == SQL_CA2_SENSITIVITY_UPDATES;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 );
- switch(setType)
- {
- default:
- case ResultSetType::FORWARD_ONLY:
- nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
- break;
- case ResultSetType::SCROLL_INSENSITIVE:
- nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2;
- break;
- case ResultSetType::SCROLL_SENSITIVE:
- nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
- break;
- }
-
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
- return (nValue & SQL_CA2_SENSITIVITY_DELETIONS) != SQL_CA2_SENSITIVITY_DELETIONS;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- SQLUINTEGER nValue;
- SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 );
- switch(setType)
- {
- default:
- case ResultSetType::FORWARD_ONLY:
- nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
- break;
- case ResultSetType::SCROLL_INSENSITIVE:
- nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2;
- break;
- case ResultSetType::SCROLL_SENSITIVE:
- nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
- break;
- }
-
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
- return (nValue & SQL_CA2_SENSITIVITY_ADDITIONS) == SQL_CA2_SENSITIVITY_ADDITIONS;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- return ownUpdatesAreVisible(setType);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- return ownDeletesAreVisible(setType);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
-{
- return ownInsertsAreVisible(setType);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getUDTs( const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& /*typeNamePattern*/, const Sequence< sal_Int32 >& /*types*/ ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
deleted file mode 100644
index 4a6062acc6..0000000000
--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
+++ /dev/null
@@ -1,1340 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "TConnection.hxx"
-
-#include "odbc/ODatabaseMetaDataResultSet.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbc/ProcedureResult.hpp>
-#include <com/sun/star/sdbc/IndexType.hpp>
-#include <comphelper/property.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include "odbc/OResultSetMetaData.hxx"
-#include "odbc/OTools.hxx"
-#include <comphelper/types.hxx>
-#include "FDatabaseMetaDataResultSetMetaData.hxx"
-#include <connectivity/dbexception.hxx>
-
-using namespace ::comphelper;
-
-
-using namespace connectivity::odbc;
-using namespace cppu;
-//------------------------------------------------------------------------------
-using namespace ::com::sun::star::lang;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::util;
-
-// -------------------------------------------------------------------------
-ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet(OConnection* _pConnection)
- :ODatabaseMetaDataResultSet_BASE(m_aMutex)
- ,OPropertySetHelper(ODatabaseMetaDataResultSet_BASE::rBHelper)
-
- ,m_aStatementHandle(_pConnection->createStatementHandle())
- ,m_aStatement(NULL)
- ,m_xMetaData(NULL)
- ,m_pRowStatusArray(NULL)
- ,m_pConnection(_pConnection)
- ,m_nTextEncoding(_pConnection->getTextEncoding())
- ,m_nRowPos(-1)
- ,m_nLastColumnPos(0)
- ,m_nDriverColumnCount(0)
- ,m_nCurrentFetchState(0)
- ,m_bWasNull(sal_True)
- ,m_bEOF(sal_False)
- ,m_bFreeHandle(sal_False)
-{
- OSL_ENSURE(m_pConnection,"ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet: No parent set!");
- osl_incrementInterlockedCount( &m_refCount );
- m_pConnection->acquire();
- m_pRowStatusArray = new SQLUSMALLINT[1]; // the default value
- osl_decrementInterlockedCount( &m_refCount );
- // allocBuffer();
-}
-
-// -------------------------------------------------------------------------
-ODatabaseMetaDataResultSet::~ODatabaseMetaDataResultSet()
-{
- OSL_ENSURE(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed,"Object wasn't disposed!");
- if(!ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed)
- {
- osl_incrementInterlockedCount( &m_refCount );
- dispose();
- }
- delete [] m_pRowStatusArray;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::disposing(void)
-{
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
- if(m_bFreeHandle)
- m_pConnection->freeStatementHandle(m_aStatementHandle);
-
- m_aStatement = NULL;
-m_xMetaData.clear();
- m_pConnection->release();
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL ODatabaseMetaDataResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OPropertySetHelper::queryInterface(rType);
- return aRet.hasValue() ? aRet : ODatabaseMetaDataResultSet_BASE::queryInterface(rType);
-}
-// -----------------------------------------------------------------------------
-Reference< XPropertySetInfo > SAL_CALL ODatabaseMetaDataResultSet::getPropertySetInfo( ) throw(RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::acquire() throw()
-{
- ODatabaseMetaDataResultSet_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::release() throw()
-{
- ODatabaseMetaDataResultSet_BASE::release();
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL ODatabaseMetaDataResultSet::getTypes( ) throw(RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const Reference< XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< XFastPropertySet > *)0 ),
- ::getCppuType( (const Reference< XPropertySet > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),ODatabaseMetaDataResultSet_BASE::getTypes());
-}
-// -----------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaDataResultSet::mapColumn (sal_Int32 column)
-{
- sal_Int32 map = column;
-
- if (!m_aColMapping.empty())
- {
- // Validate column number
- map = m_aColMapping[column];
- }
-
- return map;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- Reference< XResultSetMetaData > xMeta = getMetaData();
- sal_Int32 nLen = xMeta->getColumnCount();
- sal_Int32 i = 1;
- for(;i<=nLen;++i)
- if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
- columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
- break;
- return i;
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResultSet::getBinaryStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getBinaryStream", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::io::XInputStream > SAL_CALL ODatabaseMetaDataResultSet::getCharacterStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getCharacterStream", *this );
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
- columnIndex = mapColumn(columnIndex);
-
- sal_Bool bRet = sal_False;
- if(columnIndex <= m_nDriverColumnCount)
- {
- sal_Int32 nType = getMetaData()->getColumnType(columnIndex);
- switch(nType)
- {
- case DataType::BIT:
- {
- sal_Int8 nValue = 0;
- OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_BIT,m_bWasNull,**this,&nValue,sizeof nValue);
- bRet = nValue != 0;
- }
- break;
- default:
- bRet = getInt(columnIndex) != 0;
- }
- }
- return bRet;
-}
-// -------------------------------------------------------------------------
-
-sal_Int8 SAL_CALL ODatabaseMetaDataResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- columnIndex = mapColumn(columnIndex);
- sal_Int8 nVal = 0;
- if(columnIndex <= m_nDriverColumnCount)
- {
- OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_TINYINT,m_bWasNull,**this,&nVal,sizeof nVal);
-
- ::std::map<sal_Int32, ::connectivity::TInt2IntMap >::iterator aValueRangeIter;
- if ( !m_aValueRange.empty() && (aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
- return sal_Int8((*aValueRangeIter).second[(sal_Int32)nVal]);
- }
- else
- m_bWasNull = sal_True;
- return nVal;
-}
-// -------------------------------------------------------------------------
-
-Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- columnIndex = mapColumn(columnIndex);
- if(columnIndex <= m_nDriverColumnCount)
- {
- sal_Int32 nType = getMetaData()->getColumnType(columnIndex);
- switch(nType)
- {
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- {
- ::rtl::OUString aRet = OTools::getStringValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_BINARY,m_bWasNull,**this,m_nTextEncoding);
- return Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength());
- }
- }
- return OTools::getBytesValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_BINARY,m_bWasNull,**this);
- }
- else
- m_bWasNull = sal_True;
- return Sequence<sal_Int8>();
-}
-// -------------------------------------------------------------------------
-
-::com::sun::star::util::Date SAL_CALL ODatabaseMetaDataResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- columnIndex = mapColumn(columnIndex);
- if(columnIndex <= m_nDriverColumnCount)
- {
- DATE_STRUCT aDate;
- aDate.day = 0;
- aDate.month = 0;
- aDate.year = 0;
- OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,m_pConnection->useOldDateFormat() ? SQL_C_DATE : SQL_C_TYPE_DATE,m_bWasNull,**this,&aDate,sizeof aDate);
- return Date(aDate.day,aDate.month,aDate.year);
- }
- else
- m_bWasNull = sal_True;
- return Date();
-}
-// -------------------------------------------------------------------------
-
-double SAL_CALL ODatabaseMetaDataResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- columnIndex = mapColumn(columnIndex);
- double nValue(0.0);
- if(columnIndex <= m_nDriverColumnCount)
- OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_DOUBLE,m_bWasNull,**this,&nValue,sizeof nValue);
- else
- m_bWasNull = sal_True;
- return nValue;
-}
-// -------------------------------------------------------------------------
-
-float SAL_CALL ODatabaseMetaDataResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- columnIndex = mapColumn(columnIndex);
- float nVal(0);
- if(columnIndex <= m_nDriverColumnCount)
- OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_FLOAT,m_bWasNull,**this,&nVal,sizeof nVal);
- else
- m_bWasNull = sal_True;
- return nVal;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- columnIndex = mapColumn(columnIndex);
- sal_Int32 nVal = 0;
- if(columnIndex <= m_nDriverColumnCount)
- {
- OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_LONG,m_bWasNull,**this,&nVal,sizeof nVal);
-
- ::std::map<sal_Int32, ::connectivity::TInt2IntMap >::iterator aValueRangeIter;
- if ( !m_aValueRange.empty() && (aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
- return (*aValueRangeIter).second[(sal_Int32)nVal];
- }
- else
- m_bWasNull = sal_True;
- return nVal;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getRow( ) throw(SQLException, RuntimeException)
-{
- return 0;
-}
-// -------------------------------------------------------------------------
-
-sal_Int64 SAL_CALL ODatabaseMetaDataResultSet::getLong( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getLong", *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSetMetaData > SAL_CALL ODatabaseMetaDataResultSet::getMetaData( ) throw(SQLException, RuntimeException)
-{
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
- return m_xMetaData.is() ? m_xMetaData : (m_xMetaData = new OResultSetMetaData(m_pConnection,m_aStatementHandle));
-}
-// -------------------------------------------------------------------------
-Reference< XArray > SAL_CALL ODatabaseMetaDataResultSet::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getArray", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XClob > SAL_CALL ODatabaseMetaDataResultSet::getClob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getClob", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XBlob > SAL_CALL ODatabaseMetaDataResultSet::getBlob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getBlob", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Reference< XRef > SAL_CALL ODatabaseMetaDataResultSet::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getRef", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL ODatabaseMetaDataResultSet::getObject( sal_Int32 /*columnIndex*/, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getObject", *this );
- return Any();
-}
-// -------------------------------------------------------------------------
-
-sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
- columnIndex = mapColumn(columnIndex);
- sal_Int16 nVal = 0;
- if(columnIndex <= m_nDriverColumnCount)
- {
- OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_SHORT,m_bWasNull,**this,&nVal,sizeof nVal);
-
- ::std::map<sal_Int32, ::connectivity::TInt2IntMap >::iterator aValueRangeIter;
- if ( !m_aValueRange.empty() && (aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
- return sal_Int16((*aValueRangeIter).second[(sal_Int32)nVal]);
- }
- else
- m_bWasNull = sal_True;
- return nVal;
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL ODatabaseMetaDataResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- columnIndex = mapColumn(columnIndex);
- ::rtl::OUString aVal;
- if(columnIndex <= m_nDriverColumnCount)
- aVal = OTools::getStringValue(m_pConnection,m_aStatementHandle,columnIndex,impl_getColumnType_nothrow(columnIndex),m_bWasNull,**this,m_nTextEncoding);
- else
- m_bWasNull = sal_True;
-
- return aVal;
-}
-
-// -------------------------------------------------------------------------
-
-
-::com::sun::star::util::Time SAL_CALL ODatabaseMetaDataResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- columnIndex = mapColumn(columnIndex);
- TIME_STRUCT aTime={0,0,0};
- if(columnIndex <= m_nDriverColumnCount)
- OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,m_pConnection->useOldDateFormat() ? SQL_C_TIME : SQL_C_TYPE_TIME,m_bWasNull,**this,&aTime,sizeof aTime);
- else
- m_bWasNull = sal_True;
- return Time(0,aTime.second,aTime.minute,aTime.hour);
-}
-// -------------------------------------------------------------------------
-
-
-::com::sun::star::util::DateTime SAL_CALL ODatabaseMetaDataResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- columnIndex = mapColumn(columnIndex);
- TIMESTAMP_STRUCT aTime={0,0,0,0,0,0,0};
- if(columnIndex <= m_nDriverColumnCount)
- OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,m_pConnection->useOldDateFormat() ? SQL_C_TIMESTAMP : SQL_C_TYPE_TIMESTAMP,m_bWasNull,**this,&aTime,sizeof aTime);
- else
- m_bWasNull = sal_True;
- return DateTime((sal_uInt16)aTime.fraction*1000,aTime.second,aTime.minute,aTime.hour,aTime.day,aTime.month,aTime.year);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isAfterLast( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- return m_nCurrentFetchState == SQL_NO_DATA;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isFirst( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- return m_nRowPos == 1;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isLast( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- return m_bEOF && m_nCurrentFetchState != SQL_NO_DATA;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- if(first())
- previous();
- m_nCurrentFetchState = SQL_SUCCESS;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::afterLast( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- if(last())
- next();
- m_bEOF = sal_True;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL ODatabaseMetaDataResultSet::close( ) throw(SQLException, RuntimeException)
-{
- {
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::first( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_FIRST,0);
- OTools::ThrowException(m_pConnection,m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- sal_Bool bRet = ( m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO );
- if( bRet )
- m_nRowPos = 1;
- return bRet;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::last( ) throw(SQLException, RuntimeException)
-{
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_LAST,0);
- OTools::ThrowException(m_pConnection,m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- // here I know definitely that I stand on the last record
- return (m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_ABSOLUTE,row);
- OTools::ThrowException(m_pConnection,m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
- if(bRet)
- m_nRowPos = row;
- return bRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_RELATIVE,row);
- OTools::ThrowException(m_pConnection,m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
- if(bRet)
- m_nRowPos += row;
- return bRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::previous( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_PRIOR,0);
- OTools::ThrowException(m_pConnection,m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
- if(bRet)
- --m_nRowPos;
- return bRet;
-}
-// -------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL ODatabaseMetaDataResultSet::getStatement( ) throw(SQLException, RuntimeException)
-{
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowDeleted( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- return m_pRowStatusArray[0] == SQL_ROW_DELETED;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowInserted( ) throw(SQLException, RuntimeException)
-{
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- return m_pRowStatusArray[0] == SQL_ROW_ADDED;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- return m_pRowStatusArray[0] == SQL_ROW_UPDATED;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- return m_nRowPos == 0;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::next( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- // m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_NEXT,0);
- m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
- OTools::ThrowException(m_pConnection,m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- return m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL ODatabaseMetaDataResultSet::wasNull( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- return m_bWasNull;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::refreshRow( ) throw(SQLException, RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL ODatabaseMetaDataResultSet::cancel( ) throw(RuntimeException)
-{
-
- checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- OTools::ThrowException(m_pConnection,N3SQLCancel(m_aStatementHandle),m_aStatementHandle,SQL_HANDLE_STMT,*this);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL ODatabaseMetaDataResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL ODatabaseMetaDataResultSet::getWarnings( ) throw(SQLException, RuntimeException)
-{
- return Any();
-}
-//------------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaDataResultSet::getResultSetConcurrency() const throw(SQLException, RuntimeException)
-{
- return ResultSetConcurrency::READ_ONLY;
-}
-//------------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaDataResultSet::getResultSetType() const throw(SQLException, RuntimeException)
-{
- return ResultSetType::FORWARD_ONLY;
-}
-//------------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaDataResultSet::getFetchDirection() const throw(SQLException, RuntimeException)
-{
- return FetchDirection::FORWARD;
-}
-//------------------------------------------------------------------------------
-sal_Int32 ODatabaseMetaDataResultSet::getFetchSize() const throw(SQLException, RuntimeException)
-{
- sal_Int32 nValue=1;
- return nValue;
-}
-//------------------------------------------------------------------------------
-::rtl::OUString ODatabaseMetaDataResultSet::getCursorName() const throw(SQLException, RuntimeException)
-{
- return ::rtl::OUString();
-}
-
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* ODatabaseMetaDataResultSet::createArrayHelper( ) const
-{
-
- Sequence< com::sun::star::beans::Property > aProps(5);
- com::sun::star::beans::Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP0(CURSORNAME, ::rtl::OUString);
- DECL_PROP0(FETCHDIRECTION, sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_PROP0(RESULTSETCONCURRENCY,sal_Int32);
- DECL_PROP0(RESULTSETTYPE, sal_Int32);
-
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & ODatabaseMetaDataResultSet::getInfoHelper()
-{
- return *const_cast<ODatabaseMetaDataResultSet*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool ODatabaseMetaDataResultSet::convertFastPropertyValue(
- Any & rConvertedValue,
- Any & rOldValue,
- sal_Int32 nHandle,
- const Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException)
-{
- switch(nHandle)
- {
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw ::com::sun::star::lang::IllegalArgumentException();
- case PROPERTY_ID_FETCHDIRECTION:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchDirection());
- case PROPERTY_ID_FETCHSIZE:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchSize());
- default:
- ;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& /*rValue*/ ) throw (Exception)
-{
- switch(nHandle)
- {
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- case PROPERTY_ID_FETCHDIRECTION:
- case PROPERTY_ID_FETCHSIZE:
- throw Exception();
- default:
- OSL_FAIL("setFastPropertyValue_NoBroadcast: Illegal handle value!");
- }
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const
-{
- switch(nHandle)
- {
- case PROPERTY_ID_CURSORNAME:
- rValue <<= getCursorName();
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- rValue <<= getResultSetConcurrency();
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- rValue <<= getResultSetType();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- rValue <<= getFetchDirection();
- break;
- case PROPERTY_ID_FETCHSIZE:
- rValue <<= getFetchSize();
- break;
- }
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openTypeInfo() throw(SQLException, RuntimeException)
-{
- TInt2IntMap aMap;
- aMap[SQL_BIT] = DataType::BIT;
- aMap[SQL_TINYINT] = DataType::TINYINT;
- aMap[SQL_SMALLINT] = DataType::SMALLINT;
- aMap[SQL_INTEGER] = DataType::INTEGER;
- aMap[SQL_FLOAT] = DataType::FLOAT;
- aMap[SQL_REAL] = DataType::REAL;
- aMap[SQL_DOUBLE] = DataType::DOUBLE;
- aMap[SQL_BIGINT] = DataType::BIGINT;
-
- aMap[SQL_CHAR] = DataType::CHAR;
- aMap[SQL_WCHAR] = DataType::CHAR;
- aMap[SQL_VARCHAR] = DataType::VARCHAR;
- aMap[SQL_WVARCHAR] = DataType::VARCHAR;
- aMap[SQL_LONGVARCHAR] = DataType::LONGVARCHAR;
- aMap[SQL_WLONGVARCHAR] = DataType::LONGVARCHAR;
-
- aMap[SQL_TYPE_DATE] = DataType::DATE;
- aMap[SQL_DATE] = DataType::DATE;
- aMap[SQL_TYPE_TIME] = DataType::TIME;
- aMap[SQL_TIME] = DataType::TIME;
- aMap[SQL_TYPE_TIMESTAMP] = DataType::TIMESTAMP;
- aMap[SQL_TIMESTAMP] = DataType::TIMESTAMP;
-
- aMap[SQL_DECIMAL] = DataType::DECIMAL;
- aMap[SQL_NUMERIC] = DataType::NUMERIC;
-
- aMap[SQL_BINARY] = DataType::BINARY;
- aMap[SQL_VARBINARY] = DataType::VARBINARY;
- aMap[SQL_LONGVARBINARY] = DataType::LONGVARBINARY;
-
- aMap[SQL_GUID] = DataType::VARBINARY;
-
-
- m_aValueRange[2] = aMap;
-
- OTools::ThrowException(m_pConnection,N3SQLGetTypeInfo(m_aStatementHandle, SQL_ALL_TYPES),m_aStatementHandle,SQL_HANDLE_STMT,*this);
- checkColumnCount();
-}
-//-----------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openTables(const Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern,
- const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException)
-{
- m_bFreeHandle = sal_True;
- ::rtl::OString aPKQ,aPKO,aPKN,aCOL;
- const ::rtl::OUString *pSchemaPat = NULL;
-
- if(schemaPattern.toChar() != '%')
- pSchemaPat = &schemaPattern;
- else
- pSchemaPat = NULL;
-
- if ( catalog.hasValue() )
- aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
- aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
- aPKN = ::rtl::OUStringToOString(tableNamePattern,m_nTextEncoding);
-
- const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
- *pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = aPKN.getStr();
-
-
- const char *pCOL = NULL;
- const char* pComma = ",";
- const ::rtl::OUString* pBegin = types.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + types.getLength();
- for(;pBegin != pEnd;++pBegin)
- {
- aCOL += ::rtl::OUStringToOString(*pBegin,m_nTextEncoding);
- aCOL += pComma;
- }
- if ( aCOL.getLength() )
- {
- aCOL = aCOL.replaceAt(aCOL.getLength()-1,1,pComma);
- pCOL = aCOL.getStr();
- }
- else
- pCOL = SQL_ALL_TABLE_TYPES;
-
- SQLRETURN nRetcode = N3SQLTables(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS,
- (SDB_ODBC_CHAR *) pCOL, pCOL ? SQL_NTS : 0);
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- checkColumnCount();
-
-}
-//-----------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openTablesTypes( ) throw(SQLException, RuntimeException)
-{
- m_bFreeHandle = sal_True;
- SQLRETURN nRetcode = N3SQLTables(m_aStatementHandle,
- 0,0,
- 0,0,
- 0,0,
- (SDB_ODBC_CHAR *) SQL_ALL_TABLE_TYPES,SQL_NTS);
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
-
- m_aColMapping.clear();
- m_aColMapping.push_back(-1);
- m_aColMapping.push_back(4);
- m_xMetaData = new OResultSetMetaData(m_pConnection,m_aStatementHandle,m_aColMapping);
- checkColumnCount();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openCatalogs() throw(SQLException, RuntimeException)
-{
- m_bFreeHandle = sal_True;
- SQLRETURN nRetcode = N3SQLTables(m_aStatementHandle,
- (SDB_ODBC_CHAR *) SQL_ALL_CATALOGS,SQL_NTS,
- (SDB_ODBC_CHAR *) "",SQL_NTS,
- (SDB_ODBC_CHAR *) "",SQL_NTS,
- (SDB_ODBC_CHAR *) "",SQL_NTS);
-
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
-
- m_aColMapping.clear();
- m_aColMapping.push_back(-1);
- m_aColMapping.push_back(1);
- m_xMetaData = new OResultSetMetaData(m_pConnection,m_aStatementHandle,m_aColMapping);
- checkColumnCount();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openSchemas() throw(SQLException, RuntimeException)
-{
- m_bFreeHandle = sal_True;
- SQLRETURN nRetcode = N3SQLTables(m_aStatementHandle,
- (SDB_ODBC_CHAR *) "",SQL_NTS,
- (SDB_ODBC_CHAR *) SQL_ALL_SCHEMAS,SQL_NTS,
- (SDB_ODBC_CHAR *) "",SQL_NTS,
- (SDB_ODBC_CHAR *) "",SQL_NTS);
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
-
- m_aColMapping.clear();
- m_aColMapping.push_back(-1);
- m_aColMapping.push_back(2);
- m_xMetaData = new OResultSetMetaData(m_pConnection,m_aStatementHandle,m_aColMapping);
- checkColumnCount();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openColumnPrivileges( const Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table, const ::rtl::OUString& columnNamePattern )
- throw(SQLException, RuntimeException)
-{
- const ::rtl::OUString *pSchemaPat = NULL;
-
- if(schema.toChar() != '%')
- pSchemaPat = &schema;
- else
- pSchemaPat = NULL;
-
- m_bFreeHandle = sal_True;
- ::rtl::OString aPKQ,aPKO,aPKN,aCOL;
-
- if ( catalog.hasValue() )
- aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
- aPKO = ::rtl::OUStringToOString(schema,m_nTextEncoding);
- aPKN = ::rtl::OUStringToOString(table,m_nTextEncoding);
- aCOL = ::rtl::OUStringToOString(columnNamePattern,m_nTextEncoding);
-
- const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
- *pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = aPKN.getStr(),
- *pCOL = aCOL.getStr();
-
-
- SQLRETURN nRetcode = N3SQLColumnPrivileges(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS,
- (SDB_ODBC_CHAR *) pCOL, SQL_NTS);
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
-
- checkColumnCount();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openColumns( const Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern )
- throw(SQLException, RuntimeException)
-{
- const ::rtl::OUString *pSchemaPat = NULL;
-
- if(schemaPattern.toChar() != '%')
- pSchemaPat = &schemaPattern;
- else
- pSchemaPat = NULL;
-
- m_bFreeHandle = sal_True;
- ::rtl::OString aPKQ,aPKO,aPKN,aCOL;
- if ( catalog.hasValue() )
- aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
- aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
- aPKN = ::rtl::OUStringToOString(tableNamePattern,m_nTextEncoding);
- aCOL = ::rtl::OUStringToOString(columnNamePattern,m_nTextEncoding);
-
- const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
- *pPKO = pSchemaPat && pSchemaPat->getLength() && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = aPKN.getStr(),
- *pCOL = aCOL.getStr();
-
-
- SQLRETURN nRetcode = N3SQLColumns(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS,
- (SDB_ODBC_CHAR *) pCOL, SQL_NTS);
-
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- TInt2IntMap aMap;
- aMap[SQL_BIT] = DataType::BIT;
- aMap[SQL_TINYINT] = DataType::TINYINT;
- aMap[SQL_SMALLINT] = DataType::SMALLINT;
- aMap[SQL_INTEGER] = DataType::INTEGER;
- aMap[SQL_FLOAT] = DataType::FLOAT;
- aMap[SQL_REAL] = DataType::REAL;
- aMap[SQL_DOUBLE] = DataType::DOUBLE;
- aMap[SQL_BIGINT] = DataType::BIGINT;
-
- aMap[SQL_CHAR] = DataType::CHAR;
- aMap[SQL_WCHAR] = DataType::CHAR;
- aMap[SQL_VARCHAR] = DataType::VARCHAR;
- aMap[SQL_WVARCHAR] = DataType::VARCHAR;
- aMap[SQL_LONGVARCHAR] = DataType::LONGVARCHAR;
- aMap[SQL_WLONGVARCHAR] = DataType::LONGVARCHAR;
-
- aMap[SQL_TYPE_DATE] = DataType::DATE;
- aMap[SQL_DATE] = DataType::DATE;
- aMap[SQL_TYPE_TIME] = DataType::TIME;
- aMap[SQL_TIME] = DataType::TIME;
- aMap[SQL_TYPE_TIMESTAMP] = DataType::TIMESTAMP;
- aMap[SQL_TIMESTAMP] = DataType::TIMESTAMP;
-
- aMap[SQL_DECIMAL] = DataType::DECIMAL;
- aMap[SQL_NUMERIC] = DataType::NUMERIC;
-
- aMap[SQL_BINARY] = DataType::BINARY;
- aMap[SQL_VARBINARY] = DataType::VARBINARY;
- aMap[SQL_LONGVARBINARY] = DataType::LONGVARBINARY;
-
- aMap[SQL_GUID] = DataType::VARBINARY;
-
- m_aValueRange[5] = aMap;
- checkColumnCount();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openProcedureColumns( const Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& procedureNamePattern,const ::rtl::OUString& columnNamePattern )
- throw(SQLException, RuntimeException)
-{
- const ::rtl::OUString *pSchemaPat = NULL;
-
- if(schemaPattern.toChar() != '%')
- pSchemaPat = &schemaPattern;
- else
- pSchemaPat = NULL;
-
- m_bFreeHandle = sal_True;
- ::rtl::OString aPKQ,aPKO,aPKN,aCOL;
- if ( catalog.hasValue() )
- aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
- aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
- aPKN = ::rtl::OUStringToOString(procedureNamePattern,m_nTextEncoding);
- aCOL = ::rtl::OUStringToOString(columnNamePattern,m_nTextEncoding);
-
- const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
- *pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = aPKN.getStr(),
- *pCOL = aCOL.getStr();
-
-
- SQLRETURN nRetcode = N3SQLProcedureColumns(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS,
- (SDB_ODBC_CHAR *) pCOL, SQL_NTS);
-
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- checkColumnCount();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openProcedures(const Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& procedureNamePattern)
- throw(SQLException, RuntimeException)
-{
- const ::rtl::OUString *pSchemaPat = NULL;
-
- if(schemaPattern.toChar() != '%')
- pSchemaPat = &schemaPattern;
- else
- pSchemaPat = NULL;
-
- m_bFreeHandle = sal_True;
- ::rtl::OString aPKQ,aPKO,aPKN,aCOL;
-
- if ( catalog.hasValue() )
- aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
- aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
- aPKN = ::rtl::OUStringToOString(procedureNamePattern,m_nTextEncoding);
-
- const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
- *pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = aPKN.getStr();
-
-
- SQLRETURN nRetcode = N3SQLProcedures(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS);
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- checkColumnCount();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openSpecialColumns(sal_Bool _bRowVer,const Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table,sal_Int32 scope, sal_Bool nullable )
- throw(SQLException, RuntimeException)
-{
- const ::rtl::OUString *pSchemaPat = NULL;
-
- if(schema.toChar() != '%')
- pSchemaPat = &schema;
- else
- pSchemaPat = NULL;
-
- m_bFreeHandle = sal_True;
- ::rtl::OString aPKQ,aPKO,aPKN,aCOL;
- if ( catalog.hasValue() )
- aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
- aPKO = ::rtl::OUStringToOString(schema,m_nTextEncoding);
- aPKN = ::rtl::OUStringToOString(table,m_nTextEncoding);
-
- const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
- *pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = aPKN.getStr();
-
-
- SQLRETURN nRetcode = N3SQLSpecialColumns(m_aStatementHandle,_bRowVer ? SQL_ROWVER : SQL_BEST_ROWID,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS,
- (SQLSMALLINT)scope,
- nullable ? SQL_NULLABLE : SQL_NO_NULLS);
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- checkColumnCount();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openVersionColumns(const Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table) throw(SQLException, RuntimeException)
-{
- openSpecialColumns(sal_True,catalog,schema,table,SQL_SCOPE_TRANSACTION,sal_False);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openBestRowIdentifier( const Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table,sal_Int32 scope,sal_Bool nullable ) throw(SQLException, RuntimeException)
-{
- openSpecialColumns(sal_False,catalog,schema,table,scope,nullable);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openForeignKeys( const Any& catalog, const ::rtl::OUString* schema,
- const ::rtl::OUString* table,
- const Any& catalog2, const ::rtl::OUString* schema2,
- const ::rtl::OUString* table2) throw(SQLException, RuntimeException)
-{
- m_bFreeHandle = sal_True;
-
- ::rtl::OString aPKQ,aPKO,aPKN, aFKQ, aFKO, aFKN;
- if ( catalog.hasValue() )
- aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
- if ( catalog2.hasValue() )
- aFKQ = ::rtl::OUStringToOString(comphelper::getString(catalog2),m_nTextEncoding);
-
- const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
- *pPKO = schema && schema->getLength() ? ::rtl::OUStringToOString(*schema,m_nTextEncoding).getStr() : NULL,
- *pPKN = table ? (aPKN = ::rtl::OUStringToOString(*table,m_nTextEncoding)).getStr(): NULL,
- *pFKQ = catalog2.hasValue() && aFKQ.getLength() ? aFKQ.getStr() : NULL,
- *pFKO = schema2 && schema2->getLength() ? (aFKO = ::rtl::OUStringToOString(*schema2,m_nTextEncoding)).getStr() : NULL,
- *pFKN = table2 ? (aFKN = ::rtl::OUStringToOString(*table2,m_nTextEncoding)).getStr() : NULL;
-
-
- SQLRETURN nRetcode = N3SQLForeignKeys(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKN, pPKN ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pFKQ, (catalog2.hasValue() && aFKQ.getLength()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pFKO, pFKO ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pFKN, SQL_NTS
- );
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- checkColumnCount();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openImportedKeys(const Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table) throw(SQLException, RuntimeException)
-{
-
- openForeignKeys(Any(),NULL,NULL,catalog,!schema.compareToAscii("%") ? &schema : NULL,&table);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openExportedKeys(const Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table) throw(SQLException, RuntimeException)
-{
- openForeignKeys(catalog,!schema.compareToAscii("%") ? &schema : NULL,&table,Any(),NULL,NULL);
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table) throw(SQLException, RuntimeException)
-{
- const ::rtl::OUString *pSchemaPat = NULL;
-
- if(schema.toChar() != '%')
- pSchemaPat = &schema;
- else
- pSchemaPat = NULL;
-
- m_bFreeHandle = sal_True;
- ::rtl::OString aPKQ,aPKO,aPKN,aCOL;
-
- if ( catalog.hasValue() )
- aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
- aPKO = ::rtl::OUStringToOString(schema,m_nTextEncoding);
-
- const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
- *pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = (aPKN = ::rtl::OUStringToOString(table,m_nTextEncoding)).getStr();
-
-
- SQLRETURN nRetcode = N3SQLPrimaryKeys(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS);
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- checkColumnCount();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openTablePrivileges(const Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern) throw(SQLException, RuntimeException)
-{
- const ::rtl::OUString *pSchemaPat = NULL;
-
- if(schemaPattern.toChar() != '%')
- pSchemaPat = &schemaPattern;
- else
- pSchemaPat = NULL;
-
- m_bFreeHandle = sal_True;
- ::rtl::OString aPKQ,aPKO,aPKN;
-
- if ( catalog.hasValue() )
- aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
- aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
-
- const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
- *pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = (aPKN = ::rtl::OUStringToOString(tableNamePattern,m_nTextEncoding)).getStr();
-
-
- SQLRETURN nRetcode = N3SQLTablePrivileges(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS);
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- checkColumnCount();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::openIndexInfo( const Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table,sal_Bool unique,sal_Bool approximate )
- throw(SQLException, RuntimeException)
-{
- const ::rtl::OUString *pSchemaPat = NULL;
-
- if(schema.toChar() != '%')
- pSchemaPat = &schema;
- else
- pSchemaPat = NULL;
-
- m_bFreeHandle = sal_True;
- ::rtl::OString aPKQ,aPKO,aPKN;
-
- if ( catalog.hasValue() )
- aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
- aPKO = ::rtl::OUStringToOString(schema,m_nTextEncoding);
-
- const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
- *pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = (aPKN = ::rtl::OUStringToOString(table,m_nTextEncoding)).getStr();
-
-
- SQLRETURN nRetcode = N3SQLStatistics(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS,
- unique ? SQL_INDEX_UNIQUE : SQL_INDEX_ALL,
- approximate);
- OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- checkColumnCount();
-}
-// -------------------------------------------------------------------------
-void ODatabaseMetaDataResultSet::checkColumnCount()
-{
- sal_Int16 nNumResultCols=0;
- OTools::ThrowException(m_pConnection,N3SQLNumResultCols(m_aStatementHandle,&nNumResultCols),m_aStatementHandle,SQL_HANDLE_STMT,*this);
- m_nDriverColumnCount = nNumResultCols;
-}
-// -----------------------------------------------------------------------------
-
-SWORD ODatabaseMetaDataResultSet::impl_getColumnType_nothrow(sal_Int32 columnIndex)
-{
- ::std::map<sal_Int32,SWORD>::iterator aFind = m_aODBCColumnTypes.find(columnIndex);
- if ( aFind == m_aODBCColumnTypes.end() )
- aFind = m_aODBCColumnTypes.insert(::std::map<sal_Int32,SWORD>::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pConnection,m_aStatementHandle,*this,columnIndex))).first;
- return aFind->second;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbcbase/ODriver.cxx b/connectivity/source/drivers/odbcbase/ODriver.cxx
deleted file mode 100644
index 7be1cf3bba..0000000000
--- a/connectivity/source/drivers/odbcbase/ODriver.cxx
+++ /dev/null
@@ -1,231 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "odbc/ODriver.hxx"
-#include "odbc/OConnection.hxx"
-#include "odbc/OFunctions.hxx"
-#include "odbc/OTools.hxx"
-#include "connectivity/dbexception.hxx"
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-
-using namespace connectivity::odbc;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-// --------------------------------------------------------------------------------
-ODBCDriver::ODBCDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory)
- :ODriver_BASE(m_aMutex)
- ,m_xORB(_rxFactory)
- ,m_pDriverHandle(SQL_NULL_HANDLE)
-{
-}
-// --------------------------------------------------------------------------------
-void ODBCDriver::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
-
- for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
- {
- Reference< XComponent > xComp(i->get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- }
- m_xConnections.clear();
-
- ODriver_BASE::disposing();
-}
-
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString ODBCDriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdbc.ODBCDriver"));
- // this name is referenced in the configuration and in the odbc.xml
- // Please take care when changing it.
-}
-
-typedef Sequence< ::rtl::OUString > SS;
-//------------------------------------------------------------------------------
-SS ODBCDriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
-{
- SS aSNS( 1 );
- aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"));
- return aSNS;
-}
-
-//------------------------------------------------------------------
-::rtl::OUString SAL_CALL ODBCDriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-
-//------------------------------------------------------------------
-sal_Bool SAL_CALL ODBCDriver::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- SS aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-
-//------------------------------------------------------------------
-SS SAL_CALL ODBCDriver::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-
-// --------------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL ODBCDriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- if ( ! acceptsURL(url) )
- return NULL;
-
- if(!m_pDriverHandle)
- {
- ::rtl::OUString aPath;
- if(!EnvironmentHandle(aPath))
- throw SQLException(aPath,*this,::rtl::OUString(),1000,Any());
- }
- OConnection* pCon = new OConnection(m_pDriverHandle,this);
- Reference< XConnection > xCon = pCon;
- pCon->Construct(url,info);
- m_xConnections.push_back(WeakReferenceHelper(*pCon));
-
- return xCon;
-}
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL ODBCDriver::acceptsURL( const ::rtl::OUString& url )
- throw(SQLException, RuntimeException)
-{
- return (!url.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:odbc:")),10));
-}
-// --------------------------------------------------------------------------------
-Sequence< DriverPropertyInfo > SAL_CALL ODBCDriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException)
-{
- if ( acceptsURL(url) )
- {
- ::std::vector< DriverPropertyInfo > aDriverInfo;
-
- Sequence< ::rtl::OUString > aBooleanValues(2);
- aBooleanValues[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) );
- aBooleanValues[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) );
-
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet of the database."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseCatalog"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Use catalog for file-based databases."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SystemDriverSettings"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Driver settings."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParameterNameSubstitution"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Change named parameters with '?'."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IgnoreDriverPrivileges"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Ignore the privileges from the database driver."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsAutoRetrievingEnabled"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Retrieve generated values."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoRetrievingStatement"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Auto-increment statement."))
- ,sal_False
- ,::rtl::OUString()
- ,Sequence< ::rtl::OUString >())
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GenerateASBeforeCorrelationName"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Generate AS before table correlation names."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) )
- ,aBooleanValues)
- );
- aDriverInfo.push_back(DriverPropertyInfo(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EscapeDateTime"))
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Escape date time format."))
- ,sal_False
- ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) )
- ,aBooleanValues)
- );
-
- return Sequence< DriverPropertyInfo >(&aDriverInfo[0],aDriverInfo.size());
- }
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
- ::dbtools::throwGenericSQLException(sMessage ,*this);
- return Sequence< DriverPropertyInfo >();
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODBCDriver::getMajorVersion( ) throw(RuntimeException)
-{
- return 1;
-}
-// --------------------------------------------------------------------------------
-sal_Int32 SAL_CALL ODBCDriver::getMinorVersion( ) throw(RuntimeException)
-{
- return 0;
-}
-// --------------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
deleted file mode 100644
index 233e95cca0..0000000000
--- a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
+++ /dev/null
@@ -1,978 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include <string.h>
-#include <osl/diagnose.h>
-#include "diagnose_ex.h"
-#include "odbc/OPreparedStatement.hxx"
-#include "odbc/OBoundParam.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include "odbc/OTools.hxx"
-#include "odbc/ODriver.hxx"
-#include "odbc/OResultSet.hxx"
-#include "odbc/OResultSetMetaData.hxx"
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/sequence.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/dbtools.hxx"
-#include <comphelper/types.hxx>
-#include "connectivity/FValue.hxx"
-#include "resource/common_res.hrc"
-#include "connectivity/sqlparse.hxx"
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::odbc;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-
-IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbcx.OPreparedStatement","com.sun.star.sdbc.PreparedStatement");
-
-
-OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const ::rtl::OUString& sql)
- :OStatement_BASE2(_pConnection)
- ,numParams(0)
- ,boundParams(NULL)
- ,m_bPrepared(sal_False)
-{
- m_sSqlStatement = sql;
- try
- {
- if(_pConnection->isParameterSubstitutionEnabled())
- {
- OSQLParser aParser(_pConnection->getDriver()->getORB());
- ::rtl::OUString sErrorMessage;
- ::rtl::OUString sNewSql;
- ::std::auto_ptr<OSQLParseNode> pNode( aParser.parseTree(sErrorMessage,sql) );
- if ( pNode.get() )
- { // special handling for parameters
- OSQLParseNode::substituteParameterNames(pNode.get());
- pNode->parseNodeToStr( sNewSql, _pConnection );
- m_sSqlStatement = sNewSql;
- }
- }
- }
- catch(Exception&)
- {
- }
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::acquire() throw()
-{
- OStatement_BASE2::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::release() throw()
-{
- OStatement_BASE2::release();
-}
-// -----------------------------------------------------------------------------
-Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OStatement_BASE2::queryInterface(rType);
- return aRet.hasValue() ? aRet : OPreparedStatement_BASE::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL OPreparedStatement::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::comphelper::concatSequences(OPreparedStatement_BASE::getTypes(),OStatement_BASE2::getTypes());
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- prepareStatement();
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- if(!m_xMetaData.is())
- m_xMetaData = new OResultSetMetaData(getOwnConnection(),m_aStatementHandle);
- return m_xMetaData;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- // Close/clear our result set
- clearMyResultSet ();
-
- // Reset last warning message
-
- try {
- clearWarnings ();
- OStatement_BASE2::close();
- FreeParams();
- }
- catch (SQLException &) {
- // If we get an error, ignore
- }
-
- // Remove this Statement object from the Connection object's
- // list
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- sal_Bool needData = sal_False;
-
- // Reset warnings
-
- clearWarnings ();
-
- // Reset the statement handle, warning and saved Resultset
-
- reset();
-
- // Call SQLExecute
- prepareStatement();
-
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- try
- {
- SQLRETURN nReturn = N3SQLExecute(m_aStatementHandle);
-
- OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- needData = nReturn == SQL_NEED_DATA;
-
- // Now loop while more data is needed (i.e. a data-at-
- // execution parameter was given). For each parameter
- // that needs data, put the data from the input stream.
-
- while (needData) {
-
- // Get the parameter number that requires data
-
- sal_Int32* paramIndex = 0;
- nReturn = N3SQLParamData(m_aStatementHandle,(SQLPOINTER*)&paramIndex);
-
- // If the parameter index is -1, there is no
- // more data required
-
- if ( !paramIndex || ( *paramIndex == -1 ) )
- needData = sal_False;
- else
- {
- // Now we have the proper parameter
- // index, get the data from the input
- // stream and do a SQLPutData
- putParamData (*paramIndex);
- }
- }
-
- }
- catch (const SQLWarning&)
- {
- }
-
- // Now loop while more data is needed (i.e. a data-at-
- // execution parameter was given). For each parameter
- // that needs data, put the data from the input stream.
-
- while (needData) {
-
- // Get the parameter number that requires data
-
- sal_Int32* paramIndex = 0;
- N3SQLParamData (m_aStatementHandle,(SQLPOINTER*)&paramIndex);
-
- // If the parameter index is -1, there is no more
- // data required
-
- if (*paramIndex == -1) {
- needData = sal_False;
- }
- else {
- // Now we have the proper parameter index,
- // get the data from the input stream
- // and do a SQLPutData
- putParamData(*paramIndex);
- }
- }
-
- // Now determine if there is a result set associated with
- // the SQL statement that was executed. Get the column
- // count, and if it is not zero, there is a result set.
-
-
- return getColumnCount() > 0;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- sal_Int32 numRows = -1;
-
- prepareStatement();
- // Execute the statement. If execute returns sal_False, a
- // row count exists.
-
- if (!execute())
- numRows = getUpdateCount ();
- else
- {
- // No update count was produced (a ResultSet was). Raise
- // an exception
- m_pConnection->throwGenericSQLException(STR_NO_ROWCOUNT,*this);
- }
- return numRows;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
-{
- ::rtl::OString aString(::rtl::OUStringToOString(x,getOwnConnection()->getTextEncoding()));
- setParameter(parameterIndex,DataType::CHAR,aString.getLength(),(void*)&x);
-}
-// -------------------------------------------------------------------------
-
-Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- return (Reference< XConnection >)m_pConnection;
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- Reference< XResultSet > rs = NULL;
-
- prepareStatement();
-
- if (execute())
- rs = getResultSet(sal_False);
- else
- {
- // No ResultSet was produced. Raise an exception
- m_pConnection->throwGenericSQLException(STR_NO_RESULTSET,*this);
- }
- return rs;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- sal_Int32 value = 0;
-
- // If the parameter is sal_True, set the value to 1
- if (x) {
- value = 1;
- }
-
- // Set the parameter as if it were an integer
- setInt (parameterIndex, value);
-}
-// -------------------------------------------------------------------------
-void OPreparedStatement::setParameter(sal_Int32 parameterIndex,sal_Int32 _nType,sal_Int32 _nSize,void* _pData)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- prepareStatement();
- // Allocate a buffer to be used in binding. This will be
- // a 'permanent' buffer that the bridge will fill in with
- // the bound data in native format.
-
-
- checkParameterIndex(parameterIndex);
- sal_Int32 nRealSize = _nSize;
- SQLSMALLINT fSqlType = static_cast<SQLSMALLINT>(OTools::jdbcTypeToOdbc(_nType));
- switch(fSqlType)
- {
- case SQL_CHAR:
- case SQL_VARCHAR:
- case SQL_DECIMAL:
- case SQL_NUMERIC:
- ++nRealSize;
- break;
- case SQL_BINARY:
- case SQL_VARBINARY:
- nRealSize=1; //dummy buffer, binary data isn't copied
- break;
- default:
- break;
- }
-
- sal_Int8* bindBuf = allocBindBuf(parameterIndex, nRealSize);
-
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- OTools::bindParameter( m_pConnection,
- m_aStatementHandle,
- parameterIndex,
- bindBuf,
- getLengthBuf(parameterIndex),
- fSqlType,
- sal_False,
- m_pConnection->useOldDateFormat(),
- _pData,
- (Reference <XInterface>)*this,
- getOwnConnection()->getTextEncoding());
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,DataType::TINYINT,sizeof(sal_Int8),&x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const Date& aData ) throw(SQLException, RuntimeException)
-{
- DATE_STRUCT x = OTools::DateToOdbcDate(aData);
- setParameter(parameterIndex,DataType::DATE,sizeof(DATE_STRUCT),&x);
-}
-// -------------------------------------------------------------------------
-
-
-void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const Time& aVal ) throw(SQLException, RuntimeException)
-{
- TIME_STRUCT x = OTools::TimeToOdbcTime(aVal);
- setParameter(parameterIndex,DataType::TIME,sizeof(TIME_STRUCT),&x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const DateTime& aVal ) throw(SQLException, RuntimeException)
-{
- TIMESTAMP_STRUCT x = OTools::DateTimeToTimestamp(aVal);
- setParameter(parameterIndex,DataType::TIMESTAMP,sizeof(TIMESTAMP_STRUCT),&x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,DataType::DOUBLE,sizeof(double),&x);
-}
-
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,DataType::FLOAT,sizeof(float),&x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,DataType::INTEGER,sizeof(sal_Int32),&x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(SQLException, RuntimeException)
-{
- try
- {
- setParameter(parameterIndex,DataType::BIGINT,sizeof(sal_Int64),&x);
- }
- catch(SQLException&)
- {
- setString(parameterIndex,ORowSetValue(x));
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- prepareStatement();
- // Get the buffer needed for the length
- checkParameterIndex(parameterIndex);
-
- sal_Int8* lenBuf = getLengthBuf (parameterIndex);
- *(SQLLEN*)lenBuf = SQL_NULL_DATA;
-
-
- SQLLEN prec = 0;
- SQLULEN nColumnSize = 0;
- if (sqlType == SQL_CHAR || sqlType == SQL_VARCHAR || sqlType == SQL_LONGVARCHAR)
- {
- prec = 1;
- nColumnSize = 1;
- }
-
- SQLSMALLINT fCType = 0;
- SQLSMALLINT fSqlType = 0;
-
- SQLSMALLINT nDecimalDigits = 0;
- OTools::getBindTypes( sal_False,
- m_pConnection->useOldDateFormat(),
- (SQLSMALLINT)sqlType,
- fCType,
- fSqlType);
-
- SQLRETURN nReturn = N3SQLBindParameter( m_aStatementHandle,
- (SQLUSMALLINT)parameterIndex,
- (SQLSMALLINT)SQL_PARAM_INPUT,
- fCType,
- fSqlType,
- nColumnSize,
- nDecimalDigits,
- NULL,
- prec,
- (SQLLEN*)lenBuf
- );
- OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Reference< XClob >& x ) throw(SQLException, RuntimeException)
-{
- if ( x.is() )
- setStream(parameterIndex, x->getCharacterStream(), (SQLLEN)x->length(), DataType::LONGVARCHAR);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Reference< XBlob >& x ) throw(SQLException, RuntimeException)
-{
- if ( x.is() )
- setStream(parameterIndex, x->getBinaryStream(), (SQLLEN)x->length(), DataType::LONGVARCHAR);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setArray( sal_Int32 /*parameterIndex*/, const Reference< XArray >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setArray", *this );
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setRef( sal_Int32 /*parameterIndex*/, const Reference< XRef >& /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XParameters::setRef", *this );
-}
-// -------------------------------------------------------------------------
-void OPreparedStatement::setDecimal( sal_Int32 parameterIndex, const ::rtl::OUString& x )
-{
- ::rtl::OString aString(::rtl::OUStringToOString(x,getOwnConnection()->getTextEncoding()));
- setParameter(parameterIndex,DataType::DECIMAL,aString.getLength(),(void*)&x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 sqlType, sal_Int32 scale ) throw(SQLException, RuntimeException)
-{
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
- prepareStatement();
- // For each known SQL Type, call the appropriate
- // set routine
-
- switch (sqlType)
- {
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- if(x.hasValue())
- {
- ::rtl::OUString sStr;
- x >>= sStr;
- ::rtl::OString aString(::rtl::OUStringToOString(sStr,getOwnConnection()->getTextEncoding()));
- setParameter(parameterIndex,sqlType,aString.getLength(),&aString);
- }
- else
- setNull(parameterIndex,sqlType);
- break;
- case DataType::DECIMAL:
- {
- ORowSetValue aValue;
- aValue.fill(x);
- setDecimal(parameterIndex,aValue);
- }
- break;
- case DataType::NUMERIC:
- {
- ORowSetValue aValue;
- aValue.fill(x);
- setString(parameterIndex,aValue);
- }
- break;
- default:
- ::dbtools::setObjectWithInfo(this,parameterIndex,x,sqlType,scale);
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& /*typeName*/ ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- setNull(parameterIndex,sqlType);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x ) throw(SQLException, RuntimeException)
-{
- if (!::dbtools::implSetObject(this, parameterIndex, x))
- { // there is no other setXXX call which can handle the value in x
- throw SQLException();
- }
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,DataType::SMALLINT,sizeof(sal_Int16),&x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
-{
- setParameter(parameterIndex,DataType::BINARY,x.getLength(),(void*)&x);
- boundParams[parameterIndex-1].setSequence(x); // this assures that the sequence stays alive
-}
-// -------------------------------------------------------------------------
-
-
-void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- setStream(parameterIndex, x, length, DataType::LONGVARCHAR);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- setStream(parameterIndex, x, length, DataType::LONGVARBINARY);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::clearParameters( ) throw(SQLException, RuntimeException)
-{
- prepareStatement();
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- SQLRETURN nRet = N3SQLFreeStmt (m_aStatementHandle, SQL_RESET_PARAMS);
- nRet = N3SQLFreeStmt (m_aStatementHandle, SQL_UNBIND);
- OSL_UNUSED(nRet);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OPreparedStatement::clearBatch( ) throw(SQLException, RuntimeException)
-{
- // clearParameters( );
- // m_aBatchList.erase();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::addBatch( ) throw(SQLException, RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-
-Sequence< sal_Int32 > SAL_CALL OPreparedStatement::executeBatch( ) throw(SQLException, RuntimeException)
-{
- return Sequence< sal_Int32 > ();
-}
-// -------------------------------------------------------------------------
-
-//====================================================================
-// methods
-//====================================================================
-
-//--------------------------------------------------------------------
-// initBoundParam
-// Initialize the bound parameter objects
-//--------------------------------------------------------------------
-
-void OPreparedStatement::initBoundParam () throw(SQLException)
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- // Get the number of parameters
- numParams = 0;
- N3SQLNumParams (m_aStatementHandle,&numParams);
-
- // There are parameter markers, allocate the bound
- // parameter objects
-
- if (numParams > 0)
- {
- // Allocate an array of bound parameter objects
-
- boundParams = new OBoundParam[numParams];
-
- // Allocate and initialize each bound parameter
-
- for (sal_Int32 i = 0; i < numParams; i++)
- {
- boundParams[i] = OBoundParam();
- boundParams[i].initialize ();
- }
- }
-}
-// -------------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-// allocBindBuf
-// Allocate storage for the permanent data buffer for the bound
-// parameter.
-//--------------------------------------------------------------------
-
-sal_Int8* OPreparedStatement::allocBindBuf( sal_Int32 index,sal_Int32 bufLen)
-{
- sal_Int8* b = NULL;
-
- // Sanity check the parameter number
-
- if ((index >= 1) &&
- (index <= numParams) && bufLen > 0 )
- {
- b = boundParams[index - 1].allocBindDataBuffer(bufLen);
- }
-
- return b;
-}
-// -------------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-// getDataBuf
-// Gets the data buffer for the given parameter index
-//--------------------------------------------------------------------
-
-sal_Int8* OPreparedStatement::getDataBuf (sal_Int32 index)
-{
- sal_Int8* b = NULL;
-
- // Sanity check the parameter number
-
- if ((index >= 1) &&
- (index <= numParams))
- {
- b = boundParams[index - 1].getBindDataBuffer ();
- }
-
- return b;
-}
-// -------------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-// getLengthBuf
-// Gets the length buffer for the given parameter index
-//--------------------------------------------------------------------
-
-sal_Int8* OPreparedStatement::getLengthBuf (sal_Int32 index)
-{
- sal_Int8* b = NULL;
-
- // Sanity check the parameter number
-
- if ((index >= 1) &&
- (index <= numParams))
- {
- b = boundParams[index - 1].getBindLengthBuffer ();
- }
-
- return b;
-}
-// -------------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-// getParamLength
-// Returns the length of the given parameter number. When each
-// parameter was bound, a 4-sal_Int8 buffer was given to hold the
-// length (stored in native format). Get the buffer, convert the
-// buffer from native format, and return it. If the length is -1,
-// the column is considered to be NULL.
-//--------------------------------------------------------------------
-
-sal_Int32 OPreparedStatement::getParamLength ( sal_Int32 index)
-{
- sal_Int32 paramLen = SQL_NULL_DATA;
-
- // Sanity check the parameter number
-
- if ((index >= 1) &&
- (index <= numParams)) {
-
- // Now get the length of the parameter from the
- // bound param array. -1 is returned if it is NULL.
- long n = 0;
- memcpy (&n, boundParams[index -1].getBindLengthBuffer (), sizeof (n));
- paramLen = n;
- }
- return paramLen;
-}
-// -------------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-// putParamData
-// Puts parameter data from a previously bound input stream. The
-// input stream was bound using SQL_LEN_DATA_AT_EXEC.
-//--------------------------------------------------------------------
-
-void OPreparedStatement::putParamData (sal_Int32 index) throw(SQLException)
-{
- // Sanity check the parameter index
- if ((index < 1) ||
- (index > numParams))
- {
- return;
- }
-
- // We'll transfer up to MAX_PUT_DATA_LENGTH at a time
- Sequence< sal_Int8 > buf( MAX_PUT_DATA_LENGTH );
-
- // Get the information about the input stream
-
- Reference< XInputStream> inputStream = boundParams[index - 1].getInputStream ();
- if ( !inputStream.is() )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(STR_NO_INPUTSTREAM));
- throw SQLException (sError, *this,::rtl::OUString(),0,Any());
- }
-
- sal_Int32 maxBytesLeft = boundParams[index - 1].getInputStreamLen ();
-
- // Loop while more data from the input stream
- sal_Int32 haveRead = 0;
- try
- {
-
- do
- {
- sal_Int32 toReadThisRound = ::std::min( MAX_PUT_DATA_LENGTH, maxBytesLeft );
-
- // Read some data from the input stream
- haveRead = inputStream->readBytes( buf, toReadThisRound );
- OSL_ENSURE( haveRead == buf.getLength(), "OPreparedStatement::putParamData: inconsistency!" );
-
- if ( !haveRead )
- // no more data in the stream - the given stream length was a maximum which could not be
- // fulfilled by the stream
- break;
-
- // Put the data
- OSL_ENSURE( m_aStatementHandle, "OPreparedStatement::putParamData: StatementHandle is null!" );
- N3SQLPutData ( m_aStatementHandle, buf.getArray(), buf.getLength() );
-
- // decrement the number of bytes still needed
- maxBytesLeft -= haveRead;
- }
- while ( maxBytesLeft > 0 );
- }
- catch (const IOException& ex)
- {
-
- // If an I/O exception was generated, turn
- // it into a SQLException
-
- throw SQLException(ex.Message,*this,::rtl::OUString(),0,Any());
- }
-}
-// -------------------------------------------------------------------------
-//--------------------------------------------------------------------
-// getPrecision
-// Given a SQL type, return the maximum precision for the column.
-// Returns -1 if not known
-//--------------------------------------------------------------------
-
-sal_Int32 OPreparedStatement::getPrecision ( sal_Int32 sqlType)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- sal_Int32 prec = -1;
- const TTypeInfoVector& rTypeInfo = m_pConnection->getTypeInfo();
- if ( !rTypeInfo.empty() )
- {
- m_pConnection->buildTypeInfo();
- }
-
- if ( !rTypeInfo.empty() )
- {
- OTypeInfo aInfo;
- aInfo.nType = (sal_Int16)sqlType;
- TTypeInfoVector::const_iterator aIter = ::std::find(rTypeInfo.begin(),rTypeInfo.end(),aInfo);
- if(aIter != rTypeInfo.end())
- prec = (*aIter).nPrecision;
- }
- return prec;
-}
-
-//--------------------------------------------------------------------
-// setStream
-// Sets an input stream as a parameter, using the given SQL type
-//--------------------------------------------------------------------
-
-void OPreparedStatement::setStream(
- sal_Int32 ParameterIndex,
- const Reference< XInputStream>& x,
- SQLLEN length,
- sal_Int32 SQLtype)
- throw(SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- prepareStatement();
-
- checkParameterIndex(ParameterIndex);
- // Get the buffer needed for the length
-
- sal_Int8* lenBuf = getLengthBuf(ParameterIndex);
-
- // Allocate a new buffer for the parameter data. This buffer
- // will be returned by SQLParamData (it is set to the parameter
- // number, a 4-sal_Int8 integer)
-
- sal_Int8* dataBuf = allocBindBuf (ParameterIndex, 4);
-
- // Bind the parameter with SQL_LEN_DATA_AT_EXEC
- SQLSMALLINT Ctype = SQL_C_CHAR;
- SQLLEN atExec = SQL_LEN_DATA_AT_EXEC (length);
- memcpy (dataBuf, &ParameterIndex, sizeof(ParameterIndex));
- memcpy (lenBuf, &atExec, sizeof (atExec));
-
- if ((SQLtype == SQL_BINARY) || (SQLtype == SQL_VARBINARY) || (SQLtype == SQL_LONGVARBINARY))
- Ctype = SQL_C_BINARY;
-
-
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- N3SQLBindParameter(m_aStatementHandle,
- (SQLUSMALLINT)ParameterIndex,
- (SQLUSMALLINT)SQL_PARAM_INPUT,
- Ctype,
- (SQLSMALLINT)SQLtype,
- (SQLULEN)length,
- 0,
- dataBuf,
- sizeof(ParameterIndex),
- (SQLLEN*)lenBuf);
-
- // Save the input stream
- boundParams[ParameterIndex - 1].setInputStream (x, length);
-}
-// -------------------------------------------------------------------------
-
-// -------------------------------------------------------------------------
-
-void OPreparedStatement::FreeParams()
-{
- numParams = 0;
- delete [] boundParams;
- boundParams = NULL;
-}
-// -------------------------------------------------------------------------
-void OPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception)
-{
- try
- {
- switch(nHandle)
- {
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- if(!isPrepared())
- setResultSetConcurrency(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- if(!isPrepared())
- setResultSetType(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- if(!isPrepared())
- setFetchDirection(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_USEBOOKMARKS:
- if(!isPrepared())
- setUsingBookmarks(comphelper::getBOOL(rValue));
- break;
- default:
- OStatement_Base::setFastPropertyValue_NoBroadcast(nHandle,rValue);
- }
- }
- catch(const SQLException&)
- {
- // throw Exception(e.Message,*this);
- }
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::prepareStatement()
-{
- if(!isPrepared())
- {
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- ::rtl::OString aSql(::rtl::OUStringToOString(m_sSqlStatement,getOwnConnection()->getTextEncoding()));
- SQLRETURN nReturn = N3SQLPrepare(m_aStatementHandle,(SDB_ODBC_CHAR *) aSql.getStr(),aSql.getLength());
- OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- m_bPrepared = sal_True;
- initBoundParam();
- }
-}
-// -----------------------------------------------------------------------------
-void OPreparedStatement::checkParameterIndex(sal_Int32 _parameterIndex)
-{
- if( !_parameterIndex || _parameterIndex > numParams)
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(STR_WRONG_PARAM_INDEX,
- "$pos$", ::rtl::OUString::valueOf(_parameterIndex),
- "$count$", ::rtl::OUString::valueOf((sal_Int32)numParams)
- ));
- SQLException aNext(sError,*this, ::rtl::OUString(),0,Any());
-
- ::dbtools::throwInvalidIndexException(*this,makeAny(aNext));
- }
-}
-// -----------------------------------------------------------------------------
-OResultSet* OPreparedStatement::createResulSet()
-{
- OResultSet* pReturn = new OResultSet(m_aStatementHandle,this);
- pReturn->setMetaData(getMetaData());
- return pReturn;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx
deleted file mode 100644
index 32917e67bb..0000000000
--- a/connectivity/source/drivers/odbcbase/OResultSet.cxx
+++ /dev/null
@@ -1,1768 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "odbc/OResultSet.hxx"
-#include "odbc/OTools.hxx"
-#include "odbc/OResultSetMetaData.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/sdbcx/CompareBookmark.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <comphelper/property.hxx>
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/extract.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/types.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbexception.hxx"
-#include "diagnose_ex.h"
-#include <rtl/logfile.hxx>
-
-#include <o3tl/compat_functional.hxx>
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::odbc;
-using namespace cppu;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-
-#define ODBC_SQL_NOT_DEFINED 99UL
-
-//------------------------------------------------------------------------------
-// IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
-::rtl::OUString SAL_CALL OResultSet::getImplementationName( ) throw ( RuntimeException)
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.odbc.ResultSet"));
-}
-// -------------------------------------------------------------------------
- Sequence< ::rtl::OUString > SAL_CALL OResultSet::getSupportedServiceNames( ) throw( RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(2);
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.ResultSet"));
- aSupported[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.ResultSet"));
- return aSupported;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw( RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-
-// -------------------------------------------------------------------------
-OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) : OResultSet_BASE(m_aMutex)
- ,OPropertySetHelper(OResultSet_BASE::rBHelper)
- ,m_aStatementHandle(_pStatementHandle)
- ,m_aConnectionHandle(pStmt->getConnectionHandle())
- ,m_pStatement(pStmt)
- ,m_pSkipDeletedSet(NULL)
- ,m_xStatement(*pStmt)
- ,m_xMetaData(NULL)
- ,m_pRowStatusArray( NULL )
- ,m_nTextEncoding(pStmt->getOwnConnection()->getTextEncoding())
- ,m_nRowPos(0)
- ,m_nLastColumnPos(0)
- ,m_nUseBookmarks(ODBC_SQL_NOT_DEFINED)
- ,m_nCurrentFetchState(0)
- ,m_bWasNull(sal_True)
- ,m_bEOF(sal_True)
- ,m_bLastRecord(sal_False)
- ,m_bFreeHandle(sal_False)
- ,m_bInserting(sal_False)
- ,m_bFetchData(sal_True)
- ,m_bRowInserted(sal_False)
- ,m_bRowDeleted(sal_False)
- ,m_bUseFetchScroll(sal_False)
-{
- osl_incrementInterlockedCount( &m_refCount );
- try
- {
- m_pRowStatusArray = new SQLUSMALLINT[1]; // the default value
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_STATUS_PTR,m_pRowStatusArray,SQL_IS_POINTER);
- }
- catch(const Exception&)
- { // we don't want our result destroy here
- }
- SQLINTEGER nCurType = 0;
- try
- {
- N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_TYPE,&nCurType,SQL_IS_UINTEGER,0);
- SQLUINTEGER nValueLen = m_pStatement->getCursorProperties(nCurType,sal_False);
- if( (nValueLen & SQL_CA2_SENSITIVITY_DELETIONS) != SQL_CA2_SENSITIVITY_DELETIONS ||
- (nValueLen & SQL_CA2_CRC_EXACT) != SQL_CA2_CRC_EXACT)
- m_pSkipDeletedSet = new OSkipDeletedSet(this);
- }
- catch(const Exception&)
- { // we don't want our result destroy here
- }
- try
- {
- SQLUINTEGER nValueLen = 0;
- OTools::GetInfo(m_pStatement->getOwnConnection(),m_aConnectionHandle,SQL_GETDATA_EXTENSIONS,nValueLen,NULL);
- m_bFetchData = !((SQL_GD_ANY_ORDER & nValueLen) == SQL_GD_ANY_ORDER && nCurType != SQL_CURSOR_FORWARD_ONLY);
- }
- catch(const Exception&)
- { // we don't want our result destroy here
- m_bFetchData = sal_True;
- }
- try
- {
- if ( getOdbcFunction(ODBC3SQLGetFunctions) )
- {
- SQLUSMALLINT nSupported = 0;
- m_bUseFetchScroll = ( N3SQLGetFunctions(m_aConnectionHandle,SQL_API_SQLFETCHSCROLL,&nSupported) == SQL_SUCCESS && nSupported == 1 );
- }
- }
- catch(const Exception&)
- {
- m_bUseFetchScroll = sal_False;
- }
-
- osl_decrementInterlockedCount( &m_refCount );
-}
-// -------------------------------------------------------------------------
-OResultSet::~OResultSet()
-{
- delete [] m_pRowStatusArray;
- delete m_pSkipDeletedSet;
-}
-// -----------------------------------------------------------------------------
-void OResultSet::construct()
-{
- osl_incrementInterlockedCount( &m_refCount );
- allocBuffer();
- osl_decrementInterlockedCount( &m_refCount );
-}
-// -------------------------------------------------------------------------
-void OResultSet::disposing(void)
-{
- SQLRETURN nRet = N3SQLCloseCursor(m_aStatementHandle);
- OSL_UNUSED( nRet );
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
- if(!m_aBindVector.empty())
- releaseBuffer();
- if(m_bFreeHandle)
- m_pStatement->getOwnConnection()->freeStatementHandle(m_aStatementHandle);
-
-m_xStatement.clear();
-m_xMetaData.clear();
-}
-// -------------------------------------------------------------------------
-SQLRETURN OResultSet::unbind(sal_Bool _bUnbindHandle)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::unbind" );
- SQLRETURN nRet = 0;
- if ( _bUnbindHandle )
- nRet = N3SQLFreeStmt(m_aStatementHandle,SQL_UNBIND);
-
- if ( m_aBindVector.size() > 1 )
- {
- TVoidVector::iterator pValue = m_aBindVector.begin() + 1;
- TVoidVector::iterator pEnd = m_aBindVector.end();
- for(; pValue != pEnd; ++pValue)
- {
- switch (pValue->second)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- delete static_cast< ::rtl::OString* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::BIGINT:
- delete static_cast< sal_Int64* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- delete static_cast< ::rtl::OString* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::REAL:
- case DataType::DOUBLE:
- delete static_cast< double* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- delete [] static_cast< char* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- delete [] static_cast< char* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::DATE:
- delete static_cast< DATE_STRUCT* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::TIME:
- delete static_cast< TIME_STRUCT* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::TIMESTAMP:
- delete static_cast< TIMESTAMP_STRUCT* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::BIT:
- case DataType::TINYINT:
- delete static_cast< sal_Int8* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::SMALLINT:
- delete static_cast< sal_Int16* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::INTEGER:
- delete static_cast< sal_Int32* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::FLOAT:
- delete static_cast< float* >(reinterpret_cast< void * >(pValue->first));
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- delete static_cast< sal_Int8* >(reinterpret_cast< void * >(pValue->first));
- break;
- }
- }
- m_aBindVector.clear();
- m_aBindVector.push_back(TVoidPtr(0,0)); // the first is reserved for the bookmark
- }
- return nRet;
-}
-// -------------------------------------------------------------------------
-TVoidPtr OResultSet::allocBindColumn(sal_Int32 _nType,sal_Int32 _nColumnIndex)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::allocBindColumn" );
- TVoidPtr aPair;
- switch (_nType)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new ::rtl::OString()),_nType);
- break;
- case DataType::BIGINT:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new sal_Int64(0)),_nType);
- break;
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new ::rtl::OString()),_nType);
- break;
- case DataType::REAL:
- case DataType::DOUBLE:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new double(0.0)),_nType);
- break;
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new char[2]),_nType); // dient nur zum auffinden
- break;
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new char[2]),_nType); // dient nur zum auffinden
- break;
- case DataType::DATE:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new DATE_STRUCT),_nType);
- break;
- case DataType::TIME:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new TIME_STRUCT),_nType);
- break;
- case DataType::TIMESTAMP:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new TIMESTAMP_STRUCT),_nType);
- break;
- case DataType::BIT:
- case DataType::TINYINT:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new sal_Int8(0)),_nType);
- break;
- case DataType::SMALLINT:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new sal_Int16(0)),_nType);
- break;
- case DataType::INTEGER:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new sal_Int32(0)),_nType);
- break;
- case DataType::FLOAT:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new float(0)),_nType);
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- aPair = TVoidPtr(reinterpret_cast< sal_Int64 >(new sal_Int8[m_aRow[_nColumnIndex].getSequence().getLength()]),_nType);
- break;
- default:
- OSL_FAIL("Unknown type");
- aPair = TVoidPtr(0,_nType);
- }
- return aPair;
-}
-// -------------------------------------------------------------------------
-void OResultSet::allocBuffer()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::allocBuffer" );
- Reference< XResultSetMetaData > xMeta = getMetaData();
- sal_Int32 nLen = xMeta->getColumnCount();
-
- m_aBindVector.reserve(nLen+1);
- m_aBindVector.push_back(TVoidPtr(0,0)); // the first is reserved for the bookmark
- m_aRow.resize(nLen+1);
-
- for(sal_Int32 i = 1;i<=nLen;++i)
- {
- sal_Int32 nType = xMeta->getColumnType(i);
- m_aRow[i].setTypeKind( nType );
- }
- m_aLengthVector.resize(nLen + 1);
-}
-// -------------------------------------------------------------------------
-void OResultSet::releaseBuffer()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::releaseBuffer" );
- unbind(sal_False);
- m_aLengthVector.clear();
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OPropertySetHelper::queryInterface(rType);
- return aRet.hasValue() ? aRet : OResultSet_BASE::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
- Sequence< Type > SAL_CALL OResultSet::getTypes( ) throw( RuntimeException)
-{
- OTypeCollection aTypes( ::getCppuType( (const Reference< ::com::sun::star::beans::XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XFastPropertySet > *)0 ),
- ::getCppuType( (const Reference< ::com::sun::star::beans::XPropertySet > *)0 ));
-
- return ::comphelper::concatSequences(aTypes.getTypes(),OResultSet_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::findColumn" );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- ::osl::MutexGuard aGuard( m_aMutex );
-
- Reference< XResultSetMetaData > xMeta = getMetaData();
- sal_Int32 nLen = xMeta->getColumnCount();
- sal_Int32 i = 1;
- for(;i<=nLen;++i)
- if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
- columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
- break;
- return i;
-}
-// -------------------------------------------------------------------------
-Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- // TODO use getBytes instead of
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- // TODO use getBytes instead of
- return NULL;
-}
-// -----------------------------------------------------------------------------
-const ORowSetValue& OResultSet::getValue(sal_Int32 _nColumnIndex,SQLSMALLINT _nType,void* _pValue,SQLINTEGER _rSize)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::getValue" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- if(m_bFetchData)
- {
- if(_nColumnIndex > m_nLastColumnPos)
- fillRow(_nColumnIndex);
- return m_aRow[_nColumnIndex];
- }
- else
- OTools::getValue(m_pStatement->getOwnConnection(),m_aStatementHandle,_nColumnIndex,_nType,m_bWasNull,**this,_pValue,_rSize);
-
- return m_aEmptyValue;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- sal_Int8 nVal(0);
- const ORowSetValue& aValue = getValue(columnIndex,SQL_C_BIT,&nVal,sizeof nVal);
- return (&aValue == &m_aEmptyValue) ? (sal_Bool)nVal : (sal_Bool)aValue;
-}
-// -------------------------------------------------------------------------
-
-sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- sal_Int8 nRet(0);
- const ORowSetValue& aValue = getValue(columnIndex,SQL_C_TINYINT,&nRet,sizeof nRet);
- return (&aValue == &m_aEmptyValue) ? nRet : (sal_Int8)aValue;
-}
-// -------------------------------------------------------------------------
-
-Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::getBytes" );
-
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- if(m_bFetchData)
- {
- if(columnIndex > m_nLastColumnPos)
- fillRow(columnIndex);
- Sequence< sal_Int8 > nRet;
- switch(m_aRow[columnIndex].getTypeKind())
- {
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- nRet = m_aRow[columnIndex];
- break;
- default:
- {
- ::rtl::OUString sRet;
- sRet = m_aRow[columnIndex].getString();
- nRet = Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(sRet.getStr()),sizeof(sal_Unicode)*sRet.getLength());
- }
- }
- return nRet;
- }
-
- const SWORD nColumnType = impl_getColumnType_nothrow(columnIndex);
-
- switch(nColumnType)
- {
- case SQL_WVARCHAR:
- case SQL_WCHAR:
- case SQL_WLONGVARCHAR:
- case SQL_VARCHAR:
- case SQL_CHAR:
- case SQL_LONGVARCHAR:
- {
- ::rtl::OUString aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding);
- return Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength());
- }
- default:
- ;
- }
- return OTools::getBytesValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_C_BINARY,m_bWasNull,**this);
-}
-// -------------------------------------------------------------------------
-
-Date SAL_CALL OResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::getDate" );
- DATE_STRUCT aDate;
- aDate.day = 0;
- aDate.month = 0;
- aDate.year = 0;
-
- const ORowSetValue& aValue = getValue( columnIndex,
- m_pStatement->getOwnConnection()->useOldDateFormat() ? SQL_C_DATE : SQL_C_TYPE_DATE,
- &aDate,sizeof aDate);
- return (&aValue == &m_aEmptyValue) ? Date(aDate.day,aDate.month,aDate.year) : (Date)aValue;
-}
-// -------------------------------------------------------------------------
-
-double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- double nRet(0);
- const ORowSetValue& aValue = getValue(columnIndex,SQL_C_DOUBLE,&nRet,sizeof nRet);
- return (&aValue == &m_aEmptyValue) ? nRet : (double)aValue;
-}
-// -------------------------------------------------------------------------
-
-float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- float nRet(0);
- const ORowSetValue& aValue = getValue(columnIndex,SQL_C_FLOAT,&nRet,sizeof nRet);
- return (&aValue == &m_aEmptyValue) ? nRet : (float)aValue;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nRet(0);
- const ORowSetValue& aValue = getValue(columnIndex,SQL_C_LONG,&nRet,sizeof nRet);
- return (&aValue == &m_aEmptyValue) ? nRet : (sal_Int32)aValue;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSet::getRow( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return m_pSkipDeletedSet ? m_pSkipDeletedSet->getMappedPosition(getDriverPos()) : getDriverPos();
-}
-// -------------------------------------------------------------------------
-
-sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- sal_Int64 nRet(0);
- try
- {
- const ORowSetValue& aValue = getValue(columnIndex,SQL_C_SBIGINT,&nRet,sizeof nRet);
- return (&aValue == &m_aEmptyValue) ? nRet : (sal_Int64)aValue;
- }
- catch(const SQLException&)
- {
- nRet = getString(columnIndex).toInt64();
- }
- return nRet;
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::getMetaData" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(!m_xMetaData.is())
- m_xMetaData = new OResultSetMetaData(m_pStatement->getOwnConnection(),m_aStatementHandle);
- return m_xMetaData;
-}
-// -------------------------------------------------------------------------
-Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getArray", *this );
- return NULL;
-}
-
-// -------------------------------------------------------------------------
-
-Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getClob", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-Reference< XBlob > SAL_CALL OResultSet::getBlob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getBlob", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRow::getRef", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::getObject" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- fillRow(columnIndex);
- return m_aRow[columnIndex].makeAny();
-}
-// -------------------------------------------------------------------------
-
-sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- sal_Int16 nRet(0);
- const ORowSetValue& aValue = getValue(columnIndex,SQL_C_SHORT,&nRet,sizeof nRet);
- return (&aValue == &m_aEmptyValue) ? nRet : (sal_Int16)aValue;
-}
-// -------------------------------------------------------------------------
-
-
-::rtl::OUString SAL_CALL OResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::getString" );
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ::rtl::OUString nRet;
- if ( m_bFetchData )
- nRet = getValue(columnIndex,0,NULL,0);
- else
- {
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- const SWORD nColumnType = impl_getColumnType_nothrow(columnIndex);
- nRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding);
- }
- return nRet;
-}
-// -------------------------------------------------------------------------
-
-Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::getTime" );
- TIME_STRUCT aTime={0,0,0};
- const ORowSetValue& aValue = getValue(columnIndex,
- m_pStatement->getOwnConnection()->useOldDateFormat() ? SQL_C_TIME : SQL_C_TYPE_TIME,
- &aTime,sizeof aTime);
- return (&aValue == &m_aEmptyValue) ? Time(0,aTime.second,aTime.minute,aTime.hour) : (Time)aValue;
-}
-// -------------------------------------------------------------------------
-
-
-DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::getTimestamp" );
- TIMESTAMP_STRUCT aTime={0,0,0,0,0,0,0};
- const ORowSetValue& aValue = getValue(columnIndex,
- m_pStatement->getOwnConnection()->useOldDateFormat() ? SQL_C_TIMESTAMP : SQL_C_TYPE_TIMESTAMP,
- &aTime,sizeof aTime);
- return (&aValue == &m_aEmptyValue)
- ?
- DateTime(static_cast<sal_uInt16>(aTime.fraction*1000),aTime.second,aTime.minute,aTime.hour,aTime.day,aTime.month,aTime.year)
- :
- (DateTime)aValue;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- return m_nRowPos == 0;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return m_nRowPos != 0 && m_nCurrentFetchState == SQL_NO_DATA;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return m_nRowPos == 1;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_bEOF && m_nCurrentFetchState != SQL_NO_DATA;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::beforeFirst" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- if(first())
- previous();
- m_nCurrentFetchState = SQL_SUCCESS;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::afterLast( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::afterLast" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- if(last())
- next();
- m_bEOF = sal_True;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::first( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::first" );
- return moveImpl(IResultSetHelper::FIRST,0,sal_True);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::last( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::last" );
- return moveImpl(IResultSetHelper::LAST,0,sal_True);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::absolute" );
- return moveImpl(IResultSetHelper::ABSOLUTE,row,sal_True);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::relative" );
- return moveImpl(IResultSetHelper::RELATIVE,row,sal_True);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::previous( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::previous" );
- return moveImpl(IResultSetHelper::PRIOR,0,sal_True);
-}
-// -------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL OResultSet::getStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- return m_xStatement;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::rowDeleted() throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::rowDeleted" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- sal_Bool bRet = m_bRowDeleted;
- m_bRowDeleted = sal_False;
-
- return bRet;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::rowInserted( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::rowInserted" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- sal_Bool bInserted = m_bRowInserted;
- m_bRowInserted = sal_False;
-
- return bInserted;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::rowUpdated" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_pRowStatusArray[0] == SQL_ROW_UPDATED;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::next( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::next" );
- return moveImpl(IResultSetHelper::NEXT,1,sal_True);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSet::wasNull( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::wasNull" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- return m_bFetchData ? m_aRow[m_nLastColumnPos].isNull() : m_bWasNull;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::cancel( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- OTools::ThrowException(m_pStatement->getOwnConnection(),N3SQLCancel(m_aStatementHandle),m_aStatementHandle,SQL_HANDLE_STMT,*this);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OResultSet::getWarnings( ) throw(SQLException, RuntimeException)
-{
- return Any();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::insertRow" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- SQLLEN nMaxLen = 20;
- SQLLEN nRealLen = 0;
- Sequence<sal_Int8> aBookmark(nMaxLen);
-
- SQLRETURN nRet = N3SQLBindCol(m_aStatementHandle,
- 0,
- SQL_C_VARBOOKMARK,
- aBookmark.getArray(),
- nMaxLen,
- &nRealLen
- );
- // Sequence<sal_Int8> aRealBookmark(nMaxLen);
-
- sal_Bool bPositionByBookmark = ( NULL != getOdbcFunction( ODBC3SQLBulkOperations ) );
- if ( bPositionByBookmark )
- {
- nRet = N3SQLBulkOperations( m_aStatementHandle, SQL_ADD );
- fillNeededData( nRet );
- }
- else
- {
- if(isBeforeFirst())
- next(); // must be done
- nRet = N3SQLSetPos( m_aStatementHandle, 1, SQL_ADD, SQL_LOCK_NO_CHANGE );
- fillNeededData( nRet );
- }
- try
- {
- OTools::ThrowException(m_pStatement->getOwnConnection(),nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- }
- catch(const SQLException&)
- {
- nRet = unbind();
- throw;
- }
-
-
- if ( bPositionByBookmark )
- {
- nRet = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_FETCH_BOOKMARK_PTR,aBookmark.getArray(),SQL_IS_POINTER); // SQL_LEN_BINARY_ATTR(aBookmark.getLength())
-
- nRet = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_BOOKMARK,0);
- }
- else
- nRet = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_RELATIVE,0); // OJ 06.03.2004
- // sometimes we got an error but we are not interested in anymore #106047# OJ
- // OTools::ThrowException(m_pStatement->getOwnConnection(),nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- nRet = unbind();
- OTools::ThrowException(m_pStatement->getOwnConnection(),nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
-
- if(m_pSkipDeletedSet)
- {
- aBookmark.realloc(nRealLen);
- if(moveToBookmark(makeAny(aBookmark)))
- {
- sal_Int32 nRowPos = getDriverPos();
- if ( -1 == m_nRowPos )
- {
- nRowPos = m_aPosToBookmarks.size() + 1;
- }
- if ( nRowPos == m_nRowPos )
- ++nRowPos;
- m_nRowPos = nRowPos;
- m_pSkipDeletedSet->insertNewPosition(nRowPos);
- m_aPosToBookmarks[aBookmark] = nRowPos;
- }
- }
- m_bRowInserted = sal_True;
-
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::updateRow" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- SQLRETURN nRet;
-
- sal_Bool bPositionByBookmark = ( NULL != getOdbcFunction( ODBC3SQLBulkOperations ) );
- if ( bPositionByBookmark )
- {
- SQLLEN nRealLen = 0;
- nRet = N3SQLBindCol(m_aStatementHandle,
- 0,
- SQL_C_VARBOOKMARK,
- m_aBookmark.getArray(),
- m_aBookmark.getLength(),
- &nRealLen
- );
- fillNeededData(nRet = N3SQLBulkOperations(m_aStatementHandle, SQL_UPDATE_BY_BOOKMARK));
- }
- else
- fillNeededData(nRet = N3SQLSetPos(m_aStatementHandle,1,SQL_UPDATE,SQL_LOCK_NO_CHANGE));
- OTools::ThrowException(m_pStatement->getOwnConnection(),nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- // now unbind all columns so we can fetch all columns again with SQLGetData
- nRet = unbind();
- OSL_ENSURE(nRet == SQL_SUCCESS,"Could not unbind the columns!");
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::deleteRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::deleteRow" );
- SQLRETURN nRet = SQL_SUCCESS;
- sal_Int32 nPos = getDriverPos();
- nRet = N3SQLSetPos(m_aStatementHandle,1,SQL_DELETE,SQL_LOCK_NO_CHANGE);
- OTools::ThrowException(m_pStatement->getOwnConnection(),nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
-
- m_bRowDeleted = ( m_pRowStatusArray[0] == SQL_ROW_DELETED );
- if ( m_bRowDeleted )
- {
- TBookmarkPosMap::iterator aIter = m_aPosToBookmarks.begin();
- TBookmarkPosMap::iterator aEnd = m_aPosToBookmarks.end();
- for (; aIter != aEnd; ++aIter)
- {
- if ( aIter->second == nPos )
- {
- m_aPosToBookmarks.erase(aIter);
- break;
- }
- }
- }
- if ( m_pSkipDeletedSet )
- m_pSkipDeletedSet->deletePosition(nPos);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeException)
-{
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::moveToInsertRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::moveToInsertRow" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_nLastColumnPos = 0;
- // first unbound all columns
- OSL_VERIFY_EQUALS( unbind(), SQL_SUCCESS, "Could not unbind columns!" );
- // SQLRETURN nRet = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_ARRAY_SIZE ,(SQLPOINTER)1,SQL_IS_INTEGER);
- m_bInserting = sal_True;
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::moveToCurrentRow( ) throw(SQLException, RuntimeException)
-{
- m_nLastColumnPos = 0;
-}
-// -------------------------------------------------------------------------
-void OResultSet::updateValue(sal_Int32 columnIndex,SQLSMALLINT _nType,void* _pValue) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::updateValue" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- m_aBindVector.push_back(allocBindColumn(OTools::MapOdbcType2Jdbc(_nType),columnIndex));
- void* pData = reinterpret_cast<void*>(m_aBindVector.rbegin()->first);
- OSL_ENSURE(pData != NULL,"Data for update is NULL!");
- OTools::bindValue( m_pStatement->getOwnConnection(),
- m_aStatementHandle,
- columnIndex,
- _nType,
- 0,
- _pValue,
- pData,
- &m_aLengthVector[columnIndex],
- **this,
- m_nTextEncoding,
- m_pStatement->getOwnConnection()->useOldDateFormat());
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- m_aBindVector.push_back(allocBindColumn(DataType::CHAR,columnIndex));
- void* pData = reinterpret_cast<void*>(m_aBindVector.rbegin()->first);
- OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_CHAR,0,(sal_Int8*)NULL,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding,m_pStatement->getOwnConnection()->useOldDateFormat());
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,SQL_BIT,&x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,SQL_CHAR,&x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,SQL_TINYINT,&x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,SQL_INTEGER,&x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateLong( sal_Int32 /*columnIndex*/, sal_Int64 /*x*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRowUpdate::updateLong", *this );
-}
-// -----------------------------------------------------------------------
-void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,SQL_REAL,&x);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(SQLException, RuntimeException)
-{
- updateValue(columnIndex,SQL_DOUBLE,&x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nType = m_aRow[columnIndex].getTypeKind();
- SQLSMALLINT nOdbcType = static_cast<SQLSMALLINT>(OTools::jdbcTypeToOdbc(nType));
- m_aRow[columnIndex] = x;
- m_aRow[columnIndex].setTypeKind(nType); // OJ: otherwise longvarchar will be recognized by fillNeededData
- updateValue(columnIndex,nOdbcType,(void*)&x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
-{
- sal_Int32 nType = m_aRow[columnIndex].getTypeKind();
- SQLSMALLINT nOdbcType = static_cast<SQLSMALLINT>(OTools::jdbcTypeToOdbc(nType));
- m_aRow[columnIndex] = x;
- m_aRow[columnIndex].setTypeKind(nType); // OJ: otherwise longvarbinary will be recognized by fillNeededData
- updateValue(columnIndex,nOdbcType,(void*)&x);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const Date& x ) throw(SQLException, RuntimeException)
-{
- DATE_STRUCT aVal = OTools::DateToOdbcDate(x);
- updateValue(columnIndex,SQL_DATE,&aVal);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const Time& x ) throw(SQLException, RuntimeException)
-{
- TIME_STRUCT aVal = OTools::TimeToOdbcTime(x);
- updateValue(columnIndex,SQL_TIME,&aVal);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const DateTime& x ) throw(SQLException, RuntimeException)
-{
- TIMESTAMP_STRUCT aVal = OTools::DateTimeToTimestamp(x);
- updateValue(columnIndex,SQL_TIMESTAMP,&aVal);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const Reference< XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- if(!x.is())
- ::dbtools::throwFunctionSequenceException(*this);
-
- Sequence<sal_Int8> aSeq;
- x->readBytes(aSeq,length);
- updateBytes(columnIndex,aSeq);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
-{
- updateBinaryStream(columnIndex,x,length);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::refreshRow" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- // SQLRETURN nRet = N3SQLSetPos(m_aStatementHandle,1,SQL_REFRESH,SQL_LOCK_NO_CHANGE);
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_RELATIVE,0);
- OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException)
-{
- if (!::dbtools::implUpdateObject(this, columnIndex, x))
- throw SQLException();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 /*scale*/ ) throw(SQLException, RuntimeException)
-{
- if (!::dbtools::implUpdateObject(this, columnIndex, x))
- throw SQLException();
-}
-// -------------------------------------------------------------------------
-// XRowLocate
-Any SAL_CALL OResultSet::getBookmark( ) throw( SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::getBookmark" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- TBookmarkPosMap::iterator aFind = ::std::find_if(m_aPosToBookmarks.begin(),m_aPosToBookmarks.end(),
- ::o3tl::compose1(::std::bind2nd(::std::equal_to<sal_Int32>(),m_nRowPos),::o3tl::select2nd<TBookmarkPosMap::value_type>()));
-
- if ( aFind == m_aPosToBookmarks.end() )
- {
- if ( m_nUseBookmarks == ODBC_SQL_NOT_DEFINED )
- {
- RTL_LOGFILE_CONTEXT_TRACE( aLogger, "SQLGetStmtAttr" );
- m_nUseBookmarks = SQL_UB_OFF;
- SQLRETURN nRet = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_USE_BOOKMARKS,&m_nUseBookmarks,SQL_IS_UINTEGER,NULL);
- OSL_UNUSED( nRet );
- }
- if(m_nUseBookmarks == SQL_UB_OFF)
- throw SQLException();
-
- m_aBookmark = OTools::getBytesValue(m_pStatement->getOwnConnection(),m_aStatementHandle,0,SQL_C_VARBOOKMARK,m_bWasNull,**this);
- m_aPosToBookmarks[m_aBookmark] = m_nRowPos;
- OSL_ENSURE(m_aBookmark.getLength(),"Invalid bookmark from length 0!");
- }
- else
- m_aBookmark = aFind->first;
- return makeAny(m_aBookmark);
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::moveToBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::moveToBookmark" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- m_nLastColumnPos = 0;
- bookmark >>= m_aBookmark;
- OSL_ENSURE(m_aBookmark.getLength(),"Invalid bookmark from length 0!");
- if(m_aBookmark.getLength())
- {
- SQLRETURN nReturn = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_FETCH_BOOKMARK_PTR,m_aBookmark.getArray(),SQL_IS_POINTER); // SQL_LEN_BINARY_ATTR(aBookmark.getLength())
- OSL_UNUSED( nReturn );
-
- if ( SQL_INVALID_HANDLE != nReturn && SQL_ERROR != nReturn )
- {
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_BOOKMARK,0);
- OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- TBookmarkPosMap::iterator aFind = m_aPosToBookmarks.find(m_aBookmark);
- if(aFind != m_aPosToBookmarks.end())
- m_nRowPos = aFind->second;
- else
- m_nRowPos = -1;
- return m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
- }
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw( SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::moveRelativeToBookmark" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
- m_nLastColumnPos = 0;
- bookmark >>= m_aBookmark;
- SQLRETURN nReturn = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_FETCH_BOOKMARK_PTR,m_aBookmark.getArray(),SQL_IS_POINTER);
- OSL_UNUSED( nReturn );
-
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_BOOKMARK,rows);
- OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- return m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSet::compareBookmarks( const Any& lhs, const Any& rhs ) throw( SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::compareBookmarks" );
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return (lhs == rhs) ? CompareBookmark::EQUAL : CompareBookmark::NOT_EQUAL;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks( ) throw( SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSet::hashBookmark( const Any& /*bookmark*/ ) throw( SQLException, RuntimeException)
-{
- ::dbtools::throwFunctionNotSupportedException( "XRowLocate::hashBookmark", *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-// XDeleteRows
-Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& rows ) throw( SQLException, RuntimeException)
-{
- Sequence< sal_Int32 > aRet(rows.getLength());
- sal_Int32 *pRet = aRet.getArray();
-
- const Any *pBegin = rows.getConstArray();
- const Any *pEnd = pBegin + rows.getLength();
-
- for(;pBegin != pEnd;++pBegin,++pRet)
- {
- try
- {
- if(moveToBookmark(*pBegin))
- {
- deleteRow();
- *pRet = 1;
- }
- }
- catch(const SQLException&)
- {
- *pRet = 0;
- }
- }
- return aRet;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OResultSet::getResultSetConcurrency() const
-{
- sal_uInt32 nValue = 0;
- SQLRETURN nReturn = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CONCURRENCY,&nValue,SQL_IS_UINTEGER,0);
- OSL_UNUSED( nReturn );
- if(SQL_CONCUR_READ_ONLY == nValue)
- nValue = ResultSetConcurrency::READ_ONLY;
- else
- nValue = ResultSetConcurrency::UPDATABLE;
-
- return nValue;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OResultSet::getResultSetType() const
-{
- sal_uInt32 nValue = 0;
- N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_SENSITIVITY,&nValue,SQL_IS_UINTEGER,0);
- if(SQL_SENSITIVE == nValue)
- nValue = ResultSetType::SCROLL_SENSITIVE;
- else if(SQL_INSENSITIVE == nValue)
- nValue = ResultSetType::SCROLL_INSENSITIVE;
- else
- {
- SQLINTEGER nCurType = 0;
- N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_TYPE,&nCurType,SQL_IS_UINTEGER,0);
- if(SQL_CURSOR_KEYSET_DRIVEN == nCurType)
- nValue = ResultSetType::SCROLL_SENSITIVE;
- else if(SQL_CURSOR_STATIC == nCurType)
- nValue = ResultSetType::SCROLL_INSENSITIVE;
- else if(SQL_CURSOR_FORWARD_ONLY == nCurType)
- nValue = ResultSetType::FORWARD_ONLY;
- else if(SQL_CURSOR_DYNAMIC == nCurType)
- nValue = ResultSetType::SCROLL_SENSITIVE;
- }
- return nValue;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OResultSet::getFetchDirection() const
-{
- return FetchDirection::FORWARD;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OResultSet::getFetchSize() const
-{
- sal_uInt32 nValue = 0;
- N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_ARRAY_SIZE,&nValue,SQL_IS_UINTEGER,0);
- return nValue;
-}
-//------------------------------------------------------------------------------
-::rtl::OUString OResultSet::getCursorName() const
-{
- SQLCHAR pName[258];
- SQLSMALLINT nRealLen = 0;
- N3SQLGetCursorName(m_aStatementHandle,(SQLCHAR*)pName,256,&nRealLen);
- return ::rtl::OUString::createFromAscii((const char*)pName);
-}
-// -------------------------------------------------------------------------
-sal_Bool OResultSet::isBookmarkable() const
-{
- if(!m_aConnectionHandle)
- return sal_False;
-
- sal_uInt32 nValue = 0;
- N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_TYPE,&nValue,SQL_IS_UINTEGER,0);
-
- sal_Int32 nAttr = 0;
- try
- {
- switch(nValue)
- {
- case SQL_CURSOR_FORWARD_ONLY:
- return sal_False;
- case SQL_CURSOR_STATIC:
- OTools::GetInfo(m_pStatement->getOwnConnection(),m_aConnectionHandle,SQL_STATIC_CURSOR_ATTRIBUTES1,nAttr,NULL);
- break;
- case SQL_CURSOR_KEYSET_DRIVEN:
- OTools::GetInfo(m_pStatement->getOwnConnection(),m_aConnectionHandle,SQL_KEYSET_CURSOR_ATTRIBUTES1,nAttr,NULL);
- break;
- case SQL_CURSOR_DYNAMIC:
- OTools::GetInfo(m_pStatement->getOwnConnection(),m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nAttr,NULL);
- break;
- }
- }
- catch(const Exception&)
- {
- return sal_False;
- }
-
- if ( m_nUseBookmarks == ODBC_SQL_NOT_DEFINED )
- {
- m_nUseBookmarks = SQL_UB_OFF;
- SQLRETURN nRet = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_USE_BOOKMARKS,&m_nUseBookmarks,SQL_IS_UINTEGER,NULL);
- OSL_UNUSED( nRet );
- }
-
- return (m_nUseBookmarks != SQL_UB_OFF) && (nAttr & SQL_CA1_BOOKMARK) == SQL_CA1_BOOKMARK;
-}
-//------------------------------------------------------------------------------
-void OResultSet::setFetchDirection(sal_Int32 _par0)
-{
- OSL_ENSURE(_par0>0,"Illegal fetch direction!");
- if ( _par0 > 0 )
- {
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_TYPE,(SQLPOINTER)(sal_IntPtr)_par0,SQL_IS_UINTEGER);
- }
-}
-//------------------------------------------------------------------------------
-void OResultSet::setFetchSize(sal_Int32 _par0)
-{
- OSL_ENSURE(_par0>0,"Illegal fetch size!");
- if ( _par0 > 0 )
- {
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_ARRAY_SIZE,(SQLPOINTER)(sal_IntPtr)_par0,SQL_IS_UINTEGER);
- delete [] m_pRowStatusArray;
-
- m_pRowStatusArray = new SQLUSMALLINT[_par0];
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_STATUS_PTR,m_pRowStatusArray,SQL_IS_POINTER);
- }
-}
-// -------------------------------------------------------------------------
-IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
-{
- Sequence< Property > aProps(6);
- Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP1IMPL(CURSORNAME, ::rtl::OUString) PropertyAttribute::READONLY);
- DECL_PROP0(FETCHDIRECTION, sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
- DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
- DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
-
- return new OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-IPropertyArrayHelper & OResultSet::getInfoHelper()
-{
- return *const_cast<OResultSet*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool OResultSet::convertFastPropertyValue(
- Any & rConvertedValue,
- Any & rOldValue,
- sal_Int32 nHandle,
- const Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException)
-{
- switch(nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw ::com::sun::star::lang::IllegalArgumentException();
- case PROPERTY_ID_FETCHDIRECTION:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchDirection());
- case PROPERTY_ID_FETCHSIZE:
- return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchSize());
- default:
- ;
- }
- return sal_False;
-}
-// -------------------------------------------------------------------------
-void OResultSet::setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const Any& rValue
- )
- throw (Exception)
-{
- switch(nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- case PROPERTY_ID_CURSORNAME:
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- case PROPERTY_ID_RESULTSETTYPE:
- throw Exception();
- case PROPERTY_ID_FETCHDIRECTION:
- setFetchDirection(getINT32(rValue));
- break;
- case PROPERTY_ID_FETCHSIZE:
- setFetchSize(getINT32(rValue));
- break;
- default:
- ;
- }
-}
-// -------------------------------------------------------------------------
-void OResultSet::getFastPropertyValue(
- Any& rValue,
- sal_Int32 nHandle
- ) const
-{
- switch(nHandle)
- {
- case PROPERTY_ID_ISBOOKMARKABLE:
- rValue = bool2any(isBookmarkable());
- break;
- case PROPERTY_ID_CURSORNAME:
- rValue <<= getCursorName();
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- rValue <<= getResultSetConcurrency();
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- rValue <<= getResultSetType();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- rValue <<= getFetchDirection();
- break;
- case PROPERTY_ID_FETCHSIZE:
- rValue <<= getFetchSize();
- break;
- }
-}
-// -------------------------------------------------------------------------
-void OResultSet::fillRow(sal_Int32 _nToColumn)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::fillRow" );
- if((sal_Int32)m_aRow.size() <= _nToColumn)
- {
- m_aRow.resize(_nToColumn+1);
- m_aRow[_nToColumn].setBound(sal_True);
- }
- m_bFetchData = sal_False;
-
- sal_Int32 nColumn = m_nLastColumnPos + 1;
- TDataRow::iterator pColumn = m_aRow.begin() + nColumn;
- TDataRow::iterator pColumnEnd = m_aRow.begin() + _nToColumn + 1;
-
- for (; pColumn < pColumnEnd; ++nColumn, ++pColumn)
- {
- const sal_Int32 nType = pColumn->getTypeKind();
- switch (nType)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- {
- const SWORD nColumnType = impl_getColumnType_nothrow(nColumn);
- *pColumn = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,nColumn,nColumnType,m_bWasNull,**this,m_nTextEncoding);
- }
- break;
- case DataType::BIGINT:
- *pColumn = getLong(nColumn);
- break;
- case DataType::REAL:
- case DataType::DOUBLE:
- *pColumn = getDouble(nColumn);
- break;
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- *pColumn = getBytes(nColumn);
- break;
- case DataType::DATE:
- *pColumn = getDate(nColumn);
- break;
- case DataType::TIME:
- *pColumn = getTime(nColumn);
- break;
- case DataType::TIMESTAMP:
- *pColumn = getTimestamp(nColumn);
- break;
- case DataType::BIT:
- *pColumn = getBoolean(nColumn);
- break;
- case DataType::TINYINT:
- *pColumn = getByte(nColumn);
- break;
- case DataType::SMALLINT:
- *pColumn = getShort(nColumn);
- break;
- case DataType::INTEGER:
- *pColumn = getInt(nColumn);
- break;
- case DataType::FLOAT:
- *pColumn = getFloat(nColumn);
- break;
- case DataType::BINARY:
- case DataType::VARBINARY:
- *pColumn = getBytes(nColumn);
- break;
- }
-
- if ( m_bWasNull )
- pColumn->setNull();
- if(nType != pColumn->getTypeKind())
- {
- pColumn->setTypeKind(nType);
- }
- }
- m_nLastColumnPos = _nToColumn;
- m_bFetchData = sal_True;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OResultSet::acquire() throw()
-{
- OResultSet_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OResultSet::release() throw()
-{
- OResultSet_BASE::release();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-sal_Bool OResultSet::move(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool /*_bRetrieveData*/)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::move" );
- SQLSMALLINT nFetchOrientation = SQL_FETCH_NEXT;
- switch(_eCursorPosition)
- {
- case IResultSetHelper::NEXT:
- nFetchOrientation = SQL_FETCH_NEXT;
- break;
- case IResultSetHelper::PRIOR:
- nFetchOrientation = SQL_FETCH_PRIOR;
- break;
- case IResultSetHelper::FIRST:
- nFetchOrientation = SQL_FETCH_FIRST;
- break;
- case IResultSetHelper::LAST:
- nFetchOrientation = SQL_FETCH_LAST;
- break;
- case IResultSetHelper::RELATIVE:
- nFetchOrientation = SQL_FETCH_RELATIVE;
- break;
- case IResultSetHelper::ABSOLUTE:
- nFetchOrientation = SQL_FETCH_ABSOLUTE;
- break;
- case IResultSetHelper::BOOKMARK: // special case here because we are only called with position numbers
- {
- TBookmarkPosMap::iterator aIter = m_aPosToBookmarks.begin();
- TBookmarkPosMap::iterator aEnd = m_aPosToBookmarks.end();
- for (; aIter != aEnd; ++aIter)
- {
- if ( aIter->second == _nOffset )
- return moveToBookmark(makeAny(aIter->first));
- }
- OSL_FAIL("Bookmark not found!");
- }
- return sal_False;
- }
-
- m_bEOF = sal_False;
- m_nLastColumnPos = 0;
-
- SQLRETURN nOldFetchStatus = m_nCurrentFetchState;
- if ( !m_bUseFetchScroll && _eCursorPosition == IResultSetHelper::NEXT )
- m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
- else
- m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,nFetchOrientation,_nOffset);
-
- OSL_TRACE( __FILE__": OSkipDeletedSet::OResultSet::move(%d,%d), FetchState = %d",nFetchOrientation,_nOffset,m_nCurrentFetchState);
- OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
-
- const bool bSuccess = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
- if ( bSuccess )
- {
- switch(_eCursorPosition)
- {
- case IResultSetHelper::NEXT:
- ++m_nRowPos;
- break;
- case IResultSetHelper::PRIOR:
- --m_nRowPos;
- break;
- case IResultSetHelper::FIRST:
- m_nRowPos = 1;
- break;
- case IResultSetHelper::LAST:
- m_bEOF = sal_True;
- break;
- case IResultSetHelper::RELATIVE:
- m_nRowPos += _nOffset;
- break;
- case IResultSetHelper::ABSOLUTE:
- case IResultSetHelper::BOOKMARK: // special case here because we are only called with position numbers
- m_nRowPos = _nOffset;
- break;
- } // switch(_eCursorPosition)
- if ( m_nUseBookmarks == ODBC_SQL_NOT_DEFINED )
- {
- RTL_LOGFILE_CONTEXT_TRACE( aLogger, "SQLGetStmtAttr" );
- m_nUseBookmarks = SQL_UB_OFF;
- SQLRETURN nRet = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_USE_BOOKMARKS,&m_nUseBookmarks,SQL_IS_UINTEGER,NULL);
- OSL_UNUSED( nRet );
- }
- if ( m_nUseBookmarks != SQL_UB_OFF )
- {
- RTL_LOGFILE_CONTEXT_TRACE( aLogger, "OTools::getBytesValue" );
- m_aBookmark = OTools::getBytesValue(m_pStatement->getOwnConnection(),m_aStatementHandle,0,SQL_C_VARBOOKMARK,m_bWasNull,**this);
- m_aPosToBookmarks[m_aBookmark] = m_nRowPos;
- OSL_ENSURE(m_aBookmark.getLength(),"Invalid bookmark from length 0!");
- }
- }
- else if ( IResultSetHelper::PRIOR == _eCursorPosition && m_nCurrentFetchState == SQL_NO_DATA )
- m_nRowPos = 0;
- else if(IResultSetHelper::NEXT == _eCursorPosition && m_nCurrentFetchState == SQL_NO_DATA && nOldFetchStatus != SQL_NO_DATA)
- ++m_nRowPos;
-
- return bSuccess;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 OResultSet::getDriverPos() const
-{
- sal_Int32 nValue = 0;
- SQLRETURN nRet = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_NUMBER,&nValue,SQL_IS_UINTEGER,0);
- OSL_UNUSED( nRet );
- OSL_TRACE( __FILE__": OResultSet::getDriverPos() = Ret = %d, RowNum = %d, RowPos = %d",nRet,nValue , m_nRowPos);
- return nValue ? nValue : m_nRowPos;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OResultSet::deletedVisible() const
-{
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OResultSet::isRowDeleted() const
-{
- return m_pRowStatusArray[0] == SQL_ROW_DELETED;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OResultSet::moveImpl(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- return (m_pSkipDeletedSet != NULL)
- ? m_pSkipDeletedSet->skipDeleted(_eCursorPosition,_nOffset,_bRetrieveData)
- : move(_eCursorPosition,_nOffset,_bRetrieveData);
-}
-// -----------------------------------------------------------------------------
-void OResultSet::fillNeededData(SQLRETURN _nRet)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSet::fillNeededData" );
- SQLRETURN nRet = _nRet;
- if( nRet == SQL_NEED_DATA)
- {
- void* pColumnIndex = 0;
- nRet = N3SQLParamData(m_aStatementHandle,&pColumnIndex);
-
- do
- {
- if (nRet != SQL_SUCCESS && nRet != SQL_SUCCESS_WITH_INFO && nRet != SQL_NEED_DATA)
- break;
-
- sal_IntPtr nColumnIndex ( reinterpret_cast<sal_IntPtr>(pColumnIndex));
- Sequence< sal_Int8 > aSeq;
- switch(m_aRow[nColumnIndex].getTypeKind())
- {
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- case DataType::BLOB:
- aSeq = m_aRow[nColumnIndex];
- N3SQLPutData (m_aStatementHandle, aSeq.getArray(), aSeq.getLength());
- break;
- case SQL_WLONGVARCHAR:
- {
- ::rtl::OUString sRet;
- sRet = m_aRow[nColumnIndex].getString();
- nRet = N3SQLPutData (m_aStatementHandle, (SQLPOINTER)sRet.getStr(), sizeof(sal_Unicode)*sRet.getLength());
- break;
- }
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- {
- ::rtl::OUString sRet;
- sRet = m_aRow[nColumnIndex].getString();
- ::rtl::OString aString(::rtl::OUStringToOString(sRet,m_nTextEncoding));
- nRet = N3SQLPutData (m_aStatementHandle, (SQLPOINTER)aString.getStr(), aString.getLength());
- break;
- }
- default:
- OSL_FAIL("Not supported at the moment!");
- }
- nRet = N3SQLParamData(m_aStatementHandle,&pColumnIndex);
- }
- while (nRet == SQL_NEED_DATA);
- }
-}
-// -----------------------------------------------------------------------------
-SWORD OResultSet::impl_getColumnType_nothrow(sal_Int32 columnIndex)
-{
- ::std::map<sal_Int32,SWORD>::iterator aFind = m_aODBCColumnTypes.find(columnIndex);
- if ( aFind == m_aODBCColumnTypes.end() )
- aFind = m_aODBCColumnTypes.insert(::std::map<sal_Int32,SWORD>::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,columnIndex))).first;
- return aFind->second;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx b/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx
deleted file mode 100644
index a534a7e560..0000000000
--- a/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx
+++ /dev/null
@@ -1,318 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "odbc/OResultSetMetaData.hxx"
-#include "odbc/OTools.hxx"
-#include <rtl/logfile.hxx>
-
-using namespace connectivity::odbc;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::sdbc;
-
-// -------------------------------------------------------------------------
-OResultSetMetaData::~OResultSetMetaData()
-{
-}
-// -------------------------------------------------------------------------
-::rtl::OUString OResultSetMetaData::getCharColAttrib(sal_Int32 _column,sal_Int32 ident) throw(SQLException, RuntimeException)
-{
- sal_Int32 column = _column;
- if(_column <(sal_Int32) m_vMapping.size()) // use mapping
- column = m_vMapping[_column];
-
- SQLSMALLINT BUFFER_LEN = 128;
- char *pName = new char[BUFFER_LEN+1];
- SQLSMALLINT nRealLen=0;
- SQLRETURN nRet = N3SQLColAttribute(m_aStatementHandle,
- (SQLUSMALLINT)column,
- (SQLUSMALLINT)ident,
- (SQLPOINTER)pName,
- BUFFER_LEN,
- &nRealLen,
- NULL
- );
- ::rtl::OUString sValue;
- if ( nRet == SQL_SUCCESS )
- {
- if ( nRealLen < 0 )
- nRealLen = BUFFER_LEN;
- sValue = ::rtl::OUString(pName,nRealLen,m_pConnection->getTextEncoding());
- }
- delete [] pName;
- OTools::ThrowException(m_pConnection,nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- if(nRealLen > BUFFER_LEN)
- {
- pName = new char[nRealLen+1];
- nRet = N3SQLColAttribute(m_aStatementHandle,
- (SQLUSMALLINT)column,
- (SQLUSMALLINT)ident,
- (SQLPOINTER)pName,
- nRealLen,
- &nRealLen,
- NULL
- );
- if ( nRet == SQL_SUCCESS && nRealLen > 0)
- sValue = ::rtl::OUString(pName,nRealLen,m_pConnection->getTextEncoding());
- delete [] pName;
- OTools::ThrowException(m_pConnection,nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
- }
-
- return sValue;
-}
-// -------------------------------------------------------------------------
-SQLLEN OResultSetMetaData::getNumColAttrib(OConnection* _pConnection
- ,SQLHANDLE _aStatementHandle
- ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
- ,sal_Int32 _column
- ,sal_Int32 _ident) throw(SQLException, RuntimeException)
-{
- SQLLEN nValue=0;
- OTools::ThrowException(_pConnection,(*(T3SQLColAttribute)_pConnection->getOdbcFunction(ODBC3SQLColAttribute))(_aStatementHandle,
- (SQLUSMALLINT)_column,
- (SQLUSMALLINT)_ident,
- NULL,
- 0,
- NULL,
- &nValue),_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
- return nValue;
-}
-// -------------------------------------------------------------------------
-sal_Int32 OResultSetMetaData::getNumColAttrib(sal_Int32 _column,sal_Int32 ident) throw(SQLException, RuntimeException)
-{
- sal_Int32 column = _column;
- if(_column < (sal_Int32)m_vMapping.size()) // use mapping
- column = m_vMapping[_column];
-
- return getNumColAttrib(m_pConnection,m_aStatementHandle,*this,column,ident);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return getNumColAttrib(column,SQL_DESC_DISPLAY_SIZE);
-}
-// -------------------------------------------------------------------------
-SQLSMALLINT OResultSetMetaData::getColumnODBCType(OConnection* _pConnection
- ,SQLHANDLE _aStatementHandle
- ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
- ,sal_Int32 column)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- SQLSMALLINT nType = 0;
- try
- {
- nType = (SQLSMALLINT)getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE);
- if(nType == SQL_UNKNOWN_TYPE)
- nType = (SQLSMALLINT)getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column, SQL_DESC_TYPE);
- }
- catch(SQLException& ) // in this case we have an odbc 2.0 driver
- {
- nType = (SQLSMALLINT)getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE );
- }
-
- return nType;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- ::std::map<sal_Int32,sal_Int32>::iterator aFind = m_aColumnTypes.find(column);
- if ( aFind == m_aColumnTypes.end() )
- {
- sal_Int32 nType = 0;
- if(!m_bUseODBC2Types)
- {
- try
- {
- nType = getNumColAttrib(column,SQL_DESC_CONCISE_TYPE);
- if(nType == SQL_UNKNOWN_TYPE)
- nType = getNumColAttrib(column, SQL_DESC_TYPE);
- nType = OTools::MapOdbcType2Jdbc(nType);
- }
- catch(SQLException& ) // in this case we have an odbc 2.0 driver
- {
- m_bUseODBC2Types = sal_True;
- nType = OTools::MapOdbcType2Jdbc(getNumColAttrib(column,SQL_DESC_CONCISE_TYPE ));
- }
- }
- else
- nType = OTools::MapOdbcType2Jdbc(getNumColAttrib(column,SQL_DESC_CONCISE_TYPE ));
- aFind = m_aColumnTypes.insert(::std::map<sal_Int32,sal_Int32>::value_type(column,nType)).first;
- }
-
-
- return aFind->second;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSetMetaData::getColumnCount( ) throw(SQLException, RuntimeException)
-{
- if(m_nColCount != -1)
- return m_nColCount;
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSetMetaData::getColumnCount" );
- sal_Int16 nNumResultCols=0;
- OTools::ThrowException(m_pConnection,N3SQLNumResultCols(m_aStatementHandle,&nNumResultCols),m_aStatementHandle,SQL_HANDLE_STMT,*this);
- return m_nColCount = nNumResultCols;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return getNumColAttrib(column,SQL_DESC_CASE_SENSITIVE) == SQL_TRUE;
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL OResultSetMetaData::getSchemaName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return getCharColAttrib(column,SQL_DESC_SCHEMA_NAME);
-}
-// -------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return getCharColAttrib(column,SQL_DESC_NAME);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getTableName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return getCharColAttrib(column,SQL_DESC_TABLE_NAME);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getCatalogName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return getCharColAttrib(column,SQL_DESC_CATALOG_NAME);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnTypeName( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSetMetaData::getColumnTypeName" );
- return getCharColAttrib(column,SQL_DESC_TYPE_NAME);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnLabel( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSetMetaData::getColumnLabel" );
- return getCharColAttrib(column,SQL_DESC_LABEL);
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OResultSetMetaData::getColumnServiceName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSetMetaData::getColumnServiceName" );
- return ::rtl::OUString();
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isCurrency( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return getNumColAttrib(column,SQL_DESC_FIXED_PREC_SCALE) == SQL_TRUE;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- return getNumColAttrib(column,SQL_DESC_AUTO_UNIQUE_VALUE) == SQL_TRUE;
-}
-// -------------------------------------------------------------------------
-
-
-sal_Bool SAL_CALL OResultSetMetaData::isSigned( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSetMetaData::isSigned" );
- return getNumColAttrib(column,SQL_DESC_UNSIGNED) == SQL_FALSE;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getPrecision( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSetMetaData::getPrecision" );
- sal_Int32 nType = 0;
- try
- {
- nType = getNumColAttrib(column,SQL_DESC_PRECISION);
- }
- catch(const SQLException& ) // in this case we have an odbc 2.0 driver
- {
- m_bUseODBC2Types = sal_True;
- nType = getNumColAttrib(column,SQL_COLUMN_PRECISION );
- }
- return nType;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSetMetaData::getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSetMetaData::getScale" );
- sal_Int32 nType = 0;
- try
- {
- nType = getNumColAttrib(column,SQL_DESC_SCALE);
- }
- catch(const SQLException& ) // in this case we have an odbc 2.0 driver
- {
- m_bUseODBC2Types = sal_True;
- nType = getNumColAttrib(column,SQL_COLUMN_SCALE );
- }
- return nType;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSetMetaData::isNullable" );
- return getNumColAttrib(column,SQL_DESC_NULLABLE);
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSetMetaData::isSearchable" );
- return getNumColAttrib(column,SQL_DESC_SEARCHABLE) != SQL_PRED_NONE;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isReadOnly( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSetMetaData::isReadOnly" );
- return getNumColAttrib(column,SQL_DESC_UPDATABLE) == SQL_ATTR_READONLY;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OResultSetMetaData::isDefinitelyWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSetMetaData::isDefinitelyWritable" );
- return getNumColAttrib(column,SQL_DESC_UPDATABLE) == SQL_ATTR_WRITE;
-;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSetMetaData::isWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OResultSetMetaData::isWritable" );
- return getNumColAttrib(column,SQL_DESC_UPDATABLE) == SQL_ATTR_WRITE;
-}
-// -------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbcbase/OStatement.cxx b/connectivity/source/drivers/odbcbase/OStatement.cxx
deleted file mode 100644
index 93676093cc..0000000000
--- a/connectivity/source/drivers/odbcbase/OStatement.cxx
+++ /dev/null
@@ -1,1162 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include <osl/diagnose.h>
-#include "odbc/OStatement.hxx"
-#include "odbc/OConnection.hxx"
-#include "odbc/OResultSet.hxx"
-#include <comphelper/property.hxx>
-#include "odbc/OTools.hxx"
-#include <comphelper/uno3.hxx>
-#include <osl/thread.h>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include "diagnose_ex.h"
-#include <algorithm>
-#include "resource/common_res.hrc"
-#include "connectivity/dbexception.hxx"
-
-using namespace ::comphelper;
-
-#define THROW_SQL(x) \
- OTools::ThrowException(m_pConnection,x,m_aStatementHandle,SQL_HANDLE_STMT,*this)
-
-#if OSL_DEBUG_LEVEL > 1
-#define DEBUG_THROW \
- try \
- { \
- THROW_SQL(nRetCode); \
- } \
- catch(const SQLException&) \
- { \
- OSL_FAIL("Exception in odbc caught"); \
- }
-#endif
-
-
-
-using namespace connectivity::odbc;
-//------------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::sdbcx;
-using namespace com::sun::star::container;
-using namespace com::sun::star::io;
-using namespace com::sun::star::util;
-//------------------------------------------------------------------------------
-OStatement_Base::OStatement_Base(OConnection* _pConnection )
- :OStatement_BASE(m_aMutex)
- ,OPropertySetHelper(OStatement_BASE::rBHelper)
- ,m_pConnection(_pConnection)
- ,m_aStatementHandle(SQL_NULL_HANDLE)
- ,m_pRowStatusArray(0)
- ,rBHelper(OStatement_BASE::rBHelper)
-{
- osl_incrementInterlockedCount( &m_refCount );
- m_pConnection->acquire();
- m_aStatementHandle = m_pConnection->createStatementHandle();
-
- //setMaxFieldSize(0);
- // Don't do this. By ODBC spec, "0" is the default for the SQL_ATTR_MAX_LENGTH attribute. We once introduced
- // this line since an PostgreSQL ODBC driver had a default other than 0. However, current drivers (at least 8.3
- // and later) have a proper default of 0, so there should be no need anymore.
- // On the other hand, the NotesSQL driver (IBM's ODBC driver for the Lotus Notes series) wrongly interprets
- // "0" as "0", whereas the ODBC spec says it should in fact mean "unlimited".
- // So, removing this line seems to be the best option for now.
- // If we ever again encounter a ODBC driver which needs this option, then we should introduce a data source
- // setting for it, instead of unconditionally doing it.
-
- osl_decrementInterlockedCount( &m_refCount );
-}
-// -----------------------------------------------------------------------------
-OStatement_Base::~OStatement_Base()
-{
- OSL_ENSURE(!m_aStatementHandle,"Sohould ne null here!");
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::disposeResultSet()
-{
- // free the cursor if alive
- Reference< XComponent > xComp(m_xResultSet.get(), UNO_QUERY);
- if (xComp.is())
- xComp->dispose();
- m_xResultSet = Reference< XResultSet>();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::disposing(void)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- disposeResultSet();
- ::comphelper::disposeComponent(m_xGeneratedStatement);
-
- OSL_ENSURE(m_aStatementHandle,"OStatement_BASE2::disposing: StatementHandle is null!");
- if (m_pConnection)
- {
- m_pConnection->freeStatementHandle(m_aStatementHandle);
- m_pConnection->release();
- m_pConnection = NULL;
- }
- OSL_ENSURE(!m_aStatementHandle,"Sohould ne null here!");
-
- OStatement_BASE::disposing();
-}
-//------------------------------------------------------------------------------
-void OStatement_BASE2::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- dispose_ChildImpl();
- OStatement_Base::disposing();
-}
-//-----------------------------------------------------------------------------
-void SAL_CALL OStatement_BASE2::release() throw()
-{
- relase_ChildImpl();
-}
-//-----------------------------------------------------------------------------
-Any SAL_CALL OStatement_Base::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- if ( m_pConnection && !m_pConnection->isAutoRetrievingEnabled() && rType == ::getCppuType( (const Reference< XGeneratedResultSet > *)0 ) )
- return Any();
- Any aRet = OStatement_BASE::queryInterface(rType);
- return aRet.hasValue() ? aRet : OPropertySetHelper::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OStatement_Base::getTypes( ) throw(RuntimeException)
-{
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const Reference< XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< XFastPropertySet > *)0 ),
- ::getCppuType( (const Reference< XPropertySet > *)0 ));
- Sequence< Type > aOldTypes = OStatement_BASE::getTypes();
- if ( m_pConnection && !m_pConnection->isAutoRetrievingEnabled() )
- {
- ::std::remove(aOldTypes.getArray(),aOldTypes.getArray() + aOldTypes.getLength(),
- ::getCppuType( (const Reference< XGeneratedResultSet > *)0 ));
- aOldTypes.realloc(aOldTypes.getLength() - 1);
- }
-
- return ::comphelper::concatSequences(aTypes.getTypes(),aOldTypes);
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL OStatement_Base::getGeneratedValues( ) throw (SQLException, RuntimeException)
-{
- OSL_ENSURE( m_pConnection && m_pConnection->isAutoRetrievingEnabled(),"Illegal call here. isAutoRetrievingEnabled is false!");
- Reference< XResultSet > xRes;
- if ( m_pConnection )
- {
- ::rtl::OUString sStmt = m_pConnection->getTransformedGeneratedStatement(m_sSqlStatement);
- if ( sStmt.getLength() )
- {
- ::comphelper::disposeComponent(m_xGeneratedStatement);
- m_xGeneratedStatement = m_pConnection->createStatement();
- xRes = m_xGeneratedStatement->executeQuery(sStmt);
- }
- }
- return xRes;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::cancel( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- OTools::ThrowException(m_pConnection,N3SQLCancel(m_aStatementHandle),m_aStatementHandle,SQL_HANDLE_STMT,*this);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OStatement_Base::close( ) throw(SQLException, RuntimeException)
-{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- }
- dispose();
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OStatement::clearBatch( ) throw(SQLException, RuntimeException)
-{
-
-}
-// -------------------------------------------------------------------------
-
-void OStatement_Base::reset() throw (SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- clearWarnings ();
-
- if (m_xResultSet.get().is())
- {
- clearMyResultSet();
- }
- if(m_aStatementHandle)
- {
- THROW_SQL(N3SQLFreeStmt(m_aStatementHandle, SQL_CLOSE));
- }
-}
-//--------------------------------------------------------------------
-// clearMyResultSet
-// If a ResultSet was created for this Statement, close it
-//--------------------------------------------------------------------
-
-void OStatement_Base::clearMyResultSet () throw (SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- try
- {
- Reference<XCloseable> xCloseable;
- if ( ::comphelper::query_interface( m_xResultSet.get(), xCloseable ) )
- xCloseable->close();
- }
- catch( const DisposedException& ) { }
-
- m_xResultSet = Reference< XResultSet >();
-}
-//--------------------------------------------------------------------
-SQLLEN OStatement_Base::getRowCount () throw( SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- SQLLEN numRows = 0;
-
- try {
- THROW_SQL(N3SQLRowCount(m_aStatementHandle,&numRows));
- }
- catch (const SQLException&)
- {
- }
- return numRows;
-}
-//--------------------------------------------------------------------
-// lockIfNecessary
-// If the given SQL statement contains a 'FOR UPDATE' clause, change
-// the concurrency to lock so that the row can then be updated. Returns
-// true if the concurrency has been changed
-//--------------------------------------------------------------------
-
-sal_Bool OStatement_Base::lockIfNecessary (const ::rtl::OUString& sql) throw( SQLException)
-{
- sal_Bool rc = sal_False;
-
- // First, convert the statement to upper case
-
- ::rtl::OUString sqlStatement = sql.toAsciiUpperCase ();
-
- // Now, look for the FOR UPDATE keywords. If there is any extra white
- // space between the FOR and UPDATE, this will fail.
-
- sal_Int32 index = sqlStatement.indexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FOR UPDATE")));
-
- // We found it. Change our concurrency level to ensure that the
- // row can be updated.
-
- if (index > 0)
- {
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- try
- {
- SQLINTEGER nLock = SQL_CONCUR_LOCK;
- THROW_SQL(N3SQLSetStmtAttr(m_aStatementHandle, SQL_CONCURRENCY,(SQLPOINTER)(sal_IntPtr)nLock,SQL_IS_UINTEGER));
- }
- catch (const SQLWarning& warn)
- {
- // Catch any warnings and place on the warning stack
- setWarning (warn);
- }
- rc = sal_True;
- }
-
- return rc;
-}
-//--------------------------------------------------------------------
-// setWarning
-// Sets the warning
-//--------------------------------------------------------------------
-
-void OStatement_Base::setWarning (const SQLWarning &ex) throw( SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- m_aLastWarning = ex;
-}
-
-//--------------------------------------------------------------------
-// getColumnCount
-// Return the number of columns in the ResultSet
-//--------------------------------------------------------------------
-
-sal_Int32 OStatement_Base::getColumnCount () throw( SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- sal_Int16 numCols = 0;
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
-
- try {
- THROW_SQL(N3SQLNumResultCols(m_aStatementHandle,&numCols));
- }
- catch (const SQLException&)
- {
- }
- return numCols;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- m_sSqlStatement = sql;
-
-
- ::rtl::OString aSql(::rtl::OUStringToOString(sql,getOwnConnection()->getTextEncoding()));
-
- sal_Bool hasResultSet = sal_False;
- SQLWarning aWarning;
-
- // Reset the statement handle and warning
-
- reset();
-
- // Check for a 'FOR UPDATE' statement. If present, change
- // the concurrency to lock
-
- lockIfNecessary (sql);
-
- // Call SQLExecDirect
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
-
- try {
- THROW_SQL(N3SQLExecDirect(m_aStatementHandle, (SDB_ODBC_CHAR*)aSql.getStr(),aSql.getLength()));
- }
- catch (const SQLWarning& ex) {
-
- // Save pointer to warning and save with ResultSet
- // object once it is created.
-
- aWarning = ex;
- }
-
- // Now determine if there is a result set associated with
- // the SQL statement that was executed. Get the column
- // count, and if it is not zero, there is a result set.
-
- if (getColumnCount () > 0)
- {
- hasResultSet = sal_True;
- }
-
- return hasResultSet;
-}
-//--------------------------------------------------------------------
-// getResultSet
-// getResultSet returns the current result as a ResultSet. It
-// returns NULL if the current result is not a ResultSet.
-//--------------------------------------------------------------------
-Reference< XResultSet > OStatement_Base::getResultSet (sal_Bool checkCount) throw( SQLException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- if (m_xResultSet.get().is()) // if resultset already retrieved,
- {
- // throw exception to avoid sequence error
- ::dbtools::throwFunctionSequenceException(*this,Any());
- }
-
- OResultSet* pRs = NULL;
- sal_Int32 numCols = 1;
-
- // If we already know we have result columns, checkCount
- // is false. This is an optimization to prevent unneeded
- // calls to getColumnCount
-
- if (checkCount)
- numCols = getColumnCount ();
-
- // Only return a result set if there are result columns
-
- if (numCols > 0)
- {
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- pRs = createResulSet();
- pRs->construct();
-
- // Save a copy of our last result set
- // Changed to save copy at getResultSet.
- //m_xResultSet = rs;
- }
- else
- clearMyResultSet ();
-
- return pRs;
-}
-//--------------------------------------------------------------------
-// getStmtOption
-// Invoke SQLGetStmtOption with the given option.
-//--------------------------------------------------------------------
-
-sal_Int32 OStatement_Base::getStmtOption (short fOption) const
-{
- sal_Int32 result = 0;
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- N3SQLGetStmtAttr(m_aStatementHandle, fOption,&result,SQL_IS_INTEGER,NULL);
- return result;
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- Reference< XResultSet > xRS = NULL;
-
- // Execute the statement. If execute returns true, a result
- // set exists.
-
- if (execute (sql))
- {
- xRS = getResultSet (sal_False);
- m_xResultSet = xRS;
- }
- else
- {
- // No ResultSet was produced. Raise an exception
- m_pConnection->throwGenericSQLException(STR_NO_RESULTSET,*this);
- }
- return xRS;
-}
-// -------------------------------------------------------------------------
-
-Reference< XConnection > SAL_CALL OStatement_Base::getConnection( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- return (Reference< XConnection >)m_pConnection;
-}
-// -------------------------------------------------------------------------
-
-Any SAL_CALL OStatement::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ::cppu::queryInterface(rType,static_cast< XBatchExecution*> (this));
- return aRet.hasValue() ? aRet : OStatement_Base::queryInterface(rType);
-}
-// -------------------------------------------------------------------------
-
-void SAL_CALL OStatement::addBatch( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- m_aBatchList.push_back(sql);
-}
-// -------------------------------------------------------------------------
-Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- ::rtl::OString aBatchSql;
- sal_Int32 nLen = 0;
- for(::std::list< ::rtl::OUString>::const_iterator i=m_aBatchList.begin();i != m_aBatchList.end();++i,++nLen)
- {
- aBatchSql += ::rtl::OUStringToOString(*i,getOwnConnection()->getTextEncoding());
- aBatchSql += ";";
- }
-
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- THROW_SQL(N3SQLExecDirect(m_aStatementHandle, (SDB_ODBC_CHAR*)aBatchSql.getStr(),aBatchSql.getLength()));
-
- Sequence< sal_Int32 > aRet(nLen);
- sal_Int32* pArray = aRet.getArray();
- for(sal_Int32 j=0;j<nLen;++j)
- {
- SQLRETURN nError = N3SQLMoreResults(m_aStatementHandle);
- if(nError == SQL_SUCCESS)
- {
- SQLLEN nRowCount=0;
- N3SQLRowCount(m_aStatementHandle,&nRowCount);
- pArray[j] = nRowCount;
- }
- }
- return aRet;
-}
-// -------------------------------------------------------------------------
-
-
-sal_Int32 SAL_CALL OStatement_Base::executeUpdate( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- sal_Int32 numRows = -1;
-
- // Execute the statement. If execute returns false, a
- // row count exists.
-
- if (!execute (sql)) {
- numRows = getUpdateCount();
- }
- else {
-
- // No update count was produced (a ResultSet was). Raise
- // an exception
-
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceString(STR_NO_ROWCOUNT));
- throw SQLException (sError, *this,::rtl::OUString(),0,Any());
- }
- return numRows;
-
-}
-// -------------------------------------------------------------------------
-
-Reference< XResultSet > SAL_CALL OStatement_Base::getResultSet( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- m_xResultSet = getResultSet(sal_True);
- return m_xResultSet;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OStatement_Base::getUpdateCount( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- sal_Int32 rowCount = -1;
-
- // Only return a row count for SQL statements that did not
- // return a result set.
-
- if (getColumnCount () == 0)
- rowCount = getRowCount ();
-
- return rowCount;
-}
-// -------------------------------------------------------------------------
-
-sal_Bool SAL_CALL OStatement_Base::getMoreResults( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- SQLWarning warning;
- sal_Bool hasResultSet = sal_False;
-
- // clear previous warnings
-
- clearWarnings ();
-
- // Call SQLMoreResults
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
-
- try {
- hasResultSet = N3SQLMoreResults(m_aStatementHandle) == SQL_SUCCESS;
- }
- catch (const SQLWarning &ex) {
-
- // Save pointer to warning and save with ResultSet
- // object once it is created.
-
- warning = ex;
- }
-
- // There are more results (it may not be a result set, though)
-
- if (hasResultSet)
- {
-
- // Now determine if there is a result set associated
- // with the SQL statement that was executed. Get the
- // column count, and if it is zero, there is not a
- // result set.
-
- if (getColumnCount () == 0)
- hasResultSet = sal_False;
- }
-
- // Set the warning for the statement, if one was generated
-
- setWarning (warning);
-
- // Return the result set indicator
-
- return hasResultSet;
-}
-// -------------------------------------------------------------------------
-
-// -------------------------------------------------------------------------
-Any SAL_CALL OStatement_Base::getWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- return makeAny(m_aLastWarning);
-}
-// -------------------------------------------------------------------------
-
-// -------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::clearWarnings( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
- m_aLastWarning = SQLWarning();
-}
-// -------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getQueryTimeOut() const
-{
- return getStmtOption(SQL_ATTR_QUERY_TIMEOUT);
-}
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getMaxRows() const
-{
- return getStmtOption(SQL_ATTR_MAX_ROWS);
-}
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getResultSetConcurrency() const
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- sal_uInt32 nValue;
- SQLRETURN nRetCode = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CONCURRENCY,&nValue,SQL_IS_UINTEGER,0);
- OSL_UNUSED( nRetCode );
- if(nValue == SQL_CONCUR_READ_ONLY)
- nValue = ResultSetConcurrency::READ_ONLY;
- else
- nValue = ResultSetConcurrency::UPDATABLE;
- return nValue;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getResultSetType() const
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- sal_uInt32 nValue = SQL_CURSOR_FORWARD_ONLY;
- SQLRETURN nRetCode = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_SENSITIVITY,&nValue,SQL_IS_UINTEGER,0);
- nRetCode = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_TYPE,&nValue,SQL_IS_UINTEGER,0);
- OSL_UNUSED( nRetCode );
- switch(nValue)
- {
- case SQL_CURSOR_FORWARD_ONLY:
- nValue = ResultSetType::FORWARD_ONLY;
- break;
- case SQL_CURSOR_KEYSET_DRIVEN:
- case SQL_CURSOR_STATIC:
- nValue = ResultSetType::SCROLL_INSENSITIVE;
- break;
- case SQL_CURSOR_DYNAMIC:
- nValue = ResultSetType::SCROLL_SENSITIVE;
- break;
- }
-
- return nValue;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getFetchDirection() const
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- sal_uInt32 nValue = 0;
- SQLRETURN nRetCode = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_SCROLLABLE,&nValue,SQL_IS_UINTEGER,0);
- OSL_UNUSED( nRetCode );
-
- switch(nValue)
- {
- case SQL_SCROLLABLE:
- nValue = FetchDirection::REVERSE;
- break;
- default:
- nValue = FetchDirection::FORWARD;
- break;
- }
-
- return nValue;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getFetchSize() const
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- sal_uInt32 nValue;
- SQLRETURN nRetCode = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_ARRAY_SIZE,&nValue,SQL_IS_UINTEGER,0);
- OSL_UNUSED( nRetCode );
- return nValue;
-}
-//------------------------------------------------------------------------------
-sal_Int32 OStatement_Base::getMaxFieldSize() const
-{
- return getStmtOption(SQL_ATTR_MAX_LENGTH);
-}
-//------------------------------------------------------------------------------
-::rtl::OUString OStatement_Base::getCursorName() const
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- SQLCHAR pName[258];
- SQLSMALLINT nRealLen = 0;
- SQLRETURN nRetCode = N3SQLGetCursorName(m_aStatementHandle,(SQLCHAR*)pName,256,&nRealLen);
- OSL_UNUSED( nRetCode );
- return ::rtl::OUString::createFromAscii((const char*)pName);
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setQueryTimeOut(sal_Int32 seconds)
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- SQLRETURN nRetCode = N3SQLSetStmtAttr(m_aStatementHandle, SQL_ATTR_QUERY_TIMEOUT,(SQLPOINTER)(sal_IntPtr)seconds,SQL_IS_UINTEGER);
- OSL_UNUSED( nRetCode );
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setMaxRows(sal_Int32 _par0)
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- SQLRETURN nRetCode = N3SQLSetStmtAttr(m_aStatementHandle, SQL_ATTR_MAX_ROWS, (SQLPOINTER)(sal_IntPtr)_par0,SQL_IS_UINTEGER);
- OSL_UNUSED( nRetCode );
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setResultSetConcurrency(sal_Int32 _par0)
-{
- SQLINTEGER nSet;
- if(_par0 == ResultSetConcurrency::READ_ONLY)
- nSet = SQL_CONCUR_READ_ONLY;
- else
- nSet = SQL_CONCUR_VALUES;
-
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- N3SQLSetStmtAttr(m_aStatementHandle, SQL_ATTR_CONCURRENCY,(SQLPOINTER)(sal_IntPtr)nSet,SQL_IS_UINTEGER);
-
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setResultSetType(sal_Int32 _par0)
-{
-
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- SQLRETURN nRetCode = N3SQLSetStmtAttr(m_aStatementHandle, SQL_ATTR_ROW_BIND_TYPE,(SQLPOINTER)SQL_BIND_BY_COLUMN,SQL_IS_UINTEGER);
- OSL_UNUSED( nRetCode );
-
- sal_Bool bUseBookmark = isUsingBookmarks();
- SQLUINTEGER nSet( SQL_UNSPECIFIED );
- switch(_par0)
- {
- case ResultSetType::FORWARD_ONLY:
- nSet = SQL_UNSPECIFIED;
- break;
- case ResultSetType::SCROLL_INSENSITIVE:
- nSet = SQL_INSENSITIVE;
- N3SQLSetStmtAttr(m_aStatementHandle, SQL_ATTR_CURSOR_TYPE,(SQLPOINTER)SQL_CURSOR_KEYSET_DRIVEN,SQL_IS_UINTEGER);
- break;
- case ResultSetType::SCROLL_SENSITIVE:
- if(bUseBookmark)
- {
- SQLUINTEGER nCurProp = getCursorProperties(SQL_CURSOR_DYNAMIC,sal_True);
- if((nCurProp & SQL_CA1_BOOKMARK) != SQL_CA1_BOOKMARK) // check if bookmark for this type isn't supported
- { // we have to test the next one
- nCurProp = getCursorProperties(SQL_CURSOR_KEYSET_DRIVEN,sal_True);
- sal_Bool bNotBookmarks = ((nCurProp & SQL_CA1_BOOKMARK) != SQL_CA1_BOOKMARK);
- nCurProp = getCursorProperties(SQL_CURSOR_KEYSET_DRIVEN,sal_False);
- nSet = SQL_CURSOR_KEYSET_DRIVEN;
- if( bNotBookmarks ||
- ((nCurProp & SQL_CA2_SENSITIVITY_DELETIONS) != SQL_CA2_SENSITIVITY_DELETIONS) ||
- ((nCurProp & SQL_CA2_SENSITIVITY_ADDITIONS) != SQL_CA2_SENSITIVITY_ADDITIONS))
- {
- // bookmarks for keyset isn't supported so reset bookmark setting
- setUsingBookmarks(sal_False);
- nSet = SQL_CURSOR_DYNAMIC;
- }
- }
- else
- nSet = SQL_CURSOR_DYNAMIC;
- }
- else
- nSet = SQL_CURSOR_DYNAMIC;
- if(N3SQLSetStmtAttr(m_aStatementHandle, SQL_ATTR_CURSOR_TYPE,(SQLPOINTER)(sal_uIntPtr)nSet,SQL_IS_UINTEGER) != SQL_SUCCESS)
- {
- nSet = SQL_CURSOR_KEYSET_DRIVEN;
- N3SQLSetStmtAttr(m_aStatementHandle, SQL_ATTR_CURSOR_TYPE,(SQLPOINTER)(sal_uIntPtr)nSet,SQL_IS_UINTEGER);
- }
- nSet = SQL_SENSITIVE;
- break;
- default:
- OSL_FAIL( "OStatement_Base::setResultSetType: invalid result set type!" );
- break;
- }
-
-
- N3SQLSetStmtAttr(m_aStatementHandle, SQL_ATTR_CURSOR_SENSITIVITY,(SQLPOINTER)(sal_uIntPtr)nSet,SQL_IS_UINTEGER);
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setEscapeProcessing( const sal_Bool _bEscapeProc )
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- SQLUINTEGER nEscapeProc( _bEscapeProc ? SQL_NOSCAN_OFF : SQL_NOSCAN_ON );
- SQLRETURN nRetCode = N3SQLSetStmtAttr( m_aStatementHandle, SQL_ATTR_NOSCAN, (SQLPOINTER)(sal_uIntPtr)nEscapeProc, SQL_IS_UINTEGER );
- (void)nRetCode;
-}
-
-//------------------------------------------------------------------------------
-void OStatement_Base::setFetchDirection(sal_Int32 _par0)
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- sal_IntPtr nCursType = 0;
- SQLRETURN nRetCode = SQL_SUCCESS;
- if(_par0 == FetchDirection::FORWARD)
- {
- nCursType = SQL_NONSCROLLABLE;
- nRetCode = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_SCROLLABLE,(SQLPOINTER)nCursType,SQL_IS_UINTEGER);
- }
- else if(_par0 == FetchDirection::REVERSE)
- {
- nCursType = SQL_SCROLLABLE;
- nRetCode = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_SCROLLABLE,(SQLPOINTER)nCursType,SQL_IS_UINTEGER);
- }
- OSL_UNUSED( nRetCode );
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setFetchSize(sal_Int32 _par0)
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- OSL_ENSURE(_par0>0,"Illegal fetch size!");
- if ( _par0 > 0 )
- {
- SQLRETURN nRetCode = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_ARRAY_SIZE,(SQLPOINTER)(sal_IntPtr)_par0,SQL_IS_UINTEGER);
-
- delete m_pRowStatusArray;
- m_pRowStatusArray = new SQLUSMALLINT[_par0];
- nRetCode = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_STATUS_PTR,m_pRowStatusArray,SQL_IS_POINTER);
- OSL_UNUSED( nRetCode );
- }
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setMaxFieldSize(sal_Int32 _par0)
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_MAX_LENGTH,(SQLPOINTER)(sal_IntPtr)_par0,SQL_IS_UINTEGER);
-}
-//------------------------------------------------------------------------------
-void OStatement_Base::setCursorName(const ::rtl::OUString &_par0)
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- ::rtl::OString aName(::rtl::OUStringToOString(_par0,getOwnConnection()->getTextEncoding()));
- N3SQLSetCursorName(m_aStatementHandle,(SDB_ODBC_CHAR*)aName.getStr(),(SQLSMALLINT)aName.getLength());
-}
-// -------------------------------------------------------------------------
-sal_Bool OStatement_Base::isUsingBookmarks() const
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- sal_uInt32 nValue = SQL_UB_OFF;
- SQLRETURN nRetCode = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_USE_BOOKMARKS,&nValue,SQL_IS_UINTEGER,NULL);
- OSL_UNUSED( nRetCode );
- return nValue != SQL_UB_OFF;
-}
-// -------------------------------------------------------------------------
-sal_Bool OStatement_Base::getEscapeProcessing() const
-{
- OSL_ENSURE( m_aStatementHandle, "StatementHandle is null!" );
- sal_uInt32 nValue = SQL_NOSCAN_OFF;
- SQLRETURN nRetCode = N3SQLGetStmtAttr( m_aStatementHandle, SQL_ATTR_NOSCAN, &nValue, SQL_IS_UINTEGER, NULL );
- (void)nRetCode;
- return nValue == SQL_NOSCAN_OFF;
-}
-// -------------------------------------------------------------------------
-void OStatement_Base::setUsingBookmarks(sal_Bool _bUseBookmark)
-{
- OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- sal_uIntPtr nValue = _bUseBookmark ? SQL_UB_VARIABLE : SQL_UB_OFF;
- SQLRETURN nRetCode = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_USE_BOOKMARKS,(SQLPOINTER)nValue,SQL_IS_UINTEGER);
- OSL_UNUSED( nRetCode );
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OStatement_Base::createArrayHelper( ) const
-{
- Sequence< Property > aProps(10);
- Property* pProperties = aProps.getArray();
- sal_Int32 nPos = 0;
- DECL_PROP0(CURSORNAME, ::rtl::OUString);
- DECL_BOOL_PROP0(ESCAPEPROCESSING);
- DECL_PROP0(FETCHDIRECTION,sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
- DECL_PROP0(MAXFIELDSIZE,sal_Int32);
- DECL_PROP0(MAXROWS, sal_Int32);
- DECL_PROP0(QUERYTIMEOUT,sal_Int32);
- DECL_PROP0(RESULTSETCONCURRENCY,sal_Int32);
- DECL_PROP0(RESULTSETTYPE,sal_Int32);
- DECL_BOOL_PROP0(USEBOOKMARKS);
-
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OStatement_Base::getInfoHelper()
-{
- return *const_cast<OStatement_Base*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-sal_Bool OStatement_Base::convertFastPropertyValue(
- Any & rConvertedValue,
- Any & rOldValue,
- sal_Int32 nHandle,
- const Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException)
-{
- sal_Bool bConverted = sal_False;
- try
- {
- switch(nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- bConverted = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getQueryTimeOut());
- break;
-
- case PROPERTY_ID_MAXFIELDSIZE:
- bConverted = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getMaxFieldSize());
- break;
-
- case PROPERTY_ID_MAXROWS:
- bConverted = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getMaxRows());
- break;
-
- case PROPERTY_ID_CURSORNAME:
- bConverted = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getCursorName());
- break;
-
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- bConverted = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getResultSetConcurrency());
- break;
-
- case PROPERTY_ID_RESULTSETTYPE:
- bConverted = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getResultSetType());
- break;
-
- case PROPERTY_ID_FETCHDIRECTION:
- bConverted = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchDirection());
- break;
-
- case PROPERTY_ID_FETCHSIZE:
- bConverted = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, getFetchSize());
- break;
-
- case PROPERTY_ID_USEBOOKMARKS:
- bConverted = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, isUsingBookmarks());
- break;
-
- case PROPERTY_ID_ESCAPEPROCESSING:
- bConverted = ::comphelper::tryPropertyValue( rConvertedValue, rOldValue, rValue, getEscapeProcessing() );
- break;
-
- }
- }
- catch(const SQLException&)
- {
- // throw Exception(e.Message,*this);
- }
- return bConverted;
-}
-// -------------------------------------------------------------------------
-void OStatement_Base::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception)
-{
- try
- {
- switch(nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- setQueryTimeOut(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_MAXFIELDSIZE:
- setMaxFieldSize(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_MAXROWS:
- setMaxRows(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_CURSORNAME:
- setCursorName(comphelper::getString(rValue));
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- setResultSetConcurrency(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- setResultSetType(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- setFetchDirection(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_FETCHSIZE:
- setFetchSize(comphelper::getINT32(rValue));
- break;
- case PROPERTY_ID_USEBOOKMARKS:
- setUsingBookmarks(comphelper::getBOOL(rValue));
- break;
- case PROPERTY_ID_ESCAPEPROCESSING:
- setEscapeProcessing( ::comphelper::getBOOL( rValue ) );
- break;
- default:
- OSL_FAIL( "OStatement_Base::setFastPropertyValue_NoBroadcast: what property?" );
- break;
- }
- }
- catch(const SQLException& )
- {
- // throw Exception(e.Message,*this);
- }
-}
-// -------------------------------------------------------------------------
-void OStatement_Base::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
-{
- switch(nHandle)
- {
- case PROPERTY_ID_QUERYTIMEOUT:
- rValue <<= getQueryTimeOut();
- break;
- case PROPERTY_ID_MAXFIELDSIZE:
- rValue <<= getMaxFieldSize();
- break;
- case PROPERTY_ID_MAXROWS:
- rValue <<= getMaxRows();
- break;
- case PROPERTY_ID_CURSORNAME:
- rValue <<= getCursorName();
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- rValue <<= getResultSetConcurrency();
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- rValue <<= getResultSetType();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- rValue <<= getFetchDirection();
- break;
- case PROPERTY_ID_FETCHSIZE:
- rValue <<= getFetchSize();
- break;
- case PROPERTY_ID_USEBOOKMARKS:
- rValue <<= isUsingBookmarks();
- break;
- case PROPERTY_ID_ESCAPEPROCESSING:
- rValue <<= getEscapeProcessing();
- break;
- default:
- OSL_FAIL( "OStatement_Base::getFastPropertyValue: what property?" );
- break;
- }
-}
-// -------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OStatement,"com.sun.star.sdbcx.OStatement","com.sun.star.sdbc.Statement");
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::acquire() throw()
-{
- OStatement_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::release() throw()
-{
- OStatement_BASE::release();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement::acquire() throw()
-{
- OStatement_BASE2::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OStatement::release() throw()
-{
- OStatement_BASE2::release();
-}
-// -----------------------------------------------------------------------------
-OResultSet* OStatement_Base::createResulSet()
-{
- return new OResultSet(m_aStatementHandle,this);
-}
-// -----------------------------------------------------------------------------
-Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OStatement_Base::getPropertySetInfo( ) throw(RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-SQLUINTEGER OStatement_Base::getCursorProperties(SQLINTEGER _nCursorType,sal_Bool bFirst)
-{
- SQLUINTEGER nValueLen = 0;
- try
- {
- SQLUSMALLINT nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
- if(SQL_CURSOR_KEYSET_DRIVEN == _nCursorType)
- nAskFor = bFirst ? SQL_KEYSET_CURSOR_ATTRIBUTES1 : SQL_KEYSET_CURSOR_ATTRIBUTES2;
- else if(SQL_CURSOR_STATIC == _nCursorType)
- nAskFor = bFirst ? SQL_STATIC_CURSOR_ATTRIBUTES1 : SQL_STATIC_CURSOR_ATTRIBUTES2;
- else if(SQL_CURSOR_FORWARD_ONLY == _nCursorType)
- nAskFor = bFirst ? SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 : SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
- else if(SQL_CURSOR_DYNAMIC == _nCursorType)
- nAskFor = bFirst ? SQL_DYNAMIC_CURSOR_ATTRIBUTES1 : SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
-
-
- OTools::GetInfo(getOwnConnection(),getConnectionHandle(),nAskFor,nValueLen,NULL);
- }
- catch(const Exception&)
- { // we don't want our result destroy here
- nValueLen = 0;
- }
- return nValueLen;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx
deleted file mode 100644
index 8c816a5fb6..0000000000
--- a/connectivity/source/drivers/odbcbase/OTools.cxx
+++ /dev/null
@@ -1,908 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "odbc/OTools.hxx"
-#include "odbc/OFunctions.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <osl/diagnose.h>
-#include "odbc/OConnection.hxx"
-#include "diagnose_ex.h"
-#include <rtl/logfile.hxx>
-#include <rtl/ustrbuf.hxx>
-
-
-#include <string.h>
-#include <string>
-#include <algorithm>
-
-using namespace connectivity::odbc;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::sdbc;
-using namespace com::sun::star::util;
-
-void OTools::getValue( OConnection* _pConnection,
- SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _nType,
- sal_Bool &_bWasNull,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- void* _pValue,
- SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::getValue" );
- SQLLEN pcbValue = SQL_NULL_DATA;
- OTools::ThrowException(_pConnection,
- (*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
- (SQLUSMALLINT)columnIndex,
- _nType,
- _pValue,
- _nSize,
- &pcbValue),
- _aStatementHandle,SQL_HANDLE_STMT,_xInterface,sal_False);
- _bWasNull = pcbValue == SQL_NULL_DATA;
-}
-// -----------------------------------------------------------------------------
-void OTools::bindParameter( OConnection* _pConnection,
- SQLHANDLE _hStmt,
- sal_Int32 nPos,
- sal_Int8*& pDataBuffer,
- sal_Int8* pLenBuffer,
- SQLSMALLINT _nODBCtype,
- sal_Bool _bUseWChar,
- sal_Bool _bUseOldTimeDate,
- const void* _pValue,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindParameter" );
- SQLRETURN nRetcode;
- SQLSMALLINT fSqlType;
- SQLSMALLINT fCType;
- SQLLEN nMaxLen = 0;
- SQLLEN* pLen = (SQLLEN*)pLenBuffer;
- SQLULEN nColumnSize=0;
- SQLSMALLINT nDecimalDigits=0;
-
- OTools::getBindTypes(_bUseWChar,_bUseOldTimeDate,_nODBCtype,fCType,fSqlType);
-
- OTools::bindData(_nODBCtype,_bUseWChar,pDataBuffer,pLen,_pValue,_nTextEncoding,nColumnSize);
- if ((nColumnSize == 0) && (fSqlType == SQL_CHAR || fSqlType == SQL_VARCHAR || fSqlType == SQL_LONGVARCHAR))
- nColumnSize = 1;
-
- if(fSqlType == SQL_LONGVARCHAR || fSqlType == SQL_LONGVARBINARY)
- memcpy(pDataBuffer,&nPos,sizeof(nPos));
-
- nRetcode = (*(T3SQLBindParameter)_pConnection->getOdbcFunction(ODBC3SQLBindParameter))(_hStmt,
- (SQLUSMALLINT)nPos,
- SQL_PARAM_INPUT,
- fCType,
- fSqlType,
- nColumnSize,
- nDecimalDigits,
- pDataBuffer,
- nMaxLen,
- pLen);
-
- OTools::ThrowException(_pConnection,nRetcode,_hStmt,SQL_HANDLE_STMT,_xInterface);
-}
-// -----------------------------------------------------------------------------
-void OTools::bindData( SQLSMALLINT _nOdbcType,
- sal_Bool _bUseWChar,
- sal_Int8 *&_pData,
- SQLLEN*& pLen,
- const void* _pValue,
- rtl_TextEncoding _nTextEncoding,
- SQLULEN& _nColumnSize)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindData" );
- _nColumnSize = 0;
-
- switch (_nOdbcType)
- {
- case SQL_CHAR:
- case SQL_VARCHAR:
- case SQL_DECIMAL:
- if(_bUseWChar)
- {
- *pLen = SQL_NTS;
- ::rtl::OUString sStr(*(::rtl::OUString*)_pValue);
- _nColumnSize = sStr.getLength();
- *((rtl::OUString*)_pData) = sStr;
-
- // Pointer on Char*
- _pData = (sal_Int8*)((rtl::OUString*)_pData)->getStr();
- }
- else
- {
- ::rtl::OString aString(::rtl::OUStringToOString(*(::rtl::OUString*)_pValue,_nTextEncoding));
- *pLen = SQL_NTS;
- _nColumnSize = aString.getLength();
- memcpy(_pData,aString.getStr(),aString.getLength());
- ((sal_Int8*)_pData)[aString.getLength()] = '\0';
- }
- break;
-
- case SQL_BIGINT:
- *((sal_Int64*)_pData) = *(sal_Int64*)_pValue;
- *pLen = sizeof(sal_Int64);
- _nColumnSize = *pLen;
- break;
-
- case SQL_NUMERIC:
- if(_bUseWChar)
- {
- ::rtl::OUString aString = rtl::OUString::valueOf(*(double*)_pValue);
- _nColumnSize = aString.getLength();
- *pLen = _nColumnSize;
- *((rtl::OUString*)_pData) = aString;
- // Pointer on Char*
- _pData = (sal_Int8*)((rtl::OUString*)_pData)->getStr();
- }
- else
- {
- ::rtl::OString aString = ::rtl::OString::valueOf(*(double*)_pValue);
- _nColumnSize = aString.getLength();
- *pLen = _nColumnSize;
- memcpy(_pData,aString.getStr(),aString.getLength());
- ((sal_Int8*)_pData)[_nColumnSize] = '\0';
- } break;
- case SQL_BIT:
- case SQL_TINYINT:
- *((sal_Int8*)_pData) = *(sal_Int8*)_pValue;
- *pLen = sizeof(sal_Int8);
- break;
-
- case SQL_SMALLINT:
- *((sal_Int16*)_pData) = *(sal_Int16*)_pValue;
- *pLen = sizeof(sal_Int16);
- break;
- case SQL_INTEGER:
- *((sal_Int32*)_pData) = *(sal_Int32*)_pValue;
- *pLen = sizeof(sal_Int32);
- break;
- case SQL_FLOAT:
- *((float*)_pData) = *(float*)_pValue;
- *pLen = sizeof(float);
- break;
- case SQL_REAL:
- case SQL_DOUBLE:
- *((double*)_pData) = *(double*)_pValue;
- *pLen = sizeof(double);
- break;
- case SQL_BINARY:
- case SQL_VARBINARY:
- {
- const ::com::sun::star::uno::Sequence< sal_Int8 >* pSeq = static_cast< const ::com::sun::star::uno::Sequence< sal_Int8 >* >(_pValue);
- OSL_ENSURE(pSeq,"OTools::bindData: Sequence is null!");
-
- if(pSeq)
- {
- _pData = (sal_Int8*)pSeq->getConstArray();
- *pLen = pSeq->getLength();
- }
- }
- break;
- case SQL_LONGVARBINARY:
- {
- sal_Int32 nLen = 0;
- nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength();
- *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
- }
- break;
- case SQL_LONGVARCHAR:
- {
- sal_Int32 nLen = 0;
- if(_bUseWChar)
- nLen = sizeof(sal_Unicode) * ((::rtl::OUString*)_pValue)->getLength();
- else
- {
- ::rtl::OString aString(::rtl::OUStringToOString(*(::rtl::OUString*)_pValue,_nTextEncoding));
- nLen = aString.getLength();
- }
- *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
- } break;
- case SQL_DATE:
- *(DATE_STRUCT*)_pData = *(DATE_STRUCT*)_pValue;
- *pLen = (SQLLEN)sizeof(DATE_STRUCT);
- _nColumnSize = 10;
- break;
- case SQL_TIME:
- *(TIME_STRUCT*)_pData = *(TIME_STRUCT*)_pValue;
- *pLen = (SQLLEN)sizeof(TIME_STRUCT);
- _nColumnSize = 8;
- break;
- case SQL_TIMESTAMP:
- *(TIMESTAMP_STRUCT*)_pData = *(TIMESTAMP_STRUCT*)_pValue;
- *pLen = (SQLLEN)sizeof(TIMESTAMP_STRUCT);
- _nColumnSize = 19;
- break;
- }
-}
-// -------------------------------------------------------------------------
-void OTools::bindValue( OConnection* _pConnection,
- SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _nType,
- SQLSMALLINT _nMaxLen,
- const void* _pValue,
- void* _pData,
- SQLLEN *pLen,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding,
- sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindValue" );
- SQLRETURN nRetcode;
- SQLSMALLINT fSqlType;
- SQLSMALLINT fCType;
- SQLLEN nMaxLen = _nMaxLen;
-
- OTools::getBindTypes( sal_False,
- _bUseOldTimeDate,
- _nType,
- fCType,
- fSqlType);
-
- if (columnIndex != 0 && !_pValue)
- {
- *pLen = SQL_NULL_DATA;
- nRetcode = (*(T3SQLBindCol)_pConnection->getOdbcFunction(ODBC3SQLBindCol))(_aStatementHandle,
- (SQLUSMALLINT)columnIndex,
- fCType,
- _pData,
- nMaxLen,
- pLen
- );
- }
- else
- {
- try
- {
- switch (_nType)
- {
- case SQL_CHAR:
- case SQL_VARCHAR:
- {
- ::rtl::OString aString(::rtl::OUStringToOString(*(::rtl::OUString*)_pValue,_nTextEncoding));
- *pLen = SQL_NTS;
- *((::rtl::OString*)_pData) = aString;
- _nMaxLen = (SQLSMALLINT)aString.getLength();
-
- // Pointer on Char*
- _pData = (void*)aString.getStr();
- } break;
- case SQL_BIGINT:
- *((sal_Int64*)_pData) = *(sal_Int64*)_pValue;
- *pLen = sizeof(sal_Int64);
- break;
- case SQL_DECIMAL:
- case SQL_NUMERIC:
- {
- ::rtl::OString aString = ::rtl::OString::valueOf(*(double*)_pValue);
- _nMaxLen = (SQLSMALLINT)aString.getLength();
- *pLen = _nMaxLen;
- *((::rtl::OString*)_pData) = aString;
- // Pointer on Char*
- _pData = (void*)((::rtl::OString*)_pData)->getStr();
- } break;
- case SQL_BIT:
- case SQL_TINYINT:
- *((sal_Int8*)_pData) = *(sal_Int8*)_pValue;
- *pLen = sizeof(sal_Int8);
- break;
-
- case SQL_SMALLINT:
- *((sal_Int16*)_pData) = *(sal_Int16*)_pValue;
- *pLen = sizeof(sal_Int16);
- break;
- case SQL_INTEGER:
- *((sal_Int32*)_pData) = *(sal_Int32*)_pValue;
- *pLen = sizeof(sal_Int32);
- break;
- case SQL_FLOAT:
- *((float*)_pData) = *(float*)_pValue;
- *pLen = sizeof(float);
- break;
- case SQL_REAL:
- case SQL_DOUBLE:
- *((double*)_pData) = *(double*)_pValue;
- *pLen = sizeof(double);
- break;
- case SQL_BINARY:
- case SQL_VARBINARY:
- {
- _pData = (void*)((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getConstArray();
- *pLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength();
- } break;
- case SQL_LONGVARBINARY:
- {
- _pData = (void*)(sal_IntPtr)(columnIndex);
- sal_Int32 nLen = 0;
- nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength();
- *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
- }
- break;
- case SQL_LONGVARCHAR:
- {
- _pData = (void*)(sal_IntPtr)(columnIndex);
- sal_Int32 nLen = 0;
- nLen = ((::rtl::OUString*)_pValue)->getLength();
- *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
- } break;
- case SQL_DATE:
- *pLen = sizeof(DATE_STRUCT);
- *((DATE_STRUCT*)_pData) = *(DATE_STRUCT*)_pValue;
- break;
- case SQL_TIME:
- *pLen = sizeof(TIME_STRUCT);
- *((TIME_STRUCT*)_pData) = *(TIME_STRUCT*)_pValue;
- break;
- case SQL_TIMESTAMP:
- *pLen = sizeof(TIMESTAMP_STRUCT);
- *((TIMESTAMP_STRUCT*)_pData) = *(TIMESTAMP_STRUCT*)_pValue;
- break;
- }
- }
- catch ( ... )
- {
- }
-
- nRetcode = (*(T3SQLBindCol)_pConnection->getOdbcFunction(ODBC3SQLBindCol))(_aStatementHandle,
- (SQLUSMALLINT)columnIndex,
- fCType,
- _pData,
- nMaxLen,
- pLen
- );
- }
-
- OTools::ThrowException(_pConnection,nRetcode,_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
-}
-// -----------------------------------------------------------------------------
-void OTools::ThrowException(OConnection* _pConnection,
- SQLRETURN _rRetCode,
- SQLHANDLE _pContext,
- SQLSMALLINT _nHandleType,
- const Reference< XInterface >& _xInterface,
- sal_Bool _bNoFound,
- rtl_TextEncoding _nTextEncoding) throw(SQLException)
-{
- switch(_rRetCode)
- {
- case SQL_NEED_DATA:
- case SQL_STILL_EXECUTING:
- case SQL_SUCCESS:
-
- case SQL_SUCCESS_WITH_INFO:
- return;
- case SQL_NO_DATA_FOUND:
- if(_bNoFound)
- return; // no need to throw a exception
- case SQL_ERROR: break;
-
-
- case SQL_INVALID_HANDLE: OSL_FAIL("SdbODBC3_SetStatus: SQL_INVALID_HANDLE");
- throw SQLException();
- }
-
- // Additional Information on the latest ODBC-functioncall available
- // SQLError provides this Information.
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::ThrowException" );
-
- SDB_ODBC_CHAR szSqlState[5];
- SQLINTEGER pfNativeError;
- SDB_ODBC_CHAR szErrorMessage[SQL_MAX_MESSAGE_LENGTH];
- szErrorMessage[0] = '\0';
- SQLSMALLINT pcbErrorMsg = 0;
-
- // Information for latest operation:
- // when hstmt != SQL_NULL_HSTMT is (Used from SetStatus in SdbCursor, SdbTable, ...),
- // then the status of the latest statments will be fetched, without the Status of the last
- // Statments of this connection [what in this case will probably be the same, but the Reference
- // Manual isn't totally clear in this...].
- // corresponding for hdbc.
- SQLRETURN n = (*(T3SQLGetDiagRec)_pConnection->getOdbcFunction(ODBC3SQLGetDiagRec))(_nHandleType,_pContext,1,
- szSqlState,
- &pfNativeError,
- szErrorMessage,sizeof szErrorMessage - 1,&pcbErrorMsg);
- OSL_UNUSED( n );
- OSL_ENSURE(n != SQL_INVALID_HANDLE,"SdbODBC3_SetStatus: SQLError returned SQL_INVALID_HANDLE");
- OSL_ENSURE(n == SQL_SUCCESS || n == SQL_SUCCESS_WITH_INFO || n == SQL_NO_DATA_FOUND || n == SQL_ERROR,"SdbODBC3_SetStatus: SQLError failed");
-
- // For the Return Code of SQLError see ODBC 2.0 Programmer's Reference Page 287ff
- throw SQLException( ::rtl::OUString((char *)szErrorMessage,pcbErrorMsg,_nTextEncoding),
- _xInterface,
- ::rtl::OUString((char *)szSqlState,5,_nTextEncoding),
- pfNativeError,
- Any()
- );
-
-}
-// -------------------------------------------------------------------------
-Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
- SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _fSqlType,
- sal_Bool &_bWasNull,
- const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::getBytesValue" );
- char aCharArray[2048];
- // First try to fetch the data with the little Buffer:
- SQLLEN nMaxLen = sizeof aCharArray - 1;
- // GETDATA(SQL_C_CHAR,aCharArray,nMaxLen);
- SQLLEN pcbValue = 0;
- OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
- (SQLUSMALLINT)columnIndex,
- _fSqlType,
- (SQLPOINTER)aCharArray,
- nMaxLen,
- &pcbValue),
- _aStatementHandle,SQL_HANDLE_STMT,_xInterface);
-
- _bWasNull = pcbValue == SQL_NULL_DATA;
- if(_bWasNull)
- return Sequence<sal_Int8>();
-
- SQLINTEGER nBytes = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : nMaxLen;
- if ( ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen) && aCharArray[nBytes-1] == 0 && nBytes > 0 )
- --nBytes;
- Sequence<sal_Int8> aData((sal_Int8*)aCharArray, nBytes);
-
- // It is about Binariy Data, a String, that for StarView is to long or
- // the driver kan't predict the length of the data - as well as save the
- // MemoryStream.
- while ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen)
- {
- // At Strings the Buffer won't be completly used
- // (The last Byte is always a NULL-Byte, however it won't be counted with pcbValue)
- if (pcbValue != SQL_NO_TOTAL && (pcbValue - nMaxLen) < nMaxLen)
- nBytes = pcbValue - nMaxLen;
- else
- nBytes = nMaxLen;
-
- // While there is a "truncation"-Warning, proceed with fetching Data.
- OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
- (SQLUSMALLINT)columnIndex,
- SQL_C_BINARY,
- &aCharArray,
- (SQLINTEGER)nBytes,
- &pcbValue),
- _aStatementHandle,SQL_HANDLE_STMT,_xInterface);
- sal_Int32 nLen = aData.getLength();
- aData.realloc(nLen + nBytes);
- memcpy(aData.getArray() + nLen, aCharArray, nBytes);
- }
- return aData;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString OTools::getStringValue(OConnection* _pConnection,
- SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _fSqlType,
- sal_Bool &_bWasNull,
- const Reference< XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::getStringValue" );
- ::rtl::OUStringBuffer aData;
- switch(_fSqlType)
- {
- case SQL_WVARCHAR:
- case SQL_WCHAR:
- case SQL_WLONGVARCHAR:
- {
- sal_Unicode waCharArray[2048];
- // read the unicode data
- SQLLEN nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1;
-
- SQLLEN pcbValue=0;
- OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
- (SQLUSMALLINT)columnIndex,
- SQL_C_WCHAR,
- &waCharArray,
- (SQLLEN)nMaxLen*sizeof(sal_Unicode),
- &pcbValue),
- _aStatementHandle,SQL_HANDLE_STMT,_xInterface);
- _bWasNull = pcbValue == SQL_NULL_DATA;
- if(_bWasNull)
- return ::rtl::OUString();
- // at failure the GETDATA-Makro will stop with returning,
- // at NULL with break!
- SQLLEN nRealSize = 0;
- if ( pcbValue > -1 )
- nRealSize = pcbValue / sizeof(sal_Unicode);
- SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(nRealSize, nMaxLen) : (nMaxLen-1);
- waCharArray[nLen] = 0;
- aData.append(waCharArray,nLen);
-
- // It is about Binariy Data, a String, that for StarView is to long or
- // the driver kan't predict the length of the data - as well as save the
- // MemoryStream.
- while ((pcbValue == SQL_NO_TOTAL ) || nLen > nMaxLen)
- {
- // At Strings the Buffer won't be completly used
- // (The last Byte is always a NULL-Byte, however it won't be counted with pcbValue)
- if (pcbValue != SQL_NO_TOTAL && (pcbValue - nMaxLen) < nMaxLen)
- nLen = pcbValue - nMaxLen;
- else
- nLen = nMaxLen;
-
- // While there is a "truncation"-Warning, proceed with fetching Data.
- OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
- (SQLUSMALLINT)columnIndex,
- SQL_C_WCHAR,
- &waCharArray,
- (SQLLEN)nLen+1,
- &pcbValue),
- _aStatementHandle,SQL_HANDLE_STMT,_xInterface);
- nRealSize = 0;
- if ( pcbValue > -1 )
- nRealSize = pcbValue / sizeof(sal_Unicode);
- nLen = pcbValue != SQL_NO_TOTAL ? std::min(nRealSize, nMaxLen) : (nMaxLen-1);
- waCharArray[nLen] = 0;
-
- aData.append(::rtl::OUString(waCharArray));
- }
- }
- break;
- default:
- {
- char aCharArray[2048];
- // First try to fetch the data with the little Buffer:
- SQLLEN nMaxLen = sizeof aCharArray - 1;
- SQLLEN pcbValue = 0;
- OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
- (SQLUSMALLINT)columnIndex,
- SQL_C_CHAR,
- &aCharArray,
- nMaxLen,
- &pcbValue),
- _aStatementHandle,SQL_HANDLE_STMT,_xInterface);
- _bWasNull = pcbValue == SQL_NULL_DATA;
- if(_bWasNull)
- return ::rtl::OUString();
-
- SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
- aCharArray[nLen] = 0;
- if ( ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen) && aCharArray[nLen-1] == 0 && nLen > 0 )
- --nLen;
- aData.append(::rtl::OUString((const sal_Char*)aCharArray,nLen, _nTextEncoding));
-
- // It is about Binariy Data, a String, that for StarView is to long or
- // the driver kan't predict the length of the data - as well as save the
- // MemoryStream.
- while ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen)
- {
- // While there is a "truncation"-Warning, proceed with fetching Data.
- OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
- (SQLUSMALLINT)columnIndex,
- SQL_C_CHAR,
- &aCharArray,
- (SQLINTEGER)nMaxLen,
- &pcbValue),
- _aStatementHandle,SQL_HANDLE_STMT,_xInterface);
- nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
- if ( ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen) && aCharArray[nLen-1] == 0 && nLen > 0 )
- --nLen;
- aCharArray[nLen] = 0;
-
- aData.append(::rtl::OUString((const sal_Char*)aCharArray,nLen,_nTextEncoding));
- }
-
- }
- }
-
- return aData.makeStringAndClear();
-}
-// -------------------------------------------------------------------------
-void OTools::GetInfo(OConnection* _pConnection,
- SQLHANDLE _aConnectionHandle,
- SQLUSMALLINT _nInfo,
- ::rtl::OUString &_rValue,
- const Reference< XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
-{
- char aValue[512];
- SQLSMALLINT nValueLen=0;
- OTools::ThrowException(_pConnection,
- (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,aValue,(sizeof aValue)-1,&nValueLen),
- _aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
-
- _rValue = ::rtl::OUString(aValue,nValueLen,_nTextEncoding);
-}
-// -------------------------------------------------------------------------
-void OTools::GetInfo(OConnection* _pConnection,
- SQLHANDLE _aConnectionHandle,
- SQLUSMALLINT _nInfo,
- sal_Int32 &_rValue,
- const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
-{
- SQLSMALLINT nValueLen;
- _rValue = 0; // in case the driver uses only 16 of the 32 bits (as it does, for example, for SQL_CATALOG_LOCATION)
- OTools::ThrowException(_pConnection,
- (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
- _aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
-}
-// -------------------------------------------------------------------------
-void OTools::GetInfo(OConnection* _pConnection,
- SQLHANDLE _aConnectionHandle,
- SQLUSMALLINT _nInfo,
- SQLUINTEGER &_rValue,
- const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
-{
- SQLSMALLINT nValueLen;
- _rValue = 0; // in case the driver uses only 16 of the 32 bits (as it does, for example, for SQL_CATALOG_LOCATION)
- OTools::ThrowException(_pConnection,
- (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
- _aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
-}
-// -------------------------------------------------------------------------
-void OTools::GetInfo(OConnection* _pConnection,
- SQLHANDLE _aConnectionHandle,
- SQLUSMALLINT _nInfo,
- SQLUSMALLINT &_rValue,
- const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
-{
- SQLSMALLINT nValueLen;
- _rValue = 0; // in case the driver uses only 16 of the 32 bits (as it does, for example, for SQL_CATALOG_LOCATION)
- OTools::ThrowException(_pConnection,
- (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
- _aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
-}
-// -------------------------------------------------------------------------
-void OTools::GetInfo(OConnection* _pConnection,
- SQLHANDLE _aConnectionHandle,
- SQLUSMALLINT _nInfo,
- sal_Bool &_rValue,
- const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
-{
- SQLSMALLINT nValueLen;
- OTools::ThrowException(_pConnection,
- (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
- _aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
-}
-// -------------------------------------------------------------------------
-sal_Int32 OTools::MapOdbcType2Jdbc(sal_Int32 _nType)
-{
- sal_Int32 nValue = DataType::VARCHAR;
- switch(_nType)
- {
- case SQL_BIT:
- nValue = DataType::BIT;
- break;
- case SQL_TINYINT:
- nValue = DataType::TINYINT;
- break;
- case SQL_SMALLINT:
- nValue = DataType::SMALLINT;
- break;
- case SQL_INTEGER:
- nValue = DataType::INTEGER;
- break;
- case SQL_BIGINT:
- nValue = DataType::BIGINT;
- break;
- case SQL_FLOAT:
- nValue = DataType::FLOAT;
- break;
- case SQL_REAL:
- nValue = DataType::REAL;
- break;
- case SQL_DOUBLE:
- nValue = DataType::DOUBLE;
- break;
- case SQL_NUMERIC:
- nValue = DataType::NUMERIC;
- break;
- case SQL_DECIMAL:
- nValue = DataType::DECIMAL;
- break;
- case SQL_WCHAR:
- case SQL_CHAR:
- nValue = DataType::CHAR;
- break;
- case SQL_WVARCHAR:
- case SQL_VARCHAR:
- nValue = DataType::VARCHAR;
- break;
- case SQL_WLONGVARCHAR:
- case SQL_LONGVARCHAR:
- nValue = DataType::LONGVARCHAR;
- break;
- case SQL_TYPE_DATE:
- case SQL_DATE:
- nValue = DataType::DATE;
- break;
- case SQL_TYPE_TIME:
- case SQL_TIME:
- nValue = DataType::TIME;
- break;
- case SQL_TYPE_TIMESTAMP:
- case SQL_TIMESTAMP:
- nValue = DataType::TIMESTAMP;
- break;
- case SQL_BINARY:
- nValue = DataType::BINARY;
- break;
- case SQL_VARBINARY:
- case SQL_GUID:
- nValue = DataType::VARBINARY;
- break;
- case SQL_LONGVARBINARY:
- nValue = DataType::LONGVARBINARY;
- break;
- default:
- OSL_ASSERT(!"Invalid type");
- }
- return nValue;
-}
-//--------------------------------------------------------------------
-// jdbcTypeToOdbc
-// Convert the JDBC SQL type to the correct ODBC type
-//--------------------------------------------------------------------
-sal_Int32 OTools::jdbcTypeToOdbc(sal_Int32 jdbcType)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::jdbcTypeToOdbc" );
- // For the most part, JDBC types match ODBC types. We'll
- // just convert the ones that we know are different
-
- sal_Int32 odbcType = jdbcType;
-
- switch (jdbcType)
- {
- case DataType::DATE:
- odbcType = SQL_DATE;
- break;
- case DataType::TIME:
- odbcType = SQL_TIME;
- break;
- case DataType::TIMESTAMP:
- odbcType = SQL_TIMESTAMP;
- break;
- }
-
- return odbcType;
-}
-//-----------------------------------------------------------------------------
-void OTools::getBindTypes(sal_Bool _bUseWChar,
- sal_Bool _bUseOldTimeDate,
- SQLSMALLINT _nOdbcType,
- SQLSMALLINT& fCType,
- SQLSMALLINT& fSqlType
- )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::getBindTypes" );
- switch(_nOdbcType)
- {
- case SQL_CHAR: if(_bUseWChar)
- {
- fCType = SQL_C_WCHAR;
- fSqlType = SQL_WCHAR;
- }
- else
- {
- fCType = SQL_C_CHAR;
- fSqlType = SQL_CHAR;
- }
- break;
- case SQL_VARCHAR: if(_bUseWChar)
- {
- fCType = SQL_C_WCHAR;
- fSqlType = SQL_WVARCHAR;
- }
- else
- {
- fCType = SQL_C_CHAR;
- fSqlType = SQL_VARCHAR;
- }
- break;
- case SQL_LONGVARCHAR: if(_bUseWChar)
- {
- fCType = SQL_C_WCHAR;
- fSqlType = SQL_WLONGVARCHAR;
- }
- else
- {
- fCType = SQL_C_CHAR;
- fSqlType = SQL_LONGVARCHAR;
- }
- break;
- case SQL_DECIMAL: fCType = _bUseWChar ? SQL_C_WCHAR : SQL_C_CHAR;
- fSqlType = SQL_DECIMAL; break;
- case SQL_NUMERIC: fCType = _bUseWChar ? SQL_C_WCHAR : SQL_C_CHAR;
- fSqlType = SQL_NUMERIC; break;
- case SQL_BIT: fCType = SQL_C_TINYINT;
- fSqlType = SQL_INTEGER; break;
- case SQL_TINYINT: fCType = SQL_C_TINYINT;
- fSqlType = SQL_TINYINT; break;
- case SQL_SMALLINT: fCType = SQL_C_SHORT;
- fSqlType = SQL_SMALLINT; break;
- case SQL_INTEGER: fCType = SQL_C_LONG;
- fSqlType = SQL_INTEGER; break;
- case SQL_BIGINT: fCType = SQL_C_SBIGINT;
- fSqlType = SQL_BIGINT; break;
- case SQL_FLOAT: fCType = SQL_C_FLOAT;
- fSqlType = SQL_FLOAT; break;
- case SQL_REAL: fCType = SQL_C_DOUBLE;
- fSqlType = SQL_REAL; break;
- case SQL_DOUBLE: fCType = SQL_C_DOUBLE;
- fSqlType = SQL_DOUBLE; break;
- case SQL_BINARY: fCType = SQL_C_BINARY;
- fSqlType = SQL_BINARY; break;
- case SQL_VARBINARY:
- fCType = SQL_C_BINARY;
- fSqlType = SQL_VARBINARY; break;
- case SQL_LONGVARBINARY: fCType = SQL_C_BINARY;
- fSqlType = SQL_LONGVARBINARY; break;
- case SQL_DATE:
- if(_bUseOldTimeDate)
- {
- fCType = SQL_C_DATE;
- fSqlType = SQL_DATE;
- }
- else
- {
- fCType = SQL_C_TYPE_DATE;
- fSqlType = SQL_TYPE_DATE;
- }
- break;
- case SQL_TIME:
- if(_bUseOldTimeDate)
- {
- fCType = SQL_C_TIME;
- fSqlType = SQL_TIME;
- }
- else
- {
- fCType = SQL_C_TYPE_TIME;
- fSqlType = SQL_TYPE_TIME;
- }
- break;
- case SQL_TIMESTAMP:
- if(_bUseOldTimeDate)
- {
- fCType = SQL_C_TIMESTAMP;
- fSqlType = SQL_TIMESTAMP;
- }
- else
- {
- fCType = SQL_C_TYPE_TIMESTAMP;
- fSqlType = SQL_TYPE_TIMESTAMP;
- }
- break;
- default: fCType = SQL_C_BINARY;
- fSqlType = SQL_LONGVARBINARY; break;
- }
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/odbcbase/makefile.mk b/connectivity/source/drivers/odbcbase/makefile.mk
deleted file mode 100755
index 85e96ea857..0000000000
--- a/connectivity/source/drivers/odbcbase/makefile.mk
+++ /dev/null
@@ -1,90 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=..$/..
-PRJNAME=connectivity
-TARGET=odbcbase
-
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/version.mk
-
-CDEFS += -DOOO_DLLIMPLEMENTATION_ODBCBASE
-
-.IF "$(SYSTEM_ODBC_HEADERS)" == "YES"
-CFLAGS+=-DSYSTEM_ODBC_HEADERS
-.ENDIF
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/OPreparedStatement.obj \
- $(SLO)$/OStatement.obj \
- $(SLO)$/OResultSetMetaData.obj \
- $(SLO)$/OResultSet.obj \
- $(SLO)$/OTools.obj \
- $(SLO)$/ODatabaseMetaDataResultSet.obj \
- $(SLO)$/ODatabaseMetaData.obj \
- $(SLO)$/ODriver.obj \
- $(SLO)$/OConnection.obj
-
-# --- ODBC BASE Library -----------------------------------
-
-SHL1TARGET= $(ODBC2_TARGET)$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(DBTOOLSLIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB) \
- $(SALHELPERLIB)
-
-SHL1DEPN=
-SHL1IMPLIB= i$(ODBC2_TARGET)
-SHL1USE_EXPORTS=name
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt \
- $(SLB)$/$(TARGET).lib
-DEFLIB1NAME=$(TARGET)
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
-# --- filter file ------------------------------
-
-$(MISC)$/$(SHL1TARGET).flt: makefile.mk
- @echo CLEAR_THE_FILE > $@
diff --git a/connectivity/source/inc/AutoRetrievingBase.hxx b/connectivity/source/inc/AutoRetrievingBase.hxx
deleted file mode 100644
index ff48a26c56..0000000000
--- a/connectivity/source/inc/AutoRetrievingBase.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_AUTOKEYRETRIEVINGBASE_HXX_
-#define _CONNECTIVITY_AUTOKEYRETRIEVINGBASE_HXX_
-
-#include <rtl/ustring.hxx>
-#include "connectivity/dbtoolsdllapi.hxx"
-
-namespace connectivity
-{
- class OOO_DLLPUBLIC_DBTOOLS OAutoRetrievingBase
- {
- ::rtl::OUString m_sGeneratedValueStatement; // contains the statement which should be used when query for automatically generated values
- sal_Bool m_bAutoRetrievingEnabled; // set to when we should allow to query for generated values
- protected:
- OAutoRetrievingBase() : m_bAutoRetrievingEnabled(sal_False) {}
- virtual ~OAutoRetrievingBase(){}
-
- inline void enableAutoRetrievingEnabled(sal_Bool _bAutoEnable) { m_bAutoRetrievingEnabled = _bAutoEnable; }
- inline void setAutoRetrievingStatement(const ::rtl::OUString& _sStmt) { m_sGeneratedValueStatement = _sStmt; }
- public:
- inline sal_Bool isAutoRetrievingEnabled() const { return m_bAutoRetrievingEnabled; }
- inline const ::rtl::OUString& getAutoRetrievingStatement() const { return m_sGeneratedValueStatement; }
-
- /** transform the statement to query for auto generated values
- @param _sInsertStatement
- The "INSERT" statement, is used to query for column and table names
- @return
- The transformed generated statement.
- */
- ::rtl::OUString getTransformedGeneratedStatement(const ::rtl::OUString& _sInsertStatement) const;
- };
-}
-#endif // _CONNECTIVITY_AUTOKEYRETRIEVINGBASE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/FDatabaseMetaDataResultSet.hxx b/connectivity/source/inc/FDatabaseMetaDataResultSet.hxx
deleted file mode 100644
index 1d495aee63..0000000000
--- a/connectivity/source/inc/FDatabaseMetaDataResultSet.hxx
+++ /dev/null
@@ -1,281 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FDATABASEMETADATARESULTSET_HXX_
-#define _CONNECTIVITY_FDATABASEMETADATARESULTSET_HXX_
-
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <cppuhelper/compbase9.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include "connectivity/CommonTools.hxx"
-#include <comphelper/propertycontainer.hxx>
-#include "connectivity/FValue.hxx"
-#include "connectivity/dbtoolsdllapi.hxx"
-#include <comphelper/broadcasthelper.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-
-namespace connectivity
-{
- class ODatabaseMetaDataResultSetMetaData;
- typedef ::cppu::WeakComponentImplHelper9< ::com::sun::star::sdbc::XResultSet,
- ::com::sun::star::sdbc::XRow,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::lang::XInitialization,
- ::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::sdbc::XColumnLocate> ODatabaseMetaDataResultSet_BASE;
-
- // typedef ORefVector<ORowSetValue> ORow;
- // typedef ORefVector<ORow> ORows;
-
- class OOO_DLLPUBLIC_DBTOOLS ODatabaseMetaDataResultSet :
- public comphelper::OBaseMutex,
- public ODatabaseMetaDataResultSet_BASE,
- public ::comphelper::OPropertyContainer,
- public ::comphelper::OPropertyArrayUsageHelper<ODatabaseMetaDataResultSet>
- {
-
- public:
- DECLARE_STL_VECTOR(ORowSetValueDecoratorRef,ORow);
- DECLARE_STL_VECTOR(ORow, ORows);
-
- enum MetaDataResultSetType
- {
- /// describes a result set as expected by XDatabaseMetaData::getCatalogs
- eCatalogs = 0,
- /// describes a result set as expected by XDatabaseMetaData::getSchemas
- eSchemas = 1,
- /// describes a result set as expected by XDatabaseMetaData::getColumnPrivileges
- eColumnPrivileges = 2,
- /// describes a result set as expected by XDatabaseMetaData::getColumns
- eColumns = 3,
- /// describes a result set as expected by XDatabaseMetaData::getTables
- eTables = 4,
- /// describes a result set as expected by XDatabaseMetaData::getTableTypes
- eTableTypes = 5,
- /// describes a result set as expected by XDatabaseMetaData::getProcedureColumns
- eProcedureColumns = 6,
- /// describes a result set as expected by XDatabaseMetaData::getProcedures
- eProcedures = 7,
- /// describes a result set as expected by XDatabaseMetaData::getExportedKeys
- eExportedKeys = 8,
- /// describes a result set as expected by XDatabaseMetaData::getImportedKeys
- eImportedKeys = 9,
- /// describes a result set as expected by XDatabaseMetaData::getPrimaryKeys
- ePrimaryKeys = 10,
- /// describes a result set as expected by XDatabaseMetaData::getIndexInfo
- eIndexInfo = 11,
- /// describes a result set as expected by XDatabaseMetaData::getTablePrivileges
- eTablePrivileges = 12,
- /// describes a result set as expected by XDatabaseMetaData::getCrossReference
- eCrossReference = 13,
- /// describes a result set as expected by XDatabaseMetaData::getTypeInfo
- eTypeInfo = 14,
- /// describes a result set as expected by XDatabaseMetaData::getBestRowIdentifier
- eBestRowIdentifier = 15,
- /// describes a result set as expected by XDatabaseMetaData::getVersionColumns
- eVersionColumns = 16
- };
-
- private:
- ORowSetValue m_aEmptyValue;
- ::com::sun::star::uno::WeakReferenceHelper m_aStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
- sal_Int32 m_nColPos;
-
- sal_Int32 m_nFetchSize;
- sal_Int32 m_nResultSetType;
- sal_Int32 m_nFetchDirection;
- sal_Int32 m_nResultSetConcurrency;
-
- void construct();
- void checkIndex(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException);
- void setType(MetaDataResultSetType _eType);
-
- protected:
- ORows m_aRows;
- ORows::iterator m_aRowsIter;
- sal_Bool m_bBOF;
- sal_Bool m_bEOF;
-
- virtual const ORowSetValue& getValue(sal_Int32 columnIndex);
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- virtual ~ODatabaseMetaDataResultSet();
- public:
-
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- /// default construction
- ODatabaseMetaDataResultSet();
- /// construction of a pre-defined result set type
- ODatabaseMetaDataResultSet( MetaDataResultSetType _eType );
-
- void setRows(const ORows& _rRows);
-
- // XServiceInfo
-
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- protected:
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XResultSet
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XColumnLocate
- virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XInitialization
- virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- void setCatalogsMap();
- void setSchemasMap();
- void setColumnPrivilegesMap();
- void setColumnsMap();
- void setTablesMap();
- void setTableTypes();
- void setProcedureColumnsMap();
- void setProceduresMap();
- void setExportedKeysMap();
- void setImportedKeysMap();
- void setPrimaryKeysMap();
- void setIndexInfoMap();
- void setTablePrivilegesMap();
- void setCrossReferenceMap();
- void setTypeInfoMap();
- void setBestRowIdentifierMap();
- void setVersionColumnsMap();
- public:
- // some methods to get already defined ORowSetValues
- // this increase the reuse of ORowSetValues
- /// return an empty ORowSetValueDecorator
- static ORowSetValueDecoratorRef getEmptyValue();
- /// return an ORowSetValueDecorator with 0 as value
- static ORowSetValueDecoratorRef get0Value();
- /// return an ORowSetValueDecorator with 1 as value
- static ORowSetValueDecoratorRef get1Value();
- /// return an ORowSetValueDecorator with ColumnSearch::BASIC as value
- static ORowSetValueDecoratorRef getBasicValue();
- /// return an ORowSetValueDecorator with string SELECT as value
- static ORowSetValueDecoratorRef getSelectValue();
- /// return an ORowSetValueDecorator with string INSERT as value
- static ORowSetValueDecoratorRef getInsertValue();
- /// return an ORowSetValueDecorator with string DELETE as value
- static ORowSetValueDecoratorRef getDeleteValue();
- /// return an ORowSetValueDecorator with string UPDATE as value
- static ORowSetValueDecoratorRef getUpdateValue();
- /// return an ORowSetValueDecorator with string CREATE as value
- static ORowSetValueDecoratorRef getCreateValue();
- /// return an ORowSetValueDecorator with string READ as value
- static ORowSetValueDecoratorRef getReadValue();
- /// return an ORowSetValueDecorator with string ALTER as value
- static ORowSetValueDecoratorRef getAlterValue();
- /// return an ORowSetValueDecorator with string DROP as value
- static ORowSetValueDecoratorRef getDropValue();
- /// return an ORowSetValueDecorator with string ' as value
- static ORowSetValueDecoratorRef getQuoteValue();
-
- };
-}
-#endif // _CONNECTIVITY_FDATABASEMETADATARESULTSET_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/FDatabaseMetaDataResultSetMetaData.hxx b/connectivity/source/inc/FDatabaseMetaDataResultSetMetaData.hxx
deleted file mode 100644
index 90e48efbd6..0000000000
--- a/connectivity/source/inc/FDatabaseMetaDataResultSetMetaData.hxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DATABASEMETADATARESULTSETMETADATA_HXX_
-#define _CONNECTIVITY_DATABASEMETADATARESULTSETMETADATA_HXX_
-
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-#ifndef _VECTOR_
-#include <vector>
-#endif
-#include "FDatabaseMetaDataResultSet.hxx"
-#include "OColumn.hxx"
-#include "connectivity/StdTypeDefs.hxx"
-#include "connectivity/dbtoolsdllapi.hxx"
-
-namespace connectivity
-{
- //**************************************************************
- //************ Class: ODatabaseMetaDataResultSetMetaData
- //**************************************************************
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> ODatabaseMetaResultSetMetaData_BASE;
-
- class OOO_DLLPUBLIC_DBTOOLS ODatabaseMetaDataResultSetMetaData : public ODatabaseMetaResultSetMetaData_BASE
- {
- TIntVector m_vMapping; // when not every column is needed
- ::std::map<sal_Int32,connectivity::OColumn> m_mColumns;
- ::std::map<sal_Int32,connectivity::OColumn>::const_iterator m_mColumnsIter;
-
- sal_Int32 m_nColCount;
- protected:
- virtual ~ODatabaseMetaDataResultSetMetaData();
- public:
- // a Constructor, that is needed for when Returning the Object is needed:
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- ODatabaseMetaDataResultSetMetaData( )
- : m_nColCount(0)
- {
- }
- /// Avoid ambigous cast error from the compiler.
- inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
- { return this; }
-
- virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // methods to set the right column mapping
- void setColumnPrivilegesMap();
- void setColumnMap();
- void setColumnsMap();
- void setTableNameMap();
- void setTablesMap();
- void setProcedureColumnsMap();
- void setPrimaryKeysMap();
- void setIndexInfoMap();
- void setTablePrivilegesMap();
- void setCrossReferenceMap();
- void setTypeInfoMap();
- void setProcedureNameMap();
- void setProceduresMap();
- void setTableTypes();
- void setBestRowIdentifierMap() { setVersionColumnsMap();}
- void setVersionColumnsMap();
- void setExportedKeysMap() { setCrossReferenceMap(); }
- void setImportedKeysMap() { setCrossReferenceMap(); }
- void setCatalogsMap();
- void setSchemasMap();
- };
-}
-#endif // _CONNECTIVITY_FILE_ADATABASEMETARESULTSETMETADATA_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/OColumn.hxx b/connectivity/source/inc/OColumn.hxx
deleted file mode 100644
index a03750d908..0000000000
--- a/connectivity/source/inc/OColumn.hxx
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_COLUMN_HXX_
-#define _CONNECTIVITY_COLUMN_HXX_
-
-#include <rtl/ustring.hxx>
-#include <sal/types.h>
-#include "connectivity/dbtoolsdllapi.hxx"
-
-namespace connectivity
-{
- class OOO_DLLPUBLIC_DBTOOLS OColumn
- {
- ::rtl::OUString m_CatalogName;
- ::rtl::OUString m_SchemaName;
- ::rtl::OUString m_TableName;
- ::rtl::OUString m_ColumnName;
- ::rtl::OUString m_ColumnLabel;
- ::rtl::OUString m_ColumnTypeName;
- ::rtl::OUString m_ColumnServiceName;
-
- sal_Int32 m_Nullable;
- sal_Int32 m_ColumnDisplaySize;
- sal_Int32 m_Precision;
- sal_Int32 m_Scale;
- sal_Int32 m_ColumnType;
-
- sal_Bool m_AutoIncrement;
- sal_Bool m_CaseSensitive;
- sal_Bool m_Searchable;
- sal_Bool m_Currency;
- sal_Bool m_Signed;
- sal_Bool m_ReadOnly;
- sal_Bool m_Writable;
- sal_Bool m_DefinitelyWritable;
-
- public:
- OColumn() {}
- OColumn(const ::rtl::OUString &_aTableName,
- const ::rtl::OUString &_aColumnName,
-
- sal_Int32 _aNullable=0,
- sal_Int32 _aColumnDisplaySize=0,
- sal_Int32 _aPrecision=0,
- sal_Int32 _aScale=0,
- sal_Int32 _aColumnType=0,
-
- sal_Bool _aAutoIncrement=sal_False,
- sal_Bool _aCaseSensitive=sal_False,
- sal_Bool _aSearchable=sal_True,
- sal_Bool _aCurrency=sal_False,
- sal_Bool _aSigned=sal_False,
- sal_Bool _aReadOnly=sal_True,
- sal_Bool _aWritable=sal_False,
- sal_Bool _aDefinitelyWritable=sal_False,
-
- const ::rtl::OUString &_aColumnLabel = ::rtl::OUString(),
- const ::rtl::OUString &_aColumnTypeName = ::rtl::OUString(),
- const ::rtl::OUString &_aColumnServiceName = ::rtl::OUString())
- : m_TableName(_aTableName),
- m_ColumnName(_aColumnName),
- m_ColumnLabel(_aColumnLabel),
- m_ColumnTypeName(_aColumnTypeName),
- m_ColumnServiceName(_aColumnServiceName),
-
- m_Nullable(_aNullable),
- m_ColumnDisplaySize(_aColumnDisplaySize),
- m_Precision(_aPrecision),
- m_Scale(_aScale),
- m_ColumnType(_aColumnType),
-
- m_AutoIncrement(_aAutoIncrement),
- m_CaseSensitive(_aCaseSensitive),
- m_Searchable(_aSearchable),
- m_Currency(_aCurrency),
- m_Signed(_aSigned),
- m_ReadOnly(_aReadOnly),
- m_Writable(_aWritable),
- m_DefinitelyWritable(_aDefinitelyWritable)
- {
- if(!m_ColumnLabel.getLength())
- m_ColumnLabel = _aColumnName;
- }
-
- inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () )
- { return ::rtl_allocateMemory( nSize ); }
- inline static void * SAL_CALL operator new( size_t ,void* _pHint ) SAL_THROW( () )
- { return _pHint; }
- inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () )
- { ::rtl_freeMemory( pMem ); }
- inline static void SAL_CALL operator delete( void *,void* ) SAL_THROW( () )
- { }
-
- sal_Bool isAutoIncrement() const { return m_AutoIncrement; }
- sal_Bool isCaseSensitive() const { return m_CaseSensitive; }
- sal_Bool isSearchable() const { return m_Searchable; }
- sal_Bool isCurrency() const { return m_Currency; }
- sal_Bool isSigned() const { return m_Signed; }
- sal_Bool isReadOnly() const { return m_ReadOnly; }
- sal_Bool isWritable() const { return m_Writable; }
- sal_Bool isDefinitelyWritable() const { return m_DefinitelyWritable; }
-
- sal_Int32 isNullable() const { return m_Nullable; }
- sal_Int32 getColumnDisplaySize() const { return m_ColumnDisplaySize; }
- sal_Int32 getPrecision() const { return m_Precision; }
- sal_Int32 getScale() const { return m_Scale; }
- sal_Int32 getColumnType() const { return m_ColumnType; }
-
- const ::rtl::OUString& getColumnLabel() const { return m_ColumnLabel; }
- const ::rtl::OUString& getColumnName() const { return m_ColumnName; }
- const ::rtl::OUString& getSchemaName() const { return m_SchemaName; }
- const ::rtl::OUString& getTableName() const { return m_TableName; }
- const ::rtl::OUString& getCatalogName() const { return m_CatalogName; }
- const ::rtl::OUString& getColumnTypeName() const { return m_ColumnTypeName; }
- const ::rtl::OUString& getColumnServiceName() const { return m_ColumnServiceName; }
-
- };
-}
-
-#endif //_CONNECTIVITY_COLUMN_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/OSubComponent.hxx b/connectivity/source/inc/OSubComponent.hxx
deleted file mode 100644
index 947f1e4b2d..0000000000
--- a/connectivity/source/inc/OSubComponent.hxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_OSUBCOMPONENT_HXX_
-#define _CONNECTIVITY_OSUBCOMPONENT_HXX_
-
-#include <cppuhelper/weak.hxx>
-#include <cppuhelper/interfacecontainer.h>
-#include "connectivity/dbtoolsdllapi.hxx"
-
-namespace com
-{
- namespace sun
- {
- namespace star
- {
- namespace lang
- {
- class XComponent;
- }
- }
- }
-}
-namespace connectivity
-{
- OOO_DLLPUBLIC_DBTOOLS
- void release(oslInterlockedCount& _refCount,
- ::cppu::OBroadcastHelper& rBHelper,
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- ::com::sun::star::lang::XComponent* _pObject);
- //************************************************************
- // OSubComponent
- //************************************************************
- template <class SELF, class WEAK> class OSubComponent
- {
- protected:
- // the parent must support the tunnel implementation
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent;
- SELF* m_pDerivedImplementation;
-
- public:
- OSubComponent(
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParent,
- SELF* _pDerivedImplementation)
- :m_xParent(_xParent)
- ,m_pDerivedImplementation(_pDerivedImplementation)
- {
- }
-
- protected:
- void dispose_ChildImpl()
- {
- // avoid ambiguity
- ::osl::MutexGuard aGuard( m_pDerivedImplementation->WEAK::rBHelper.rMutex );
- m_xParent.clear();
- }
- void relase_ChildImpl()
- {
- ::connectivity::release(m_pDerivedImplementation->m_refCount,
- m_pDerivedImplementation->WEAK::rBHelper,
- m_xParent,
- m_pDerivedImplementation);
-
- m_pDerivedImplementation->WEAK::release();
- }
- };
-}
-#endif // _CONNECTIVITY_OSUBCOMPONENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/OTypeInfo.hxx b/connectivity/source/inc/OTypeInfo.hxx
deleted file mode 100644
index 5dc25cea17..0000000000
--- a/connectivity/source/inc/OTypeInfo.hxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_OTYPEINFO_HXX_
-#define _CONNECTIVITY_OTYPEINFO_HXX_
-
-#include <com/sun/star/sdbc/ColumnSearch.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include "connectivity/dbtoolsdllapi.hxx"
-
-namespace connectivity
-{
- struct OTypeInfo
- {
- ::rtl::OUString aTypeName; // Name des Types in der Datenbank
- ::rtl::OUString aLiteralPrefix; // Prefix zum Quoten
- ::rtl::OUString aLiteralSuffix; // Suffix zum Quoten
- ::rtl::OUString aCreateParams; // Parameter zum Erstellen
- ::rtl::OUString aLocalTypeName;
-
- sal_Int32 nPrecision; // Laenge des Types
-
- sal_Int16 nMaximumScale; // Nachkommastellen
- sal_Int16 nMinimumScale; // Min Nachkommastellen
-
- sal_Int16 nType; // Datenbanktyp
- sal_Int16 nSearchType; // kann nach dem Typen gesucht werden
- sal_Int16 nNumPrecRadix; // indicating the radix, which is usually 2 or 10
-
- sal_Bool bCurrency : 1, // Waehrung
- bAutoIncrement : 1, // Ist es ein automatisch incrementierendes Feld
- bNullable : 1, // Kann das Feld NULL annehmen
- bCaseSensitive : 1, // Ist der Type Casesensitive
- bUnsigned : 1, // Ist der Type Unsigned
- bEmpty_1 : 1, // for later use
- bEmpty_2 : 1;
-
- OTypeInfo()
- :nPrecision(0)
- ,nMaximumScale(0)
- ,nMinimumScale(0)
- ,nType( ::com::sun::star::sdbc::DataType::OTHER)
- ,nSearchType( ::com::sun::star::sdbc::ColumnSearch::FULL)
- ,bCurrency(sal_False)
- ,bAutoIncrement(sal_False)
- ,bNullable(sal_True)
- ,bCaseSensitive(sal_False)
- ,bUnsigned(sal_False)
- {}
-
- inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () )
- { return ::rtl_allocateMemory( nSize ); }
- inline static void * SAL_CALL operator new( size_t /*nSize*/,void* _pHint ) SAL_THROW( () )
- { return _pHint; }
- inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () )
- { ::rtl_freeMemory( pMem ); }
- inline static void SAL_CALL operator delete( void * /*pMem*/,void* /*_pHint*/ ) SAL_THROW( () )
- { }
-
- sal_Bool operator == (const OTypeInfo& lh) const { return lh.nType == nType; }
- sal_Bool operator != (const OTypeInfo& lh) const { return lh.nType != nType; }
-
- inline ::rtl::OUString getDBName() const { return aTypeName; }
- };
-}
-#endif // _CONNECTIVITY_OTYPEINFO_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ParameterSubstitution.hxx b/connectivity/source/inc/ParameterSubstitution.hxx
deleted file mode 100644
index f62137a36d..0000000000
--- a/connectivity/source/inc/ParameterSubstitution.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "precompiled_connectivity.hxx"
-#include <com/sun/star/util/XStringSubstitution.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/sdbc/XConnection.hpp>
-#include <cppuhelper/implbase3.hxx>
-
-namespace connectivity
-{
- typedef ::cppu::WeakImplHelper3< ::com::sun::star::util::XStringSubstitution
- ,::com::sun::star::lang::XServiceInfo
- ,::com::sun::star::lang::XInitialization > ParameterSubstitution_BASE;
- class ParameterSubstitution : public ParameterSubstitution_BASE
- {
- ::osl::Mutex m_aMutex;
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XConnection > m_xConnection;
-
- ParameterSubstitution( const ParameterSubstitution& );
- ParameterSubstitution& operator=( const ParameterSubstitution& );
- public:
-
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext);
- protected:
- ParameterSubstitution(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext );
- virtual ~ParameterSubstitution(){}
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
- // XInitialization
- virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- // XStringSubstitution
- virtual ::rtl::OUString SAL_CALL substituteVariables( const ::rtl::OUString& aText, ::sal_Bool bSubstRequired ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL reSubstituteVariables( const ::rtl::OUString& aText ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSubstituteVariableValue( const ::rtl::OUString& variable ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- };
-// ==================================
-} // connectivity
-// ==================================
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/RowFunctionParser.hxx b/connectivity/source/inc/RowFunctionParser.hxx
deleted file mode 100644
index bccad9ab06..0000000000
--- a/connectivity/source/inc/RowFunctionParser.hxx
+++ /dev/null
@@ -1,153 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_ROWFUNCTIONPARSER_HXX_INCLUDED
-#define CONNECTIVITY_ROWFUNCTIONPARSER_HXX_INCLUDED
-
-#include <sal/config.h>
-#include <boost/shared_ptr.hpp>
-#include "FDatabaseMetaDataResultSet.hxx"
-#include <vector>
-#include "connectivity/dbtoolsdllapi.hxx"
-
-// -------------------------------------------------------------------------
-namespace connectivity
-{
-// -------------------------------------------------------------------------
-struct OOO_DLLPUBLIC_DBTOOLS RowEquation
-{
- sal_Int32 nOperation;
- ORowSetValueDecoratorRef nPara[ 3 ];
-
- RowEquation() :
- nOperation ( 0 )
- {
- }
-};
-
-enum ExpressionFunct
-{
- FUNC_CONST,
-
- ENUM_FUNC_EQUATION,
-
- UNARY_FUNC_COLUMN,
- ENUM_FUNC_AND,
- ENUM_FUNC_OR
-};
-
-#define EXPRESSION_FLAG_SUMANGLE_MODE 1
-
-class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE ExpressionNode
-{
-public:
- virtual ~ExpressionNode(){}
-
- /** Operator to calculate function value.
-
- This method calculates the function value.
- */
- virtual ORowSetValueDecoratorRef evaluate(const ODatabaseMetaDataResultSet::ORow& _aRow ) const = 0;
-
- virtual void fill(const ODatabaseMetaDataResultSet::ORow& _aRow ) const = 0;
-
- /** Operator to retrieve the type of expression node
- */
- virtual ExpressionFunct getType() const = 0;
-
- /** Operator to retrieve the ms version of expression
- */
- virtual ODatabaseMetaDataResultSet::ORow fillNode(
- std::vector< RowEquation >& rEquations, ExpressionNode* pOptionalArg, sal_uInt32 nFlags ) = 0;
-};
-typedef ::boost::shared_ptr< ExpressionNode > ExpressionNodeSharedPtr;
-
-/** This exception is thrown, when the arithmetic expression
- parser failed to parse a string.
- */
-struct OOO_DLLPUBLIC_DBTOOLS ParseError
-{
- ParseError() {}
- ParseError( const char* ) {}
-};
-
-class OOO_DLLPUBLIC_DBTOOLS FunctionParser
-{
-public:
-
- /** Parse a string
-
- The following grammar is accepted by this method:
- <code>
-
- number_digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'
-
- number = number number_digit | number_digit
-
- equal_function = '='
- ternary_function = 'if'
-
- string_reference = 'a-z,A-Z,0-9' ' '
- modifier_reference = '$' '0-9' ' '
-
- basic_expression =
- number |
- string_reference |
- additive_expression equal_function additive_expression |
- unary_function '(' number_digit ')'
- ternary_function '(' additive_expression ',' additive_expression ',
- ' additive_expression ')' | '(' additive_expression ')'
-
- </code>
-
- @param rFunction
- The string to parse
-
- @throws ParseError if an invalid expression is given.
-
- @return the generated function object.
- */
-
- static ExpressionNodeSharedPtr parseFunction( const ::rtl::OUString& _sFunction);
-
-private:
- // disabled constructor/destructor, since this is
- // supposed to be a singleton
- FunctionParser();
-
- // default: disabled copy/assignment
- FunctionParser(const FunctionParser&);
- FunctionParser& operator=( const FunctionParser& );
-};
-
-// -------------------------------------------------------------------------
-} // namespace connectivity
-// -------------------------------------------------------------------------
-#endif /* CONNECTIVITY_ROWFUNCTIONPARSER_HXX_INCLUDED */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/TConnection.hxx b/connectivity/source/inc/TConnection.hxx
deleted file mode 100644
index d4efc56186..0000000000
--- a/connectivity/source/inc/TConnection.hxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_CONNECTION_HXX
-#define CONNECTIVITY_CONNECTION_HXX
-
-#include <rtl/textenc.h>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XConnection.hpp>
-#include <cppuhelper/compbase4.hxx>
-#include "propertyids.hxx"
-#include "connectivity/CommonTools.hxx"
-#include "connectivity/dbtoolsdllapi.hxx"
-#include "resource/sharedresources.hxx"
-
-namespace connectivity
-{
- typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::sdbc::XConnection,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::lang::XUnoTunnel
- > OMetaConnection_BASE;
-
- typedef ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > TConditions;
-
- class OOO_DLLPUBLIC_DBTOOLS OMetaConnection : public OMetaConnection_BASE
- {
- protected:
- ::osl::Mutex m_aMutex;
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
- m_aConnectionInfo;
- connectivity::OWeakRefArray m_aStatements; // vector containing a list
- // of all the Statement objects
- // for this Connection
- ::rtl::OUString m_sURL;
- rtl_TextEncoding m_nTextEncoding; // the encoding which is used for all text conversions
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDatabaseMetaData >
- m_xMetaData;
- SharedResources m_aResources;
- public:
-
- static ::dbtools::OPropertyMap& getPropMap();
-
- OMetaConnection();
-
- inline rtl_TextEncoding getTextEncoding() const { return m_nTextEncoding; }
- inline ::rtl::OUString getURL() const { return m_sURL; }
- inline void setURL(const ::rtl::OUString& _rsUrl) { m_sURL = _rsUrl; }
- void throwGenericSQLException( sal_uInt16 _nErrorResourceId,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xContext );
- const SharedResources& getResources() const { return m_aResources;}
-
- inline void setConnectionInfo(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aInfo) { m_aConnectionInfo = _aInfo; }
- inline const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >&
- getConnectionInfo() const { return m_aConnectionInfo; }
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- //XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
- };
-}
-#endif // CONNECTIVITY_CONNECTION_HXX
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/TDatabaseMetaDataBase.hxx b/connectivity/source/inc/TDatabaseMetaDataBase.hxx
deleted file mode 100644
index d6b0dae8b6..0000000000
--- a/connectivity/source/inc/TDatabaseMetaDataBase.hxx
+++ /dev/null
@@ -1,145 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ODATABASEMETADATABASE_HXX_
-#define _CONNECTIVITY_ODATABASEMETADATABASE_HXX_
-
-#include <com/sun/star/sdbc/XDatabaseMetaData2.hpp>
-#include <cppuhelper/implbase2.hxx>
-#include <comphelper/broadcasthelper.hxx>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include "FDatabaseMetaDataResultSet.hxx"
-#include <functional>
-#include "connectivity/dbtoolsdllapi.hxx"
-
-namespace connectivity
-{
- typedef ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > TConditions;
- class OOO_DLLPUBLIC_DBTOOLS ODatabaseMetaDataBase :
- public comphelper::OBaseMutex,
- public ::cppu::WeakImplHelper2< ::com::sun::star::sdbc::XDatabaseMetaData2,
- ::com::sun::star::lang::XEventListener>
- {
- private:
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aConnectionInfo;
- ::connectivity::ODatabaseMetaDataResultSet::ORows m_aTypeInfoRows;
-
- // cached database information
- ::std::pair<bool,sal_Bool> m_isCatalogAtStart;
- ::std::pair<bool,::rtl::OUString> m_sCatalogSeparator;
- ::std::pair<bool,::rtl::OUString> m_sIdentifierQuoteString;
- ::std::pair<bool,sal_Bool> m_supportsCatalogsInTableDefinitions;
- ::std::pair<bool,sal_Bool> m_supportsSchemasInTableDefinitions;
- ::std::pair<bool,sal_Bool> m_supportsCatalogsInDataManipulation;
- ::std::pair<bool,sal_Bool> m_supportsSchemasInDataManipulation;
- ::std::pair<bool,sal_Bool> m_supportsMixedCaseQuotedIdentifiers;
- ::std::pair<bool,sal_Bool> m_supportsAlterTableWithAddColumn;
- ::std::pair<bool,sal_Bool> m_supportsAlterTableWithDropColumn;
- ::std::pair<bool,sal_Int32> m_MaxStatements;
- ::std::pair<bool,sal_Int32> m_MaxTablesInSelect;
- ::std::pair<bool,sal_Bool> m_storesMixedCaseQuotedIdentifiers;
-
- template <typename T> T callImplMethod(::std::pair<bool,T>& _rCache,const ::std::mem_fun_t<T,ODatabaseMetaDataBase>& _pImplMethod)
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( !_rCache.first )
- {
- _rCache.second = _pImplMethod(this);
- _rCache.first = true;
- }
- return _rCache.second;
- }
- protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener> m_xListenerHelper; // forward the calls from the connection to me
-
- virtual ~ODatabaseMetaDataBase();
-
- protected:
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw() = 0;
- // cached database information
- virtual ::rtl::OUString impl_getIdentifierQuoteString_throw( ) = 0;
- virtual sal_Bool impl_isCatalogAtStart_throw( ) = 0;
- virtual ::rtl::OUString impl_getCatalogSeparator_throw( ) = 0;
- virtual sal_Bool impl_supportsCatalogsInTableDefinitions_throw( ) = 0;
- virtual sal_Bool impl_supportsSchemasInTableDefinitions_throw( ) = 0;
- virtual sal_Bool impl_supportsCatalogsInDataManipulation_throw( ) = 0;
- virtual sal_Bool impl_supportsSchemasInDataManipulation_throw( ) = 0;
- virtual sal_Bool impl_supportsMixedCaseQuotedIdentifiers_throw( ) = 0;
- virtual sal_Bool impl_supportsAlterTableWithAddColumn_throw( ) = 0;
- virtual sal_Bool impl_supportsAlterTableWithDropColumn_throw( ) = 0;
- virtual sal_Int32 impl_getMaxStatements_throw( ) = 0;
- virtual sal_Int32 impl_getMaxTablesInSelect_throw( ) = 0;
- virtual sal_Bool impl_storesMixedCaseQuotedIdentifiers_throw( ) = 0;
-
-
- public:
-
- ODatabaseMetaDataBase(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo);
-
- // XDatabaseMetaData2
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getConnectionInfo( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTypeInfo( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getProcedures( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getProcedureColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getSchemas( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getCatalogs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTablePrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getBestRowIdentifier( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope, sal_Bool nullable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getVersionColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getImportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getExportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getCrossReference( const ::com::sun::star::uno::Any& primaryCatalog, const ::rtl::OUString& primarySchema, const ::rtl::OUString& primaryTable, const ::com::sun::star::uno::Any& foreignCatalog, const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getIndexInfo( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Bool unique, sal_Bool approximate ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // cached database information
- virtual ::rtl::OUString SAL_CALL getIdentifierQuoteString( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCatalogAtStart( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogSeparator( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInTableDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInTableDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInDataManipulation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInDataManipulation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMixedCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsAlterTableWithAddColumn( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsAlterTableWithDropColumn( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxStatements( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxTablesInSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesMixedCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // _CONNECTIVITY_ODATABASEMETADATABASE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/TKeyValue.hxx b/connectivity/source/inc/TKeyValue.hxx
deleted file mode 100644
index 4e9bb50586..0000000000
--- a/connectivity/source/inc/TKeyValue.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_TKEYVALUE_HXX
-#define CONNECTIVITY_TKEYVALUE_HXX
-
-#include "connectivity/FValue.hxx"
-#include "connectivity/dbtoolsdllapi.hxx"
-
-namespace connectivity
-{
- class OOO_DLLPUBLIC_DBTOOLS OKeyValue
- {
- private:
- ::std::vector<ORowSetValueDecoratorRef> m_aKeys;
- sal_Int32 m_nValue;
-
- protected:
- OKeyValue();
- OKeyValue(sal_Int32 nVal);
- public:
-
- ~OKeyValue();
-
- inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () )
- { return ::rtl_allocateMemory( nSize ); }
- inline static void * SAL_CALL operator new( size_t,void* _pHint ) SAL_THROW( () )
- { return _pHint; }
- inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () )
- { ::rtl_freeMemory( pMem ); }
- inline static void SAL_CALL operator delete( void *,void* ) SAL_THROW( () )
- { }
-
- static OKeyValue* createKeyValue(sal_Int32 nVal);
- // static OKeyValue* createEmptyKeyValue();
-
- inline void pushKey(const ORowSetValueDecoratorRef& _aValueRef)
- {
- m_aKeys.push_back(_aValueRef);
- }
- inline void setValue(sal_Int32 nVal) { m_nValue = nVal; }
-
- ::rtl::OUString getKeyString(::std::vector<ORowSetValueDecoratorRef>::size_type i) const
- {
- OSL_ENSURE(m_aKeys.size() > i,"Wrong index for KEyValue");
- return m_aKeys[i]->getValue();
- }
- double getKeyDouble(::std::vector<ORowSetValueDecoratorRef>::size_type i) const
- {
- OSL_ENSURE(m_aKeys.size() > i,"Wrong index for KEyValue");
- return m_aKeys[i]->getValue();
- }
-
- inline sal_Int32 getValue() const { return m_nValue; }
- };
-}
-
-#endif // CONNECTIVITY_TKEYVALUE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/TPrivilegesResultSet.hxx b/connectivity/source/inc/TPrivilegesResultSet.hxx
deleted file mode 100644
index 23e47cf565..0000000000
--- a/connectivity/source/inc/TPrivilegesResultSet.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_PRIVILEGESRESULTSET_HXX
-#define CONNECTIVITY_PRIVILEGESRESULTSET_HXX
-
-#include "FDatabaseMetaDataResultSet.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include "connectivity/dbtoolsdllapi.hxx"
-
-namespace connectivity
-{
- class OOO_DLLPUBLIC_DBTOOLS OResultSetPrivileges :
- public ODatabaseMetaDataResultSet
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> m_xTables;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow> m_xRow;
- sal_Bool m_bResetValues;
- protected:
- virtual const ORowSetValue& getValue(sal_Int32 columnIndex);
- public:
- OResultSetPrivileges(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _rxMeta
- ,const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern);
-
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XResultSet
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // CONNECTIVITY_PRIVILEGESRESULTSET_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/TResultSetHelper.hxx b/connectivity/source/inc/TResultSetHelper.hxx
deleted file mode 100644
index 8480dd9ab9..0000000000
--- a/connectivity/source/inc/TResultSetHelper.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_TRESULTSETHELPER_HXX
-#define CONNECTIVITY_TRESULTSETHELPER_HXX
-
-#include <sal/types.h>
-#include "connectivity/dbtoolsdllapi.hxx"
-
-namespace connectivity
-{
- class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE IResultSetHelper
- {
- public:
- enum Movement
- {
- NEXT = 0,
- PRIOR,
- FIRST,
- LAST,
- RELATIVE,
- ABSOLUTE,
- BOOKMARK
- };
- public:
- virtual sal_Bool move(Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData) = 0;
- virtual sal_Int32 getDriverPos() const = 0;
- virtual sal_Bool deletedVisible() const = 0;
- virtual sal_Bool isRowDeleted() const = 0;
- };
-}
-
-#endif // CONNECTIVITY_TRESULTSETHELPER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/TSkipDeletedSet.hxx b/connectivity/source/inc/TSkipDeletedSet.hxx
deleted file mode 100644
index 8bee3576a9..0000000000
--- a/connectivity/source/inc/TSkipDeletedSet.hxx
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_SKIPDELETEDSSET_HXX
-#define CONNECTIVITY_SKIPDELETEDSSET_HXX
-
-#include "TResultSetHelper.hxx"
-#include <rtl/alloc.h>
-#include <boost/unordered_map.hpp>
-#include <vector>
-#include "connectivity/dbtoolsdllapi.hxx"
-
-namespace connectivity
-{
- /**
- the class OSkipDeletedSet supports a general method to skip deleted rows
- */
- class OOO_DLLPUBLIC_DBTOOLS OSkipDeletedSet
- {
- ::std::vector<sal_Int32> m_aBookmarksPositions;// vector of iterators to position map, the order is the logical position
- IResultSetHelper* m_pHelper; // used for moving in the resultset
- bool m_bDeletedVisible;
-
- sal_Bool moveAbsolute(sal_Int32 _nOffset,sal_Bool _bRetrieveData);
- public:
- OSkipDeletedSet(IResultSetHelper* _pHelper);
- ~OSkipDeletedSet();
-
- inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () )
- { return ::rtl_allocateMemory( nSize ); }
- inline static void * SAL_CALL operator new( size_t,void* _pHint ) SAL_THROW( () )
- { return _pHint; }
- inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () )
- { ::rtl_freeMemory( pMem ); }
- inline static void SAL_CALL operator delete( void *,void* ) SAL_THROW( () )
- { }
-
- /**
- skipDeleted moves the resultset to the position defined by the parameters
- it garantees that the row isn't deleted
- @param
- IResultSetHelper::Movement _eCursorPosition in which direction the resultset should be moved
- sal_Int32 _nOffset the position relativ to the movement
- sal_Bool _bRetrieveData is true when the current row should be filled which data
- @return
- true when the movement was successful otherwise false
- */
- sal_Bool skipDeleted(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData);
- /**
- clear the map and the vector used in this class
- */
- void clear();
- /**
- getMappedPosition returns the mapped position of a logical position
- @param
- sal_Int32 _nBookmark the logical position
-
- @return the mapped position
- */
- sal_Int32 getMappedPosition(sal_Int32 _nBookmark) const;
- /**
- insertNewPosition adds a new position to the map
- @param
- sal_Int32 _nPos the logical position
- */
- void insertNewPosition(sal_Int32 _nPos);
- /**
- deletePosition deletes this position from the map and decrement all following positions
- @param
- sal_Int32 _nPos the logical position
- */
- void deletePosition(sal_Int32 _nPos);
- /**
- getLastPosition returns the last position
- @return the last position
- */
- inline sal_Int32 getLastPosition() const { return m_aBookmarksPositions.size(); }
- inline void SetDeletedVisible(bool _bDeletedVisible) { m_bDeletedVisible = _bDeletedVisible; }
- };
-}
-#endif // CONNECTIVITY_SKIPDELETEDSSET_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/TSortIndex.hxx b/connectivity/source/inc/TSortIndex.hxx
deleted file mode 100644
index 062946ac8d..0000000000
--- a/connectivity/source/inc/TSortIndex.hxx
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_TSORTINDEX_HXX
-#define CONNECTIVITY_TSORTINDEX_HXX
-
-#include "connectivity/dbtoolsdllapi.hxx"
-#include "TKeyValue.hxx"
-
-namespace connectivity
-{
- typedef enum
- {
- SQL_ORDERBYKEY_NONE, // do not sort
- SQL_ORDERBYKEY_DOUBLE, // numeric key
- SQL_ORDERBYKEY_STRING // String Key
- } OKeyType;
-
- typedef enum
- {
- SQL_ASC = 1, // ascending
- SQL_DESC = -1 // otherwise
- } TAscendingOrder;
-
- class OKeySet;
- class OKeyValue; // simple class which holds a sal_Int32 and a ::std::vector<ORowSetValueDecoratorRef>
-
- /**
- The class OSortIndex can be used to implement a sorted index.
- This can depend on the fields which should be sorted.
- */
- class OOO_DLLPUBLIC_DBTOOLS OSortIndex
- {
- public:
- typedef ::std::vector< ::std::pair<sal_Int32,OKeyValue*> > TIntValuePairVector;
- typedef ::std::vector<OKeyType> TKeyTypeVector;
-
- private:
- TIntValuePairVector m_aKeyValues;
- TKeyTypeVector m_aKeyType;
- ::std::vector<TAscendingOrder> m_aAscending;
- sal_Bool m_bFrozen;
-
- public:
-
- OSortIndex( const ::std::vector<OKeyType>& _aKeyType,
- const ::std::vector<TAscendingOrder>& _aAscending);
-
- ~OSortIndex();
-
- inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () )
- { return ::rtl_allocateMemory( nSize ); }
- inline static void * SAL_CALL operator new( size_t,void* _pHint ) SAL_THROW( () )
- { return _pHint; }
- inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () )
- { ::rtl_freeMemory( pMem ); }
- inline static void SAL_CALL operator delete( void *,void* ) SAL_THROW( () )
- { }
-
-
- /**
- AddKeyValue appends a new value.
- @param
- pKeyValue the keyvalue to be appended
- ATTENTION: when the sortindex is already frozen the parameter will be deleted
- */
- void AddKeyValue(OKeyValue * pKeyValue);
-
- /**
- Freeze freezes the sortindex so that new values could only be appended by their value
- */
- void Freeze();
-
- /**
- CreateKeySet creates the keyset which vaalues could be used to travel in your table/result
- The returned keyset is frozen.
- */
- ::rtl::Reference<OKeySet> CreateKeySet();
-
-
-
- // look at the name
- sal_Bool IsFrozen() const { return m_bFrozen; }
- // returns the current size of the keyvalues
- sal_Int32 Count() const { return m_aKeyValues.size(); }
- /** GetValue returns the value at position nPos (1..n) [sorted access].
- It only allowed to call this method after the sortindex has been frozen.
- */
-
- sal_Int32 GetValue(sal_Int32 nPos) const;
-
- inline const ::std::vector<OKeyType>& getKeyType() const { return m_aKeyType; }
- inline TAscendingOrder getAscending(::std::vector<TAscendingOrder>::size_type _nPos) const { return m_aAscending[_nPos]; }
-
- };
-
- /**
- The class OKeySet is a refcountable vector which also has a state.
- This state gives information about if the keyset is fixed.
- */
- class OOO_DLLPUBLIC_DBTOOLS OKeySet : public ORefVector<sal_Int32>
- {
- sal_Bool m_bFrozen;
- public:
- OKeySet()
- : ORefVector<sal_Int32>()
- , m_bFrozen(sal_False){}
- OKeySet(Vector::size_type _nSize)
- : ORefVector<sal_Int32>(_nSize)
- , m_bFrozen(sal_False){}
-
- sal_Bool isFrozen() const { return m_bFrozen; }
- void setFrozen(sal_Bool _bFrozen=sal_True) { m_bFrozen = _bFrozen; }
- };
-}
-#endif // CONNECTIVITY_TSORTINDEX_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/UStringDescription_Impl.hxx b/connectivity/source/inc/UStringDescription_Impl.hxx
deleted file mode 100644
index 8ac78d4924..0000000000
--- a/connectivity/source/inc/UStringDescription_Impl.hxx
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_USTRINGDESCRIPTION_IMPL_HXX
-#define CONNECTIVITY_USTRINGDESCRIPTION_IMPL_HXX
-
-#define IMPLEMENT_CONSTASCII_USTRING(name) \
-UStringDescription name(connectivity::dbtools::get##name)
-
-UStringDescription::UStringDescription(PVFN _fCharFkt)
-{
- pZeroTerminatedName = (*_fCharFkt)();
- nLength = 0;
- const sal_Char* pIter = pZeroTerminatedName;
- while((*pIter++) != '\0')
- ++nLength;
-}
-// -------------------------------------------------------------------------
-UStringDescription::~UStringDescription()
-{
-}
-
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_QUERYTIMEOUT );
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MAXFIELDSIZE );
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MAXROWS );
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CURSORNAME );
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_RESULTSETCONCURRENCY );
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_RESULTSETTYPE );
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FETCHDIRECTION );
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FETCHSIZE );
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ESCAPEPROCESSING );
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_USEBOOKMARKS );
-
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_NAME);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TYPE);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TYPENAME);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PRECISION);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SCALE);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISNULLABLE);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISAUTOINCREMENT);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISROWVERSION);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DESCRIPTION);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DEFAULTVALUE);
-
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REFERENCEDTABLE);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_UPDATERULE);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DELETERULE);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CATALOG);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISUNIQUE);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISPRIMARYKEYINDEX);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISCLUSTERED);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISASCENDING);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SCHEMANAME);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CATALOGNAME);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_COMMAND);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHECKOPTION);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PASSWORD);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_RELATEDCOLUMN);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISSEARCHABLE);
-
-IMPLEMENT_CONSTASCII_USTRING(STAT_INVALID_INDEX);
-
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FUNCTION);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TABLENAME);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REALNAME);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DBASEPRECISIONCHANGED);
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISCURRENCY);
-
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISBOOKMARKABLE);
-//============================================================
-//= error messages
-//============================================================
-IMPLEMENT_CONSTASCII_USTRING(ERRORMSG_SEQUENCE);
-IMPLEMENT_CONSTASCII_USTRING(SQLSTATE_SEQUENCE);
-IMPLEMENT_CONSTASCII_USTRING(SQLSTATE_GENERAL);
-//============================================================
-//= different
-//============================================================
-IMPLEMENT_CONSTASCII_USTRING(STR_DELIMITER);
-
-#endif // CONNECTIVITY_USTRINGDESCRIPTION_IMPL_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BCatalog.hxx b/connectivity/source/inc/adabas/BCatalog.hxx
deleted file mode 100644
index 1480e078d4..0000000000
--- a/connectivity/source/inc/adabas/BCatalog.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADABAS_CATALOG_HXX_
-#define _CONNECTIVITY_ADABAS_CATALOG_HXX_
-
-#include "connectivity/sdbcx/VCatalog.hxx"
-#include "odbc/OFunctiondefs.hxx"
-#include "connectivity/StdTypeDefs.hxx"
-
-namespace connectivity
-{
- namespace adabas
- {
- // please don't name the class the same name as in an other namespaces
- // some compilers have problems with this task as I noticed on windows
- class OAdabasConnection;
- class OAdabasCatalog : public connectivity::sdbcx::OCatalog
- {
- OAdabasConnection* m_pConnection; // used to get the metadata
- SQLHANDLE m_aConnectionHdl; // used for odbc specific stuff
-
- void fillVector(const ::rtl::OUString& _sQuery,TStringVector& _rVector);
-
- protected:
- /** builds the name which should be used to access the object later on in the collection.
- Will only be called in fillNames.
- @param _xRow
- The cuurent row from a call of XDatabaseMetaData::getTables.
- */
- virtual ::rtl::OUString buildName( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >& _xRow);
- public:
- // implementation of the pure virtual methods
- virtual void refreshTables();
- virtual void refreshViews() ;
- virtual void refreshGroups();
- virtual void refreshUsers() ;
-
- public:
- OAdabasCatalog(SQLHANDLE _aConnectionHdl,OAdabasConnection* _pCon);
-
- OAdabasConnection* getConnection() const { return m_pConnection; }
- sdbcx::OCollection* getPrivateTables() const { return m_pTables;}
- sdbcx::OCollection* getPrivateViews() const { return m_pViews; }
-
- static const ::rtl::OUString& getDot();
- // correct the the column properties of float/real/double values
- // all & parameters are IN and OUT
- static void correctColumnProperties(sal_Int32 _nPrec, sal_Int32& _rnType,::rtl::OUString& _rsTypeName);
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_CATALOG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BColumn.hxx b/connectivity/source/inc/adabas/BColumn.hxx
deleted file mode 100644
index a310e1a4f6..0000000000
--- a/connectivity/source/inc/adabas/BColumn.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_COLUMN_HXX_
-#define _CONNECTIVITY_ADABAS_COLUMN_HXX_
-
-#include "connectivity/sdbcx/VColumn.hxx"
-
-namespace connectivity
-{
- namespace adabas
- {
- class OAdabasColumn : public sdbcx::OColumn
- {
- public:
- OAdabasColumn();
- OAdabasColumn(const ::rtl::OUString& _Name,
- const ::rtl::OUString& _TypeName,
- const ::rtl::OUString& _DefaultValue,
- sal_Int32 _IsNullable,
- sal_Int32 _Precision,
- sal_Int32 _Scale,
- sal_Int32 _Type,
- sal_Bool _IsAutoIncrement);
-
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_COLUMN_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BColumns.hxx b/connectivity/source/inc/adabas/BColumns.hxx
deleted file mode 100644
index 060569d839..0000000000
--- a/connectivity/source/inc/adabas/BColumns.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_COLUMNS_HXX_
-#define _CONNECTIVITY_ADABAS_COLUMNS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include "connectivity/sdbcx/IRefreshable.hxx"
-#include "adabas/BTable.hxx"
-
-namespace connectivity
-{
- namespace adabas
- {
- class OColumns : public sdbcx::OCollection
- {
- protected:
- OAdabasTable* m_pTable;
-
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OColumns( OAdabasTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector
- ) : sdbcx::OCollection(*_pTable,sal_True,_rMutex,_rVector)
- ,m_pTable(_pTable)
- {}
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_COLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BConnection.hxx b/connectivity/source/inc/adabas/BConnection.hxx
deleted file mode 100644
index 5ecdde267f..0000000000
--- a/connectivity/source/inc/adabas/BConnection.hxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADABAS_BCONNECTION_HXX_
-#define _CONNECTIVITY_ADABAS_BCONNECTION_HXX_
-
-#include <cppuhelper/compbase2.hxx>
-#include "odbc/OConnection.hxx"
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#include <cppuhelper/weakref.hxx>
-#include <rtl/ref.hxx>
-
-namespace connectivity
-{
- namespace odbc
- {
- class ODBCDriver;
- }
- namespace adabas
- {
- typedef connectivity::odbc::OConnection OConnection_BASE2;
-
- // we must use the name "OAdabasConnection" because of a compiler bug
-
- class OAdabasConnection : public OConnection_BASE2
- {
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbcx::XTablesSupplier> m_xCatalog;
-
- protected:
- virtual SQLRETURN openConnectionWithAuth(const ::rtl::OUString& aConnectStr,sal_Int32 nTimeOut, const ::rtl::OUString& _uid,const ::rtl::OUString& _pwd);
- virtual connectivity::odbc::OConnection* cloneConnection(); // creates a new connection
- public:
- virtual SQLRETURN Construct( const ::rtl::OUString& url,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info) throw(::com::sun::star::sdbc::SQLException);
-
- OAdabasConnection(const SQLHANDLE _pDriverHandle,connectivity::odbc::ODBCDriver* _pDriver);
-
- // OComponentHelper;
- virtual void SAL_CALL disposing();
-
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- //XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- ::rtl::Reference<OSQLColumns> createSelectColumns(const ::rtl::OUString& _rSql);
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_BCONNECTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BDatabaseMetaData.hxx b/connectivity/source/inc/adabas/BDatabaseMetaData.hxx
deleted file mode 100644
index 9c2ba7edfe..0000000000
--- a/connectivity/source/inc/adabas/BDatabaseMetaData.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "odbc/ODatabaseMetaData.hxx"
-
-namespace connectivity
-{
- namespace odbc
- {
- class OConnection;
- }
- namespace adabas
- {
- typedef odbc::ODatabaseMetaData OAdabasDatabaseMetaData_BASE;
-
- class OAdabasDatabaseMetaData : public OAdabasDatabaseMetaData_BASE
- {
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw();
- public:
- OAdabasDatabaseMetaData(const SQLHANDLE _pHandle,odbc::OConnection* _pCon)
- : ODatabaseMetaData(_pHandle,_pCon)
- {
- }
-
- // just to return our url
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BDriver.hxx b/connectivity/source/inc/adabas/BDriver.hxx
deleted file mode 100644
index 0b06028b9e..0000000000
--- a/connectivity/source/inc/adabas/BDriver.hxx
+++ /dev/null
@@ -1,178 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_BDRIVER_HXX_
-#define _CONNECTIVITY_ADABAS_BDRIVER_HXX_
-
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#include <com/sun/star/sdbcx/XCreateCatalog.hpp>
-#include <com/sun/star/sdbcx/XDropCatalog.hpp>
-
-#include <com/sun/star/lang/XEventListener.hpp>
-
-#include <cppuhelper/implbase4.hxx>
-#include "odbc/OFunctiondefs.hxx"
-#include "odbc/ODriver.hxx"
-
-namespace connectivity
-{
- namespace adabas
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ODriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
-
- typedef ::cppu::ImplHelper4< ::com::sun::star::sdbcx::XCreateCatalog,
- ::com::sun::star::sdbcx::XDataDefinitionSupplier,
- ::com::sun::star::lang::XEventListener,
- ::com::sun::star::sdbcx::XDropCatalog> ODriver_BASE2;
-
- typedef odbc::ODBCDriver ODriver_BASE;
-
- class ODriver : public ODriver_BASE,
- public ODriver_BASE2
- {
- typedef struct DatabaseStruct
- {
- ::rtl::OUString sControlUser;
- ::rtl::OUString sControlPassword;
- ::rtl::OUString sSysUser;
- ::rtl::OUString sSysPassword;
- ::rtl::OUString sDomainPassword;
- ::rtl::OUString sCacheSize;
- ::rtl::OUString sBackupFile;
- ::rtl::OUString sDataDevName;
- ::rtl::OUString sSysDevSpace;
- ::rtl::OUString sTransLogName;
- ::rtl::OUString sDBName;
- sal_Int32 nDataIncrement; // which size the database should grow
- sal_Int32 nDataSize;
- sal_Int32 nLogSize;
- sal_Bool bShutDown;
- sal_Bool bRestoreDatabase;
-
- DatabaseStruct() : nDataIncrement(0),nDataSize(0),nLogSize(0),bShutDown(sal_False),bRestoreDatabase(sal_False){ }
- } TDatabaseStruct;
-
- DECLARE_STL_USTRINGACCESS_MAP(TDatabaseStruct,TDatabaseMap);
- TDatabaseMap m_aDatabaseMap; // contains all adabas databases with their flag to shut down or not
-
- // environment vars
- ::rtl::OUString m_sDbWork;
- ::rtl::OUString m_sDbConfig;
- ::rtl::OUString m_sDbRoot;
- ::rtl::OUString m_sDbWorkURL;
- ::rtl::OUString m_sDbConfigURL;
- ::rtl::OUString m_sDbRootURL;
- ::rtl::OUString m_sDbRunDir;
- ::rtl::OUString m_sDelimit;
-
- void checkAndInsertNewDevSpace(const ::rtl::OUString& _rDBName,const TDatabaseStruct& _rDBInfo);
- void checkAndRestart(const ::rtl::OUString& _rDBName,const TDatabaseStruct& _rDbInfo);
- void X_CONS(const ::rtl::OUString& _DBNAME,const ::rtl::OString& _ACTION,const ::rtl::OUString& _FILENAME);
- sal_Bool getDBName(const ::rtl::OUString& _rName,::rtl::OUString& _rDBName) const;
- ::rtl::OUString getDatabaseInitFile( const TDatabaseStruct& _aInfo);
- ::rtl::OUString generateInitFile() const;
- void fillEnvironmentVariables();
- void fillInfo(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info, TDatabaseStruct& _rDBInfo /*out*/);
- void LoadBatch(const ::rtl::OUString& _rDBNAME,
- const ::rtl::OUString& _rUSR,
- const ::rtl::OUString& _rPWD,
- const ::rtl::OUString& _rBatch);
- void XUTIL(const ::rtl::OUString& _rParam,
- const ::rtl::OUString& _DBNAME,
- const ::rtl::OUString& _USRNAME,
- const ::rtl::OUString& _USRPWD);
- int X_STOP(const ::rtl::OUString& _DBNAME);
- int X_START(const ::rtl::OUString& _DBNAME);
- void createDb(const TDatabaseStruct& _aInfo);
- void clearDatabase(const ::rtl::OUString& _rDBName);
- int X_PARAM(const ::rtl::OUString& _DBNAME,
- const ::rtl::OUString& _USR,
- const ::rtl::OUString& _PWD,
- const ::rtl::OUString& _CMD);
- sal_Int32 CreateFiles(const TDatabaseStruct& _aInfo);
- sal_Bool CreateFile(const ::rtl::OUString &_FileName,
- sal_Int32 _nSize);
- void PutParam(const ::rtl::OUString& rDBNAME,
- const ::rtl::OUString& rWhat,
- const ::rtl::OUString& rHow);
- void createNeededDirs( const ::rtl::OUString& _rDBName);
- sal_Bool isKernelVersion(const char* _pVersion);
- sal_Bool isVersion( const ::rtl::OUString& _rDBName,
- const char* _pVersion);
-
- void convertOldVersion( const ::rtl::OUString& _rDBName,
- const TDatabaseStruct& _rDbInfo);
-
- void installSystemTables( const TDatabaseStruct& _aInfo);
-
- protected:
- virtual SQLHANDLE EnvironmentHandle(::rtl::OUString &_rPath);
- virtual ~ODriver();
- public:
- explicit ODriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
-
- // XInterface
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
- private:
- DECLARE_SERVICE_INFO();
-
- virtual oslGenericFunction getOdbcFunction(sal_Int32 _nIndex) const;
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XDriver
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XDataDefinitionSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& connection ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XCreateCatalog
- virtual void SAL_CALL createCatalog( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
- // XDropCatalog
- virtual void SAL_CALL dropCatalog( const ::rtl::OUString& catalogName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
- };
- }
-
-}
-#endif //_CONNECTIVITY_ADABAS_BDRIVER_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BGroup.hxx b/connectivity/source/inc/adabas/BGroup.hxx
deleted file mode 100644
index 3f79fd7459..0000000000
--- a/connectivity/source/inc/adabas/BGroup.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_GROUP_HXX_
-#define _CONNECTIVITY_ADABAS_GROUP_HXX_
-
-#include "connectivity/sdbcx/VGroup.hxx"
-
-namespace connectivity
-{
- namespace adabas
- {
- class OAdabasConnection;
- class OAdabasGroup : public sdbcx::OGroup
- {
- OAdabasConnection* m_pConnection;
- public:
- virtual void refreshUsers();
- public:
- OAdabasGroup( OAdabasConnection* _pConnection);
- OAdabasGroup( OAdabasConnection* _pConnection,const ::rtl::OUString& _Name);
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_GROUP_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BGroups.hxx b/connectivity/source/inc/adabas/BGroups.hxx
deleted file mode 100644
index 832613e7e8..0000000000
--- a/connectivity/source/inc/adabas/BGroups.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_GROUPS_HXX_
-#define _CONNECTIVITY_ADABAS_GROUPS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-namespace connectivity
-{
- namespace sdbcx
- {
- class IRefreshableGroups;
- }
- namespace adabas
- {
- class OAdabasConnection;
- class OGroups : public sdbcx::OCollection
- {
- protected:
- OAdabasConnection* m_pConnection;
- connectivity::sdbcx::IRefreshableGroups* m_pParent;
-
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OGroups(::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- OAdabasConnection* _pConnection,
- connectivity::sdbcx::IRefreshableGroups* _pParent) : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector)
- ,m_pConnection(_pConnection)
- ,m_pParent(_pParent)
- {}
- };
- }
-}
-
-#endif // _CONNECTIVITY_ADABAS_GROUPS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BIndex.hxx b/connectivity/source/inc/adabas/BIndex.hxx
deleted file mode 100644
index 74e52681f1..0000000000
--- a/connectivity/source/inc/adabas/BIndex.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_INDEX_HXX_
-#define _CONNECTIVITY_ADABAS_INDEX_HXX_
-
-#include "connectivity/sdbcx/VIndex.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-
-namespace connectivity
-{
- namespace adabas
- {
- class OAdabasTable;
- class OAdabasIndex : public sdbcx::OIndex
- {
- OAdabasTable* m_pTable;
- public:
- virtual void refreshColumns();
- public:
- OAdabasIndex(OAdabasTable* _pTable);
- OAdabasIndex( OAdabasTable* _pTable,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Catalog,
- sal_Bool _isUnique,
- sal_Bool _isPrimaryKeyIndex,
- sal_Bool _isClustered
- );
- OAdabasTable* getTable() const { return m_pTable; }
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_INDEX_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BIndexColumn.hxx b/connectivity/source/inc/adabas/BIndexColumn.hxx
deleted file mode 100644
index 45fa0146f2..0000000000
--- a/connectivity/source/inc/adabas/BIndexColumn.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_INDEXCOLUMN_HXX_
-#define _CONNECTIVITY_ADABAS_INDEXCOLUMN_HXX_
-
-#include "adabas/BColumn.hxx"
-
-namespace connectivity
-{
- namespace adabas
- {
- class OIndexColumn : public OAdabasColumn
- {
- protected:
- sal_Bool m_IsAscending;
- public:
- OIndexColumn();
- OIndexColumn( sal_Bool _IsAscending,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _TypeName,
- const ::rtl::OUString& _DefaultValue,
- sal_Int32 _IsNullable,
- sal_Int32 _Precision,
- sal_Int32 _Scale,
- sal_Int32 _Type,
- sal_Bool _IsAutoIncrement);
-
- virtual void construct();
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_INDEXCOLUMN_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BIndexColumns.hxx b/connectivity/source/inc/adabas/BIndexColumns.hxx
deleted file mode 100644
index 8ed56e03d2..0000000000
--- a/connectivity/source/inc/adabas/BIndexColumns.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_INDEXCOLUMNS_HXX_
-#define _CONNECTIVITY_ADABAS_INDEXCOLUMNS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "adabas/BIndex.hxx"
-
-namespace connectivity
-{
- namespace adabas
- {
- class OIndexColumns : public sdbcx::OCollection
- {
- OAdabasIndex* m_pIndex;
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- public:
- OIndexColumns( OAdabasIndex* _pIndex,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector)
- : sdbcx::OCollection(*_pIndex,sal_True,_rMutex,_rVector)
- ,m_pIndex(_pIndex)
- {
- }
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_INDEXCOLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BIndexes.hxx b/connectivity/source/inc/adabas/BIndexes.hxx
deleted file mode 100644
index be9a975d87..0000000000
--- a/connectivity/source/inc/adabas/BIndexes.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADABAS_INDEXES_HXX_
-#define _CONNECTIVITY_ADABAS_INDEXES_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include "adabas/BTable.hxx"
-namespace connectivity
-{
- namespace adabas
- {
- class OIndexes : public sdbcx::OCollection
- {
- OAdabasTable* m_pTable;
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OIndexes(OAdabasTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector
- ) : sdbcx::OCollection(*_pTable,sal_True,_rMutex,_rVector)
- ,m_pTable(_pTable)
- {}
- };
- }
-}
-
-#endif // _CONNECTIVITY_ADABAS_INDEXES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BKeys.hxx b/connectivity/source/inc/adabas/BKeys.hxx
deleted file mode 100644
index 155186067b..0000000000
--- a/connectivity/source/inc/adabas/BKeys.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_KEYS_HXX_
-#define _CONNECTIVITY_ADABAS_KEYS_HXX_
-
-#include "connectivity/TKeys.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include "adabas/BTable.hxx"
-namespace connectivity
-{
- namespace adabas
- {
- class OKeys : public OKeysHelper
- {
- protected:
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
-
- virtual ::rtl::OUString getDropForeignKey() const;
- public:
- OKeys(OAdabasTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector
- ) : OKeysHelper(_pTable,_rMutex,_rVector)
- {}
- };
- }
-}
-
-#endif // _CONNECTIVITY_ADABAS_KEYS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BPreparedStatement.hxx b/connectivity/source/inc/adabas/BPreparedStatement.hxx
deleted file mode 100644
index cbe73c0bd9..0000000000
--- a/connectivity/source/inc/adabas/BPreparedStatement.hxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_ADABAS_PREPAREDSTATEMENT_HXX
-#define CONNECTIVITY_ADABAS_PREPAREDSTATEMENT_HXX
-
-#include "odbc/OPreparedStatement.hxx"
-#include "adabas/BConnection.hxx"
-
-namespace connectivity
-{
- namespace adabas
- {
- class OAdabasPreparedStatement : public ::connectivity::odbc::OPreparedStatement
- {
- ::rtl::Reference<OSQLColumns> m_aSelectColumns;
- protected:
- virtual odbc::OResultSet* createResulSet();
- virtual void setResultSetConcurrency(sal_Int32 _par0) ;
- virtual void setResultSetType(sal_Int32 _par0) ;
- virtual void setUsingBookmarks(sal_Bool _bUseBookmark) ;
- public:
- OAdabasPreparedStatement( OAdabasConnection* _pConnection,const ::rtl::OUString& sql);
- };
- }
-}
-
-#endif // CONNECTIVITY_ADABAS_PREPAREDSTATEMENT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BResultSet.hxx b/connectivity/source/inc/adabas/BResultSet.hxx
deleted file mode 100644
index 64f5932d9f..0000000000
--- a/connectivity/source/inc/adabas/BResultSet.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_ADABAS_RESULTSET_HXX
-#define CONNECTIVITY_ADABAS_RESULTSET_HXX
-
-#include "odbc/OResultSet.hxx"
-
-namespace connectivity
-{
- namespace adabas
- {
- class OAdabasResultSet : public ::connectivity::odbc::OResultSet
- {
- ::rtl::Reference<OSQLColumns> m_aSelectColumns;
- public:
- OAdabasResultSet(SQLHANDLE _pStatementHandle,::connectivity::odbc::OStatement_Base* pStmt,const ::rtl::Reference<OSQLColumns>& _rSelectColumns)
- : ::connectivity::odbc::OResultSet( _pStatementHandle,pStmt)
- ,m_aSelectColumns(_rSelectColumns)
- {}
-
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // CONNECTIVITY_ADABAS_RESULTSET_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BResultSetMetaData.hxx b/connectivity/source/inc/adabas/BResultSetMetaData.hxx
deleted file mode 100644
index 8b46754dfb..0000000000
--- a/connectivity/source/inc/adabas/BResultSetMetaData.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_ADABAS_RESULTSETMETADATA_HXX
-#define CONNECTIVITY_ADABAS_RESULTSETMETADATA_HXX
-
-#include "odbc/OResultSetMetaData.hxx"
-#include <rtl/ref.hxx>
-
-namespace connectivity
-{
- namespace adabas
- {
- //**************************************************************
- //************ Class: ResultSetMetaData
- //**************************************************************
-
- typedef odbc::OResultSetMetaData OAdabasResultSetMetaData_BASE;
- class OAdabasResultSetMetaData : public OAdabasResultSetMetaData_BASE
- {
- ::rtl::Reference<OSQLColumns> m_aSelectColumns;
- public:
- // a Constructor, that is needed for when Returning the Object is needed:
- OAdabasResultSetMetaData(odbc::OConnection* _pConnection, SQLHANDLE _pStmt ,const ::rtl::Reference<OSQLColumns>& _rSelectColumns);
- virtual ~OAdabasResultSetMetaData();
-
- virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // CONNECTIVITY_ADABAS_RESULTSETMETADATA_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BStatement.hxx b/connectivity/source/inc/adabas/BStatement.hxx
deleted file mode 100644
index 67f7a954c2..0000000000
--- a/connectivity/source/inc/adabas/BStatement.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_ADABAS_STATEMENT_HXX
-#define CONNECTIVITY_ADABAS_STATEMENT_HXX
-
-#include "odbc/OStatement.hxx"
-#include "adabas/BConnection.hxx"
-#include "connectivity/CommonTools.hxx"
-#include <rtl/ref.hxx>
-
-namespace connectivity
-{
- namespace adabas
- {
- class OAdabasStatement : public ::connectivity::odbc::OStatement
- {
- OAdabasConnection* m_pOwnConnection;
- ::rtl::Reference<OSQLColumns> m_aSelectColumns;
- protected:
- virtual odbc::OResultSet* createResulSet();
- virtual void setResultSetConcurrency(sal_Int32 _par0);
- virtual void setResultSetType(sal_Int32 _par0) ;
- virtual void setUsingBookmarks(sal_Bool _bUseBookmark);
- public:
- OAdabasStatement( OAdabasConnection* _pConnection)
- : ::connectivity::odbc::OStatement( _pConnection )
- ,m_pOwnConnection(_pConnection)
- {}
-
- virtual sal_Bool SAL_CALL execute( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif // CONNECTIVITY_ADABAS_STATEMENT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BTable.hxx b/connectivity/source/inc/adabas/BTable.hxx
deleted file mode 100644
index 520627b080..0000000000
--- a/connectivity/source/inc/adabas/BTable.hxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_TABLE_HXX_
-#define _CONNECTIVITY_ADABAS_TABLE_HXX_
-
-#include "connectivity/sdbcx/VTable.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include "adabas/BConnection.hxx"
-#include "connectivity/TTableHelper.hxx"
-
-namespace connectivity
-{
- namespace adabas
- {
- typedef connectivity::OTableHelper OTable_TYPEDEF;
-
- ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xColProp);
-
- class OAdabasTable : public OTableHelper
- {
- OAdabasConnection* m_pConnection;
- protected:
- /** creates the column collection for the table
- @param _rNames
- The column names.
- */
- virtual sdbcx::OCollection* createColumns(const TStringVector& _rNames);
-
- /** creates the key collection for the table
- @param _rNames
- The key names.
- */
- virtual sdbcx::OCollection* createKeys(const TStringVector& _rNames);
-
- /** creates the index collection for the table
- @param _rNames
- The index names.
- */
- virtual sdbcx::OCollection* createIndexes(const TStringVector& _rNames);
-
- public:
- OAdabasTable( sdbcx::OCollection* _pTables,
- OAdabasConnection* _pConnection);
- OAdabasTable( sdbcx::OCollection* _pTables,
- OAdabasConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description = ::rtl::OUString(),
- const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
- const ::rtl::OUString& _CatalogName = ::rtl::OUString()
- );
-
- ::rtl::OUString getTableName() const { return m_Name; }
- ::rtl::OUString getSchema() const { return m_SchemaName; }
-
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- // XAlterTable
- virtual void SAL_CALL alterColumnByName( const ::rtl::OUString& colName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- // XNamed
- virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
- /**
- returns the ALTER TABLE XXX COLUMN statement
- */
- ::rtl::OUString getAlterTableColumnPart(const ::rtl::OUString& _rsColumnName );
-
- // starts a sql transaaction
- void beginTransAction();
- // rolls back a sql transaaction
- void rollbackTransAction();
- // ends a sql transaaction
- void endTransAction();
- // some methods to alter table structures
- void alterColumnType(const ::rtl::OUString& _rColName,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xDescriptor);
- void alterNotNullValue(sal_Int32 _nNewNullable,const ::rtl::OUString& _rColName);
- void alterDefaultValue(const ::rtl::OUString& _sNewDefault,const ::rtl::OUString& _rColName);
- void dropDefaultValue(const ::rtl::OUString& _sNewDefault);
- void addDefaultValue(const ::rtl::OUString& _sNewDefault,const ::rtl::OUString& _rColName);
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_TABLE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BTables.hxx b/connectivity/source/inc/adabas/BTables.hxx
deleted file mode 100644
index cd80f95e9c..0000000000
--- a/connectivity/source/inc/adabas/BTables.hxx
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADABAS_TABLES_HXX_
-#define _CONNECTIVITY_ADABAS_TABLES_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-namespace connectivity
-{
- namespace adabas
- {
- class OTables : public sdbcx::OCollection
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- // OCatalog* m_pParent;
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
-
- void setComments(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void createTable( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
-
- virtual ::rtl::OUString getNameForObject(const sdbcx::ObjectType& _xObject);
- public:
- OTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector)
- ,m_xMetaData(_rMetaData)
- {}
-
- // only the name is identical to ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- // XDrop
- void appendNew(const ::rtl::OUString& _rsNewTable);
- // some helper functions
- /**
- returns a sql string which contains the column definition part for create or alter statements
- */
- static ::rtl::OUString getColumnSqlType(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColProp);
- /**
- returns the "not null" part or the default part of the table statement
- */
- static ::rtl::OUString getColumnSqlNotNullDefault(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColProp);
- /**
- returns the corresponding typename
- can contain () which have to filled with values
- */
- static ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColProp);
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_TABLES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BUser.hxx b/connectivity/source/inc/adabas/BUser.hxx
deleted file mode 100644
index bff6c6b5f1..0000000000
--- a/connectivity/source/inc/adabas/BUser.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_USER_HXX_
-#define _CONNECTIVITY_ADABAS_USER_HXX_
-
-#include "connectivity/sdbcx/VUser.hxx"
-
-namespace connectivity
-{
- namespace adabas
- {
- class OAdabasConnection;
- typedef connectivity::sdbcx::OUser OUser_TYPEDEF;
-
- class OAdabasUser : public OUser_TYPEDEF
- {
- OAdabasConnection* m_pConnection;
-
- ::rtl::OUString getPrivilegeString(sal_Int32 nRights) const;
- // return the privileges and additional the grant rights
- void getAnyTablePrivileges(const ::rtl::OUString& objName, sal_Int32& nRights,sal_Int32& nRightsWithGrant) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- public:
- virtual void refreshGroups();
- public:
- OAdabasUser( OAdabasConnection* _pConnection);
- OAdabasUser( OAdabasConnection* _pConnection,const ::rtl::OUString& _Name);
-
- // XUser
- virtual void SAL_CALL changePassword( const ::rtl::OUString& objPassword, const ::rtl::OUString& newPassword ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XAuthorizable
- virtual sal_Int32 SAL_CALL getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-
- class OUserExtend;
- typedef ::comphelper::OPropertyArrayUsageHelper<OUserExtend> OUserExtend_PROP;
-
- class OUserExtend : public OAdabasUser,
- public OUserExtend_PROP
- {
- protected:
- ::rtl::OUString m_Password;
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- public:
- OUserExtend(OAdabasConnection* _pConnection);
-
- virtual void construct();
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_USER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BUsers.hxx b/connectivity/source/inc/adabas/BUsers.hxx
deleted file mode 100644
index 9a6b771302..0000000000
--- a/connectivity/source/inc/adabas/BUsers.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_USERS_HXX_
-#define _CONNECTIVITY_ADABAS_USERS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-namespace connectivity
-{
- namespace sdbcx
- {
- class IRefreshableUsers;
- }
- namespace adabas
- {
- class OAdabasConnection;
- class OUsers : public sdbcx::OCollection
- {
- OAdabasConnection* m_pConnection;
- connectivity::sdbcx::IRefreshableUsers* m_pParent;
- public:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OUsers( ::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- OAdabasConnection* _pConnection,
- connectivity::sdbcx::IRefreshableUsers* _pParent) : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector)
- ,m_pConnection(_pConnection)
- ,m_pParent(_pParent)
- {}
-
- };
- }
-}
-
-#endif // _CONNECTIVITY_ADABAS_USERS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/adabas/BViews.hxx b/connectivity/source/inc/adabas/BViews.hxx
deleted file mode 100644
index 51df106960..0000000000
--- a/connectivity/source/inc/adabas/BViews.hxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADABAS_VIEWS_HXX_
-#define _CONNECTIVITY_ADABAS_VIEWS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-namespace connectivity
-{
- namespace adabas
- {
- class OViews : public sdbcx::OCollection
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- sal_Bool m_bInDrop;
- // OCatalog* m_pParent;
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
-
- void createView( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- public:
- OViews(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector)
- ,m_xMetaData(_rMetaData)
- ,m_bInDrop(sal_False)
- {}
-
- // only the name is identical to ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- void dropByNameImpl(const ::rtl::OUString& elementName);
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_VIEWS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/ACallableStatement.hxx b/connectivity/source/inc/ado/ACallableStatement.hxx
deleted file mode 100644
index 350695e768..0000000000
--- a/connectivity/source/inc/ado/ACallableStatement.hxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_ACALLABLESTATEMENT_HXX_
-#define _CONNECTIVITY_ADO_ACALLABLESTATEMENT_HXX_
-
-#include "ado/APreparedStatement.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XOutParameters.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-namespace connectivity
-{
- namespace ado
- {
- //**************************************************************
- //************ Class: java.sql.CallableStatement
- //**************************************************************
-
- class OCallableStatement : public OPreparedStatement,
- public ::com::sun::star::sdbc::XRow,
- public ::com::sun::star::sdbc::XOutParameters
- {
- OLEVariant m_aValue;
- public:
- DECLARE_SERVICE_INFO();
- virtual ~OCallableStatement() {} ;
- // a Constructor, that is needed for when Returning the Object is needed:
- OCallableStatement( OConnection* _pConnection,const OTypeInfoMap& _TypeInfo,const ::rtl::OUString& sql );
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XOutParameters
- virtual void SAL_CALL registerOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_OCallableStatement_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/ACatalog.hxx b/connectivity/source/inc/ado/ACatalog.hxx
deleted file mode 100644
index 7fb8f30f5f..0000000000
--- a/connectivity/source/inc/ado/ACatalog.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADO_CATALOG_HXX_
-#define _CONNECTIVITY_ADO_CATALOG_HXX_
-
-#include "connectivity/sdbcx/VCatalog.hxx"
-#include "ado/Awrapadox.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class OConnection;
-
- class OCatalog : public connectivity::sdbcx::OCatalog
- {
- WpADOCatalog m_aCatalog;
- OConnection* m_pConnection;
-
- public:
- virtual void refreshTables();
- virtual void refreshViews() ;
- virtual void refreshGroups();
- virtual void refreshUsers() ;
-
- public:
- OCatalog(_ADOCatalog* _pCatalog,OConnection* _pCon);
- ~OCatalog();
-
- OConnection* getConnection() const { return m_pConnection; }
- sdbcx::OCollection* getPrivateTables() const { return m_pTables; }
- WpADOCatalog getCatalog() const { return m_aCatalog; }
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_CATALOG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/ACollection.hxx b/connectivity/source/inc/ado/ACollection.hxx
deleted file mode 100644
index 6716921fcf..0000000000
--- a/connectivity/source/inc/ado/ACollection.hxx
+++ /dev/null
@@ -1,233 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_COLLECTION_HXX_
-#define _CONNECTIVITY_ADO_COLLECTION_HXX_
-
-#include <cppuhelper/implbase3.hxx>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include "ado/Awrapadox.hxx"
-#include "ado/Aolevariant.hxx"
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-namespace connectivity
-{
- namespace ado
- {
- namespace starcontainer = ::com::sun::star::container;
- namespace starlang = ::com::sun::star::lang;
- namespace staruno = ::com::sun::star::uno;
- namespace starbeans = ::com::sun::star::beans;
-
- typedef ::cppu::WeakImplHelper3< starcontainer::XNameAccess,
- starcontainer::XIndexAccess,
- starlang::XServiceInfo> OCollectionBase;
-
- //************************************************************
- // OCollection
- //************************************************************
- template <class T,class SimT,class OCl> class OCollection : public OCollectionBase
- {
- private:
- OCollection( const OCollection& ); // never implemented
- OCollection& operator=( const OCollection& ); // never implemented
-
- protected:
- vector<OCl*> m_aElements;
- ::cppu::OWeakObject& m_rParent;
- ::osl::Mutex& m_rMutex; // mutex of the parent
- T* m_pCollection;
-
-
- public:
- OCollection(::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,T* _pCollection)
- : m_rParent(_rParent)
- ,m_rMutex(_rMutex)
- ,m_pCollection(_pCollection)
- {
- m_pCollection->AddRef();
- }
-
- ~OCollection()
- {
- m_pCollection->Release();
- }
-
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (staruno::RuntimeException)
- {
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.ACollection"));
- }
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& _rServiceName ) throw(staruno::RuntimeException)
- {
- staruno::Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- for (sal_Int32 i=0; i<aSupported.getLength(); ++i, ++pSupported)
- if (pSupported->equals(_rServiceName))
- return sal_True;
-
- return sal_False;
- }
- virtual staruno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(staruno::RuntimeException)
- {
- staruno::Sequence< ::rtl::OUString > aSupported(1);
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Container"));
- return aSupported;
- }
-
- // dispatch the refcounting to the parent
- virtual void SAL_CALL acquire() throw()
- {
- m_rParent.acquire();
- }
- virtual void SAL_CALL release() throw()
- {
- m_rParent.release();
- }
-
- // ::com::sun::star::container::XElementAccess
- virtual staruno::Type SAL_CALL getElementType( ) throw(staruno::RuntimeException)
- {
- return::getCppuType(static_cast< staruno::Reference< starbeans::XPropertySet>*>(NULL));
- }
-
- virtual sal_Bool SAL_CALL hasElements( ) throw(staruno::RuntimeException)
- {
- ::osl::MutexGuard aGuard(m_rMutex);
- return getCount() > 0;
- }
-
- // starcontainer::XIndexAccess
- virtual sal_Int32 SAL_CALL getCount( ) throw(staruno::RuntimeException)
- {
- ::osl::MutexGuard aGuard(m_rMutex);
- sal_Int32 nCnt = 0;
- m_pCollection->get_Count(&nCnt);
- return nCnt;
- }
-
- virtual staruno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(starlang::IndexOutOfBoundsException, starlang::WrappedTargetException, staruno::RuntimeException)
- {
- ::osl::MutexGuard aGuard(m_rMutex);
- if (Index < 0 || Index >= getCount())
- throw starlang::IndexOutOfBoundsException();
- SimT* pCol = NULL;
- m_pCollection->get_Item(OLEVariant(Index),&pCol);
- if(!pCol)
- throw starlang::IndexOutOfBoundsException();
-
- OCl* pIndex = new OCl(pCol);
-
- m_aElements.push_back(pIndex);
-
- return staruno::makeAny( staruno::Reference< starbeans::XPropertySet >(pIndex));
- }
-
-
- // starcontainer::XNameAccess
- virtual staruno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(starcontainer::NoSuchElementException, starlang::WrappedTargetException, staruno::RuntimeException)
- {
- ::osl::MutexGuard aGuard(m_rMutex);
-
- SimT* pCol = NULL;
- m_pCollection->get_Item(OLEVariant(aName),&pCol);
- if(!pCol)
- throw starlang::IndexOutOfBoundsException();
-
- OCl* pIndex = new OCl(pCol);
-
- m_aElements.push_back(pIndex);
-
- return staruno::makeAny( staruno::Reference< starbeans::XPropertySet >(pIndex));
- }
- virtual staruno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(staruno::RuntimeException)
- {
- ::osl::MutexGuard aGuard(m_rMutex);
- sal_Int32 nLen = getCount();
- staruno::Sequence< ::rtl::OUString > aNameList(nLen);
-
- ::rtl::OUString* pStringArray = aNameList.getArray();
- OLEVariant aVar;
- for (sal_Int32 i=0;i<nLen;++i)
- {
- aVar.setInt32(i);
- SimT* pIdx = NULL;
- m_pCollection->get_Item(aVar,&pIdx);
- pIdx->AddRef();
- _bstr_t sBSTR;
- pIdx->get_Name(&sBSTR);
- (*pStringArray) = (sal_Unicode*)sBSTR;
- pIdx->Release();
- ++pStringArray;
- }
- return aNameList;
- }
- virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(staruno::RuntimeException)
- {
- ::osl::MutexGuard aGuard(m_rMutex);
- SimT* pCol = NULL;
- m_pCollection->get_Item(OLEVariant(aName),&pCol);
- return pCol != NULL;
- }
-
- void SAL_CALL disposing()
- {
- ::osl::MutexGuard aGuard(m_rMutex);
- for (::std::vector<OCl*>::const_iterator i = m_aElements.begin(); i != m_aElements.end(); ++i)
- {
- (*i)->disposing();
- (*i)->release();
- }
- m_aElements.clear();
- }
-
- };
-
- class OIndex;
- class OKey;
- class OColumn;
- class OTable;
- class OView;
- class OGroup;
- class OUser;
-
- typedef OCollection< ADOIndexes,ADOIndex,OIndex> OIndexes;
- typedef OCollection< ADOKeys,ADOKey,OKey> OKeys;
- typedef OCollection< ADOColumns,ADOColumn,OColumn> OColumns;
- typedef OCollection< ADOTables,ADOTable,OTable> OTables;
- typedef OCollection< ADOViews,ADOView,OView> OViews;
- typedef OCollection< ADOGroups,ADOGroup,OGroup> OGroups;
- typedef OCollection< ADOUsers,ADOUser,OUser> OUsers;
-
- }
-}
-#endif // _CONNECTIVITY_ADO_COLLECTION_HXX_
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AColumn.hxx b/connectivity/source/inc/ado/AColumn.hxx
deleted file mode 100644
index 62a2b101e8..0000000000
--- a/connectivity/source/inc/ado/AColumn.hxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_COLUMN_HXX_
-#define _CONNECTIVITY_ADO_COLUMN_HXX_
-
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "ado/Awrapadox.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class OConnection;
- typedef sdbcx::OColumn OColumn_ADO;
- class OAdoColumn : public OColumn_ADO
- {
- WpADOColumn m_aColumn;
- OConnection* m_pConnection;
- ::rtl::OUString m_ReferencedColumn;
- sal_Bool m_IsAscending;
-
- void fillPropertyValues();
- protected:
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- )
- throw (::com::sun::star::uno::Exception);
- public:
- OAdoColumn(sal_Bool _bCase,OConnection* _pConnection,_ADOColumn* _pColumn);
- OAdoColumn(sal_Bool _bCase,OConnection* _pConnection);
- // ODescriptor
- virtual void construct();
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- WpADOColumn getColumnImpl() const;
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_COLUMN_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AColumns.hxx b/connectivity/source/inc/ado/AColumns.hxx
deleted file mode 100644
index 4486a57271..0000000000
--- a/connectivity/source/inc/ado/AColumns.hxx
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_COLUMNS_HXX_
-#define _CONNECTIVITY_ADO_COLUMNS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include "connectivity/sdbcx/IRefreshable.hxx"
-#include "ado/Awrapadox.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class OConnection;
- class OColumns : public sdbcx::OCollection
- {
- protected:
- WpADOColumns m_aCollection;
- OConnection* m_pConnection;
-
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OColumns( ::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- const WpADOColumns& _rCollection,
- sal_Bool _bCase,
- OConnection* _pConnection) : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
- ,m_aCollection(_rCollection)
- ,m_pConnection(_pConnection)
- {
- }
-
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_COLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AConnection.hxx b/connectivity/source/inc/ado/AConnection.hxx
deleted file mode 100644
index aa170e87a2..0000000000
--- a/connectivity/source/inc/ado/AConnection.hxx
+++ /dev/null
@@ -1,153 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADO_ACONNECTION_HXX_
-#define _CONNECTIVITY_ADO_ACONNECTION_HXX_
-
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include "OSubComponent.hxx"
-#include <map>
-#include "connectivity/CommonTools.hxx"
-#include "OTypeInfo.hxx"
-#include "TConnection.hxx"
-#include "ado/Awrapado.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- struct OExtendedTypeInfo
- {
- ::connectivity::OTypeInfo aSimpleType; // the general type info
- DataTypeEnum eType;
-
- inline ::rtl::OUString getDBName() const { return aSimpleType.aTypeName; }
- };
-
- class WpADOConnection;
- class ODriver;
- class OCatalog;
- typedef ::std::multimap<DataTypeEnum, OExtendedTypeInfo*> OTypeInfoMap;
- typedef connectivity::OMetaConnection OConnection_BASE;
-
-
- class OConnection : public OConnection_BASE,
- public connectivity::OSubComponent<OConnection, OConnection_BASE>
- {
- friend class connectivity::OSubComponent<OConnection, OConnection_BASE>;
-
- protected:
- //====================================================================
- // Data attributes
- //====================================================================
- OTypeInfoMap m_aTypeInfo; // vector containing an entry
- // for each row returned by
- // DatabaseMetaData.getTypeInfo.
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbcx::XTablesSupplier> m_xCatalog;
- ODriver* m_pDriver;
- private:
- WpADOConnection* m_pAdoConnection;
- OCatalog* m_pCatalog;
- sal_Int32 m_nEngineType;
- sal_Bool m_bClosed;
- sal_Bool m_bAutocommit;
-
- protected:
- void buildTypeInfo() throw( ::com::sun::star::sdbc::SQLException);
- public:
-
- OConnection(ODriver* _pDriver) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // OConnection(const SQLHANDLE _pConnectionHandle);
- ~OConnection();
- void construct(const ::rtl::OUString& url,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info);
-
- void closeAllStatements () throw( ::com::sun::star::sdbc::SQLException);
-
- //XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
- // XServiceInfo
- DECLARE_SERVICE_INFO();
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL release() throw();
-
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL nativeSQL( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getAutoCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL commit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL rollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isClosed( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCatalog( const ::rtl::OUString& catalog ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalog( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- //
- WpADOConnection* getConnection() { return m_pAdoConnection; }
- void setCatalog(const ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbcx::XTablesSupplier>& _xCat) { m_xCatalog = _xCat; }
- void setCatalog(OCatalog* _pCatalog) { m_pCatalog = _pCatalog; }
-
- const OTypeInfoMap* getTypeInfo() const { return &m_aTypeInfo;}
- OCatalog* getAdoCatalog() const
- {
- if ( m_xCatalog.get().is() )
- return m_pCatalog;
- return NULL;
- }
-
- sal_Int32 getEngineType() const { return m_nEngineType; }
- ODriver* getDriver() const { return m_pDriver; }
-
- static const OExtendedTypeInfo* getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo,
- DataTypeEnum _nType,
- const ::rtl::OUString& _sTypeName,
- sal_Int32 _nPrecision,
- sal_Int32 _nScale,
- sal_Bool& _brForceToType);
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_ACONNECTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/ADatabaseMetaData.hxx b/connectivity/source/inc/ado/ADatabaseMetaData.hxx
deleted file mode 100644
index 2e8dab649f..0000000000
--- a/connectivity/source/inc/ado/ADatabaseMetaData.hxx
+++ /dev/null
@@ -1,232 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_ADATABASEMETADATA_HXX_
-#define _CONNECTIVITY_ADO_ADATABASEMETADATA_HXX_
-
-#include "TDatabaseMetaDataBase.hxx"
-#ifndef _MAP_
-#include <map>
-#endif
-
-
-namespace connectivity
-{
- namespace ado
- {
- class WpADOConnection;
- class OConnection;
- //**************************************************************
- //************ Class: ODatabaseMetaData
- //**************************************************************
-
- class ODatabaseMetaData : public ODatabaseMetaDataBase
- {
- typedef struct _LiteralInfo
- {
- ::rtl::OUString pwszLiteralValue;
- sal_uInt32 cchMaxLen;
- sal_Bool fSupported;
- } LiteralInfo;
-
- ::std::map<sal_uInt32,LiteralInfo> m_aLiteralInfo;
- WpADOConnection* m_pADOConnection;
- OConnection* m_pConnection;
-
- void fillLiterals();
- // get information out of rowset
- sal_Int32 getMaxSize(sal_uInt32 _nId);
- sal_Bool isCapable(sal_uInt32 _nId);
- ::rtl::OUString getLiteral(sal_uInt32 _nProperty);
-
- // get info out of propertyst
- ::rtl::OUString getStringProperty(const ::rtl::OUString& _aProperty) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getInt32Property(const ::rtl::OUString& _aProperty) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Bool getBoolProperty(const ::rtl::OUString& _aProperty) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw();
- // cached database information
- virtual ::rtl::OUString impl_getIdentifierQuoteString_throw( );
- virtual sal_Bool impl_isCatalogAtStart_throw( );
- virtual ::rtl::OUString impl_getCatalogSeparator_throw( );
- virtual sal_Bool impl_supportsCatalogsInTableDefinitions_throw( );
- virtual sal_Bool impl_supportsSchemasInTableDefinitions_throw( ) ;
- virtual sal_Bool impl_supportsCatalogsInDataManipulation_throw( );
- virtual sal_Bool impl_supportsSchemasInDataManipulation_throw( ) ;
- virtual sal_Bool impl_supportsMixedCaseQuotedIdentifiers_throw( );
- virtual sal_Bool impl_supportsAlterTableWithAddColumn_throw( );
- virtual sal_Bool impl_supportsAlterTableWithDropColumn_throw( );
- virtual sal_Int32 impl_getMaxStatements_throw( );
- virtual sal_Int32 impl_getMaxTablesInSelect_throw( );
- virtual sal_Bool impl_storesMixedCaseQuotedIdentifiers_throw( );
- public:
-
- ODatabaseMetaData(OConnection* _pCon);
-
- // XDatabaseMetaData
- virtual sal_Bool SAL_CALL allProceduresAreCallable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL allTablesAreSelectable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getUserName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedLow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFiles( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::rtl::OUString SAL_CALL getSQLKeywords( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getNumericFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getStringFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSystemFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTimeDateFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSearchStringEscape( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getExtraNameCharacters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsColumnAliasing( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTypeConversion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getProcedureTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedDelete( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsStoredProcedures( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnionAll( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxConnections( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxIndexLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxRowSize( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxStatementLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getProcedures( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getProcedureColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTables( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getSchemas( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getCatalogs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTableTypes( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTablePrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getImportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getExportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getCrossReference( const ::com::sun::star::uno::Any& primaryCatalog, const ::rtl::OUString& primarySchema, const ::rtl::OUString& primaryTable, const ::com::sun::star::uno::Any& foreignCatalog, const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getIndexInfo( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Bool unique, sal_Bool approximate ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsBatchUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getUDTs( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern, const ::com::sun::star::uno::Sequence< sal_Int32 >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_ADATABASEMETADATA_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/ADatabaseMetaDataResultSet.hxx b/connectivity/source/inc/ado/ADatabaseMetaDataResultSet.hxx
deleted file mode 100644
index 5eadfd82ea..0000000000
--- a/connectivity/source/inc/ado/ADatabaseMetaDataResultSet.hxx
+++ /dev/null
@@ -1,226 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_ADATABASEMETADATARESULTSET_HXX_
-#define _CONNECTIVITY_ADO_ADATABASEMETADATARESULTSET_HXX_
-
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <cppuhelper/compbase7.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include "ado/AStatement.hxx"
-#include <comphelper/broadcasthelper.hxx>
-#include "connectivity/StdTypeDefs.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class ODatabaseMetaDataResultSetMetaData;
- /*
- ** java_sql_ResultSet
- */
- typedef ::cppu::WeakComponentImplHelper7< ::com::sun::star::sdbc::XResultSet,
- ::com::sun::star::sdbc::XRow,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XColumnLocate> ODatabaseMetaDataResultSet_BASE;
-
- class ODatabaseMetaDataResultSet : public comphelper::OBaseMutex,
- public ODatabaseMetaDataResultSet_BASE,
- public ::cppu::OPropertySetHelper,
- public ::comphelper::OPropertyArrayUsageHelper<ODatabaseMetaDataResultSet>
- {
- ::std::vector<sal_Int32> m_aColMapping; // pos 0 is unused so we don't have to decrement 1 everytime
-
- ::std::map<sal_Int32, TInt2IntMap > m_aValueRange;
- ::std::map<sal_Int32, TInt2IntMap >::iterator m_aValueRangeIter;
-
- ::std::map<sal_Int32, ::std::map< ::rtl::OUString,sal_Int32> > m_aStrValueRange;
- ::std::map<sal_Int32, ::std::map< ::rtl::OUString,sal_Int32> >::iterator m_aStrValueRangeIter;
-
- ::std::map<sal_Int32, ::std::map< sal_Int32,::rtl::OUString> > m_aIntValueRange;
- ::std::map<sal_Int32, ::std::map< sal_Int32,::rtl::OUString> >::iterator m_aIntValueRangeIter;
-
- ADORecordset* m_pRecordSet;
- ::com::sun::star::uno::WeakReferenceHelper m_aStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
- OLEVariant m_aValue;
- sal_Int32 m_nRowPos;
- sal_Bool m_bWasNull;
- sal_Bool m_bEOF;
- sal_Bool m_bOnFirstAfterOpen;
-
- sal_Int32 getResultSetConcurrency() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getResultSetType() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getFetchDirection() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getFetchSize() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- ::rtl::OUString getCursorName() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- void setFetchDirection(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setFetchSize(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
-
- inline sal_Int32 mapColumn (sal_Int32 column);
- void checkRecordSet() throw(::com::sun::star::sdbc::SQLException);
- OLEVariant getValue(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- protected:
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- )
- throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle
- ) const;
- public:
- // a Constructor, that is needed for when Returning the Object is needed:
- ODatabaseMetaDataResultSet( ADORecordset* _pRecordSet);
- ~ODatabaseMetaDataResultSet();
-
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XResultSet
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XColumnLocate
- virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- const ::std::vector<sal_Int32>& getColumnMapping() { return m_aColMapping; }
-
- void setCatalogsMap();
- void setSchemasMap();
- void setColumnPrivilegesMap();
- void setColumnsMap();
- void setTablesMap();
- void setProcedureColumnsMap();
- void setProceduresMap();
- void setExportedKeysMap();
- void setImportedKeysMap();
- void setPrimaryKeysMap();
- void setIndexInfoMap();
- void setTablePrivilegesMap();
- void setCrossReferenceMap();
- void setTypeInfoMap(sal_Bool _bJetEngine);
- };
- // -------------------------------------------------------------------------
- inline sal_Int32 ODatabaseMetaDataResultSet::mapColumn (sal_Int32 column)
- {
- sal_Int32 map = column;
-
- if (!m_aColMapping.empty())
- {
- // Validate column number
- map = m_aColMapping[column];
- }
-
- return map;
- }
- }
-
-}
-#endif // _CONNECTIVITY_ADO_ADATABASEMETADATARESULTSET_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx b/connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx
deleted file mode 100644
index ef4e65f4de..0000000000
--- a/connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_ADATABASEMETADATARESULTSETMETADATA_HXX_
-#define _CONNECTIVITY_ADO_ADATABASEMETADATARESULTSETMETADATA_HXX_
-
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-#ifndef _VECTOR_
-#include <vector>
-#endif
-#include "ado/Awrapado.hxx"
-#include "ado/ADatabaseMetaDataResultSet.hxx"
-#include "OColumn.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- //**************************************************************
- //************ Class: ResultSetMetaData
- //**************************************************************
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> ODatabaseMetaResultSetMetaData_BASE;
-
- class ODatabaseMetaDataResultSetMetaData : public ODatabaseMetaResultSetMetaData_BASE
- {
- friend class ODatabaseMetaDataResultSet;
-
- const ::std::vector<sal_Int32> &m_vMapping; // when not every column is needed
- ::std::map<sal_Int32,connectivity::OColumn> m_mColumns;
- ::std::map<sal_Int32,connectivity::OColumn>::const_iterator m_mColumnsIter;
-
- ADORecordset* m_pRecordSet;
- sal_Int32 m_nColCount;
-
- private:
- ODatabaseMetaDataResultSetMetaData( const ODatabaseMetaDataResultSetMetaData& ); // never implemented
- ODatabaseMetaDataResultSetMetaData& operator=( const ODatabaseMetaDataResultSetMetaData& ); // never implemented
-
- protected:
- void setColumnPrivilegesMap();
- void setColumnsMap();
- void setTablesMap();
- void setProcedureColumnsMap();
- void setPrimaryKeysMap();
- void setIndexInfoMap();
- void setTablePrivilegesMap();
- void setCrossReferenceMap();
- void setTypeInfoMap();
- void setProceduresMap();
- public:
- // a Constructor, that is needed for when Returning the Object is needed:
- ODatabaseMetaDataResultSetMetaData( ADORecordset* _pRecordSet ,ODatabaseMetaDataResultSet* _pRes)
- : m_pRecordSet(_pRecordSet),m_vMapping(_pRes->getColumnMapping()),
- m_nColCount(m_vMapping.size()-1)
- {
- if(m_pRecordSet)
- m_pRecordSet->AddRef();
- }
- ~ODatabaseMetaDataResultSetMetaData();
-
- /// Avoid ambigous cast error from the compiler.
- inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
- { return this; }
-
- virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_ADATABASEMETARESULTSETMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/ADriver.hxx b/connectivity/source/inc/ado/ADriver.hxx
deleted file mode 100644
index c8ff6e06da..0000000000
--- a/connectivity/source/inc/ado/ADriver.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_ADRIVER_HXX_
-#define _CONNECTIVITY_ADO_ADRIVER_HXX_
-
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/compbase3.hxx>
-#include "connectivity/CommonTools.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ODriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
-
- typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbc::XDriver,
- ::com::sun::star::sdbcx::XDataDefinitionSupplier,
- ::com::sun::star::lang::XServiceInfo
- > ODriver_BASE;
- class ODriver : public ODriver_BASE
- {
- ::osl::Mutex m_aMutex;
-
- connectivity::OWeakRefArray m_xConnections; // vector containing a list
- // of all the Connection objects
- // for this Driver
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
-
-
- public:
- ODriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB);
- ~ODriver();
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const { return m_xORB; }
-
- private:
- void impl_checkURL_throw(const ::rtl::OUString& _sUrl);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XDataDefinitionSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& connection ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-
-}
-#endif //_CONNECTIVITY_ADO_ADRIVER_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AGroup.hxx b/connectivity/source/inc/ado/AGroup.hxx
deleted file mode 100644
index 82401b55ef..0000000000
--- a/connectivity/source/inc/ado/AGroup.hxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_GROUP_HXX_
-#define _CONNECTIVITY_ADABAS_GROUP_HXX_
-
-#include "connectivity/sdbcx/VGroup.hxx"
-#include "ado/Awrapadox.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- typedef sdbcx::OGroup OGroup_ADO;
- class OCatalog;
-
- class OAdoGroup : public OGroup_ADO
- {
- WpADOGroup m_aGroup;
- OCatalog* m_pCatalog;
-
- sal_Int32 MapRight(RightsEnum _eNum);
- RightsEnum Map2Right(sal_Int32 _eNum);
- ObjectTypeEnum MapObjectType(sal_Int32 _ObjType);
- protected:
- virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue,sal_Int32 nHandle) const;
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue)throw (::com::sun::star::uno::Exception);
-
- public:
- virtual void refreshUsers();
- public:
- OAdoGroup(OCatalog* _pParent,sal_Bool _bCase, ADOGroup* _pGroup=NULL);
- OAdoGroup(OCatalog* _pParent,sal_Bool _bCase, const ::rtl::OUString& _Name);
-
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- // XAuthorizable
- virtual sal_Int32 SAL_CALL getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- WpADOGroup getImpl() const { return m_aGroup; }
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_GROUP_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AGroups.hxx b/connectivity/source/inc/ado/AGroups.hxx
deleted file mode 100644
index b204a7115c..0000000000
--- a/connectivity/source/inc/ado/AGroups.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_GROUPS_HXX_
-#define _CONNECTIVITY_ADO_GROUPS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "ado/Awrapadox.hxx"
-#include "ado/ACatalog.hxx"
-
-namespace connectivity
-{
- namespace sdbcx
- {
- class IRefreshableGroups;
- }
- namespace ado
- {
- class OAdabasConnection;
- class OGroups : public sdbcx::OCollection
- {
- WpADOGroups m_aCollection;
- OCatalog* m_pCatalog;
- protected:
-
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OGroups(OCatalog* _pParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- const WpADOGroups& _rCollection,sal_Bool _bCase) : sdbcx::OCollection(*_pParent,_bCase,_rMutex,_rVector)
- ,m_aCollection(_rCollection)
- ,m_pCatalog(_pParent)
- {
- }
- };
- }
-}
-
-#endif // _CONNECTIVITY_ADO_GROUPS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AIndex.hxx b/connectivity/source/inc/ado/AIndex.hxx
deleted file mode 100644
index 77a994d739..0000000000
--- a/connectivity/source/inc/ado/AIndex.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_INDEX_HXX_
-#define _CONNECTIVITY_ADO_INDEX_HXX_
-
-#include "connectivity/sdbcx/VIndex.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include "ado/Awrapadox.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- typedef sdbcx::OIndex OIndex_ADO;
-
- class OConnection;
- class OAdoIndex : public OIndex_ADO
- {
- WpADOIndex m_aIndex;
- OConnection* m_pConnection;
- protected:
- void fillPropertyValues();
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue)throw (::com::sun::star::uno::Exception);
- public:
- virtual void refreshColumns();
- public:
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- OAdoIndex(sal_Bool _bCase, OConnection* _pConnection,ADOIndex* _pIndex);
- OAdoIndex(sal_Bool _bCase, OConnection* _pConnection);
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- WpADOIndex getImpl() const { return m_aIndex;}
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_INDEX_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AIndexColumn.hxx b/connectivity/source/inc/ado/AIndexColumn.hxx
deleted file mode 100644
index ddf9e3ebfd..0000000000
--- a/connectivity/source/inc/ado/AIndexColumn.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_INDEXCOLUMN_HXX_
-#define _CONNECTIVITY_ADABAS_INDEXCOLUMN_HXX_
-
-#include "ado/AColumn.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class OIndexColumn : public OAdoColumn
- {
- protected:
- sal_Bool m_IsAscending;
- public:
- OIndexColumn();
- OIndexColumn( sal_Bool _IsAscending,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _TypeName,
- const ::rtl::OUString& _DefaultValue,
- sal_Int32 _IsNullable,
- sal_Int32 _Precision,
- sal_Int32 _Scale,
- sal_Int32 _Type,
- sal_Bool _IsAutoIncrement);
-
- virtual void construct();
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_INDEXCOLUMN_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AIndexColumns.hxx b/connectivity/source/inc/ado/AIndexColumns.hxx
deleted file mode 100644
index e7f667bd7d..0000000000
--- a/connectivity/source/inc/ado/AIndexColumns.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_INDEXCOLUMNS_HXX_
-#define _CONNECTIVITY_ADABAS_INDEXCOLUMNS_HXX_
-
-#include "adabas/BColumns.hxx"
-
-namespace connectivity
-{
- namespace adabas
- {
- class OIndexColumns : public OColumns
- {
- protected:
- virtual ::com::sun::star::uno::Reference< starcontainer::XNamed > createObject(const ::rtl::OUString& _rName);
- virtual ::com::sun::star::uno::Reference< starbeans::XPropertySet > createDescriptor();
- public:
- OIndexColumns( ::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- OTable* _pTable,
- connectivity::sdbcx::IRefreshableColumns* _pParent)
- : OColumns(_rParent,_rMutex,_rVector,_pTable,_pParent)
- {
- }
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_INDEXCOLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AIndexes.hxx b/connectivity/source/inc/ado/AIndexes.hxx
deleted file mode 100644
index 454ac64935..0000000000
--- a/connectivity/source/inc/ado/AIndexes.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADO_INDEXES_HXX_
-#define _CONNECTIVITY_ADO_INDEXES_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include "ado/Awrapadox.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class OConnection;
- class OIndexes : public sdbcx::OCollection
- {
- WpADOIndexes m_aCollection;
- OConnection* m_pConnection;
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OIndexes(::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- const WpADOIndexes& _rCollection,
- sal_Bool _bCase,
- OConnection* _pConnection)
- : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
- , m_aCollection(_rCollection)
- , m_pConnection(_pConnection)
- {
- }
- };
- }
-}
-
-#endif // _CONNECTIVITY_ADO_INDEXES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AKey.hxx b/connectivity/source/inc/ado/AKey.hxx
deleted file mode 100644
index 8c37ff532b..0000000000
--- a/connectivity/source/inc/ado/AKey.hxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_KEY_HXX_
-#define _CONNECTIVITY_ADO_KEY_HXX_
-
-#include "connectivity/sdbcx/VKey.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include "ado/Awrapadox.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- typedef sdbcx::OKey OKey_ADO;
-
- class OConnection;
- class OAdoKey : public OKey_ADO
- {
- WpADOKey m_aKey;
- OConnection* m_pConnection;
- protected:
- void fillPropertyValues();
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue)throw (::com::sun::star::uno::Exception);
- public:
- virtual void refreshColumns();
- public:
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- OAdoKey(sal_Bool _bCase,OConnection* _pConnection,ADOKey* _pKey);
- OAdoKey(sal_Bool _bCase,OConnection* _pConnection);
-
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- WpADOKey getImpl() const { return m_aKey;}
- // map the update/delete rules
- static RuleEnum Map2Rule(const sal_Int32& _eNum);
- static sal_Int32 MapRule(const RuleEnum& _eNum);
-
- // map the keytypes
- static sal_Int32 MapKeyRule(const KeyTypeEnum& _eNum);
- static KeyTypeEnum Map2KeyRule(const sal_Int32& _eNum);
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_KEY_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AKeyColumn.hxx b/connectivity/source/inc/ado/AKeyColumn.hxx
deleted file mode 100644
index 64f20668a2..0000000000
--- a/connectivity/source/inc/ado/AKeyColumn.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADABAS_KEYCOLUMN_HXX_
-#define _CONNECTIVITY_ADABAS_KEYCOLUMN_HXX_
-
-#include "ado/AColumn.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class OKeyColumn : public OAdoColumn
- {
- protected:
- ::rtl::OUString m_ReferencedColumn;
- public:
- OKeyColumn();
- OKeyColumn( const ::rtl::OUString& _ReferencedColumn,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _TypeName,
- const ::rtl::OUString& _DefaultValue,
- sal_Int32 _IsNullable,
- sal_Int32 _Precision,
- sal_Int32 _Scale,
- sal_Int32 _Type,
- sal_Bool _IsAutoIncrement);
-
- virtual void construct();
- };
- }
-}
-#endif // _CONNECTIVITY_ADABAS_KEYCOLUMN_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AKeyColumns.hxx b/connectivity/source/inc/ado/AKeyColumns.hxx
deleted file mode 100644
index 0041d6c578..0000000000
--- a/connectivity/source/inc/ado/AKeyColumns.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_KEYCOLUMNS_HXX_
-#define _CONNECTIVITY_ADO_KEYCOLUMNS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class OKeyColumns : public OColumns
- {
- protected:
- virtual ::com::sun::star::uno::Reference< starcontainer::XNamed > createObject(const ::rtl::OUString& _rName);
- virtual ::com::sun::star::uno::Reference< starbeans::XPropertySet > createDescriptor();
- public:
- OKeyColumns( ::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- OTable* _pTable,
- connectivity::sdbcx::IRefreshableColumns* _pParent)
- : OColumns(_rParent,_rMutex,_rVector,_pTable,_pParent)
- {
- }
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_KEYCOLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AKeys.hxx b/connectivity/source/inc/ado/AKeys.hxx
deleted file mode 100644
index 24f7539487..0000000000
--- a/connectivity/source/inc/ado/AKeys.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_KEYS_HXX_
-#define _CONNECTIVITY_ADO_KEYS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "ado/Awrapadox.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class OConnection;
- class OKeys : public sdbcx::OCollection
- {
- WpADOKeys m_aCollection;
- OConnection* m_pConnection;
-
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OKeys(::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- const WpADOKeys& _rCollection,
- sal_Bool _bCase,
- OConnection* _pConnection) : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
- ,m_aCollection(_rCollection)
- ,m_pConnection(_pConnection)
- {
- }
- };
- }
-}
-
-#endif // _CONNECTIVITY_ADO_KEYS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/APreparedStatement.hxx b/connectivity/source/inc/ado/APreparedStatement.hxx
deleted file mode 100644
index fbe70b9111..0000000000
--- a/connectivity/source/inc/ado/APreparedStatement.hxx
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_APREPAREDSTATEMENT_HXX_
-#define _CONNECTIVITY_ADO_APREPAREDSTATEMENT_HXX_
-
-#include "ado/AStatement.hxx"
-#include <com/sun/star/sdbc/XPreparedStatement.hpp>
-#include <com/sun/star/sdbc/XParameters.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XPreparedBatchExecution.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-namespace connectivity
-{
- class OSQLParseNode;
- namespace ado
- {
-
- class OPreparedStatement : public OStatement_Base,
- public ::com::sun::star::sdbc::XPreparedStatement,
- public ::com::sun::star::sdbc::XParameters,
- public ::com::sun::star::sdbc::XPreparedBatchExecution,
- public ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- public ::com::sun::star::lang::XServiceInfo
-
- {
- void setParameter(sal_Int32 parameterIndex, const DataTypeEnum& _eType,const sal_Int32& _nSize,const OLEVariant& _Val)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void replaceParameterNodeName( OSQLParseNode* _pNode,
- const ::rtl::OUString& _sDefaultName,
- sal_Int32& _nParameterCount);
- protected:
- //====================================================================
- // Data attributes
- //====================================================================
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData;
- const OTypeInfoMap& m_aTypeInfo;
- ADOParameters* m_pParameters;
-
- virtual ~OPreparedStatement();
-
- public:
- DECLARE_SERVICE_INFO();
- // a Constructor, that is needed for when Returning the Object is needed:
- OPreparedStatement( OConnection* _pConnection,const OTypeInfoMap& _TypeInfo,const ::rtl::OUString& sql);
-
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPreparedStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL executeUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XParameters
- virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearParameters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XPreparedBatchExecution
- virtual void SAL_CALL addBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_APREPAREDSTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AResultSet.hxx b/connectivity/source/inc/ado/AResultSet.hxx
deleted file mode 100644
index de5ee8e9ab..0000000000
--- a/connectivity/source/inc/ado/AResultSet.hxx
+++ /dev/null
@@ -1,236 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_ARESULTSET_HXX_
-#define _CONNECTIVITY_ADO_ARESULTSET_HXX_
-
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
-#include <com/sun/star/sdbcx/XDeleteRows.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <cppuhelper/compbase12.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include "ado/AStatement.hxx"
-#include <comphelper/broadcasthelper.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-namespace connectivity
-{
- namespace ado
- {
- class OResultSetMetaData;
- /*
- ** java_sql_ResultSet
- */
- typedef ::cppu::WeakComponentImplHelper12< ::com::sun::star::sdbc::XResultSet,
- ::com::sun::star::sdbc::XRow,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XResultSetUpdate,
- ::com::sun::star::sdbc::XRowUpdate,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XColumnLocate,
- ::com::sun::star::sdbcx::XRowLocate,
- ::com::sun::star::sdbcx::XDeleteRows,
- ::com::sun::star::lang::XServiceInfo> OResultSet_BASE;
-
- class OResultSet : public comphelper::OBaseMutex,
- public OResultSet_BASE,
- public ::cppu::OPropertySetHelper,
- public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
- {
-
- ADORecordset* m_pRecordSet;
- OStatement_Base* m_pStmt;
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
- ::std::vector<OLEVariant> m_aBookmarks;
- OLEVariant m_aValue;
- ADO_LONGPTR m_nRowPos;
- sal_Bool m_bWasNull;
- sal_Bool m_bEOF;
- sal_Bool m_bOnFirstAfterOpen;
-
- sal_Int32 getResultSetConcurrency() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getResultSetType() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getFetchDirection() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getFetchSize() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- ::rtl::OUString getCursorName() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- void setFetchDirection(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setFetchSize(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void updateValue(sal_Int32 columnIndex,const OLEVariant& x);
- OLEVariant getValue(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- protected:
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- )
- throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle
- ) const;
- virtual ~OResultSet();
- public:
- // a Constructor, that is needed for when Returning the Object is needed:
- OResultSet( ADORecordset* _pRecordSet,OStatement_Base* pStmt);
- OResultSet( ADORecordset* _pRecordSet);
-
- // late constructor
- void construct();
- inline void setMetaData(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData>& _xMetaData) { m_xMetaData = _xMetaData;}
-
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XResultSet
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetUpdate
- virtual void SAL_CALL insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRowUpdate
- virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XColumnLocate
- virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRowLocate
- virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XDeleteRows
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- };
- }
-
-}
-#endif // _CONNECTIVITY_ADO_ARESULTSET_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AResultSetMetaData.hxx b/connectivity/source/inc/ado/AResultSetMetaData.hxx
deleted file mode 100644
index f0ea845984..0000000000
--- a/connectivity/source/inc/ado/AResultSetMetaData.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_ARESULTSETMETADATA_HXX_
-#define _CONNECTIVITY_ADO_ARESULTSETMETADATA_HXX_
-
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-#ifndef _VECTOR_
-#include <vector>
-#endif
-#include "ado/Awrapado.hxx"
-#include "ado/AResultSet.hxx"
-#include "OColumn.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
-
- //**************************************************************
- //************ Class: ResultSetMetaData
- //**************************************************************
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> OResultSetMetaData_BASE;
-
- class OResultSetMetaData : public OResultSetMetaData_BASE
- {
- friend class OResultSet;
-
- ADORecordset* m_pRecordSet;
- sal_Int32 m_nColCount;
-
- sal_Int32 MapADOType2Jdbc(DataTypeEnum eType);
- private:
- OResultSetMetaData( const OResultSetMetaData& ); // never implemented
- OResultSetMetaData& operator=( const OResultSetMetaData& ); // never implemented
-
- protected:
- virtual ~OResultSetMetaData();
- public:
- // a Constructor, that is needed for when Returning the Object is needed:
- OResultSetMetaData( ADORecordset* _pRecordSet);
-
- virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_ARESULTSETMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AStatement.hxx b/connectivity/source/inc/ado/AStatement.hxx
deleted file mode 100644
index 44bdf29b08..0000000000
--- a/connectivity/source/inc/ado/AStatement.hxx
+++ /dev/null
@@ -1,203 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_ASTATEMENT_HXX_
-#define _CONNECTIVITY_ADO_ASTATEMENT_HXX_
-
-#include <com/sun/star/sdbc/XStatement.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XMultipleResults.hpp>
-#include <com/sun/star/sdbc/XBatchExecution.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <cppuhelper/compbase5.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include <comphelper/uno3.hxx>
-#include <comphelper/broadcasthelper.hxx>
-#include "ado/AConnection.hxx"
-#ifndef _LIST_
-#include <list>
-#endif
-#include "ado/Awrapado.hxx"
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-namespace connectivity
-{
- namespace ado
- {
- typedef ::cppu::WeakComponentImplHelper5< ::com::sun::star::sdbc::XStatement,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XMultipleResults> OStatement_BASE;
-
- //**************************************************************
- //************ Class: java.sql.Statement
- //**************************************************************
- class OStatement_Base : public comphelper::OBaseMutex,
- public OStatement_BASE,
- public ::cppu::OPropertySetHelper,
- public ::comphelper::OPropertyArrayUsageHelper<OStatement_Base>,
- public connectivity::OSubComponent<OStatement_Base, OStatement_BASE>
-
- {
- friend class connectivity::OSubComponent<OStatement_Base, OStatement_BASE>;
- friend class OResultSet;
-
- ::com::sun::star::sdbc::SQLWarning m_aLastWarning;
-
- protected:
- ::std::list< ::rtl::OUString> m_aBatchList;
-
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet> m_xResultSet; // The last ResultSet created
- // for this Statement
-
- OConnection* m_pConnection;// The owning Connection object
- WpADOCommand m_Command;
- WpADORecordset m_RecordSet;
- OLEVariant m_RecordsAffected;
- OLEVariant m_Parameters;
- ::std::vector<connectivity::OTypeInfo> m_aTypeInfo; // Hashtable containing an entry
- // for each row returned by
- // DatabaseMetaData.getTypeInfo.
- ADO_LONGPTR m_nMaxRows;
- sal_Int32 m_nFetchSize;
- LockTypeEnum m_eLockType;
- CursorTypeEnum m_eCursorType;
-
- using OStatement_BASE::rBHelper;
- private:
-
- sal_Int32 getQueryTimeOut() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getMaxFieldSize() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getMaxRows() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getResultSetConcurrency() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getResultSetType() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getFetchDirection() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getFetchSize() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- ::rtl::OUString getCursorName() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- void setQueryTimeOut(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setMaxFieldSize(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setMaxRows(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setResultSetConcurrency(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setResultSetType(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setFetchDirection(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setFetchSize(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setCursorName(const ::rtl::OUString &_par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- protected:
-
- void assignRecordSet( ADORecordset* _pRS );
-
- void reset () throw( ::com::sun::star::sdbc::SQLException);
- void clearMyResultSet () throw( ::com::sun::star::sdbc::SQLException);
- void setWarning (const ::com::sun::star::sdbc::SQLWarning &ex) throw( ::com::sun::star::sdbc::SQLException);
- sal_Int32 getColumnCount () throw( ::com::sun::star::sdbc::SQLException);
- sal_Int32 getRowCount () throw( ::com::sun::star::sdbc::SQLException);
- sal_Int32 getPrecision ( sal_Int32 sqlType);
-
- void disposeResultSet();
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- )
- throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle
- ) const;
- public:
- OStatement_Base(OConnection* _pConnection );
-
- using OStatement_BASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Int32 SAL_CALL executeUpdate( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL execute( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XMultipleResults
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getResultSet( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getUpdateCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getMoreResults( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-
- class OStatement : public OStatement_Base,
- public ::com::sun::star::sdbc::XBatchExecution,
- public ::com::sun::star::lang::XServiceInfo
- {
- public:
- // a Constructor, that is needed for when Returning the Object is needed:
- OStatement( OConnection* _pConnection) : OStatement_Base( _pConnection){};
- ~OStatement();
-
- DECLARE_SERVICE_INFO();
-
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- // XBatchExecution
- virtual void SAL_CALL addBatch( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_ASTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/ATable.hxx b/connectivity/source/inc/ado/ATable.hxx
deleted file mode 100644
index 6c5e1b16bb..0000000000
--- a/connectivity/source/inc/ado/ATable.hxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_TABLE_HXX_
-#define _CONNECTIVITY_ADO_TABLE_HXX_
-
-#include "connectivity/sdbcx/VTable.hxx"
-#include "ado/Awrapadox.hxx"
-#include "ado/ACatalog.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- typedef connectivity::sdbcx::OTable OTable_TYPEDEF;
- typedef connectivity::sdbcx::OTableDescriptor_BASE OTableDescriptor_BASE_TYPEDEF;
-
- class OAdoTable : public OTable_TYPEDEF
- {
- WpADOTable m_aTable;
- OCatalog* m_pCatalog;
-
- protected:
- void fillPropertyValues();
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue)throw (::com::sun::star::uno::Exception);
-
- public:
- virtual void refreshColumns();
- virtual void refreshKeys();
- virtual void refreshIndexes();
-
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- public:
- OAdoTable(sdbcx::OCollection* _pTables,sal_Bool _bCase,OCatalog* _pCatalog,_ADOTable* _pTable);
- OAdoTable(sdbcx::OCollection* _pTables,sal_Bool _bCase,OCatalog* _pCatalog);
-
-
- virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
- ::rtl::OUString getSchema() const { return m_SchemaName; }
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> getMetaData() const;
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- // XRename
- virtual void SAL_CALL rename( const ::rtl::OUString& newName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
-
- // XAlterTable
- virtual void SAL_CALL alterColumnByName( const ::rtl::OUString& colName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL alterColumnByIndex( sal_Int32 index, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- //
- sal_Bool create() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- WpADOTable getImpl() const { return m_aTable;}
- OCatalog* getCatalog() const { return m_pCatalog; }
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_TABLE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/ATables.hxx b/connectivity/source/inc/ado/ATables.hxx
deleted file mode 100644
index ac2e0b9407..0000000000
--- a/connectivity/source/inc/ado/ATables.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADO_TABLES_HXX_
-#define _CONNECTIVITY_ADO_TABLES_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "ado/Awrapadox.hxx"
-#include "ado/ACatalog.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class OCatalog;
- class OTables : public sdbcx::OCollection
- {
- WpADOTables m_aCollection;
- OCatalog* m_pCatalog;
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- void setComments(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OTables(OCatalog* _pParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- const WpADOTables& _rCollection,
- sal_Bool _bCase) : sdbcx::OCollection(*_pParent,_bCase,_rMutex,_rVector)
- ,m_pCatalog(_pParent)
- ,m_aCollection(_rCollection)
- {
- OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid");
- }
- void appendNew(const ::rtl::OUString& _rsNewTable);
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_TABLES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AUser.hxx b/connectivity/source/inc/ado/AUser.hxx
deleted file mode 100644
index 8595c075e9..0000000000
--- a/connectivity/source/inc/ado/AUser.hxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_USER_HXX_
-#define _CONNECTIVITY_ADO_USER_HXX_
-
-#include "connectivity/sdbcx/VUser.hxx"
-#include "ado/Awrapadox.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class OCatalog;
- typedef connectivity::sdbcx::OUser OUser_TYPEDEF;
- typedef connectivity::sdbcx::OUser_BASE OUser_BASE_TYPEDEF;
-
- class OAdoUser : public OUser_TYPEDEF
- {
- protected:
- WpADOUser m_aUser;
- OCatalog* m_pCatalog;
-
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- )
- throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle
- ) const;
- public:
- virtual void refreshGroups();
- public:
- OAdoUser(OCatalog* _pParent,sal_Bool _bCase, ADOUser* _pUser=NULL);
- OAdoUser(OCatalog* _pParent,sal_Bool _bCase, const ::rtl::OUString& _Name);
-
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XUser
- virtual void SAL_CALL changePassword( const ::rtl::OUString& objPassword, const ::rtl::OUString& newPassword ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XAuthorizable
- virtual sal_Int32 SAL_CALL getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- WpADOUser getImpl() const { return m_aUser;}
- };
-
- class OUserExtend;
- typedef ::comphelper::OPropertyArrayUsageHelper<OUserExtend> OUserExtend_PROP;
-
- class OUserExtend : public OAdoUser,
- public OUserExtend_PROP
- {
- protected:
- ::rtl::OUString m_Password;
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- public:
- OUserExtend(OCatalog* _pParent,sal_Bool _bCase,ADOUser* _pUser=NULL);
- OUserExtend(OCatalog* _pParent,sal_Bool _bCase,const ::rtl::OUString& _Name);
-
- virtual void construct();
- ::rtl::OUString getPassword() const { return m_Password;}
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_USER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AUsers.hxx b/connectivity/source/inc/ado/AUsers.hxx
deleted file mode 100644
index 77aa4504bf..0000000000
--- a/connectivity/source/inc/ado/AUsers.hxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_USERS_HXX_
-#define _CONNECTIVITY_ADO_USERS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "ado/Awrapadox.hxx"
-#include "ado/ACatalog.hxx"
-
-namespace connectivity
-{
- namespace sdbcx
- {
- class IRefreshableUsers;
- }
- namespace ado
- {
-
- class OUsers : public sdbcx::OCollection
- {
- WpADOUsers m_aCollection;
- OCatalog* m_pCatalog;
- public:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OUsers( OCatalog* _pParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- const WpADOUsers& _rCollection,
- sal_Bool _bCase)
- :sdbcx::OCollection(*_pParent,_bCase,_rMutex,_rVector)
- ,m_aCollection(_rCollection)
- ,m_pCatalog(_pParent)
- {
- }
- };
- }
-}
-
-#endif // _CONNECTIVITY_ADO_USERS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AView.hxx b/connectivity/source/inc/ado/AView.hxx
deleted file mode 100644
index 8ec340608c..0000000000
--- a/connectivity/source/inc/ado/AView.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_VIEW_HXX_
-#define _CONNECTIVITY_ADO_VIEW_HXX_
-
-#include "connectivity/sdbcx/VView.hxx"
-#include "ado/Awrapadox.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
-
- typedef sdbcx::OView OView_ADO;
-
- class OAdoView : public OView_ADO
- {
- WpADOView m_aView;
-
- protected:
- // OPropertySetHelper
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle
- ) const;
- public:
- OAdoView(sal_Bool _bCase, ADOView* _pView=NULL);
-
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- WpADOView getImpl() const { return m_aView;}
- };
- }
-}
-
-#endif // _CONNECTIVITY_ADO_VIEW_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/AViews.hxx b/connectivity/source/inc/ado/AViews.hxx
deleted file mode 100644
index 27a7bebb36..0000000000
--- a/connectivity/source/inc/ado/AViews.hxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_VIEWS_HXX_
-#define _CONNECTIVITY_ADO_VIEWS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "ado/Awrapadox.hxx"
-#include "ado/ACatalog.hxx"
-
-
-namespace connectivity
-{
- namespace ado
- {
-
- class OViews : public sdbcx::OCollection
- {
- WpADOViews m_aCollection;
- OCatalog* m_pCatalog;
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- void setComments(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OViews(OCatalog* _pParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- WpADOViews& _rCollection,sal_Bool _bCase) : sdbcx::OCollection(*_pParent,_bCase,_rMutex,_rVector)
- ,m_aCollection(_rCollection)
- ,m_pCatalog(_pParent)
- {
- }
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_VIEWS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/Aolevariant.hxx b/connectivity/source/inc/ado/Aolevariant.hxx
deleted file mode 100644
index 7efda7a2f0..0000000000
--- a/connectivity/source/inc/ado/Aolevariant.hxx
+++ /dev/null
@@ -1,177 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADO_AOLEVARIANT_HXX_
-#define _CONNECTIVITY_ADO_AOLEVARIANT_HXX_
-
-#include <sal/types.h>
-#ifdef __MINGW32__
-#include <windows.h>
-#endif
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#include "ado_pre_sys_include.h"
-#include <oaidl.h>
-#include "ado_post_sys_include.h"
-
-namespace com
-{
- namespace sun
- {
- namespace star
- {
- namespace util
- {
- struct Date;
- struct Time;
- struct DateTime;
- }
- }
- }
-}
-namespace connectivity
-{
- namespace ado
- {
- class OLEString
- {
- BSTR m_sStr;
- public:
- OLEString();
- OLEString(const BSTR& _sBStr);
- OLEString(const ::rtl::OUString& _sBStr);
- OLEString(const OLEString& _rRh)
- {
- OLEString::operator=(_rRh);
- }
- ~OLEString();
- OLEString& operator=(const ::rtl::OUString& _rSrc);
- OLEString& operator=(const BSTR& _rSrc);
- OLEString& operator=(const OLEString& _rSrc);
- operator ::rtl::OUString() const;
- operator BSTR() const;
- BSTR* operator &();
- sal_Int32 length() const;
- };
-
- class OLEVariant : public ::tagVARIANT
- {
- public:
- OLEVariant();
- OLEVariant(const VARIANT& varSrc);
- OLEVariant(const OLEVariant& varSrc) ;
- OLEVariant(sal_Bool x) ;
- OLEVariant(sal_Int8 n) ;
- OLEVariant(sal_Int16 n) ;
- OLEVariant(sal_Int32 n) ;
- OLEVariant(sal_Int64 x) ;
-
- OLEVariant(const rtl::OUString& us) ;
- ~OLEVariant() ;
- OLEVariant(const ::com::sun::star::util::Date& x );
- OLEVariant(const ::com::sun::star::util::Time& x );
- OLEVariant(const ::com::sun::star::util::DateTime& x );
- OLEVariant(const float &x);
- OLEVariant(const double &x);
- OLEVariant(IDispatch* pDispInterface);
- OLEVariant(const ::com::sun::star::uno::Sequence< sal_Int8 >& x);
- OLEVariant& operator=(const OLEVariant& varSrc);
- // Assign a const VARIANT& (::VariantCopy handles everything)
- //
- OLEVariant& operator=(const tagVARIANT& varSrc);
- // Assign a const VARIANT* (::VariantCopy handles everything)
- //
- OLEVariant& operator=(const VARIANT* pSrc);
- void setByte(sal_uInt8 n) ;
- void setInt16(sal_Int16 n) ;
- void setInt32(sal_Int32 n) ;
- void setFloat(float f) ;
- void setDouble(double d) ;
- void setDate(DATE d) ;
- void setChar(unsigned char a) ;
- void setCurrency(double aCur) ;
- void setBool(sal_Bool b) ;
- void setString(const rtl::OUString& us) ;
- void setNoArg() ;
-
- void setIDispatch(IDispatch* pDispInterface);
- void setNull() ;
- void setEmpty() ;
-
- void setUI1SAFEARRAYPtr(SAFEARRAY* pSafeAr);
- void setArray(SAFEARRAY* pSafeArray, VARTYPE vtType);
- sal_Bool isNull() const ;
- sal_Bool isEmpty() const ;
-
- VARTYPE getType() const ;
- void ChangeType(VARTYPE vartype, const OLEVariant* pSrc);
-
-
- operator ::rtl::OUString() const;
-
- operator sal_Bool() const { return getBool(); }
- operator sal_Int8() const { return getInt8(); }
- operator sal_Int16() const { return getInt16(); }
- operator sal_Int32() const { return getInt32(); }
- operator float() const { return getFloat(); }
- operator double() const { return getDouble(); }
-
- operator ::com::sun::star::uno::Sequence< sal_Int8 >() const;
- operator ::com::sun::star::util::Date() const ;
- operator ::com::sun::star::util::Time() const ;
- operator ::com::sun::star::util::DateTime()const ;
- ::rtl::OUString getString() const;
- sal_Bool getBool() const;
- IUnknown* getIUnknown() const;
- IDispatch* getIDispatch() const;
- sal_uInt8 getByte() const;
- sal_Int16 getInt16() const;
- sal_Int8 getInt8() const;
- sal_Int32 getInt32() const;
- sal_uInt32 getUInt32() const;
- float getFloat() const;
- double getDouble() const;
- double getDate() const;
- CY getCurrency() const;
- SAFEARRAY* getUI1SAFEARRAYPtr() const;
- ::com::sun::star::uno::Any makeAny() const;
-
- static VARIANT_BOOL VariantBool(sal_Bool bEinBoolean);
-
- private:
- void CHS();
-
- void set(double n);
-
- };
- }
-}
-
-#endif // _CONNECTIVITY_ADO_AOLEVARIANT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/Aolewrap.hxx b/connectivity/source/inc/ado/Aolewrap.hxx
deleted file mode 100644
index dbfb0a7145..0000000000
--- a/connectivity/source/inc/ado/Aolewrap.hxx
+++ /dev/null
@@ -1,247 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADO_AOLEWRAP_HXX_
-#define _CONNECTIVITY_ADO_AOLEWRAP_HXX_
-
-#include <osl/diagnose.h>
-#include <osl/thread.h>
-#include <map>
-#include <vector>
-#include "connectivity/StdTypeDefs.hxx"
-
-namespace rtl
-{
- class OUString;
-}
-namespace connectivity
-{
- namespace ado
- {
- class OLEVariant;
- class WpBase
- {
- protected:
- IDispatch* pIUnknown;
-
- void setIDispatch(IDispatch* _pIUnknown);
- public:
- WpBase();
- WpBase(IDispatch* pInt);
- //inline
- WpBase& operator=(const WpBase& rhs);
- WpBase& operator=(IDispatch* rhs);
- WpBase(const WpBase& aWrapper);
- virtual ~WpBase();
- void clear();
-
-
- sal_Bool IsValid() const;
- operator IDispatch*();
-
- };
- //////////////////////////////////////////////////////////////////////////
- //
- // Template-Klasse WpOLEBase<class T>
- // ==================================
- //
- // Objekte dieser Klasse haelt einen Zeiger auf ein Interface vom Typ T.
- // Es gibt Konstruktoren und Zuweisungsoperator die sicherstellen, dass
- // AddRef() und Release() entsprechend den COM-Konventionen gerufen werden.
- // Ein Objekt kann auch keinen Zeiger halten (Nullzeiger), dann ergibt
- // der Aufruf von IsValid() FALSE.
- //
- // Um effizientes pass-by-value machen zu koennen, ist diese (ebenso wie die
- // abgeleiteten Klassen) eine ganz schmale Wrapper-Klasse unter Vermeidung
- // virtueller Methoden und mit Inlining.
-
- //------------------------------------------------------------------------
- template<class T> class WpOLEBase : public WpBase
- {
- protected:
- T* pInterface;
-
- public:
- WpOLEBase(T* pInt = NULL) : WpBase(pInt),pInterface(pInt){}
-
-
- //inline
- WpOLEBase<T>& operator=(const WpOLEBase<T>& rhs)
- {
- WpBase::operator=(rhs);
- pInterface = rhs.pInterface;
- return *this;
- };
-
- WpOLEBase<T>& operator=(T* rhs)
- {
- WpBase::operator=(rhs);
- pInterface = rhs.pInterface;
- return *this;
- }
-
- WpOLEBase(const WpOLEBase<T>& aWrapper)
- {
- operator=(aWrapper);
- }
-
- virtual ~WpOLEBase()
- {
- }
-
- operator T*() const { return static_cast<T*>(pInterface); }
- void setWithOutAddRef(T* _pInterface)
- {
- pInterface = _pInterface;
- WpBase::setIDispatch(_pInterface);
- }
- };
-
-
- //////////////////////////////////////////////////////////////////////////
- //
- // Template-Klasse WpOLECollection<class Ts, class T, class WrapT>
- // ===============================================================
- //
- // Diese Klasse, welche sich von WpOLEBase<Ts> ableitet, abstrahiert die
- // den DAO-Collections gemeinsamen Eigenschaften:
- //
- // Sie werden ueber ein Interface Ts (etwa: DAOFields) angesprochen
- // und koennen ueber get_Item (hier:GetItem) Items des Typs T (genauer:
- // mit Interface T, etwa DAOField) herausgeben.
- //
- // Diese Wrapperklasse gibt aber nicht ein Interface T heraus,
- // sondern ein Objekt der Klasse WrapT. Dieses muss eine Konstruktion
- // durch T zulassen, vorzugsweise ist es von WpOLEBase<T> abgeleitet.
- //
-
- //------------------------------------------------------------------------
- template<class Ts, class T, class WrapT> class WpOLECollection : public WpOLEBase<Ts>
- {
- public:
- using WpOLEBase<Ts>::pInterface;
- using WpOLEBase<Ts>::IsValid;
- // Konstruktoren, operator=
- // diese rufen nur die Oberklasse
- WpOLECollection(Ts* pInt=NULL):WpOLEBase<Ts>(pInt){}
- WpOLECollection(const WpOLECollection& rhs){operator=(rhs);}
- inline WpOLECollection& operator=(const WpOLECollection& rhs)
- {WpOLEBase<Ts>::operator=(rhs); return *this;};
-
- //////////////////////////////////////////////////////////////////////
-
- inline void Refresh(){pInterface->Refresh();}
-
- inline sal_Int32 GetItemCount() const
- {
- sal_Int32 nCount = 0;
- return pInterface ? (SUCCEEDED(pInterface->get_Count(&nCount)) ? nCount : sal_Int32(0)) : sal_Int32(0);
- }
-
- inline WrapT GetItem(sal_Int32 index) const
- {
- OSL_ENSURE(index >= 0 && index<GetItemCount(),"Wrong index for field!");
- T* pT = NULL;
- WrapT aRet(NULL);
- if(SUCCEEDED(pInterface->get_Item(OLEVariant(index), &pT)))
- aRet.setWithOutAddRef(pT);
- return aRet;
- }
-
- inline WrapT GetItem(const OLEVariant& index) const
- {
- T* pT = NULL;
- WrapT aRet(NULL);
- if(SUCCEEDED(pInterface->get_Item(index, &pT)))
- aRet.setWithOutAddRef(pT);
- return aRet;
- }
-
- inline WrapT GetItem(const ::rtl::OUString& sStr) const
- {
- WrapT aRet(NULL);
- T* pT = NULL;
- if (FAILED(pInterface->get_Item(OLEVariant(sStr), &pT)))
- {
-#if OSL_DEBUG_LEVEL > 0
- ::rtl::OString sTemp("Unknown Item: ");
- sTemp += ::rtl::OString(sStr.getStr(),sStr.getLength(),osl_getThreadTextEncoding());
- OSL_FAIL(sTemp);
-#endif
- }
- else
- aRet.setWithOutAddRef(pT);
- return aRet;
- }
- inline void fillElementNames(TStringVector& _rVector)
- {
- if(IsValid())
- {
- Refresh();
- sal_Int32 nCount = GetItemCount();
- _rVector.reserve(nCount);
- for(sal_Int32 i=0;i< nCount;++i)
- {
- WrapT aElement = GetItem(i);
- if(aElement.IsValid())
- _rVector.push_back(aElement.get_Name());
- }
- }
- }
- };
-
- template<class Ts, class T, class WrapT> class WpOLEAppendCollection:
- public WpOLECollection<Ts,T,WrapT>
- {
-
- public:
- // Konstruktoren, operator=
- // diese rufen nur die Oberklasse
- using WpOLEBase<Ts>::pInterface;
- WpOLEAppendCollection(Ts* pInt=NULL):WpOLECollection<Ts,T,WrapT>(pInt){}
- WpOLEAppendCollection(const WpOLEAppendCollection& rhs){ operator=(rhs); }
- inline WpOLEAppendCollection& operator=(const WpOLEAppendCollection& rhs)
- {WpOLEBase<Ts>::operator=(rhs); return *this;};
- //////////////////////////////////////////////////////////////////////
-
- inline sal_Bool Append(const WrapT& aWrapT)
- {
- return SUCCEEDED(pInterface->Append(OLEVariant((T*)aWrapT)));
- };
-
- inline sal_Bool Delete(const ::rtl::OUString& sName)
- {
- return SUCCEEDED(pInterface->Delete(OLEVariant(sName)));
- };
-
-
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_AOLEWRAP_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/Awrapado.hxx b/connectivity/source/inc/ado/Awrapado.hxx
deleted file mode 100644
index 63c6d4ac8e..0000000000
--- a/connectivity/source/inc/ado/Awrapado.hxx
+++ /dev/null
@@ -1,400 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADO_AWRAPADO_HXX_
-#define _CONNECTIVITY_ADO_AWRAPADO_HXX_
-
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-
-// Includes fuer ADO
-#include "ado_pre_sys_include.h"
-#include <oledb.h>
-#include <ocidl.h>
-#include <adoint.h>
-#include "ado_post_sys_include.h"
-#include "ado/adoimp.hxx"
-#include "ado/Aolewrap.hxx"
-#include "ado/Aolevariant.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class WpADOConnection;
- class WpADOCommand;
- class WpADORecordset;
- class WpADOField;
- class WpADOParameter;
- class WpADOError;
- class WpADOProperty;
-
- typedef WpOLEAppendCollection< ADOFields, ADOField, WpADOField> WpADOFields;
- typedef WpOLECollection< ADOProperties, ADOProperty, WpADOProperty> WpADOProperties;
-
- //------------------------------------------------------------------------
- class WpADOConnection : public WpOLEBase<ADOConnection>
- {
- friend class WpADOCommand;
- public:
-
- WpADOConnection(ADOConnection* pInt) : WpOLEBase<ADOConnection>(pInt){}
-
- WpADOConnection(const WpADOConnection& rhs){operator=(rhs);}
-
- WpADOConnection& operator=(const WpADOConnection& rhs)
- {WpOLEBase<ADOConnection>::operator=(rhs); return *this;}
-
- //////////////////////////////////////////////////////////////////////
-
- WpADOProperties get_Properties() const;
-
- rtl::OUString GetConnectionString() const;
- sal_Bool PutConnectionString(const ::rtl::OUString &aCon) const;
- sal_Int32 GetCommandTimeout() const;
- void PutCommandTimeout(sal_Int32 nRet);
- sal_Int32 GetConnectionTimeout() const ;
- void PutConnectionTimeout(sal_Int32 nRet);
-
- sal_Bool Close( ) ;
- sal_Bool Execute(const ::rtl::OUString& _CommandText,OLEVariant& RecordsAffected,long Options, WpADORecordset** ppiRset);
- sal_Bool BeginTrans();
- sal_Bool CommitTrans( ) ;
- sal_Bool RollbackTrans( );
- sal_Bool Open(const ::rtl::OUString& ConnectionString, const ::rtl::OUString& UserID,const ::rtl::OUString& Password,long Options);
- sal_Bool GetErrors(ADOErrors** pErrors);
-
- ::rtl::OUString GetDefaultDatabase() const;
- sal_Bool PutDefaultDatabase(const ::rtl::OUString& _bstr);
-
- IsolationLevelEnum get_IsolationLevel() const ;
- sal_Bool put_IsolationLevel(const IsolationLevelEnum& eNum) ;
-
- sal_Int32 get_Attributes() const;
- sal_Bool put_Attributes(sal_Int32 nRet);
-
- CursorLocationEnum get_CursorLocation() const;
- sal_Bool put_CursorLocation(const CursorLocationEnum &eNum) ;
-
- ConnectModeEnum get_Mode() const;
- sal_Bool put_Mode(const ConnectModeEnum &eNum) ;
-
- ::rtl::OUString get_Provider() const;
- sal_Bool put_Provider(const ::rtl::OUString& _bstr);
-
- sal_Int32 get_State() const;
-
- sal_Bool OpenSchema(SchemaEnum eNum,OLEVariant& Restrictions,OLEVariant& SchemaID,ADORecordset**pprset);
-
- ::rtl::OUString get_Version() const;
-
- // special methods
- ADORecordset* getExportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table );
- ADORecordset* getImportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table );
- ADORecordset* getPrimaryKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table );
- ADORecordset* getIndexInfo( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Bool unique, sal_Bool approximate );
- ADORecordset* getTablePrivileges( const ::com::sun::star::uno::Any& catalog,
- const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern );
- ADORecordset* getCrossReference( const ::com::sun::star::uno::Any& primaryCatalog,
- const ::rtl::OUString& primarySchema,
- const ::rtl::OUString& primaryTable,
- const ::com::sun::star::uno::Any& foreignCatalog,
- const ::rtl::OUString& foreignSchema,
- const ::rtl::OUString& foreignTable);
- ADORecordset* getProcedures( const ::com::sun::star::uno::Any& catalog,
- const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& procedureNamePattern );
- ADORecordset* getProcedureColumns( const ::com::sun::star::uno::Any& catalog,
- const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& procedureNamePattern,
- const ::rtl::OUString& columnNamePattern );
- ADORecordset* getTables( const ::com::sun::star::uno::Any& catalog,
- const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern,
- const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types );
- ADORecordset* getColumns( const ::com::sun::star::uno::Any& catalog,
- const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern,
- const ::rtl::OUString& columnNamePattern );
- ADORecordset* getColumnPrivileges( const ::com::sun::star::uno::Any& catalog,
- const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& table,
- const ::rtl::OUString& columnNamePattern );
- ADORecordset* getTypeInfo(DataTypeEnum _eType = adEmpty );
- };
-
- //------------------------------------------------------------------------
- class WpADOCommand : public WpOLEBase<ADOCommand>
- {
- public:
- WpADOCommand(){}
- // Konstruktoren, operator=
- // diese rufen nur die Oberklasse
- WpADOCommand(ADOCommand* pInt) : WpOLEBase<ADOCommand>(pInt){}
-
- WpADOCommand(const WpADOCommand& rhs){operator=(rhs);}
-
- WpADOCommand& operator=(const WpADOCommand& rhs)
- {
- WpOLEBase<ADOCommand>::operator=(rhs); return *this;}
-
- //////////////////////////////////////////////////////////////////////
-
- sal_Bool putref_ActiveConnection( WpADOConnection *pCon);
-
- void put_ActiveConnection(/* [in] */ const OLEVariant& vConn);
- void Create();
- sal_Int32 get_State() const;
- ::rtl::OUString get_CommandText() const;
- sal_Bool put_CommandText(const ::rtl::OUString &aCon) ;
- sal_Int32 get_CommandTimeout() const;
- void put_CommandTimeout(sal_Int32 nRet);
- sal_Bool get_Prepared() const;
- sal_Bool put_Prepared(VARIANT_BOOL bPrepared) const;
- sal_Bool Execute(OLEVariant& RecordsAffected,OLEVariant& Parameters,long Options, ADORecordset** ppiRset);
- ADOParameter* CreateParameter(const ::rtl::OUString &_bstr,DataTypeEnum Type,ParameterDirectionEnum Direction,long nSize,const OLEVariant &Value);
-
- ADOParameters* get_Parameters() const;
- sal_Bool put_CommandType( /* [in] */ CommandTypeEnum lCmdType);
- CommandTypeEnum get_CommandType( ) const ;
- // gibt den Namen des Feldes zur"ueck
- ::rtl::OUString GetName() const ;
- sal_Bool put_Name(const ::rtl::OUString& _Name);
- sal_Bool Cancel();
- };
- //------------------------------------------------------------------------
- class WpADOError : public WpOLEBase<ADOError>
- {
- public:
-
- // Konstruktoren, operator=
- // diese rufen nur die Oberklasse
-
- WpADOError(ADOError* pInt):WpOLEBase<ADOError>(pInt){}
-
- WpADOError(const WpADOError& rhs){operator=(rhs);}
-
- WpADOError& operator=(const WpADOError& rhs)
- {WpOLEBase<ADOError>::operator=(rhs); return *this;}
-
- //////////////////////////////////////////////////////////////////////
-
- ::rtl::OUString GetDescription() const;
- ::rtl::OUString GetSource() const ;
- sal_Int32 GetNumber() const ;
- ::rtl::OUString GetSQLState() const ;
- sal_Int32 GetNativeError() const ;
- };
-
-
-
- //------------------------------------------------------------------------
- class WpADOField : public WpOLEBase<ADOField>
- {
- // friend class WpADOFields;
- public:
-
- // Konstruktoren, operator=
- // diese rufen nur die Oberklasse
- WpADOField(ADOField* pInt=NULL):WpOLEBase<ADOField>(pInt){}
- WpADOField(const WpADOField& rhs){operator=(rhs);}
-
- WpADOField& operator=(const WpADOField& rhs)
- {WpOLEBase<ADOField>::operator=(rhs); return *this;}
- //////////////////////////////////////////////////////////////////////
-
- WpADOProperties get_Properties();
- sal_Int32 GetActualSize() const ;
- sal_Int32 GetAttributes() const ;
- sal_Int32 GetStatus() const ;
- sal_Int32 GetDefinedSize() const ;
- // gibt den Namen des Feldes zur"ueck
- ::rtl::OUString GetName() const ;
- DataTypeEnum GetADOType() const ;
- void get_Value(OLEVariant& aValVar) const ;
- OLEVariant get_Value() const;
- sal_Bool PutValue(const OLEVariant& aVariant);
- sal_Int32 GetPrecision() const ;
- sal_Int32 GetNumericScale() const ;
- sal_Bool AppendChunk(const OLEVariant& _Variant);
- OLEVariant GetChunk(long Length) const;
- void GetChunk(long Length,OLEVariant &aValVar) const;
- OLEVariant GetOriginalValue() const;
- void GetOriginalValue(OLEVariant &aValVar) const;
- OLEVariant GetUnderlyingValue() const;
-
- void GetUnderlyingValue(OLEVariant &aValVar) const;
-
- sal_Bool PutPrecision(sal_Int8 _prec);
-
- sal_Bool PutNumericScale(sal_Int8 _prec);
-
- void PutADOType(DataTypeEnum eType) ;
-
- sal_Bool PutDefinedSize(sal_Int32 _nDefSize);
-
- sal_Bool PutAttributes(sal_Int32 _nDefSize);
- };
-
-
-
- //------------------------------------------------------------------------
- class WpADOProperty: public WpOLEBase<ADOProperty>
- {
- public:
- // Konstruktoren, operator=
- // diese rufen nur die Oberklasse
- WpADOProperty(ADOProperty* pInt=NULL):WpOLEBase<ADOProperty>(pInt){}
- WpADOProperty(const WpADOProperty& rhs){operator=(rhs);}
- WpADOProperty& operator=(const WpADOProperty& rhs)
- {WpOLEBase<ADOProperty>::operator=(rhs); return *this;}
- //////////////////////////////////////////////////////////////////////
-
- OLEVariant GetValue() const;
- void GetValue(OLEVariant &aValVar) const;
- sal_Bool PutValue(const OLEVariant &aValVar) ;
- ::rtl::OUString GetName() const ;
- DataTypeEnum GetADOType() const ;
- sal_Int32 GetAttributes() const ;
- sal_Bool PutAttributes(sal_Int32 _nDefSize);
- };
-
-
- class WpADORecordset : public WpOLEBase<ADORecordset>
- {
-
- public:
- // Konstruktoren, operator=
- // diese rufen nur die Oberklasse
- WpADORecordset(ADORecordset* pInt=NULL):WpOLEBase<ADORecordset>(pInt){}
- WpADORecordset(const WpADORecordset& rhs){operator=(rhs);}
- WpADORecordset& operator=(const WpADORecordset& rhs)
- {
- WpOLEBase<ADORecordset>::operator=(rhs);
- return *this;
- }
- ~WpADORecordset()
- {
- // if(pInterface && get_State() == adStateOpen)
- // Close();
- }
- //////////////////////////////////////////////////////////////////////
- void Create();
- sal_Bool Open(
- /* [optional][in] */ VARIANT Source,
- /* [optional][in] */ VARIANT ActiveConnection,
- /* [defaultvalue][in] */ CursorTypeEnum CursorType,
- /* [defaultvalue][in] */ LockTypeEnum LockType,
- /* [defaultvalue][in] */ sal_Int32 Options);
- LockTypeEnum GetLockType();
- void Close();
- sal_Bool Cancel() const;
- sal_Int32 get_State( );
- sal_Bool Supports( /* [in] */ CursorOptionEnum CursorOptions);
- PositionEnum_Param get_AbsolutePosition();
- void GetDataSource(IUnknown** pIUnknown) const ;
- void PutRefDataSource(IUnknown* pIUnknown);
- void GetBookmark(VARIANT& var);
- OLEVariant GetBookmark();
- CompareEnum CompareBookmarks(const OLEVariant& left,const OLEVariant& right);
- sal_Bool SetBookmark(const OLEVariant &pSafeAr);
- WpADOFields GetFields() const;
- sal_Bool Move(sal_Int32 nRows, VARIANT aBmk);
- sal_Bool MoveNext();
- sal_Bool MovePrevious();
- sal_Bool MoveFirst();
- sal_Bool MoveLast();
-
- sal_Bool IsAtBOF() const;
- sal_Bool IsAtEOF() const;
- sal_Bool Delete(AffectEnum eNum);
- sal_Bool AddNew(const OLEVariant &FieldList,const OLEVariant &Values);
- sal_Bool Update(const OLEVariant &FieldList,const OLEVariant &Values);
- sal_Bool CancelUpdate();
- WpADOProperties get_Properties() const;
- sal_Bool NextRecordset(OLEVariant& RecordsAffected,ADORecordset** ppiRset);
- sal_Bool get_RecordCount(ADO_LONGPTR &_nRet) const;
- sal_Bool get_MaxRecords(ADO_LONGPTR &_nRet) const;
- sal_Bool put_MaxRecords(ADO_LONGPTR _nRet);
- sal_Bool get_CursorType(CursorTypeEnum &_nRet) const;
- sal_Bool put_CursorType(CursorTypeEnum _nRet);
- sal_Bool get_LockType(LockTypeEnum &_nRet) const;
- sal_Bool put_LockType(LockTypeEnum _nRet);
- sal_Bool get_CacheSize(sal_Int32 &_nRet) const;
- sal_Bool put_CacheSize(sal_Int32 _nRet);
- sal_Bool UpdateBatch(AffectEnum AffectRecords);
- };
-
- //------------------------------------------------------------------------
- class WpADOParameter:public WpOLEBase<ADOParameter>
- {
- public:
- // Konstruktoren, operator=
- // diese rufen nur die Oberklasse
- WpADOParameter(ADOParameter* pInt):WpOLEBase<ADOParameter>(pInt){}
- WpADOParameter(const WpADOParameter& rhs):WpOLEBase<ADOParameter>(rhs){}
- WpADOParameter& operator=(const WpADOParameter& rhs)
- {WpOLEBase<ADOParameter>::operator=(rhs); return *this;}
- //////////////////////////////////////////////////////////////////////
-
- ::rtl::OUString GetName() const ;
- DataTypeEnum GetADOType() const ;
- void put_Type(const DataTypeEnum& _eType);
- sal_Bool put_Size(const sal_Int32& _nSize);
- sal_Int32 GetAttributes() const ;
- sal_Int32 GetPrecision() const ;
- sal_Int32 GetNumericScale() const ;
- ParameterDirectionEnum get_Direction() const;
- void GetValue(OLEVariant& aValVar) const ;
- OLEVariant GetValue() const;
- sal_Bool PutValue(const OLEVariant& aVariant);
- sal_Bool AppendChunk(const OLEVariant& aVariant);
- };
-
- class OTools
- {
- public:
- /** putValue set the property value at the ado column
- @param _rProps the properties where to set
- @param _aPosition which property to set
- @param _aValVar the value to set
- */
- static void putValue(const WpADOProperties& _rProps,const OLEVariant &_aPosition,const OLEVariant &_aValVar);
-
- /** getValue returns a specific property value
- @param _rProps the properties where to set
- @param _aPosition the property
-
- @return the property value
- */
- static OLEVariant getValue(const WpADOProperties& _rProps,const OLEVariant &_aPosition);
- };
- }
-}
-#endif //_CONNECTIVITY_ADO_AWRAPADO_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/Awrapadox.hxx b/connectivity/source/inc/ado/Awrapadox.hxx
deleted file mode 100644
index aaab885eca..0000000000
--- a/connectivity/source/inc/ado/Awrapadox.hxx
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ADO_AWRAPADOX_HXX_
-#define _CONNECTIVITY_ADO_AWRAPADOX_HXX_
-
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-
-#ifndef __User_FWD_DEFINED__
-#define __User_FWD_DEFINED__
-typedef struct _ADOUser User;
-#endif /* __User_FWD_DEFINED__ */
-
-#ifndef __Group_FWD_DEFINED__
-#define __Group_FWD_DEFINED__
-typedef struct _ADOGroup Group;
-#endif /* __Group_FWD_DEFINED__ */
-
-#ifndef __Column_FWD_DEFINED__
-#define __Column_FWD_DEFINED__
-typedef struct _ADOColumn Column;
-#endif /* __Column_FWD_DEFINED__ */
-
-#ifndef __Index_FWD_DEFINED__
-#define __Index_FWD_DEFINED__
-typedef struct _ADOIndex Index;
-#endif /* __cplusplus */
-
-#ifndef __Key_FWD_DEFINED__
-#define __Key_FWD_DEFINED__
-typedef struct _ADOKey Key;
-#endif /* __Key_FWD_DEFINED__ */
-
-#ifndef __Table_FWD_DEFINED__
-#define __Table_FWD_DEFINED__
-typedef struct _ADOTable Table;
-#endif /* __Table_FWD_DEFINED__ */
-
-
-#include "ado_pre_sys_include.h"
-#include <adoint.h>
-#include <adoctint.h>
-#include "ado_post_sys_include.h"
-
-
-#include "ado/Aolewrap.hxx"
-#include "ado/Aolevariant.hxx"
-#include "ado/adoimp.hxx"
-#include "ado/Awrapado.hxx"
-#include "ado/WrapColumn.hxx"
-#include "ado/WrapIndex.hxx"
-#include "ado/WrapKey.hxx"
-#include "ado/WrapTable.hxx"
-#include "ado/WrapCatalog.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class WpADOView : public WpOLEBase<ADOView>
- {
- public:
- WpADOView(ADOView* pInt=NULL) : WpOLEBase<ADOView>(pInt){}
- WpADOView(const WpADOView& rhs){operator=(rhs);}
-
- inline WpADOView& operator=(const WpADOView& rhs)
- {WpOLEBase<ADOView>::operator=(rhs); return *this;}
-
- ::rtl::OUString get_Name() const;
- void get_Command(OLEVariant& _rVar) const;
- void put_Command(OLEVariant& _rVar);
- };
-
- class WpADOGroup : public WpOLEBase<ADOGroup>
- {
- public:
- WpADOGroup(ADOGroup* pInt=NULL) : WpOLEBase<ADOGroup>(pInt){}
- WpADOGroup(const WpADOGroup& rhs){operator=(rhs);}
-
- inline WpADOGroup& operator=(const WpADOGroup& rhs)
- {WpOLEBase<ADOGroup>::operator=(rhs); return *this;}
-
- void Create();
-
- ::rtl::OUString get_Name() const;
- void put_Name(const ::rtl::OUString& _rName);
- RightsEnum GetPermissions(
- /* [in] */ const OLEVariant& Name,
- /* [in] */ ObjectTypeEnum ObjectType);
- sal_Bool SetPermissions(
- /* [in] */ const OLEVariant& Name,
- /* [in] */ ObjectTypeEnum ObjectType,
- /* [in] */ ActionEnum Action,
- /* [in] */ RightsEnum Rights);
- WpADOUsers get_Users( );
- };
-
- class WpADOUser : public WpOLEBase<_ADOUser>
- {
- public:
- WpADOUser(_ADOUser* pInt=NULL) : WpOLEBase<_ADOUser>(pInt){}
- WpADOUser(const WpADOUser& rhs){operator=(rhs);}
-
- inline WpADOUser& operator=(const WpADOUser& rhs)
- {WpOLEBase<_ADOUser>::operator=(rhs); return *this;}
-
- void Create();
-
- ::rtl::OUString get_Name() const;
- void put_Name(const ::rtl::OUString& _rName);
- sal_Bool ChangePassword(const ::rtl::OUString& _rPwd,const ::rtl::OUString& _rNewPwd);
- WpADOGroups get_Groups();
- RightsEnum GetPermissions(
- /* [in] */ const OLEVariant& Name,
- /* [in] */ ObjectTypeEnum ObjectType);
- sal_Bool SetPermissions(
- /* [in] */ const OLEVariant& Name,
- /* [in] */ ObjectTypeEnum ObjectType,
- /* [in] */ ActionEnum Action,
- /* [in] */ RightsEnum Rights);
- };
- }
-}
-#endif // _CONNECTIVITY_ADO_AWRAPADOX_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/WrapCatalog.hxx b/connectivity/source/inc/ado/WrapCatalog.hxx
deleted file mode 100644
index 1cc25e25bd..0000000000
--- a/connectivity/source/inc/ado/WrapCatalog.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_ADO_WRAP_CATALOG_HXX
-#define CONNECTIVITY_ADO_WRAP_CATALOG_HXX
-
-#include "ado/WrapTypeDefs.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class WpADOCatalog : public WpOLEBase<_ADOCatalog>
- {
- public:
- WpADOCatalog(_ADOCatalog* pInt = NULL) : WpOLEBase<_ADOCatalog>(pInt){}
- WpADOCatalog(const WpADOCatalog& rhs){operator=(rhs);}
-
- inline WpADOCatalog& operator=(const WpADOCatalog& rhs)
- {WpOLEBase<_ADOCatalog>::operator=(rhs); return *this;}
-
- ::rtl::OUString GetObjectOwner(const ::rtl::OUString& _rName, ObjectTypeEnum _eNum);
-
- void putref_ActiveConnection(IDispatch* pCon);
- WpADOTables get_Tables();
- WpADOViews get_Views();
- WpADOGroups get_Groups();
- WpADOUsers get_Users();
- ADOProcedures* get_Procedures();
- void Create();
- };
- }
-}
-
-#endif //CONNECTIVITY_ADO_WRAP_CATALOG_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/WrapColumn.hxx b/connectivity/source/inc/ado/WrapColumn.hxx
deleted file mode 100644
index 4245ef5b31..0000000000
--- a/connectivity/source/inc/ado/WrapColumn.hxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_ADO_WRAP_COLUMN_HXX
-#define CONNECTIVITY_ADO_WRAP_COLUMN_HXX
-
-#include "ado/Aolewrap.hxx"
-
-#include "ado_pre_sys_include.h"
-#include <adoint.h>
-#include "ado_post_sys_include.h"
-
-namespace connectivity
-{
- namespace ado
- {
- class WpADOColumn : public WpOLEBase<_ADOColumn>
- {
- public:
- WpADOColumn(_ADOColumn* pInt=NULL) : WpOLEBase<_ADOColumn>(pInt){}
- WpADOColumn(const WpADOColumn& rhs){operator=(rhs);}
-
- void Create();
-
- inline WpADOColumn& operator=(const WpADOColumn& rhs)
- {WpOLEBase<_ADOColumn>::operator=(rhs); return *this;}
-
- ::rtl::OUString get_Name() const;
- ::rtl::OUString get_RelatedColumn() const;
- void put_Name(const ::rtl::OUString& _rName);
- void put_RelatedColumn(const ::rtl::OUString& _rName);
- DataTypeEnum get_Type() const;
- void put_Type(const DataTypeEnum& _eNum) ;
- sal_Int32 get_Precision() const;
- void put_Precision(sal_Int32 _nPre) ;
- sal_uInt8 get_NumericScale() const;
- void put_NumericScale(sal_Int8 _nScale);
- SortOrderEnum get_SortOrder() const;
- void put_SortOrder(SortOrderEnum _nScale);
- sal_Int32 get_DefinedSize() const;
- ColumnAttributesEnum get_Attributes() const;
- sal_Bool put_Attributes(const ColumnAttributesEnum& _eNum);
- WpADOProperties get_Properties() const;
- void put_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject);
- };
- }
-}
-
-#endif //CONNECTIVITY_ADO_WRAP_COLUMN_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/WrapIndex.hxx b/connectivity/source/inc/ado/WrapIndex.hxx
deleted file mode 100644
index 1847adfeae..0000000000
--- a/connectivity/source/inc/ado/WrapIndex.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_ADO_WRAP_INDEX_HXX
-#define CONNECTIVITY_ADO_WRAP_INDEX_HXX
-
-#include "ado/WrapTypeDefs.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class WpADOIndex : public WpOLEBase<_ADOIndex>
- {
- public:
- WpADOIndex(_ADOIndex* pInt=NULL) : WpOLEBase<_ADOIndex>(pInt){}
- WpADOIndex(const WpADOIndex& rhs){operator=(rhs);}
-
- inline WpADOIndex& operator=(const WpADOIndex& rhs)
- {WpOLEBase<_ADOIndex>::operator=(rhs); return *this;}
-
- void Create();
-
- ::rtl::OUString get_Name() const;
- void put_Name(const ::rtl::OUString& _rName);
- sal_Bool get_Clustered() const;
- void put_Clustered(sal_Bool _b);
- sal_Bool get_Unique() const;
- void put_Unique(sal_Bool _b);
- sal_Bool get_PrimaryKey() const;
- void put_PrimaryKey(sal_Bool _b);
- WpADOColumns get_Columns() const;
- };
- }
-}
-
-#endif //CONNECTIVITY_ADO_WRAP_INDEX_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/WrapKey.hxx b/connectivity/source/inc/ado/WrapKey.hxx
deleted file mode 100644
index 50b70954e4..0000000000
--- a/connectivity/source/inc/ado/WrapKey.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_ADO_WRAP_KEY_HXX
-#define CONNECTIVITY_ADO_WRAP_KEY_HXX
-
-#include "ado/WrapTypeDefs.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class WpADOKey : public WpOLEBase<ADOKey>
- {
- public:
- WpADOKey(ADOKey* pInt=NULL) : WpOLEBase<ADOKey>(pInt){}
- WpADOKey(const WpADOKey& rhs){operator=(rhs);}
-
- inline WpADOKey& operator=(const WpADOKey& rhs)
- {WpOLEBase<ADOKey>::operator=(rhs); return *this;}
-
- void Create();
-
- ::rtl::OUString get_Name() const;
- void put_Name(const ::rtl::OUString& _rName);
- KeyTypeEnum get_Type() const;
- void put_Type(const KeyTypeEnum& _eNum) ;
- ::rtl::OUString get_RelatedTable() const;
- void put_RelatedTable(const ::rtl::OUString& _rName);
- RuleEnum get_DeleteRule() const;
- void put_DeleteRule(const RuleEnum& _eNum) ;
- RuleEnum get_UpdateRule() const;
- void put_UpdateRule(const RuleEnum& _eNum) ;
- WpADOColumns get_Columns() const;
- };
- }
-}
-
-#endif //CONNECTIVITY_ADO_WRAP_KEY_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/WrapTable.hxx b/connectivity/source/inc/ado/WrapTable.hxx
deleted file mode 100644
index 7c94004230..0000000000
--- a/connectivity/source/inc/ado/WrapTable.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_ADO_WRAP_TABLE_HXX
-#define CONNECTIVITY_ADO_WRAP_TABLE_HXX
-
-#include "ado/WrapTypeDefs.hxx"
-
-namespace connectivity
-{
- namespace ado
- {
- class WpADOCatalog;
-
- class WpADOTable : public WpOLEBase<_ADOTable>
- {
- public:
- WpADOTable(_ADOTable* pInt=NULL) : WpOLEBase<_ADOTable>(pInt){}
- WpADOTable(const WpADOTable& rhs){operator=(rhs);}
-
- inline WpADOTable& operator=(const WpADOTable& rhs)
- {WpOLEBase<_ADOTable>::operator=(rhs); return *this;}
-
- void Create();
-
- ::rtl::OUString get_Name() const;
- void put_Name(const ::rtl::OUString& _rName);
- ::rtl::OUString get_Type() const;
- WpADOColumns get_Columns() const;
- WpADOIndexes get_Indexes() const;
- WpADOKeys get_Keys() const;
- WpADOCatalog get_ParentCatalog() const;
- WpADOProperties get_Properties() const;
- void putref_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject);
- };
-
-
- typedef WpOLEAppendCollection<ADOTables, _ADOTable, WpADOTable> WpADOTables;
- }
-}
-
-#endif //CONNECTIVITY_ADO_WRAP_TABLE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/WrapTypeDefs.hxx b/connectivity/source/inc/ado/WrapTypeDefs.hxx
deleted file mode 100644
index c96bcebc69..0000000000
--- a/connectivity/source/inc/ado/WrapTypeDefs.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_ADO_WRAP_TYPEDEFS_HXX
-#define CONNECTIVITY_ADO_WRAP_TYPEDEFS_HXX
-
-
-namespace connectivity
-{
- namespace ado
- {
- class WpADOTable;
- class WpADOKey;
- class WpADOIndex;
- class WpADOColumn;
- class WpADOGroup;
- class WpADOView;
- class WpADOUser;
-
- typedef WpOLEAppendCollection<ADOTables, _ADOTable, WpADOTable> WpADOTables;
- typedef WpOLEAppendCollection<ADOKeys, ADOKey, WpADOKey> WpADOKeys;
- typedef WpOLEAppendCollection<ADOIndexes, _ADOIndex, WpADOIndex> WpADOIndexes;
- typedef WpOLEAppendCollection<ADOColumns, _ADOColumn, WpADOColumn> WpADOColumns;
- typedef WpOLEAppendCollection<ADOGroups, ADOGroup, WpADOGroup> WpADOGroups;
- typedef WpOLEAppendCollection<ADOViews, ADOView, WpADOView> WpADOViews;
- typedef WpOLEAppendCollection<ADOUsers, _ADOUser, WpADOUser> WpADOUsers;
- }
-}
-
-#endif //CONNECTIVITY_ADO_WRAP_TYPEDEFS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/adoimp.hxx b/connectivity/source/inc/ado/adoimp.hxx
deleted file mode 100644
index 8744c61414..0000000000
--- a/connectivity/source/inc/ado/adoimp.hxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ADO_ADOIMP_HXX_
-#define _CONNECTIVITY_ADO_ADOIMP_HXX_
-
-#include <com/sun/star/sdbc/SQLException.hpp>
-
-#include "ado_pre_sys_include.h"
-#include <adoctint.h>
-#include "ado_post_sys_include.h"
-
-struct ADOConnection;
-enum DataTypeEnum;
-namespace connectivity
-{
- namespace ado
- {
-
- class WpADOField;
- class OLEString;
- class ADOS
- {
- public:
- // Auch hier: BSTR mit SysFreeString() freigeben!
- static OLEString& GetKeyStr();
-
- static const CLSID CLSID_ADOCATALOG_25;
- static const IID IID_ADOCATALOG_25;
-
- static const CLSID CLSID_ADOCONNECTION_21;
- static const IID IID_ADOCONNECTION_21;
-
- static const CLSID CLSID_ADOCOMMAND_21;
- static const IID IID_ADOCOMMAND_21;
-
- static const CLSID CLSID_ADORECORDSET_21;
- static const IID IID_ADORECORDSET_21;
-
- static const CLSID CLSID_ADOINDEX_25;
- static const IID IID_ADOINDEX_25;
-
- static const CLSID CLSID_ADOCOLUMN_25;
- static const IID IID_ADOCOLUMN_25;
-
- static const CLSID CLSID_ADOKEY_25;
- static const IID IID_ADOKEY_25;
-
- static const CLSID CLSID_ADOTABLE_25;
- static const IID IID_ADOTABLE_25;
-
- static const CLSID CLSID_ADOGROUP_25;
- static const IID IID_ADOGROUP_25;
-
- static const CLSID CLSID_ADOUSER_25;
- static const IID IID_ADOUSER_25;
-
- static const CLSID CLSID_ADOVIEW_25;
- static const IID IID_ADOVIEW_25;
-
- static void ThrowException(ADOConnection* _pAdoCon,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- static sal_Int32 MapADOType2Jdbc(DataTypeEnum eType);
- static DataTypeEnum MapJdbc2ADOType(sal_Int32 _nType,sal_Int32 _nJetEngine);
- static sal_Bool isJetEngine(sal_Int32 _nEngineType);
-
- static ObjectTypeEnum mapObjectType2Ado(sal_Int32 objType);
- static sal_Int32 mapAdoType2Object(ObjectTypeEnum objType);
- static sal_Int32 mapAdoRights2Sdbc(RightsEnum eRights);
- static sal_Int32 mapRights2Ado(sal_Int32 nRights);
-
- static WpADOField getField(ADORecordset* _pRecordSet,sal_Int32 _nColumnIndex) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-
-
- }
-}
-
-#define ADO_PROP(ItemName) \
- WpADOProperty aProp(aProps.GetItem(ItemName)); \
- OLEVariant aVar; \
- if(aProp.IsValid()) \
- aVar = aProp.GetValue(); \
- else \
- ADOS::ThrowException(*m_pADOConnection,*this);
-
-
-#endif //_CONNECTIVITY_ADO_ADOIMP_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/calc/CCatalog.hxx b/connectivity/source/inc/calc/CCatalog.hxx
deleted file mode 100644
index d5b21d3e6a..0000000000
--- a/connectivity/source/inc/calc/CCatalog.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_CALC_CATALOG_HXX_
-#define _CONNECTIVITY_CALC_CATALOG_HXX_
-
-#include "file/FCatalog.hxx"
-
-namespace connectivity
-{
- namespace calc
- {
- class OCalcConnection;
- class OCalcCatalog : public file::OFileCatalog
- {
- public:
- virtual void refreshTables();
-
- public:
- OCalcCatalog(OCalcConnection* _pCon);
- };
- }
-}
-
-#endif // _CONNECTIVITY_CALC_CATALOG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/calc/CColumns.hxx b/connectivity/source/inc/calc/CColumns.hxx
deleted file mode 100644
index 73e83f518c..0000000000
--- a/connectivity/source/inc/calc/CColumns.hxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_CALC_COLUMNS_HXX_
-#define _CONNECTIVITY_CALC_COLUMNS_HXX_
-
-#include "file/FColumns.hxx"
-
-namespace connectivity
-{
- namespace calc
- {
- class OCalcColumns : public file::OColumns
- {
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- public:
- OCalcColumns(file::OFileTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector
- ) : file::OColumns(_pTable,_rMutex,_rVector)
- {}
-
- };
- }
-}
-
-#endif // _CONNECTIVITY_CALC_COLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/calc/CConnection.hxx b/connectivity/source/inc/calc/CConnection.hxx
deleted file mode 100644
index 94391b98a5..0000000000
--- a/connectivity/source/inc/calc/CConnection.hxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_CALC_CONNECTION_HXX_
-#define _CONNECTIVITY_CALC_CONNECTION_HXX_
-
-#include "file/FConnection.hxx"
-
-namespace com { namespace sun { namespace star { namespace sheet {
- class XSpreadsheetDocument;
-} } } }
-
-
-namespace connectivity
-{
- namespace calc
- {
- class ODriver;
- class OCalcConnection : public file::OConnection
- {
- // the spreadsheet document:
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument > m_xDoc;
- ::rtl::OUString m_sPassword;
- String m_aFileName;
- oslInterlockedCount m_nDocCount;
-
- public:
- OCalcConnection(ODriver* _pDriver);
- virtual ~OCalcConnection();
-
- virtual void construct(const ::rtl::OUString& _rUrl,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo )
- throw( ::com::sun::star::sdbc::SQLException);
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // no interface methods
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument> acquireDoc();
- void releaseDoc();
-
- class ODocHolder
- {
- OCalcConnection* m_pConnection;
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument> m_xDoc;
- public:
- ODocHolder(OCalcConnection* _pConnection) : m_pConnection(_pConnection)
- {
- m_xDoc = m_pConnection->acquireDoc();
- }
- ~ODocHolder()
- {
- m_xDoc.clear();
- m_pConnection->releaseDoc();
- }
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument> getDoc() const { return m_xDoc; }
- };
- };
- }
-}
-
-#endif // _CONNECTIVITY_CALC_CONNECTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/calc/CDatabaseMetaData.hxx b/connectivity/source/inc/calc/CDatabaseMetaData.hxx
deleted file mode 100644
index 93e706d9aa..0000000000
--- a/connectivity/source/inc/calc/CDatabaseMetaData.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_CALC_DATABASEMETADATA_HXX_
-#define _CONNECTIVITY_CALC_DATABASEMETADATA_HXX_
-
-#include "file/FDatabaseMetaData.hxx"
-
-namespace connectivity
-{
- namespace calc
- {
- //**************************************************************
- //************ Class: java.sql.DatabaseMetaDataDate
- //**************************************************************
-
- class OCalcDatabaseMetaData : public file::ODatabaseMetaData
- {
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw();
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTables( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- protected:
- virtual ~OCalcDatabaseMetaData();
- public:
- OCalcDatabaseMetaData(file::OConnection* _pCon);
- };
- }
-}
-
-#endif // _CONNECTIVITY_CALC_DATABASEMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/calc/CDriver.hxx b/connectivity/source/inc/calc/CDriver.hxx
deleted file mode 100644
index c88cf742b6..0000000000
--- a/connectivity/source/inc/calc/CDriver.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_CALC_DRIVER_HXX_
-#define _CONNECTIVITY_CALC_DRIVER_HXX_
-
-#include "file/FDriver.hxx"
-
-namespace connectivity
-{
- namespace calc
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
- ODriver_CreateInstance(const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory)
- throw( ::com::sun::star::uno::Exception );
-
- class ODriver : public file::OFileDriver
- {
- public:
- ODriver(const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) :
- file::OFileDriver(_rxFactory){}
-
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL
- connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue >& info )
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url )
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-
-#endif //_CONNECTIVITY_CALC_DRIVER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/calc/CPreparedStatement.hxx b/connectivity/source/inc/calc/CPreparedStatement.hxx
deleted file mode 100644
index 7166b7ff5f..0000000000
--- a/connectivity/source/inc/calc/CPreparedStatement.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_CALC_PREPAREDSTATEMENT_HXX_
-#define _CONNECTIVITY_CALC_PREPAREDSTATEMENT_HXX_
-
-#include "file/FPreparedStatement.hxx"
-
-namespace connectivity
-{
- namespace calc
- {
- class OConnection;
- class OCalcPreparedStatement : public file::OPreparedStatement
- {
- protected:
- virtual file::OResultSet* createResultSet();
- public:
- OCalcPreparedStatement( file::OConnection* _pConnection) : file::OPreparedStatement( _pConnection){}
- DECLARE_SERVICE_INFO();
- };
- }
-}
-
-#endif //_CONNECTIVITY_CALC_PREPAREDSTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/calc/CResultSet.hxx b/connectivity/source/inc/calc/CResultSet.hxx
deleted file mode 100644
index 171069a014..0000000000
--- a/connectivity/source/inc/calc/CResultSet.hxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_CALC_RESULTSET_HXX_
-#define _CONNECTIVITY_CALC_RESULTSET_HXX_
-
-#include "file/FResultSet.hxx"
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
-#include <com/sun/star/sdbcx/XDeleteRows.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-namespace connectivity
-{
- namespace calc
- {
- class OCalcResultSet;
- // these typedef's are only necessary for the compiler
- typedef ::cppu::ImplHelper2< ::com::sun::star::sdbcx::XRowLocate,
- ::com::sun::star::sdbcx::XDeleteRows> OCalcResultSet_BASE;
- typedef file::OResultSet OCalcResultSet_BASE2;
- typedef ::comphelper::OPropertyArrayUsageHelper<OCalcResultSet> OCalcResultSet_BASE3;
-
-
- class OCalcResultSet : public OCalcResultSet_BASE2,
- public OCalcResultSet_BASE,
- public OCalcResultSet_BASE3
- {
- sal_Bool m_bBookmarkable;
- protected:
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- virtual sal_Bool fillIndexValues(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> &_xIndex);
- public:
- DECLARE_SERVICE_INFO();
-
- OCalcResultSet( file::OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator);
-
- private:
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XRowLocate
- virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XDeleteRows
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool isRowDeleted() const { return sal_False; }
-
- };
- }
-}
-
-#endif //_CONNECTIVITY_CALC_RESULTSET_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/calc/CStatement.hxx b/connectivity/source/inc/calc/CStatement.hxx
deleted file mode 100644
index d919c457e9..0000000000
--- a/connectivity/source/inc/calc/CStatement.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_CALC_STATEMENT_HXX_
-#define _CONNECTIVITY_CALC_STATEMENT_HXX_
-
-#include "file/FStatement.hxx"
-
-namespace connectivity
-{
- namespace calc
- {
- class OConnection;
- class OCalcStatement : public file::OStatement
- {
- protected:
- virtual file::OResultSet* createResultSet();
- public:
- OCalcStatement( file::OConnection* _pConnection) : file::OStatement( _pConnection){}
- DECLARE_SERVICE_INFO();
- };
- }
-}
-
-#endif //_CONNECTIVITY_CALC_STATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/calc/CTable.hxx b/connectivity/source/inc/calc/CTable.hxx
deleted file mode 100644
index 8e907b6d37..0000000000
--- a/connectivity/source/inc/calc/CTable.hxx
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_CALC_TABLE_HXX_
-#define _CONNECTIVITY_CALC_TABLE_HXX_
-
-#include "file/FTable.hxx"
-#include <tools/date.hxx>
-
-namespace com { namespace sun { namespace star { namespace sheet {
- class XSpreadsheet;
- class XSpreadsheetDocument;
-} } } }
-
-namespace com { namespace sun { namespace star { namespace util {
- class XNumberFormats;
-} } } }
-
-
-namespace connectivity
-{
- namespace calc
- {
- typedef file::OFileTable OCalcTable_BASE;
- class OCalcConnection;
-
- typedef ::std::map< ::rtl::OUString,
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed>,
- comphelper::UStringMixLess > OContainer;
-
- class OCalcTable : public OCalcTable_BASE
- {
- private:
- ::std::vector<sal_Int32> m_aTypes; // holds all type for columns just to avoid to ask the propertyset
- ::std::vector<sal_Int32> m_aPrecisions; // same as aboth
- ::std::vector<sal_Int32> m_aScales;
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > m_xSheet;
- OCalcConnection* m_pConnection;
- sal_Int32 m_nStartCol;
- sal_Int32 m_nStartRow;
- sal_Int32 m_nDataCols;
- sal_Int32 m_nDataRows;
- sal_Bool m_bHasHeaders;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > m_xFormats;
- ::Date m_aNullDate;
-
- void fillColumns();
-
- protected:
- virtual void FileClose();
- public:
- virtual void refreshColumns();
- virtual void refreshIndexes();
-
- public:
- OCalcTable( sdbcx::OCollection* _pTables,OCalcConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description = ::rtl::OUString(),
- const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
- const ::rtl::OUString& _CatalogName = ::rtl::OUString()
- );
-
- virtual sal_Int32 getCurrentLastPos() const;
- virtual sal_Bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos);
- virtual sal_Bool fetchRow(OValueRefRow& _rRow,const OSQLColumns& _rCols, sal_Bool _bUseTableDefs,sal_Bool bRetrieveData);
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL disposing(void);
-
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- void construct();
- };
- }
-}
-
-#endif // _CONNECTIVITY_CALC_TABLE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/calc/CTables.hxx b/connectivity/source/inc/calc/CTables.hxx
deleted file mode 100644
index 5ba872b98c..0000000000
--- a/connectivity/source/inc/calc/CTables.hxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_CALC_TABLES_HXX_
-#define _CONNECTIVITY_CALC_TABLES_HXX_
-
-#include "file/FTables.hxx"
-
-namespace connectivity
-{
- namespace calc
- {
- typedef file::OTables OCalcTables_BASE;
-
- class OCalcTables : public OCalcTables_BASE
- {
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- public:
- OCalcTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : OCalcTables_BASE(_rMetaData,_rParent,_rMutex,_rVector)
- {}
- };
- }
-}
-
-#endif // _CONNECTIVITY_CALC_TABLES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DCatalog.hxx b/connectivity/source/inc/dbase/DCatalog.hxx
deleted file mode 100644
index 6814277ba0..0000000000
--- a/connectivity/source/inc/dbase/DCatalog.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_CATALOG_HXX_
-#define _CONNECTIVITY_DBASE_CATALOG_HXX_
-
-#include "file/FCatalog.hxx"
-
-namespace connectivity
-{
- namespace dbase
- {
- class ODbaseConnection;
- class ODbaseCatalog : public file::OFileCatalog
- {
- public:
- virtual void refreshTables();
-
- public:
- ODbaseCatalog(ODbaseConnection* _pCon);
- };
- }
-}
-#endif // _CONNECTIVITY_DBASE_CATALOG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DCode.hxx b/connectivity/source/inc/dbase/DCode.hxx
deleted file mode 100644
index c5a0d66790..0000000000
--- a/connectivity/source/inc/dbase/DCode.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_DBASE_DCODE_HXX
-#define CONNECTIVITY_DBASE_DCODE_HXX
-
-#include "file/fanalyzer.hxx"
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include "file/fcode.hxx"
-
-namespace connectivity
-{
- namespace file
- {
- class OConnection;
- }
- namespace dbase
- {
- class OFILEAnalyzer : public file::OSQLAnalyzer
- {
- public:
- OFILEAnalyzer(file::OConnection* _pConnection) : file::OSQLAnalyzer(_pConnection){}
- virtual file::OOperandAttr* createOperandAttr(sal_Int32 _nPos,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xCol,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _xIndexes=NULL);
- };
-
- // Attribute aus einer Ergebniszeile
- class OFILEOperandAttr : public file::OOperandAttr
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xIndex;
- public:
- OFILEOperandAttr(sal_uInt16 _nPos,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _xIndexes=NULL);
-
- virtual sal_Bool isIndexed() const;
- virtual file::OEvaluateSet* preProcess(file::OBoolOperator* pOp, file::OOperand* pRight = 0);
- TYPEINFO();
- };
- }
-}
-
-#endif // CONNECTIVITY_DBASE_DCODE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DColumns.hxx b/connectivity/source/inc/dbase/DColumns.hxx
deleted file mode 100644
index 1595441002..0000000000
--- a/connectivity/source/inc/dbase/DColumns.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_COLUMNS_HXX_
-#define _CONNECTIVITY_DBASE_COLUMNS_HXX_
-
-#include "file/FColumns.hxx"
-
-namespace connectivity
-{
- namespace dbase
- {
- class ODbaseColumns : public file::OColumns
- {
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- ODbaseColumns(file::OFileTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector
- ) : file::OColumns(_pTable,_rMutex,_rVector)
- {}
- };
- }
-}
-#endif // _CONNECTIVITY_DBASE_COLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DConnection.hxx b/connectivity/source/inc/dbase/DConnection.hxx
deleted file mode 100644
index 97c1ca32f0..0000000000
--- a/connectivity/source/inc/dbase/DConnection.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_DCONNECTION_HXX_
-#define _CONNECTIVITY_DBASE_DCONNECTION_HXX_
-
-#include "file/FConnection.hxx"
-
-namespace connectivity
-{
- namespace dbase
- {
- class ODriver;
- typedef file::OConnection ODbaseConnection_Base;
- class ODbaseConnection : public ODbaseConnection_Base
- {
- protected:
- virtual ~ODbaseConnection();
- public:
- ODbaseConnection(ODriver* _pDriver);
- // XServiceInfo
- DECLARE_SERVICE_INFO();
-
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_DBASE_DCONNECTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DDatabaseMetaData.hxx b/connectivity/source/inc/dbase/DDatabaseMetaData.hxx
deleted file mode 100644
index 1c661bcecc..0000000000
--- a/connectivity/source/inc/dbase/DDatabaseMetaData.hxx
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_ODATABASEMETADATA_HXX_
-#define _CONNECTIVITY_DBASE_ODATABASEMETADATA_HXX_
-
-#include "file/FDatabaseMetaData.hxx"
-
-namespace connectivity
-{
- namespace dbase
- {
- //**************************************************************
- //************ Class: java.sql.DatabaseMetaDataDate
- //**************************************************************
-
- class ODbaseDatabaseMetaData : public file::ODatabaseMetaData
- {
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw();
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getIndexInfo( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Bool unique, sal_Bool approximate ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL supportsAlterTableWithAddColumn( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsAlterTableWithDropColumn( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool impl_storesMixedCaseQuotedIdentifiers_throw( );
- virtual sal_Bool impl_supportsMixedCaseQuotedIdentifiers_throw( );
- protected:
- virtual ~ODbaseDatabaseMetaData();
- public:
- ODbaseDatabaseMetaData(file::OConnection* _pCon);
- };
- }
-}
-#endif // _CONNECTIVITY_DBASE_ODATABASEMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DDatabaseMetaDataResultSet.hxx b/connectivity/source/inc/dbase/DDatabaseMetaDataResultSet.hxx
deleted file mode 100644
index b7e76b3622..0000000000
--- a/connectivity/source/inc/dbase/DDatabaseMetaDataResultSet.hxx
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_ADATABASEMETADATARESULTSET_HXX_
-#define _CONNECTIVITY_FILE_ADATABASEMETADATARESULTSET_HXX_
-
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <cppuhelper/compbase7.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include "file/FStatement.hxx"
-#include "connectivity/CommonTools.hxx"
-#include <comphelper/propertycontainer.hxx>
-
-namespace connectivity
-{
- namespace file
- {
- namespace ::com::sun::star::sdbc = ::com::sun::star::sdbc;
- namespace ::com::sun::star::beans = ::com::sun::star::beans;
- namespace ::com::sun::star::util = ::com::sun::star::util;
-
- class ODatabaseMetaDataResultSetMetaData;
- typedef ::cppu::WeakComponentImplHelper7< ::com::sun::star::sdbc::XResultSet,
- ::com::sun::star::sdbc::XRow,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XColumnLocate> ODatabaseMetaDataResultSet_BASE;
-
- DECLARE_STL_VECTOR(::com::sun::star::uno::Any,ORow);
- DECLARE_STL_VECTOR(ORow, ORows);
-
- class ODatabaseMetaDataResultSet : public comphelper::OBaseMutex,
- public ODatabaseMetaDataResultSet_BASE,
- public ::comphelper::OPropertyContainer,
- public ::comphelper::OPropertyArrayUsageHelper<ODatabaseMetaDataResultSet>
- {
-
-
- ORows m_aRows;
- ORowsIterator m_aRowsIter;
- ::com::sun::star::uno::WeakReferenceHelper
- m_aStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData>
- m_xMetaData;
- sal_Int32 m_nRowPos;
- sal_Int32 m_nColPos;
-
- sal_Int32 m_nFetchSize;
- sal_Int32 m_nResultSetType;
- sal_Int32 m_nFetchDirection;
- sal_Int32 m_nResultSetConcurrency;
-
- sal_Bool m_bWasNull;
- sal_Bool m_bBOF;
-
- void construct();
-
- protected:
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- virtual ~ODatabaseMetaDataResultSet();
- public:
- DECLARE_CTY_DEFAULTS(ODatabaseMetaDataResultSet_BASE);
- // a Constructor, that is needed for when Returning the Object is needed:
- ODatabaseMetaDataResultSet( );
-
-
- void setRows(const ORows& _rRows) { m_aRows = _rRows; }
-
- void setCatalogsMap();
- void setSchemasMap();
- void setColumnPrivilegesMap();
- void setColumnsMap();
- void setTablesMap();
- void setTableTypes();
- void setProcedureColumnsMap();
- void setProceduresMap();
- void setExportedKeysMap();
- void setImportedKeysMap();
- void setPrimaryKeysMap();
- void setIndexInfoMap();
- void setTablePrivilegesMap();
- void setCrossReferenceMap();
- void setTypeInfoMap();
-
- private:
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
- {
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
- }
- // XResultSet
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XColumnLocate
- virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-
-}
-#endif // _CONNECTIVITY_FILE_ADATABASEMETADATARESULTSET_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DDatabaseMetaDataResultSetMetaData.hxx b/connectivity/source/inc/dbase/DDatabaseMetaDataResultSetMetaData.hxx
deleted file mode 100644
index fb990b1190..0000000000
--- a/connectivity/source/inc/dbase/DDatabaseMetaDataResultSetMetaData.hxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_ADATABASEMETADATARESULTSETMETADATA_HXX_
-#define _CONNECTIVITY_FILE_ADATABASEMETADATARESULTSETMETADATA_HXX_
-
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-#ifndef _VECTOR_
-#include <vector>
-#endif
-#include "FDatabaseMetaDataResultSet.hxx"
-#include "OColumn.hxx"
-
-namespace connectivity
-{
- namespace file
- {
- //**************************************************************
- //************ Class: ResultSetMetaData
- //**************************************************************
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> ODatabaseMetaResultSetMetaData_BASE;
-
- class ODatabaseMetaDataResultSetMetaData : public ODatabaseMetaResultSetMetaData_BASE
- {
- friend class ODatabaseMetaDataResultSet;
-
- ::std::vector<sal_Int32> m_vMapping; // when not every column is needed
- ::std::map<sal_Int32,connectivity::OColumn> m_mColumns;
- ::std::map<sal_Int32,connectivity::OColumn>::const_iterator m_mColumnsIter;
-
- sal_Int32 m_nColCount;
-
- protected:
- void setColumnPrivilegesMap();
- void setColumnsMap();
- void setTablesMap();
- void setProcedureColumnsMap();
- void setPrimaryKeysMap();
- void setIndexInfoMap();
- void setTablePrivilegesMap();
- void setCrossReferenceMap();
- void setTypeInfoMap();
- void setProceduresMap();
- void setTableTypes();
- public:
- // a Constructor, that is needed for when Returning the Object is needed:
- ODatabaseMetaDataResultSetMetaData( ODatabaseMetaDataResultSet* _pRes)
- : m_nColCount(0)
- {
- }
- ~ODatabaseMetaDataResultSetMetaData();
-
- /// Avoid ambigous cast error from the compiler.
- inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
- { return this; }
-
- virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_FILE_ADATABASEMETARESULTSETMETADATA_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DDriver.hxx b/connectivity/source/inc/dbase/DDriver.hxx
deleted file mode 100644
index a4ac77d24a..0000000000
--- a/connectivity/source/inc/dbase/DDriver.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_DDRIVER_HXX_
-#define _CONNECTIVITY_DBASE_DDRIVER_HXX_
-
-#include <cppuhelper/compbase2.hxx>
-#include "connectivity/CommonTools.hxx"
-#include "file/FDriver.hxx"
-
-namespace connectivity
-{
- namespace dbase
- {
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ODriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
-
- class ODriver : public file::OFileDriver
- {
- public:
- ODriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) : file::OFileDriver(_rxFactory){}
-
- // XInterface
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- // static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-
-}
-#endif //_CONNECTIVITY_DBASE_DDRIVER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DIndex.hxx b/connectivity/source/inc/dbase/DIndex.hxx
deleted file mode 100644
index 0576e84085..0000000000
--- a/connectivity/source/inc/dbase/DIndex.hxx
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_INDEX_HXX_
-#define _CONNECTIVITY_DBASE_INDEX_HXX_
-
-#include "connectivity/sdbcx/VIndex.hxx"
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include "dbase/DTable.hxx"
-#include "dbase/dindexnode.hxx"
-
-#define dBASE_III_GROUP "dBase III"
-
-namespace connectivity
-{
- namespace dbase
- {
- class OIndexIterator;
- class ONDXKey;
-
- typedef sdbcx::OIndex ODbaseIndex_BASE;
- typedef file::OBoolOperator OBoolOperator_BASE;
- typedef file::OOperand OOperand_BASE;
-
- class ODbaseIndex : public ODbaseIndex_BASE
- {
- friend SvStream& operator << (SvStream &rStream, ODbaseIndex&);
- friend SvStream& operator >> (SvStream &rStream, ODbaseIndex&);
-
- friend class ONDXNode;
- friend class ONDXPage;
- friend class ONDXPagePtr;
- friend class OIndexIterator;
-
- public:
- //==================================================================
- // Kopfsatz-Struktur, verbleibt im Speicher
- //==================================================================
- struct NDXHeader
- {
- sal_uInt32 db_rootpage; /* Position der Rootpage */
- sal_uInt32 db_pagecount; /* Anzahl Pages */
- sal_uInt8 db_frei[4]; /* reserviert */
- sal_uInt16 db_keylen; /* Laenge des Schluessels */
- sal_uInt16 db_maxkeys; /* Max. # keys pro Seite */
- sal_uInt16 db_keytype; /* Art des Schluessels
- (0-Text)
- (1-Numerisch) */
- sal_uInt16 db_keyrec; /* Laenge eines IndexSatzes
- SatzNr + keylen */
- sal_uInt8 db_frei1[3]; /* reserviert */
- sal_uInt8 db_unique; /* eindeutig */
- char db_name[488]; /* index_name (Feldname) */
- };
-
- private:
- SvStream* m_pFileStream; // Stream zum Lesen/Schreiben des Index
- NDXHeader m_aHeader;
- ONDXPageList m_aCollector; // Pool von nicht mehr benoetigten Seiten
- ONDXPagePtr m_aRoot, // Wurzel des b+ Baums
- m_aCurLeaf; // aktuelles Blatt
- sal_uInt16 m_nCurNode; // Position des aktuellen Knoten
-
- sal_uInt32 m_nPageCount,
- m_nRootPage;
-
- ODbaseTable* m_pTable;
- sal_Bool m_bUseCollector : 1; // Verwenden des GarbageCollectors
-
- ::rtl::OUString getCompletePath();
- void closeImpl();
- /* closes and kill the index file and throws an error.
- */
- void impl_killFileAndthrowError_throw(sal_uInt16 _nErrorId,const ::rtl::OUString& _sFile);
- protected:
- virtual ~ODbaseIndex();
- public:
- ODbaseIndex(ODbaseTable* _pTable);
- ODbaseIndex(ODbaseTable* _pTable,const NDXHeader& _aHeader,const ::rtl::OUString& _Name);
-
- sal_Bool openIndexFile();
- virtual void refreshColumns();
-
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(com::sun::star::uno::RuntimeException);
- static com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- const ODbaseTable* getTable() const { return m_pTable; }
- const NDXHeader& getHeader() const { return m_aHeader; }
- virtual OIndexIterator* createIterator(OBoolOperator_BASE* pOp,
- const OOperand_BASE* pOperand = NULL);
-
- void SetRootPos(sal_uInt32 nPos) {m_nRootPage = nPos;}
- void SetPageCount(sal_uInt32 nCount) {m_nPageCount = nCount;}
-
- sal_uInt32 GetRootPos() {return m_nRootPage;}
- sal_uInt32 GetPageCount() {return m_nPageCount;}
-
- sal_Bool IsText() const {return m_aHeader.db_keytype == 0;}
- sal_uInt16 GetMaxNodes() const {return m_aHeader.db_maxkeys;}
-
- virtual sal_Bool Insert(sal_uInt32 nRec, const ORowSetValue& rValue);
- virtual sal_Bool Update(sal_uInt32 nRec, const ORowSetValue&, const ORowSetValue&);
- virtual sal_Bool Delete(sal_uInt32 nRec, const ORowSetValue& rValue);
- virtual sal_Bool Find(sal_uInt32 nRec, const ORowSetValue& rValue);
-
- void createINFEntry();
- sal_Bool CreateImpl();
- sal_Bool DropImpl();
-
- DECLARE_SERVICE_INFO();
- protected:
-
- ONDXPage* CreatePage(sal_uInt32 nPagePos, ONDXPage* pParent = NULL, sal_Bool bLoad = sal_False);
- void Collect(ONDXPage*);
- ONDXPagePtr getRoot();
-
- sal_Bool isUnique() const { return m_IsUnique; }
- sal_Bool UseCollector() const {return m_bUseCollector;}
- // Tree operationen
- void Insert(ONDXPagePtr aCurPage, ONDXNode& rNode);
- void Release(sal_Bool bSave = sal_True);
- sal_Bool ConvertToKey(ONDXKey* rKey, sal_uInt32 nRec, const ORowSetValue& rValue);
- };
-
- SvStream& operator << (SvStream &rStream, ODbaseIndex&);
- SvStream& operator >> (SvStream &rStream, ODbaseIndex&);
- }
-}
-
-#endif // _CONNECTIVITY_DBASE_INDEX_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DIndexColumns.hxx b/connectivity/source/inc/dbase/DIndexColumns.hxx
deleted file mode 100644
index 247c878580..0000000000
--- a/connectivity/source/inc/dbase/DIndexColumns.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_INDEXCOLUMNS_HXX_
-#define _CONNECTIVITY_DBASE_INDEXCOLUMNS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "dbase/DIndex.hxx"
-#include "dbase/DTable.hxx"
-
-namespace connectivity
-{
- namespace dbase
- {
- class ODbaseIndexColumns : public sdbcx::OCollection
- {
- ODbaseIndex* m_pIndex;
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- public:
- ODbaseIndexColumns( ODbaseIndex* _pIndex,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector)
- : sdbcx::OCollection(*_pIndex,_pIndex->getTable()->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
- , m_pIndex(_pIndex)
- {}
-
- };
- }
-}
-#endif // _CONNECTIVITY_DBASE_INDEXCOLUMNS_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DIndexIter.hxx b/connectivity/source/inc/dbase/DIndexIter.hxx
deleted file mode 100644
index 81ff212d4d..0000000000
--- a/connectivity/source/inc/dbase/DIndexIter.hxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_INDEXITER_HXX_
-#define _CONNECTIVITY_DBASE_INDEXITER_HXX_
-
-#include "file/fcode.hxx"
-#include "dbase/DIndex.hxx"
-#include "dbase/dindexnode.hxx"
-
-namespace connectivity
-{
- namespace dbase
- {
- //==================================================================
- // IndexIterator
- //==================================================================
- class OIndexIterator
- {
- protected:
- file::OBoolOperator* m_pOperator;
- const file::OOperand* m_pOperand;
- ODbaseIndex* m_pIndex;
- ONDXPagePtr m_aRoot,
- m_aCurLeaf;
- sal_uInt16 m_nCurNode;
-
- protected:
- sal_uIntPtr Find(sal_Bool bFirst);
- sal_uIntPtr GetCompare(sal_Bool bFirst);
- sal_uIntPtr GetLike(sal_Bool bFirst);
- sal_uIntPtr GetNull(sal_Bool bFirst);
- sal_uIntPtr GetNotNull(sal_Bool bFirst);
-
- ONDXKey* GetFirstKey(ONDXPage* pPage,
- const file::OOperand& rKey);
- ONDXKey* GetNextKey();
- ODbaseIndex* GetIndex() const {return m_pIndex;}
-
-
- public:
- OIndexIterator(ODbaseIndex* pInd,
- file::OBoolOperator* pOp,
- const file::OOperand* pOper)
- :m_pOperator(pOp)
- ,m_pOperand(pOper)
- ,m_pIndex(pInd)
- ,m_nCurNode(NODE_NOTFOUND)
- {
- pInd->acquire();
- }
-
- virtual ~OIndexIterator();
- sal_uIntPtr First();
- sal_uIntPtr Next();
-
- };
- }
-}
-#endif // _CONNECTIVITY_DBASE_INDEXITER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DIndexPage.hxx b/connectivity/source/inc/dbase/DIndexPage.hxx
deleted file mode 100644
index 2e693765ca..0000000000
--- a/connectivity/source/inc/dbase/DIndexPage.hxx
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_INDEXPAGE_HXX_
-#define _CONNECTIVITY_DBASE_INDEXPAGE_HXX_
-
-#include <rtl/ref.hxx>
-#include <tools/stream.hxx>
-#include <vector>
-
-#endif // _CONNECTIVITY_DBASE_INDEXPAGE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DIndexes.hxx b/connectivity/source/inc/dbase/DIndexes.hxx
deleted file mode 100644
index c29130d840..0000000000
--- a/connectivity/source/inc/dbase/DIndexes.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_INDEXES_HXX_
-#define _CONNECTIVITY_DBASE_INDEXES_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "dbase/DTable.hxx"
-
-namespace connectivity
-{
- namespace dbase
- {
- class ODbaseTable;
-
- typedef sdbcx::OCollection ODbaseIndexes_BASE;
-
- class ODbaseIndexes : public ODbaseIndexes_BASE
- {
- ODbaseTable* m_pTable;
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- ODbaseIndexes(ODbaseTable* _pTable, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : ODbaseIndexes_BASE(*_pTable,_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
- , m_pTable(_pTable)
- {}
-
- };
- }
-}
-#endif // _CONNECTIVITY_DBASE_INDEXES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DPreparedStatement.hxx b/connectivity/source/inc/dbase/DPreparedStatement.hxx
deleted file mode 100644
index beaec2e58e..0000000000
--- a/connectivity/source/inc/dbase/DPreparedStatement.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_DPREPAREDSTATEMENT_HXX_
-#define _CONNECTIVITY_DBASE_DPREPAREDSTATEMENT_HXX_
-
-#include "file/FPreparedStatement.hxx"
-
-namespace connectivity
-{
- namespace dbase
- {
- class OConnection;
- class ODbasePreparedStatement : public file::OPreparedStatement
- {
- protected:
- virtual file::OResultSet* createResultSet();
- public:
- ODbasePreparedStatement( file::OConnection* _pConnection) : file::OPreparedStatement( _pConnection){}
- DECLARE_SERVICE_INFO();
- };
- }
-}
-
-#endif //_CONNECTIVITY_DBASE_DPREPAREDSTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DResultSet.hxx b/connectivity/source/inc/dbase/DResultSet.hxx
deleted file mode 100644
index 9b2837916c..0000000000
--- a/connectivity/source/inc/dbase/DResultSet.hxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_DBASE_DRESULTSET_HXX_
-#define _CONNECTIVITY_DBASE_DRESULTSET_HXX_
-
-#include "file/FResultSet.hxx"
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
-#include <com/sun/star/sdbcx/XDeleteRows.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-namespace connectivity
-{
- namespace dbase
- {
- class ODbaseResultSet;
- // these typedef's are only necessary for the compiler
- typedef ::cppu::ImplHelper2< ::com::sun::star::sdbcx::XRowLocate,
- ::com::sun::star::sdbcx::XDeleteRows> ODbaseResultSet_BASE;
- typedef file::OResultSet ODbaseResultSet_BASE2;
- typedef ::comphelper::OPropertyArrayUsageHelper<ODbaseResultSet> ODbaseResultSet_BASE3;
-
-
- class ODbaseResultSet : public ODbaseResultSet_BASE2,
- public ODbaseResultSet_BASE,
- public ODbaseResultSet_BASE3
- {
- sal_Bool m_bBookmarkable;
- protected:
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- virtual sal_Bool fillIndexValues(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> &_xIndex);
- virtual file::OSQLAnalyzer* createAnalyzer();
- public:
- DECLARE_SERVICE_INFO();
-
- ODbaseResultSet( file::OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator);
-
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XRowLocate
- virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XDeleteRows
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // own methods
- sal_Int32 getCurrentFilePos() const;
-
- };
- }
-}
-#endif //_CONNECTIVITY_DBASE_DRESULTSET_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DStatement.hxx b/connectivity/source/inc/dbase/DStatement.hxx
deleted file mode 100644
index edb8c0310c..0000000000
--- a/connectivity/source/inc/dbase/DStatement.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_DSTATEMENT_HXX_
-#define _CONNECTIVITY_DBASE_DSTATEMENT_HXX_
-
-#include "file/FStatement.hxx"
-
-namespace connectivity
-{
- namespace dbase
- {
- class OConnection;
- class ODbaseStatement : public file::OStatement
- {
- protected:
- virtual file::OResultSet* createResultSet();
- public:
- ODbaseStatement( file::OConnection* _pConnection) : file::OStatement( _pConnection){}
- DECLARE_SERVICE_INFO();
- };
- }
-}
-
-#endif //_CONNECTIVITY_DBASE_DSTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DTable.hxx b/connectivity/source/inc/dbase/DTable.hxx
deleted file mode 100644
index 7f5e59bf6c..0000000000
--- a/connectivity/source/inc/dbase/DTable.hxx
+++ /dev/null
@@ -1,187 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_TABLE_HXX_
-#define _CONNECTIVITY_DBASE_TABLE_HXX_
-
-#include "file/FTable.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "connectivity/CommonTools.hxx"
-#include <tools/urlobj.hxx>
-
-
-namespace connectivity
-{
- namespace dbase
- {
- typedef file::OFileTable ODbaseTable_BASE;
- class ODbaseConnection;
-
- typedef ::std::map< ::rtl::OUString,
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed>, comphelper::UStringMixLess > OContainer;
-
- class ODbaseTable : public ODbaseTable_BASE
- {
- // der Typ einer dBase datei wird mit dem ersten Byte bestimmt
- public:
- enum DBFType { dBaseIII = 0x03,
- dBaseIV = 0x04,
- dBaseV = 0x05,
- VisualFoxPro = 0x30,
- VisualFoxProAuto = 0x31, // Visual FoxPro w. AutoIncrement field
- dBaseFS = 0x43,
- dBaseFSMemo = 0xB3,
- dBaseIIIMemo = 0x83,
- dBaseIVMemo = 0x8B,
- dBaseIVMemoSQL = 0x8E,
- FoxProMemo = 0xF5
- };
- enum DBFMemoType { MemodBaseIII = 0,
- MemodBaseIV,
- MemoFoxPro
- };
-
- private:
- struct DBFHeader { /* Kopfsatz-Struktur */
- DBFType db_typ; /* Dateityp */
- sal_uInt8 db_aedat[3]; /* Datum der letzen Aenderung */
- /* JJ MM TT */
- sal_uInt32 db_anz; /* Anzahl der Saetze */
- sal_uInt16 db_kopf; /* laenge Kopfsatz-Struktur */
- sal_uInt16 db_slng; /* laenge der Daten-Saetze */
- sal_uInt8 db_frei[20]; /* reserviert */
- };
- struct DBFColumn { /* Feldbezeichner */
- sal_uInt8 db_fnm[11]; /* Feldname */
- sal_uInt8 db_typ; /* Feldtyp */
- sal_uInt32 db_adr; /* Feldadresse */
- sal_uInt8 db_flng; /* Feldlaenge */
- sal_uInt8 db_dez; /* Dezimalstellen fuer N */
- sal_uInt8 db_frei2[14]; /* reserviert */
- };
- struct DBFMemoHeader
- {
- DBFMemoType db_typ; /* Dateityp */
- sal_uInt32 db_next; /* naechster freier Block */
- sal_uInt16 db_size; /* Blockgroesse: dBase 3 fest */
- };
-
- ::std::vector<sal_Int32> m_aTypes; // holds all type for columns just to avoid to ask the propertyset
- ::std::vector<sal_Int32> m_aPrecisions; // same as aboth
- ::std::vector<sal_Int32> m_aScales;
- ::std::vector<sal_Int32> m_aRealFieldLengths;
- DBFHeader m_aHeader;
- DBFMemoHeader m_aMemoHeader;
- SvStream* m_pMemoStream;
- rtl_TextEncoding m_eEncoding;
- sal_Bool m_bWriteableMemo;
-
- void alterColumn(sal_Int32 index,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& descriptor ,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XDataDescriptorFactory>& xOldColumn );
- void readHeader();
- void fillColumns();
- String createTempFile();
- void copyData(ODbaseTable* _pNewTable,sal_Int32 _nPos);
- sal_Bool CreateFile(const INetURLObject& aFile, sal_Bool& bCreateMemo);
- sal_Bool CreateMemoFile(const INetURLObject& aFile);
- sal_Bool HasMemoFields() const { return m_aHeader.db_typ > dBaseIV;}
- sal_Bool ReadMemoHeader();
- sal_Bool ReadMemo(sal_uIntPtr nBlockNo, ORowSetValue& aVariable);
-
- sal_Bool WriteMemo(ORowSetValue& aVariable, sal_uIntPtr& rBlockNr);
- sal_Bool WriteBuffer();
- sal_Bool UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xCols);
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> isUniqueByColumnName(sal_Int32 _nColumnPos);
- void AllocBuffer();
-
- void throwInvalidDbaseFormat();
- void SAL_CALL renameImpl( const ::rtl::OUString& newName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
- void throwInvalidColumnType(const sal_uInt16 _nErrorId,const ::rtl::OUString& _sColumnName);
-
- protected:
- virtual void FileClose();
-// using ::connectivity::sdbcx::OTableDescriptor_BASE::rBHelper;
-
- public:
- virtual void refreshColumns();
- virtual void refreshIndexes();
-
- public:
- ODbaseTable( sdbcx::OCollection* _pTables,ODbaseConnection* _pConnection);
- ODbaseTable( sdbcx::OCollection* _pTables,ODbaseConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description = ::rtl::OUString(),
- const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
- const ::rtl::OUString& _CatalogName = ::rtl::OUString()
- );
-
- void construct(); // can throw any exception
-
- virtual sal_Int32 getCurrentLastPos() const;
- virtual sal_Bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos);
- virtual sal_Bool fetchRow(OValueRefRow& _rRow,const OSQLColumns& _rCols, sal_Bool _bUseTableDefs,sal_Bool bRetrieveData);
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL disposing(void);
-
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
- // XAlterTable
- virtual void SAL_CALL alterColumnByName( const ::rtl::OUString& colName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL alterColumnByIndex( sal_Int32 index, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- // XRename
- virtual void SAL_CALL rename( const ::rtl::OUString& newName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
-
- sal_Bool DropImpl();
- sal_Bool CreateImpl();
-
-
- virtual sal_Bool InsertRow(OValueRefVector& rRow, sal_Bool bFlush,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xCols);
- virtual sal_Bool DeleteRow(const OSQLColumns& _rCols);
- virtual sal_Bool UpdateRow(OValueRefVector& rRow, OValueRefRow& pOrgRow,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xCols);
-
- virtual void addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& descriptor);
- virtual void dropColumn(sal_Int32 _nPos);
-
- static String getEntry(file::OConnection* _pConnection,const ::rtl::OUString& _sURL );
- static sal_Bool Drop_Static(const ::rtl::OUString& _sUrl,sal_Bool _bHasMemoFields,sdbcx::OCollection* _pIndexes );
-
- virtual void refreshHeader();
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> getMetaData() const;
- };
- }
-}
-#endif // _CONNECTIVITY_DBASE_TABLE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/DTables.hxx b/connectivity/source/inc/dbase/DTables.hxx
deleted file mode 100644
index 29f10222d9..0000000000
--- a/connectivity/source/inc/dbase/DTables.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DBASE_TABLES_HXX_
-#define _CONNECTIVITY_DBASE_TABLES_HXX_
-
-#include "file/FTables.hxx"
-
-namespace connectivity
-{
- namespace dbase
- {
- // namespace ::com::sun::star::sdbcx = ::com::sun::star::sdbcx;
- typedef file::OTables ODbaseTables_BASE;
-
- class ODbaseTables : public ODbaseTables_BASE
- {
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- ODbaseTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : ODbaseTables_BASE(_rMetaData,_rParent,_rMutex,_rVector)
- {}
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_DBASE_TABLES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/dbase/dindexnode.hxx b/connectivity/source/inc/dbase/dindexnode.hxx
deleted file mode 100644
index af5284ca28..0000000000
--- a/connectivity/source/inc/dbase/dindexnode.hxx
+++ /dev/null
@@ -1,349 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_DBASE_INDEXNODE_HXX_
-#define _CONNECTIVITY_DBASE_INDEXNODE_HXX_
-
-#include "file/fcode.hxx"
-#include "file/FTable.hxx"
-#include "dbase/DIndexPage.hxx"
-#include "connectivity/FValue.hxx"
-#include <tools/ref.hxx>
-
-#define NODE_NOTFOUND 0xFFFF
-#define PAGE_SIZE 512
-
-namespace connectivity
-{
- namespace dbase
- {
-
- class ONDXNode;
- class ODbaseIndex;
- //==================================================================
- // Index Key
- //==================================================================
- typedef file::OOperand ONDXKey_BASE;
- class ONDXKey : public ONDXKey_BASE
- {
- friend class ONDXNode;
- sal_uInt32 nRecord; /* Satzzeiger */
- ORowSetValue xValue; /* Schluesselwert */
-
- public:
- ONDXKey(sal_uInt32 nRec=0);
- ONDXKey(const ORowSetValue& rVal, sal_Int32 eType, sal_uInt32 nRec);
- ONDXKey(const rtl::OUString& aStr, sal_uInt32 nRec = 0);
- ONDXKey(double aVal, sal_uInt32 nRec = 0);
-
- inline ONDXKey(const ONDXKey& rKey);
-
- inline ONDXKey& operator= (const ONDXKey& rKey);
- virtual void setValue(const ORowSetValue& _rVal);
-
- virtual const ORowSetValue& getValue() const;
-
- sal_uInt32 GetRecord() const { return nRecord; }
- void setRecord(sal_uInt32 _nRec) { nRecord = _nRec; }
- void ResetRecord() { nRecord = 0; }
-
- sal_Bool operator == (const ONDXKey& rKey) const;
- sal_Bool operator != (const ONDXKey& rKey) const;
- sal_Bool operator < (const ONDXKey& rKey) const;
- sal_Bool operator <= (const ONDXKey& rKey) const;
- sal_Bool operator > (const ONDXKey& rKey) const;
- sal_Bool operator >= (const ONDXKey& rKey) const;
-
- sal_Bool Load (SvFileStream& rStream, sal_Bool bText);
- sal_Bool Write(SvFileStream& rStream, sal_Bool bText);
-
- static sal_Bool IsText(sal_Int32 eType);
-
- private:
- StringCompare Compare(const ONDXKey& rKey) const;
- };
-
-
-
-
- //==================================================================
- // Index Seitenverweis
- //==================================================================
- SV_DECL_REF(ONDXPage) // Basisklasse da weitere Informationen gehalten werden muessen
-
-
- class ONDXPagePtr : public ONDXPageRef
- {
- friend SvStream& operator << (SvStream &rStream, const ONDXPagePtr&);
- friend SvStream& operator >> (SvStream &rStream, ONDXPagePtr&);
-
- sal_uInt32 nPagePos; // Position in der Indexdatei
-
- public:
- ONDXPagePtr(sal_uInt32 nPos = 0):nPagePos(nPos){}
- ONDXPagePtr(const ONDXPagePtr& rRef);
- ONDXPagePtr(ONDXPage* pRefPage);
-
- ONDXPagePtr& operator=(const ONDXPagePtr& rRef);
- ONDXPagePtr& operator=(ONDXPage* pPageRef);
-
- sal_uInt32 GetPagePos() const {return nPagePos;}
- sal_Bool HasPage() const {return nPagePos != 0;}
- // sal_Bool Is() const { return isValid(); }
- };
- //==================================================================
- // Index Seite
- //==================================================================
- class ONDXPage : public SvRefBase
- {
- friend class ODbaseIndex;
-
- friend SvStream& operator << (SvStream &rStream, const ONDXPage&);
- friend SvStream& operator >> (SvStream &rStream, ONDXPage&);
-
- sal_uInt32 nPagePos; // Position in der Indexdatei
- sal_Bool bModified : 1;
- sal_uInt16 nCount;
-
- ONDXPagePtr aParent, // VaterSeite
- aChild; // Zeiger auf rechte ChildPage
- ODbaseIndex& rIndex;
- ONDXNode* ppNodes; // array von Knoten
-
- public:
- // Knoten Operationen
- sal_uInt16 Count() const {return nCount;}
-
- sal_Bool Insert(ONDXNode& rNode, sal_uInt32 nRowsLeft = 0);
- sal_Bool Insert(sal_uInt16 nIndex, ONDXNode& rNode);
- sal_Bool Append(ONDXNode& rNode);
- sal_Bool Delete(sal_uInt16);
- void Remove(sal_uInt16);
- void Release(sal_Bool bSave = sal_True);
- void ReleaseFull(sal_Bool bSave = sal_True);
-
- // Aufteilen und Zerlegen
- ONDXNode Split(ONDXPage& rPage);
- void Merge(sal_uInt16 nParentNodePos, ONDXPagePtr xPage);
-
- // Zugriffsoperationen
- ONDXNode& operator[] (sal_uInt16 nPos);
- const ONDXNode& operator[] (sal_uInt16 nPos) const;
-
- sal_Bool IsRoot() const;
- sal_Bool IsLeaf() const;
- sal_Bool IsModified() const;
- sal_Bool HasParent();
- sal_Bool HasChild() const;
-
- sal_Bool IsFull() const;
-
- sal_uInt32 GetPagePos() const {return nPagePos;}
- ONDXPagePtr& GetChild(ODbaseIndex* pIndex = 0);
-
- // Parent braucht nicht nachgeladen zu werden
- ONDXPagePtr GetParent();
- ODbaseIndex& GetIndex() {return rIndex;}
- const ODbaseIndex& GetIndex() const {return rIndex;}
-
- // Setzen des Childs, ueber Referenz, um die PagePos zu erhalten
- void SetChild(ONDXPagePtr aCh);
- void SetParent(ONDXPagePtr aPa);
-
- sal_uInt16 Search(const ONDXKey& rSearch);
- sal_uInt16 Search(const ONDXPage* pPage);
- void SearchAndReplace(const ONDXKey& rSearch, ONDXKey& rReplace);
-
- protected:
- ONDXPage(ODbaseIndex& rIndex, sal_uInt32 nPos, ONDXPage* = NULL);
- ~ONDXPage();
-
- virtual void QueryDelete();
-
- void SetModified(sal_Bool bMod) {bModified = bMod;}
- void SetPagePos(sal_uInt32 nPage) {nPagePos = nPage;}
-
- sal_Bool Find(const ONDXKey&); // rek. Abstieg
- sal_uInt16 FindPos(const ONDXKey& rKey) const;
-
-#if OSL_DEBUG_LEVEL > 1
- void PrintPage();
-#endif
- };
-
- SV_IMPL_REF(ONDXPage);
-
- SvStream& operator << (SvStream &rStream, const ONDXPagePtr&);
- SvStream& operator >> (SvStream &rStream, ONDXPagePtr&);
-
- inline sal_Bool ONDXPage::IsRoot() const {return !aParent.Is();}
- inline sal_Bool ONDXPage::IsLeaf() const {return !aChild.HasPage();}
- inline sal_Bool ONDXPage::IsModified() const {return bModified;}
- inline sal_Bool ONDXPage::HasParent() {return aParent.Is();}
- inline sal_Bool ONDXPage::HasChild() const {return aChild.HasPage();}
- inline ONDXPagePtr ONDXPage::GetParent() {return aParent;}
-
- inline void ONDXPage::SetParent(ONDXPagePtr aPa = ONDXPagePtr())
- {
- aParent = aPa;
- }
-
- inline void ONDXPage::SetChild(ONDXPagePtr aCh = ONDXPagePtr())
- {
- aChild = aCh;
- if (aChild.Is())
- aChild->SetParent(this);
- }
- SvStream& operator >> (SvStream &rStream, ONDXPage& rPage);
- SvStream& operator << (SvStream &rStream, const ONDXPage& rPage);
-
-
- typedef ::std::vector<ONDXPage*> ONDXPageList;
-
- //==================================================================
- // Index Knoten
- //==================================================================
- class ONDXNode
- {
- friend class ONDXPage;
- ONDXPagePtr aChild; /* naechster Seitenverweis */
- ONDXKey aKey;
-
- public:
- ONDXNode(){}
- ONDXNode(const ONDXKey& rKey,
- ONDXPagePtr aPagePtr = ONDXPagePtr())
- :aChild(aPagePtr),aKey(rKey) {}
-
- // verweist der Knoten auf eine Seite
- sal_Bool HasChild() const {return aChild.HasPage();}
- // Ist ein Index angegeben, kann gegebenfalls die Seite nachgeladen werden
- ONDXPagePtr& GetChild(ODbaseIndex* pIndex = NULL, ONDXPage* = NULL);
-
- const ONDXKey& GetKey() const { return aKey;}
- ONDXKey& GetKey() { return aKey;}
-
- // Setzen des Childs, ueber Referenz, um die PagePos zu erhalten
- void SetChild(ONDXPagePtr aCh = ONDXPagePtr(), ONDXPage* = NULL);
- void SetKey(ONDXKey& rKey) {aKey = rKey;}
-
- void Write(SvStream &rStream, const ONDXPage& rPage) const;
- void Read(SvStream &rStream, ODbaseIndex&);
- };
- //==================================================================
- // inline implementation
- //==================================================================
-// inline ONDXKey::ONDXKey(const ORowSetValue& rVal, sal_Int32 eType, sal_uInt32 nRec)
-// : ONDXKey_BASE(eType)
-// , nRecord(nRec),xValue(rVal)
-// {
-// }
-
-
-// inline ONDXKey::ONDXKey(const rtl::OUString& aStr, sal_uInt32 nRec)
-// : ONDXKey_BASE(::com::sun::star::sdbc::DataType::VARCHAR)
-// ,nRecord(nRec)
-// {
-// if (aStr.len())
-// xValue = aStr;
-// }
-
-// inline ONDXKey::ONDXKey(double aVal, sal_uInt32 nRec)
-// : ONDXKey_BASE(::com::sun::star::sdbc::DataType::DOUBLE)
-// ,nRecord(nRec)
-// ,xValue(aVal)
-// {
-// }
-
-// inline ONDXKey::ONDXKey(sal_uInt32 nRec)
-// :nRecord(nRec)
-// {
-// }
-
- inline ONDXKey::ONDXKey(const ONDXKey& rKey)
- : ONDXKey_BASE(rKey.getDBType())
- ,nRecord(rKey.nRecord)
- ,xValue(rKey.xValue)
- {
- }
-
- inline ONDXKey& ONDXKey::operator=(const ONDXKey& rKey)
- {
- if(&rKey == this)
- return *this;
-
- xValue = rKey.xValue;
- nRecord = rKey.nRecord;
- m_eDBType = rKey.getDBType();
- return *this;
- }
-
- inline sal_Bool ONDXKey::operator == (const ONDXKey& rKey) const
- {
- if(&rKey == this)
- return sal_True;
- return Compare(rKey) == COMPARE_EQUAL;
- }
- inline sal_Bool ONDXKey::operator != (const ONDXKey& rKey) const
- {
- return !operator== (rKey);
- }
- inline sal_Bool ONDXKey::operator < (const ONDXKey& rKey) const
- {
- return Compare(rKey) == COMPARE_LESS;
- }
- inline sal_Bool ONDXKey::operator > (const ONDXKey& rKey) const
- {
- return Compare(rKey) == COMPARE_GREATER;
- }
- inline sal_Bool ONDXKey::operator <= (const ONDXKey& rKey) const
- {
- return !operator > (rKey);
- }
- inline sal_Bool ONDXKey::operator >= (const ONDXKey& rKey) const
- {
- return !operator< (rKey);
- }
-
- inline void ONDXNode::SetChild(ONDXPagePtr aCh, ONDXPage* pParent)
- {
- aChild = aCh;
- if (aChild.Is())
- aChild->SetParent(pParent);
- }
-
- }
-
-}
-
-
-
-
-#endif // _CONNECTIVITY_DBASE_INDEXNODE_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/diagnose_ex.h b/connectivity/source/inc/diagnose_ex.h
deleted file mode 100755
index 5ce8b47b78..0000000000
--- a/connectivity/source/inc/diagnose_ex.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_DIAGNOSE_EX_H
-#define CONNECTIVITY_DIAGNOSE_EX_H
-
-#if OSL_DEBUG_LEVEL > 0
- #define OSL_VERIFY_RES( expression, fail_message ) \
- OSL_ENSURE( expression, fail_message )
- #define OSL_VERIFY_EQUALS( expression, compare, fail_message ) \
- OSL_ENSURE( expression == compare, fail_message )
-#else
- #define OSL_VERIFY_RES( expression, fail_message ) \
- (void)(expression)
- #define OSL_VERIFY_EQUALS( expression, compare, fail_message ) \
- (void)(expression)
-#endif
-
-#define OSL_UNUSED( expression ) \
- (void)(expression)
-
-#endif // CONNECTIVITY_DIAGNOSE_EX_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FCatalog.hxx b/connectivity/source/inc/file/FCatalog.hxx
deleted file mode 100644
index 2886762deb..0000000000
--- a/connectivity/source/inc/file/FCatalog.hxx
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_CATALOG_HXX_
-#define _CONNECTIVITY_FILE_CATALOG_HXX_
-
-#include "connectivity/sdbcx/VCatalog.hxx"
-
-#include "file/filedllapi.hxx"
-
-namespace connectivity
-{
- namespace file
- {
- class OConnection;
- class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OFileCatalog :
- public connectivity::sdbcx::OCatalog
- {
- protected:
- OConnection* m_pConnection;
-
- /** builds the name which should be used to access the object later on in the collection.
- Will only be called in fillNames.
- @param _xRow
- The current row from the resultset given to fillNames.
- */
- virtual ::rtl::OUString buildName( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >& _xRow);
-
- public:
- virtual void refreshTables();
- virtual void refreshViews();
- virtual void refreshGroups();
- virtual void refreshUsers();
-
- public:
- OFileCatalog(OConnection* _pCon);
- OConnection* getConnection() { return m_pConnection; }
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- // ::cppu::OComponentHelper
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL disposing(void);
- };
- }
-}
-#endif // _CONNECTIVITY_FILE_CATALOG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FColumns.hxx b/connectivity/source/inc/file/FColumns.hxx
deleted file mode 100644
index 45032d2324..0000000000
--- a/connectivity/source/inc/file/FColumns.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_COLUMNS_HXX_
-#define _CONNECTIVITY_FILE_COLUMNS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include "connectivity/sdbcx/IRefreshable.hxx"
-#include "file/FTable.hxx"
-#include "file/filedllapi.hxx"
-
-namespace connectivity
-{
- namespace file
- {
- class OOO_DLLPUBLIC_FILE OColumns : public sdbcx::OCollection
- {
- protected:
- OFileTable* m_pTable;
-
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- public:
- OColumns( OFileTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector
- ) : sdbcx::OCollection(*_pTable,_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
- ,m_pTable(_pTable)
- {}
- };
- }
-}
-#endif // _CONNECTIVITY_FILE_COLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FConnection.hxx b/connectivity/source/inc/file/FConnection.hxx
deleted file mode 100644
index 612c8a471e..0000000000
--- a/connectivity/source/inc/file/FConnection.hxx
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_FILE_OCONNECTION_HXX_
-#define _CONNECTIVITY_FILE_OCONNECTION_HXX_
-
-#include <com/sun/star/ucb/XContent.hpp>
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include "OSubComponent.hxx"
-#ifndef _MAP_
-#include <map>
-#endif
-#include "connectivity/CommonTools.hxx"
-#include "OTypeInfo.hxx"
-#include <tools/string.hxx>
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#include <com/sun/star/ucb/XDynamicResultSet.hpp>
-#include "connectivity/sqlparse.hxx"
-#include "connectivity/sqliterator.hxx"
-#include "TConnection.hxx"
-#include "file/filedllapi.hxx"
-
-namespace connectivity
-{
- namespace file
- {
-
- class OStatement_Base;
- class ODatabaseMetaData;
- class OFileDriver;
-
- class OOO_DLLPUBLIC_FILE OConnection :
- public connectivity::OMetaConnection,
- public connectivity::OSubComponent<OConnection, connectivity::OMetaConnection>
- {
- friend class connectivity::OSubComponent<OConnection, connectivity::OMetaConnection>;
-
- protected:
- //====================================================================
- // Data attributes
- //====================================================================
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbcx::XTablesSupplier> m_xCatalog;
-
- ::com::sun::star::sdbc::SQLWarning m_aLastWarning; // Last SQLWarning generated by
-
- String m_aFilenameExtension;
- OFileDriver* m_pDriver; // Pointer to the owning
- // driver object
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet > m_xDir; // directory
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent> m_xContent;
-
- sal_Bool m_bClosed;
- sal_Bool m_bAutoCommit;
- sal_Bool m_bReadOnly;
- sal_Bool m_bShowDeleted;
- sal_Bool m_bCaseSensitiveExtension;
- sal_Bool m_bCheckSQL92;
- bool m_bDefaultTextEncoding;
-
-
- void throwUrlNotValid(const ::rtl::OUString & _rsUrl,const ::rtl::OUString & _rsMessage);
-
- virtual ~OConnection();
- public:
-
- OConnection(OFileDriver* _pDriver);
-
- virtual void construct(const ::rtl::OUString& _rUrl,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo ) throw( ::com::sun::star::sdbc::SQLException);
-
- void closeAllStatements () throw( ::com::sun::star::sdbc::SQLException);
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL release() throw();
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
-
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL nativeSQL( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getAutoCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL commit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL rollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isClosed( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCatalog( const ::rtl::OUString& catalog ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalog( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- //XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- // no interface methods
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet > getDir() const;
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent> getContent() const { return m_xContent; }
- // create a catalog or return the catalog already created
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
-
- sal_Bool matchesExtension( const String& _rExt ) const;
-
- inline const String& getExtension() const { return m_aFilenameExtension; }
- inline sal_Bool isCaseSensitveExtension() const { return m_bCaseSensitiveExtension; }
- inline OFileDriver* getDriver() const { return m_pDriver; }
- inline sal_Bool showDeleted() const { return m_bShowDeleted; }
- inline sal_Bool isCheckEnabled() const { return m_bCheckSQL92; }
- inline bool isTextEncodingDefaulted() const { return m_bDefaultTextEncoding; }
-
- public:
- struct GrantAccess
- {
- friend class ODatabaseMetaData;
- private:
- GrantAccess() { }
- };
-
- void setCaseSensitiveExtension( sal_Bool _bIsCS, GrantAccess ) { m_bCaseSensitiveExtension = _bIsCS; }
- };
- }
-}
-#endif // _CONNECTIVITY_FILE_OCONNECTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FDatabaseMetaData.hxx b/connectivity/source/inc/file/FDatabaseMetaData.hxx
deleted file mode 100644
index aea33e0709..0000000000
--- a/connectivity/source/inc/file/FDatabaseMetaData.hxx
+++ /dev/null
@@ -1,199 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_ODATABASEMETADATA_HXX_
-#define _CONNECTIVITY_FILE_ODATABASEMETADATA_HXX_
-
-#include "TDatabaseMetaDataBase.hxx"
-#include "file/FConnection.hxx"
-#include "file/filedllapi.hxx"
-
-namespace connectivity
-{
- namespace file
- {
- //**************************************************************
- //************ Class: ODatabaseMetaData
- //**************************************************************
-
- class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE ODatabaseMetaData :
- public ODatabaseMetaDataBase
- {
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw();
- // cached database information
- virtual ::rtl::OUString impl_getIdentifierQuoteString_throw( );
- virtual sal_Bool impl_isCatalogAtStart_throw( );
- virtual ::rtl::OUString impl_getCatalogSeparator_throw( );
- virtual sal_Bool impl_supportsCatalogsInTableDefinitions_throw( );
- virtual sal_Bool impl_supportsSchemasInTableDefinitions_throw( ) ;
- virtual sal_Bool impl_supportsCatalogsInDataManipulation_throw( );
- virtual sal_Bool impl_supportsSchemasInDataManipulation_throw( ) ;
- virtual sal_Bool impl_supportsMixedCaseQuotedIdentifiers_throw( );
- virtual sal_Bool impl_supportsAlterTableWithAddColumn_throw( );
- virtual sal_Bool impl_supportsAlterTableWithDropColumn_throw( );
- virtual sal_Int32 impl_getMaxStatements_throw( );
- virtual sal_Int32 impl_getMaxTablesInSelect_throw( );
- virtual sal_Bool impl_storesMixedCaseQuotedIdentifiers_throw( );
- protected:
- OConnection* m_pConnection; // I need the native class not only the interface
- virtual ~ODatabaseMetaData();
- public:
-
- ODatabaseMetaData(OConnection* _pCon);
- // XDatabaseMetaData
- virtual sal_Bool SAL_CALL allProceduresAreCallable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL allTablesAreSelectable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getUserName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedLow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFiles( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSQLKeywords( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getNumericFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getStringFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSystemFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTimeDateFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSearchStringEscape( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getExtraNameCharacters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsColumnAliasing( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTypeConversion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getProcedureTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedDelete( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsStoredProcedures( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnionAll( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxConnections( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxIndexLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxRowSize( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxStatementLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTables( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTableTypes( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTablePrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsBatchUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getUDTs( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern, const ::com::sun::star::uno::Sequence< sal_Int32 >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_FILE_ODATABASEMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FDateFunctions.hxx b/connectivity/source/inc/file/FDateFunctions.hxx
deleted file mode 100644
index 0551d3fd4d..0000000000
--- a/connectivity/source/inc/file/FDateFunctions.hxx
+++ /dev/null
@@ -1,244 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_FDATEFUNCTIONS_HXX_
-#define _CONNECTIVITY_FILE_FDATEFUNCTIONS_HXX_
-
-#include "file/fcode.hxx"
-#include "file/filedllapi.hxx"
-
-namespace connectivity
-{
- class OSQLParseNode;
- namespace file
- {
- /** DAYOFWEEK(date)
- Returns the weekday index for date (1 = Sunday, 2 = Monday, ... 7 = Saturday). These index values correspond to the ODBC standard.
-
- > SELECT DAYOFWEEK('1998-02-03');
- -> 3
- */
- class OOp_DayOfWeek : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** DAYOFMONTH(date)
- Returns the day of the month for date, in the range 1 to 31:
-
- > SELECT DAYOFMONTH('1998-02-03');
- -> 3
- */
- class OOp_DayOfMonth : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** DAYOFYEAR(date)
- Returns the day of the year for date, in the range 1 to 366:
-
- > SELECT DAYOFYEAR('1998-02-03');
- -> 34
-
- */
- class OOp_DayOfYear : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** MONTH(date)
- Returns the month for date, in the range 1 to 12:
-
- > SELECT MONTH('1998-02-03');
- -> 2
- */
- class OOp_Month : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** DAYNAME(date)
- Returns the name of the weekday for date:
-
- > SELECT DAYNAME('1998-02-05');
- -> 'Thursday'
-
- */
- class OOp_DayName : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** MONTHNAME(date)
- Returns the name of the month for date:
-
- > SELECT MONTHNAME('1998-02-05');
- -> 'February'
-
- */
- class OOp_MonthName : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** QUARTER(date)
- Returns the quarter of the year for date, in the range 1 to 4:
-
- > SELECT QUARTER('98-04-01');
- -> 2
-
- */
- class OOp_Quarter : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** WEEK(date)
- WEEK(date,first)
- With a single argument, returns the week for date, in the range 0 to 53 (yes, there may be the beginnings of a week 53), for locations where Sunday is the first day of the week. The two-argument form of WEEK() allows you to specify whether the week starts on Sunday or Monday and whether the return value should be in the range 0-53 or 1-52. Here is a table for how the second argument works:
- Value Meaning
- 0 Week starts on Sunday and return value is in range 0-53
- 1 Week starts on Monday and return value is in range 0-53
- 2 Week starts on Sunday and return value is in range 1-53
- 3 Week starts on Monday and return value is in range 1-53 (ISO 8601)
-
- > SELECT WEEK('1998-02-20');
- -> 7
- > SELECT WEEK('1998-02-20',0);
- -> 7
- > SELECT WEEK('1998-02-20',1);
- -> 8
- > SELECT WEEK('1998-12-31',1);
- -> 53
-
- */
- class OOp_Week : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
-
- /** YEAR(date)
- Returns the year for date, in the range 1000 to 9999:
-
- > SELECT YEAR('98-02-03');
- -> 1998
- */
- class OOp_Year : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** HOUR(time)
- Returns the hour for time, in the range 0 to 23:
-
- > SELECT HOUR('10:05:03');
- -> 10
- */
- class OOp_Hour : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** MINUTE(time)
- Returns the minute for time, in the range 0 to 59:
-
- > SELECT MINUTE('98-02-03 10:05:03');
- -> 5
-
- */
- class OOp_Minute : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** SECOND(time)
- Returns the second for time, in the range 0 to 59:
-
- > SELECT SECOND('10:05:03');
- -> 3
- */
- class OOp_Second : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** CURDATE()
- CURRENT_DATE
- Returns today's date as a value in 'YYYY-MM-DD' or YYYYMMDD format, depending on whether the function is used in a string or numeric context:
-
- > SELECT CURDATE();
- -> '1997-12-15'
- */
- class OOp_CurDate : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
-
- /** CURTIME()
- CURRENT_TIME
- Returns the current time as a value in 'HH:MM:SS' or HHMMSS format, depending on whether the function is used in a string or numeric context:
-
- > SELECT CURTIME();
- -> '23:50:26'
- */
- class OOp_CurTime : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
-
- /** NOW()
- Returns the current date and time as a value in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS format, depending on whether the function is used in a string or numeric context:
-
- > SELECT NOW();
- -> '1997-12-15 23:50:26'
- */
- class OOp_Now : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
- }
-}
-
-#endif // _CONNECTIVITY_FILE_FCODE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FDriver.hxx b/connectivity/source/inc/file/FDriver.hxx
deleted file mode 100644
index 4cf15e8d86..0000000000
--- a/connectivity/source/inc/file/FDriver.hxx
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_ODRIVER_HXX_
-#define _CONNECTIVITY_FILE_ODRIVER_HXX_
-
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
-#include <cppuhelper/compbase3.hxx>
-#include "connectivity/CommonTools.hxx"
-#include "file/filedllapi.hxx"
-
-namespace connectivity
-{
- namespace file
- {
- typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbc::XDriver,
- ::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::sdbcx::XDataDefinitionSupplier> ODriver_BASE;
-
- class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OFileDriver : public ODriver_BASE
- {
- protected:
- ::osl::Mutex m_aMutex;
-
- connectivity::OWeakRefArray m_xConnections; // vector containing a list
- // of all the Connection objects
- // for this Driver
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
- public:
- OFileDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XDataDefinitionSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& connection ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getFactory() const { return m_xFactory; }
- };
- }
-
-}
-#endif //_CONNECTIVITY_FILE_ODRIVER_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FNumericFunctions.hxx b/connectivity/source/inc/file/FNumericFunctions.hxx
deleted file mode 100644
index a76e988a5f..0000000000
--- a/connectivity/source/inc/file/FNumericFunctions.hxx
+++ /dev/null
@@ -1,378 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_FNUMERICFUNCTIONS_HXX_
-#define _CONNECTIVITY_FILE_FNUMERICFUNCTIONS_HXX_
-
-#include "file/fcode.hxx"
-#include "file/filedllapi.hxx"
-
-namespace connectivity
-{
- class OSQLParseNode;
- namespace file
- {
- /** ABS(X)
- Returns the absolute value of X:
-
- > SELECT ABS(2);
- -> 2
- > SELECT ABS(-32);
- -> 32
-
- */
- class OOp_Abs : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** SIGN(X)
- Returns the sign of the argument as -1, 0, or 1, depending on whether X is negative, zero, or positive:
-
- > SELECT SIGN(-32);
- -> -1
- > SELECT SIGN(0);
- -> 0
- > SELECT SIGN(234);
- -> 1
-
- */
- class OOp_Sign : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** MOD(N,M)
- %
- Modulo (like the % operator in C). Returns the remainder of N divided by M:
-
- > SELECT MOD(234, 10);
- -> 4
- > SELECT 253 % 7;
- -> 1
- > SELECT MOD(29,9);
- -> 2
- > SELECT 29 MOD 9;
- -> 2
- */
- class OOp_Mod : public OBinaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const;
- };
-
- /** FLOOR(X)
- Returns the largest integer value not greater than X:
-
- > SELECT FLOOR(1.23);
- -> 1
- > SELECT FLOOR(-1.23);
- -> -2
-
- */
- class OOp_Floor : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** CEILING(X)
- Returns the smallest integer value not less than X:
-
- > SELECT CEILING(1.23);
- -> 2
- > SELECT CEILING(-1.23);
- -> -1
-
- */
- class OOp_Ceiling : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** ROUND(X)
- ROUND(X,D)
- Returns the argument X, rounded to the nearest integer. With two arguments rounded to a number to D decimals.
-
- > SELECT ROUND(-1.23);
- -> -1
- > SELECT ROUND(-1.58);
- -> -2
- > SELECT ROUND(1.58);
- -> 2
- > SELECT ROUND(1.298, 1);
- -> 1.3
- > SELECT ROUND(1.298, 0);
- -> 1
- > SELECT ROUND(23.298, -1);
- -> 20
- */
- class OOp_Round : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
-
- /** EXP(X)
- Returns the value of e (the base of natural logarithms) raised to the power of X:
-
- > SELECT EXP(2);
- -> 7.389056
- > SELECT EXP(-2);
- -> 0.135335
- */
- class OOp_Exp : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** LN(X)
- Returns the natural logarithm of X:
-
- > SELECT LN(2);
- -> 0.693147
- > SELECT LN(-2);
- -> NULL
-
- */
- class OOp_Ln : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** LOG(X)
- LOG(B,X)
- If called with one parameter, this function returns the natural logarithm of X:
-
- > SELECT LOG(2);
- -> 0.693147
- > SELECT LOG(-2);
- -> NULL
-
- If called with two parameters, this function returns the logarithm of X for an arbitary base B:
-
- > SELECT LOG(2,65536);
- -> 16.000000
- > SELECT LOG(1,100);
- -> NULL
- */
- class OOp_Log : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
-
- /** LOG10(X)
- Returns the base-10 logarithm of X:
-
- > SELECT LOG10(2);
- -> 0.301030
- > SELECT LOG10(100);
- -> 2.000000
- > SELECT LOG10(-100);
- -> NULL
- */
- class OOp_Log10 : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** POWER(X,Y)
- Returns the value of X raised to the power of Y:
-
- > SELECT POW(2,2);
- -> 4.000000
- > SELECT POW(2,-2);
- -> 0.250000
- */
- class OOp_Pow : public OBinaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const;
- };
-
- /** SQRT(X)
- Returns the non-negative square root of X:
-
- > SELECT SQRT(4);
- -> 2.000000
- > SELECT SQRT(20);
- -> 4.472136
- */
- class OOp_Sqrt : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** PI()
- Returns the value of PI. The default shown number of decimals is 5, but internally uses the full double precession for PI.
-
- > SELECT PI();
- -> 3.141593
- > SELECT PI()+0.000000000000000000;
- -> 3.141592653589793116
-
- */
- class OOp_Pi : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
-
- /** COS(X)
- Returns the cosine of X, where X is given in radians:
-
- > SELECT COS(PI());
- -> -1.000000
- */
- class OOp_Cos : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs = ORowSetValue()) const;
- };
-
- /** SIN(X)
- Returns the sine of X, where X is given in radians:
-
- > SELECT SIN(PI());
- -> 0.000000
-
- */
- class OOp_Sin : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs = ORowSetValue()) const;
- };
- /** TAN(X)
- Returns the tangent of X, where X is given in radians:
-
- > SELECT TAN(PI()+1);
- -> 1.557408
- */
- class OOp_Tan : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs = ORowSetValue()) const;
- };
-
- /** ACOS(X)
- Returns the arc cosine of X, that is, the value whose cosine is X. Returns NULL if X is not in the range -1 to 1:
-
- > SELECT ACOS(1);
- -> 0.000000
- > SELECT ACOS(1.0001);
- -> NULL
- > SELECT ACOS(0);
- -> 1.570796
- */
- class OOp_ACos : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs = ORowSetValue()) const;
- };
-
- /** ASIN(X)
- Returns the arc sine of X, that is, the value whose sine is X. Returns NULL if X is not in the range -1 to 1:
-
- > SELECT ASIN(0.2);
- -> 0.201358
- > SELECT ASIN('foo');
- -> 0.000000
- */
- class OOp_ASin : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs = ORowSetValue()) const;
- };
-
- /** ATAN(X)
- Returns the arc tangent of X, that is, the value whose tangent is X:
-
- > SELECT ATAN(2);
- -> 1.107149
- > SELECT ATAN(-2);
- -> -1.107149
- */
- class OOp_ATan : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs = ORowSetValue()) const;
- };
-
- /** ATAN2(Y,X)
- Returns the arc tangent of the two variables X and Y. It is similar to calculating the arc tangent of Y / X, except that the signs of both arguments are used to determine the quadrant of the result:
-
- > SELECT ATAN2(-2,2);
- -> -0.785398
- > SELECT ATAN2(PI(),0);
- -> 1.570796
-
- */
- class OOp_ATan2 : public OBinaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const;
- };
-
- /** DEGREES(X)
- Returns the argument X, converted from radians to degrees:
-
- > SELECT DEGREES(PI());
- -> 180.000000
- */
- class OOp_Degrees : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs = ORowSetValue()) const;
- };
-
- /** RADIANS(X)
- Returns the argument X, converted from degrees to radians:
-
- > SELECT RADIANS(90);
- -> 1.570796
-
- */
- class OOp_Radians : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs = ORowSetValue()) const;
- };
- }
-}
-
-#endif // _CONNECTIVITY_FILE_FNUMERICFUNCTIONS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FPreparedStatement.hxx b/connectivity/source/inc/file/FPreparedStatement.hxx
deleted file mode 100644
index bdbed49615..0000000000
--- a/connectivity/source/inc/file/FPreparedStatement.hxx
+++ /dev/null
@@ -1,136 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_OPREPAREDSTATEMENT_HXX_
-#define _CONNECTIVITY_FILE_OPREPAREDSTATEMENT_HXX_
-
-#include "file/filedllapi.hxx"
-#include "file/FStatement.hxx"
-#include <com/sun/star/sdbc/XPreparedStatement.hpp>
-#include <com/sun/star/sdbc/XParameters.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XPreparedBatchExecution.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include "file/FResultSet.hxx"
-
-namespace connectivity
-{
- namespace file
- {
-
- class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OPreparedStatement : public OStatement_BASE2,
- public ::com::sun::star::sdbc::XPreparedStatement,
- public ::com::sun::star::sdbc::XParameters,
- public ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- public ::com::sun::star::lang::XServiceInfo
-
- {
- protected:
- //====================================================================
- // Data attributes
- //====================================================================
- ::rtl::OUString m_aSql;
- OValueRefRow m_aParameterRow;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
-
- OResultSet* m_pResultSet;
- ::rtl::Reference<connectivity::OSQLColumns> m_xParamColumns; // the parameter columns
-
- // factory method for resultset's
- virtual OResultSet* createResultSet();
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> initResultSet();
-
- void checkAndResizeParameters(sal_Int32 parameterIndex);
- void setParameter(sal_Int32 parameterIndex, const ORowSetValue& x);
-
- sal_uInt32 AddParameter(connectivity::OSQLParseNode * pParameter,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xCol);
- void scanParameter(OSQLParseNode* pParseNode,::std::vector< OSQLParseNode*>& _rParaNodes);
- void describeColumn(OSQLParseNode* _pParameter,OSQLParseNode* _pNode,const OSQLTable& _xTable);
- void describeParameter();
-
- virtual void parseParamterElem(const String& _sColumnName,OSQLParseNode* pRow_Value_Constructor_Elem);
- virtual void initializeResultSet(OResultSet* _pResult);
-
- virtual ~OPreparedStatement();
- public:
- DECLARE_SERVICE_INFO();
- // a Constructor, that is needed for when Returning the Object is needed:
- OPreparedStatement( OConnection* _pConnection);
-
- virtual void construct(const ::rtl::OUString& sql) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- //XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPreparedStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL executeUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XParameters
- virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearParameters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_FILE_OPREPAREDSTATEMENT_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FResultSet.hxx b/connectivity/source/inc/file/FResultSet.hxx
deleted file mode 100644
index b4fca35761..0000000000
--- a/connectivity/source/inc/file/FResultSet.hxx
+++ /dev/null
@@ -1,343 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_FRESULTSET_HXX_
-#define _CONNECTIVITY_FILE_FRESULTSET_HXX_
-
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <cppuhelper/compbase12.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include "file/FStatement.hxx"
-#include "connectivity/CommonTools.hxx"
-#include <comphelper/propertycontainer.hxx>
-#include "file/fanalyzer.hxx"
-#include "file/FTable.hxx"
-#include "file/filedllapi.hxx"
-#include <comphelper/broadcasthelper.hxx>
-#include "connectivity/StdTypeDefs.hxx"
-#include "TSortIndex.hxx"
-#include "TSkipDeletedSet.hxx"
-#include <com/sun/star/lang/XEventListener.hpp>
-
-namespace connectivity
-{
- namespace file
- {
- /*
- ** java_sql_ResultSet
- */
- typedef ::cppu::WeakComponentImplHelper12< ::com::sun::star::sdbc::XResultSet,
- ::com::sun::star::sdbc::XRow,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XResultSetUpdate,
- ::com::sun::star::sdbc::XRowUpdate,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XColumnLocate,
- ::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::lang::XEventListener,
- ::com::sun::star::lang::XUnoTunnel> OResultSet_BASE;
-
- class OOO_DLLPUBLIC_FILE OResultSet :
- public comphelper::OBaseMutex,
- public ::connectivity::IResultSetHelper,
- public OResultSet_BASE,
- public ::comphelper::OPropertyContainer,
- public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
- {
-
- protected:
- ::std::vector<void*> m_aBindVector;
- ::std::vector<sal_Int32> m_aColMapping; // pos 0 is unused so we don't have to decrement 1 everytime
-
- ::std::vector<sal_Int32> m_aOrderbyColumnNumber;
- ::std::vector<TAscendingOrder> m_aOrderbyAscending;
-
- OValueRefRow m_aSelectRow;
- OValueRefRow m_aRow;
- OValueRefRow m_aEvaluateRow; // contains all values of a row
- OValueRefRow m_aParameterRow;
- OValueRefRow m_aInsertRow; // needed for insert by cursor
- ORefAssignValues m_aAssignValues; // needed for insert,update and parameters
- // to compare with the restrictions
- TIntVector* m_pEvaluationKeySet;
- TIntVector::iterator m_aEvaluateIter;
-
-
-// TInt2IntMap m_aBookmarks; // map from bookmarks to logical position
-// ::std::vector<TInt2IntMap::iterator> m_aBookmarksPositions;// vector of iterators to bookmark map, the order is the logical position
- OSkipDeletedSet m_aSkipDeletedSet;
-
- ::rtl::Reference<OKeySet> m_pFileSet;
- OKeySet::Vector::iterator m_aFileSetIter;
-
-
-
- OSortIndex* m_pSortIndex;
- ::rtl::Reference<connectivity::OSQLColumns> m_xColumns; // this are the select columns
- ::rtl::Reference<connectivity::OSQLColumns> m_xParamColumns;
- OFileTable* m_pTable;
- connectivity::OSQLParseNode* m_pParseTree;
-
- OSQLAnalyzer* m_pSQLAnalyzer;
- connectivity::OSQLParseTreeIterator& m_aSQLIterator;
-
- sal_Int32 m_nFetchSize;
- sal_Int32 m_nResultSetType;
- sal_Int32 m_nFetchDirection;
- sal_Int32 m_nResultSetConcurrency;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> m_xDBMetaData;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColNames; // table columns
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess> m_xColsIdx; // table columns
-
-
- ::rtl::OUString m_aTableRange;
- rtl_TextEncoding m_nTextEncoding;
- sal_Int32 m_nRowPos;
- sal_Int32 m_nFilePos;
- sal_Int32 m_nLastVisitedPos;
- sal_Int32 m_nRowCountResult;
- sal_Int32 m_nCurrentPosition; // current position of the resultset is returned when ask for getRow()
- sal_Int32 m_nColumnCount;
- sal_Bool m_bWasNull;
- sal_Bool m_bEOF; // after last record
- sal_Bool m_bLastRecord;
- sal_Bool m_bInserted; // true when moveToInsertRow was called
- // set to false when cursor moved or cancel
- sal_Bool m_bRowUpdated;
- sal_Bool m_bRowInserted;
- sal_Bool m_bRowDeleted;
- sal_Bool m_bShowDeleted;
- sal_Bool m_bIsCount;
-
- void initializeRow(OValueRefRow& _rRow,sal_Int32 _nColumnCount);
- void construct();
- sal_Bool evaluate();
-
- sal_Bool ExecuteRow(IResultSetHelper::Movement eFirstCursorPosition,
- sal_Int32 nOffset = 1,
- sal_Bool bEvaluate = sal_True,
- sal_Bool bRetrieveData = sal_True);
-
- OKeyValue* GetOrderbyKeyValue(OValueRefRow& _rRow);
- sal_Bool IsSorted() const { return !m_aOrderbyColumnNumber.empty() && m_aOrderbyColumnNumber[0] != SQL_COLUMN_NOTFOUND;}
-
- // return true when the select statement is "select count(*) from table"
- inline sal_Bool isCount() const { return m_bIsCount; }
- void checkIndex(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException);
-
- const ORowSetValue& getValue(sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException);
- void updateValue(sal_Int32 columnIndex,const ORowSetValue& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // clear insert row
- void clearInsertRow();
- void sortRows();
- protected:
-
- using OResultSet_BASE::rBHelper;
-
- sal_Bool Move(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Bool bRetrieveData);
- virtual sal_Bool fillIndexValues(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> &_xIndex);
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- virtual ~OResultSet();
- public:
- DECLARE_SERVICE_INFO();
- // a Constructor, that is needed for when Returning the Object is needed:
- OResultSet( OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator);
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
- {
- return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(*(OResultSet_BASE*)this);
- }
-
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XResultSet
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetUpdate
- virtual void SAL_CALL insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRowUpdate
- virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XColumnLocate
- virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
- //XEventlistener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
-
- // special methods
- inline sal_Int32 mapColumn(sal_Int32 column);
- virtual sal_Bool OpenImpl();
- virtual void doTableSpecials(const OSQLTable& _xTable);
-
- inline sal_Int32 getRowCountResult() const { return m_nRowCountResult; }
- inline void setParameterRow(const OValueRefRow& _rParaRow) { m_aParameterRow = _rParaRow; }
- inline void setEvaluationRow(const OValueRefRow& _aRow) { m_aEvaluateRow = _aRow; }
- inline void setParameterColumns(const ::rtl::Reference<connectivity::OSQLColumns>& _xParamColumns) { m_xParamColumns = _xParamColumns; }
- inline void setAssignValues(const ORefAssignValues& _aAssignValues) { m_aAssignValues = _aAssignValues; }
- inline void setBindingRow(const OValueRefRow& _aRow) { m_aRow = _aRow; }
- inline void setSelectRow(const OValueRefRow& _rRow)
- {
- m_aSelectRow = _rRow;
- m_nColumnCount = m_aSelectRow->get().size();
- }
- inline void setColumnMapping(const ::std::vector<sal_Int32>& _aColumnMapping) { m_aColMapping = _aColumnMapping; }
- inline void setSqlAnalyzer(OSQLAnalyzer* _pSQLAnalyzer) { m_pSQLAnalyzer = _pSQLAnalyzer; }
-
- inline void setOrderByColumns(const ::std::vector<sal_Int32>& _aColumnOrderBy) { m_aOrderbyColumnNumber = _aColumnOrderBy; }
- inline void setOrderByAscending(const ::std::vector<TAscendingOrder>& _aOrderbyAsc) { m_aOrderbyAscending = _aOrderbyAsc; }
- inline void setEvaluationKeySet(TIntVector* _pEvaluationKeySet) { m_pEvaluationKeySet = _pEvaluationKeySet; }
- inline void setMetaData(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData>& _xMetaData) { m_xMetaData = _xMetaData;}
-
- // clears the resultset so it can be reused by a preparedstatement
- void clear();
- static void setBoundedColumns(const OValueRefRow& _rRow,
- const OValueRefRow& _rSelectRow,
- const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xNames,
- sal_Bool _bSetColumnMapping,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _xMetaData,
- ::std::vector<sal_Int32>& _rColMapping);
-
- // IResultSetHelper
- virtual sal_Bool move(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData);
- virtual sal_Int32 getDriverPos() const;
- virtual sal_Bool deletedVisible() const;
- virtual sal_Bool isRowDeleted() const;
- };
- // -------------------------------------------------------------------------
- inline sal_Int32 OResultSet::mapColumn(sal_Int32 column)
- {
- sal_Int32 map = column;
-
- OSL_ENSURE(column > 0, "file::OResultSet::mapColumn: invalid column index!");
- // the first column (index 0) is for convenience only. The first real select column is no 1.
- if ((column > 0) && (column < (sal_Int32)m_aColMapping.size()))
- map = m_aColMapping[column];
-
- return map;
- }
- }
-}
-#endif // _CONNECTIVITY_FILE_ORESULTSET_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FResultSetMetaData.hxx b/connectivity/source/inc/file/FResultSetMetaData.hxx
deleted file mode 100644
index 0ec97d7027..0000000000
--- a/connectivity/source/inc/file/FResultSetMetaData.hxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_ORESULTSETMETADATA_HXX_
-#define _CONNECTIVITY_FILE_ORESULTSETMETADATA_HXX_
-
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include "connectivity/CommonTools.hxx"
-#include <rtl/ref.hxx>
-#include "file/filedllapi.hxx"
-
-namespace connectivity
-{
- namespace file
- {
- class OFileTable;
- //**************************************************************
- //************ Class: ResultSetMetaData
- //**************************************************************
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> OResultSetMetaData_BASE;
-
- class OOO_DLLPUBLIC_FILE OResultSetMetaData :
- public OResultSetMetaData_BASE
- {
- ::rtl::OUString m_aTableName;
- ::rtl::Reference<connectivity::OSQLColumns> m_xColumns;
- OFileTable* m_pTable;
-
- void checkColumnIndex(sal_Int32 column) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- protected:
- virtual ~OResultSetMetaData();
- public:
- // a Constructor, that is needed for when Returning the Object is needed:
- OResultSetMetaData(const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,const ::rtl::OUString& _aTableName,OFileTable* _pTable);
-
- /// Avoid ambigous cast error from the compiler.
- inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
- { return this; }
-
- virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_FILE_ORESULTSETMETADATA_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FStatement.hxx b/connectivity/source/inc/file/FStatement.hxx
deleted file mode 100644
index 3c300f0ff4..0000000000
--- a/connectivity/source/inc/file/FStatement.hxx
+++ /dev/null
@@ -1,225 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_OSTATEMENT_HXX_
-#define _CONNECTIVITY_FILE_OSTATEMENT_HXX_
-
-#include <com/sun/star/sdbc/XStatement.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XMultipleResults.hpp>
-#include <com/sun/star/sdbc/XBatchExecution.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <comphelper/proparrhlp.hxx>
-#include <cppuhelper/compbase3.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <comphelper/uno3.hxx>
-#include "connectivity/CommonTools.hxx"
-#include "file/FConnection.hxx"
-#include "file/filedllapi.hxx"
-#ifndef _LIST_
-#include <list>
-#endif
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <comphelper/propertycontainer.hxx>
-#include "file/fanalyzer.hxx"
-#include <comphelper/broadcasthelper.hxx>
-#include "TSortIndex.hxx"
-
-#define SQL_COLUMN_NOTFOUND STRING_NOTFOUND
-
-namespace connectivity
-{
- namespace file
- {
- class OResultSet;
- class OFileTable;
- typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XCloseable> OStatement_BASE;
-
- //**************************************************************
- //************ Class: java.sql.Statement
- //**************************************************************
- class OOO_DLLPUBLIC_FILE OStatement_Base :
- public comphelper::OBaseMutex,
- public OStatement_BASE,
- public ::comphelper::OPropertyContainer,
- public ::comphelper::OPropertyArrayUsageHelper<OStatement_Base>
-
- {
- protected:
- ::std::vector<sal_Int32> m_aColMapping; // pos 0 is unused so we don't have to decrement 1 everytime
- ::std::vector<sal_Int32> m_aParameterIndexes; // maps the parameter index to column index
- ::std::vector<sal_Int32> m_aOrderbyColumnNumber;
- ::std::vector<TAscendingOrder> m_aOrderbyAscending;
-
- ::com::sun::star::sdbc::SQLWarning m_aLastWarning;
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet> m_xResultSet; // The last ResultSet created
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> m_xDBMetaData;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColNames; // table columns // for this Statement
-
-
- connectivity::OSQLParser m_aParser;
- connectivity::OSQLParseTreeIterator m_aSQLIterator;
-
- OConnection* m_pConnection;// The owning Connection object
- connectivity::OSQLParseNode* m_pParseTree;
- OSQLAnalyzer* m_pSQLAnalyzer; //the sql analyzer used by the resultset
-
- ::std::vector<sal_Int32>* m_pEvaluationKeySet;
-
- OFileTable* m_pTable; // the current table
- OValueRefRow m_aSelectRow;
- OValueRefRow m_aRow;
- OValueRefRow m_aEvaluateRow; // contains all values of a row
- ORefAssignValues m_aAssignValues; // needed for insert,update and parameters
- // to compare with the restrictions
-
- ::rtl::OUString m_aCursorName;
- sal_Int32 m_nMaxFieldSize;
- sal_Int32 m_nMaxRows;
- sal_Int32 m_nQueryTimeOut;
- sal_Int32 m_nFetchSize;
- sal_Int32 m_nResultSetType;
- sal_Int32 m_nFetchDirection;
- sal_Int32 m_nResultSetConcurrency;
- sal_Bool m_bEscapeProcessing;
-
- ::cppu::OBroadcastHelper& rBHelper;
-
- protected:
- // initialize the column index map (mapping select columns to table columns)
- void createColumnMapping();
- // searches the statement for sort criteria
- void anylizeSQL();
- void setOrderbyColumn( connectivity::OSQLParseNode* pColumnRef,
- connectivity::OSQLParseNode* pAscendingDescending);
-
- virtual void initializeResultSet(OResultSet* _pResult);
- // create the analyzer
- virtual OSQLAnalyzer* createAnalyzer();
-
- void reset () throw( ::com::sun::star::sdbc::SQLException);
- void clearMyResultSet () throw( ::com::sun::star::sdbc::SQLException);
- void setWarning (const ::com::sun::star::sdbc::SQLWarning &ex) throw( ::com::sun::star::sdbc::SQLException);
- sal_Int32 getPrecision ( sal_Int32 sqlType);
-
- void disposeResultSet();
- void GetAssignValues();
- void SetAssignValue(const String& aColumnName,
- const String& aValue,
- sal_Bool bSetNull = sal_False,
- sal_uInt32 nParameter=SQL_NO_PARAMETER);
- void ParseAssignValues( const ::std::vector< String>& aColumnNameList,
- connectivity::OSQLParseNode* pRow_Value_Constructor_Elem,xub_StrLen nIndex);
-
- virtual void parseParamterElem(const String& _sColumnName,OSQLParseNode* pRow_Value_Constructor_Elem);
- // factory method for resultset's
- virtual OResultSet* createResultSet() = 0;
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- virtual ~OStatement_Base();
- public:
- connectivity::OSQLParseNode* getParseTree() const { return m_pParseTree;}
-
- OStatement_Base(OConnection* _pConnection );
-
- OConnection* getOwnConnection() const { return m_pConnection;}
-
- using OStatement_BASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
-
- virtual void construct(const ::rtl::OUString& sql) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- // virtual void SAL_CALL release() throw(::com::sun::star::uno::RuntimeException) = 0;
- virtual void SAL_CALL acquire() throw();
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-
- class OOO_DLLPUBLIC_FILE OStatement_BASE2 :
- public OStatement_Base,
- public connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>
-
- {
- friend class connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>;
- public:
- OStatement_BASE2(OConnection* _pConnection ) : OStatement_Base(_pConnection ),
- connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>((::cppu::OWeakObject*)_pConnection, this){}
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL release() throw();
- };
-
- typedef ::cppu::ImplHelper2< ::com::sun::star::sdbc::XStatement,::com::sun::star::lang::XServiceInfo > OStatement_XStatement;
- class OOO_DLLPUBLIC_FILE OStatement :
- public OStatement_BASE2,
- public OStatement_XStatement
- {
- protected:
- // factory method for resultset's
- virtual OResultSet* createResultSet();
- public:
- // a Constructor, that is needed for when Returning the Object is needed:
- OStatement( OConnection* _pConnection) : OStatement_BASE2( _pConnection){}
- DECLARE_SERVICE_INFO();
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Int32 SAL_CALL executeUpdate( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL execute( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- };
- }
-}
-#endif // _CONNECTIVITY_FILE_OSTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FStringFunctions.hxx b/connectivity/source/inc/file/FStringFunctions.hxx
deleted file mode 100644
index 8821d29aee..0000000000
--- a/connectivity/source/inc/file/FStringFunctions.hxx
+++ /dev/null
@@ -1,285 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_FSTRINGFUNCTIONS_HXX_
-#define _CONNECTIVITY_FILE_FSTRINGFUNCTIONS_HXX_
-
-#include "file/fcode.hxx"
-#include "file/filedllapi.hxx"
-
-namespace connectivity
-{
- class OSQLParseNode;
- namespace file
- {
- /** UCASE(str)
- UPPER(str)
- Returns the string str with all characters changed to uppercase according to the current character set mapping (the default is ISO-8859-1 Latin1):
-
- > SELECT UCASE('Hej');
- -> 'HEJ'
-
- */
- class OOp_Upper : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** LCASE(str)
- LOWER(str)
- Returns the string str with all characters changed to lowercase according to the current character set mapping (the default is ISO-8859-1 Latin1):
-
- > SELECT LCASE('QUADRATICALLY');
- -> 'quadratically'
-
- */
- class OOp_Lower : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** ASCII(str)
- Returns the ASCII code value of the leftmost character of the string str. Returns 0 if str is the empty string. Returns NULL if str is NULL:
-
- > SELECT ASCII('2');
- -> 50
- > SELECT ASCII(2);
- -> 50
- > SELECT ASCII('dx');
- -> 100
-
- */
- class OOp_Ascii : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** LENGTH(str)
- OCTET_LENGTH(str)
- CHAR_LENGTH(str)
- CHARACTER_LENGTH(str)
- Returns the length of the string str:
-
- > SELECT LENGTH('text');
- -> 4
- > SELECT OCTET_LENGTH('text');
- -> 4
-
- */
- class OOp_CharLength : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** CHAR(N,...)
- CHAR() interprets the arguments as integers and returns a string consisting of the characters given by the ASCII code values of those integers. NULL values are skipped:
-
- > SELECT CHAR(ascii('t'),ascii('e'),ascii('s'),ascii('t'));
- -> 'test'
- > SELECT CHAR(77,77.3,'77.3');
- -> 'MMM'
-
- */
- class OOp_Char : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
-
- /** CONCAT(str1,str2,...)
- Returns the string that results from concatenating the arguments. Returns NULL if any argument is NULL. May have more than 2 arguments. A numeric argument is converted to the equivalent string form:
-
- > SELECT CONCAT('OO', 'o', 'OO');
- -> 'OOoOO'
- > SELECT CONCAT('OO', NULL, 'OO');
- -> NULL
- > SELECT CONCAT(14.3);
- -> '14.3'
-
- */
- class OOp_Concat : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
-
- /** LOCATE(substr,str)
- POSITION(substr IN str)
- Returns the position of the first occurrence of substring substr in string str. Returns 0 if substr is not in str:
-
- > SELECT LOCATE('bar', 'foobarbar');
- -> 4
- > SELECT LOCATE('xbar', 'foobar');
- -> 0
- LOCATE(substr,str,pos)
- Returns the position of the first occurrence of substring substr in string str, starting at position pos. Returns 0 if substr is not in str:
-
- > SELECT LOCATE('bar', 'foobarbar',5);
- -> 7
-
- */
- class OOp_Locate : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
-
- /** SUBSTRING(str,pos)
- SUBSTRING(str FROM pos)
- Returns a substring from string str starting at position pos:
-
- > SELECT SUBSTRING('Quadratically',5);
- -> 'ratically'
- > SELECT SUBSTRING('foobarbar' FROM 4);
- -> 'barbar'
- SUBSTRING(str,pos,len)
- SUBSTRING(str FROM pos FOR len)
- Returns a substring len characters long from string str, starting at position pos. The variant form that uses FROM is SQL-92 syntax:
-
- > SELECT SUBSTRING('Quadratically',5,6);
- -> 'ratica'
-
- */
- class OOp_SubString : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
-
- /** LTRIM(str)
- Returns the string str with leading space characters removed:
-
- > SELECT LTRIM(' barbar');
- -> 'barbar'
-
- */
- class OOp_LTrim : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** RTRIM(str)
- Returns the string str with trailing space characters removed:
-
- > SELECT RTRIM('barbar ');
- -> 'barbar'
-
- */
- class OOp_RTrim : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** SPACE(N)
- Returns a string consisting of N space characters:
-
- > SELECT SPACE(6);
- -> ' '
-
- */
- class OOp_Space : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const;
- };
-
- /** REPLACE(str,from_str,to_str)
- Returns the string str with all occurrences of the string from_str replaced by the string to_str:
-
- > SELECT REPLACE('www.OOo.com', 'w', 'Ww');
- -> 'WwWwWw.OOo.com'
-
- */
- class OOp_Replace : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
-
- /** REPEAT(str,count)
- Returns a string consisting of the string str repeated count times. If count <= 0, returns an empty string. Returns NULL if str or count are NULL:
-
- > SELECT REPEAT('OOo', 3);
- -> 'OOoOOoOOo'
-
- */
- class OOp_Repeat : public OBinaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const;
- };
-
- /** INSERT(str,pos,len,newstr)
- Returns the string str, with the substring beginning at position pos and len characters long replaced by the string newstr:
-
- > SELECT INSERT('Quadratic', 3, 4, 'What');
- -> 'QuWhattic'
-
- */
- class OOp_Insert : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const;
- };
-
- /** LEFT(str,len)
- Returns the leftmost len characters from the string str:
-
- > SELECT LEFT('foobarbar', 5);
- -> 'fooba'
-
- */
- class OOp_Left : public OBinaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const;
- };
-
- /** RIGHT(str,len)
- Returns the rightmost len characters from the string str:
-
- > SELECT RIGHT('foobarbar', 4);
- -> 'rbar'
- */
- class OOp_Right : public OBinaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const;
- };
- }
-}
-
-#endif // _CONNECTIVITY_FILE_FCODE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FTable.hxx b/connectivity/source/inc/file/FTable.hxx
deleted file mode 100644
index afb95ec49a..0000000000
--- a/connectivity/source/inc/file/FTable.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_TABLE_HXX_
-#define _CONNECTIVITY_FILE_TABLE_HXX_
-
-#include "connectivity/sdbcx/VTable.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include "file/FConnection.hxx"
-#include "file/filedllapi.hxx"
-#include <tools/stream.hxx>
-#include "connectivity/FValue.hxx"
-#include "TResultSetHelper.hxx"
-
-namespace connectivity
-{
- namespace file
- {
- typedef connectivity::sdbcx::OTable OTable_TYPEDEF;
-
- class OOO_DLLPUBLIC_FILE OFileTable : public OTable_TYPEDEF
- {
- protected:
- OConnection* m_pConnection;
- SvStream* m_pFileStream;
- ::rtl::Reference<OSQLColumns> m_aColumns;
- sal_Int32 m_nFilePos; // aktuelle IResultSetHelper::Movement
- sal_uInt8* m_pBuffer;
- sal_uInt16 m_nBufferSize; // Groesse des ReadBuffer, wenn pBuffer != NULL
- sal_Bool m_bWriteable; // svstream cann't say if we are writeable
- // so we have to
-
- virtual void FileClose();
- virtual ~OFileTable( );
- public:
- virtual void refreshColumns();
- virtual void refreshKeys();
- virtual void refreshIndexes();
- public:
- OFileTable( sdbcx::OCollection* _pTables,OConnection* _pConnection);
- OFileTable( sdbcx::OCollection* _pTables,OConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description = ::rtl::OUString(),
- const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
- const ::rtl::OUString& _CatalogName = ::rtl::OUString()
- );
-
- //XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- OConnection* getConnection() const { return m_pConnection;}
- virtual sal_Int32 getCurrentLastPos() const {return -1;}
-
- virtual sal_Bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos) = 0;
- virtual sal_Bool fetchRow(OValueRefRow& _rRow,const OSQLColumns& _rCols, sal_Bool _bUseTableDefs,sal_Bool bRetrieveData) = 0;
-
- ::rtl::Reference<OSQLColumns> getTableColumns() const {return m_aColumns;}
- virtual sal_Bool InsertRow(OValueRefVector& rRow, sal_Bool bFlush,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xCols);
- virtual sal_Bool DeleteRow(const OSQLColumns& _rCols);
- virtual sal_Bool UpdateRow(OValueRefVector& rRow, OValueRefRow& pOrgRow,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xCols);
- virtual void addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& descriptor);
- virtual void dropColumn(sal_Int32 _nPos);
- // refresh the header of file based tables to see changes done by someone
- virtual void refreshHeader();
-
- ::rtl::OUString SAL_CALL getName() throw() { return m_Name; }
-
- ::rtl::OUString getSchema() { return m_SchemaName; }
- sal_Bool isReadOnly() const { return !m_bWriteable; }
- // m_pFileStream && !m_pFileStream->IsWritable(); }
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
-
- sal_Int32 getFilePos() const { return m_nFilePos; }
-
- public:
- // helper
-
- // creates a stream using ::utl::UcbStreamHelper::CreateStream, but the error is simplified
- // (NULL or non-NULL is returned)
- static SvStream* createStream_simpleError( const String& _rFileName, StreamMode _eOpenMode);
- };
- }
-}
-#endif // _CONNECTIVITY_FILE_TABLE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FTables.hxx b/connectivity/source/inc/file/FTables.hxx
deleted file mode 100644
index 4c649f3946..0000000000
--- a/connectivity/source/inc/file/FTables.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_TABLES_HXX_
-#define _CONNECTIVITY_FILE_TABLES_HXX_
-
-#include "file/filedllapi.hxx"
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-
-namespace connectivity
-{
- namespace file
- {
- class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OTables :
- public sdbcx::OCollection
- {
- protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
-
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- public:
- OTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : sdbcx::OCollection(_rParent,_rMetaData->supportsMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
- ,m_xMetaData(_rMetaData)
- {}
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
-
- // only the name is identical to ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- };
- }
-}
-#endif // _CONNECTIVITY_FILE_TABLES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/fanalyzer.hxx b/connectivity/source/inc/file/fanalyzer.hxx
deleted file mode 100644
index 1731ac829d..0000000000
--- a/connectivity/source/inc/file/fanalyzer.hxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_FANALYZER_HXX_
-#define _CONNECTIVITY_FILE_FANALYZER_HXX_
-
-#include "file/fcomp.hxx"
-#include "file/filedllapi.hxx"
-
-namespace connectivity
-{
- namespace file
- {
- class OConnection;
- class OOO_DLLPUBLIC_FILE OSQLAnalyzer
- {
- typedef ::std::list<OEvaluateSet*> OEvaluateSetList;
- typedef ::std::pair< ::rtl::Reference<OPredicateCompiler>,::rtl::Reference<OPredicateInterpreter> > TPredicates;
-
- ::std::vector< TPredicates > m_aSelectionEvaluations;
- ::rtl::Reference<OPredicateCompiler> m_aCompiler;
- ::rtl::Reference<OPredicateInterpreter> m_aInterpreter;
- OConnection* m_pConnection;
-
- mutable sal_Bool m_bHasSelectionCode;
- mutable sal_Bool m_bSelectionFirstTime;
-
- void bindRow(OCodeList& rCodeList,const OValueRefRow& _pRow,OEvaluateSetList& _rEvaluateSetList);
-
- public:
- OSQLAnalyzer(OConnection* _pConnection);
- virtual ~OSQLAnalyzer();
- inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () )
- { return ::rtl_allocateMemory( nSize ); }
- inline static void * SAL_CALL operator new( size_t /*nSize*/,void* _pHint ) SAL_THROW( () )
- { return _pHint; }
- inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () )
- { ::rtl_freeMemory( pMem ); }
- inline static void SAL_CALL operator delete( void * /*pMem*/,void* /*_pHint*/ ) SAL_THROW( () )
- { }
-
- OConnection* getConnection() const { return m_pConnection; }
- void describeParam(::rtl::Reference<OSQLColumns> rParameterColumns); // genauere Beschreibung der Parameter
- ::std::vector<sal_Int32>* bindEvaluationRow(OValueRefRow& _pRow); // Anbinden einer Ergebniszeile an die Restrictions
- /** bind the select columns if they contain a function which needs a row value
- @param _pRow the result row
- */
- void bindSelectRow(const OValueRefRow& _pRow);
-
- /** binds the row to parameter for the restrictions
- @param _pRow the parameter row
- */
- void bindParameterRow(OValueRefRow& _pRow);
-
- void setIndexes(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _xIndexes);
-
- void dispose();
- void start(OSQLParseNode* pSQLParseNode);
- void clean();
- virtual sal_Bool hasRestriction() const;
- virtual sal_Bool hasFunctions() const;
- inline sal_Bool evaluateRestriction() { return m_aInterpreter->start(); }
- void setSelectionEvaluationResult(OValueRefRow& _pRow,const ::std::vector<sal_Int32>& _rColumnMapping);
- void setOrigColumns(const OFileColumns& rCols);
- virtual OOperandAttr* createOperandAttr(sal_Int32 _nPos,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xCol,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _xIndexes=NULL);
- };
- }
-}
-#endif // _CONNECTIVITY_FILE_FANALYZER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/fcode.hxx b/connectivity/source/inc/file/fcode.hxx
deleted file mode 100644
index f52c95690e..0000000000
--- a/connectivity/source/inc/file/fcode.hxx
+++ /dev/null
@@ -1,398 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FILE_FCODE_HXX_
-#define _CONNECTIVITY_FILE_FCODE_HXX_
-
-#include "connectivity/sqliterator.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include "connectivity/CommonTools.hxx"
-#include <tools/rtti.hxx>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include "connectivity/FValue.hxx"
-#include "file/filedllapi.hxx"
-
-namespace connectivity
-{
- class OSQLParseNode;
- namespace dbase
- {
- class ODbaseIndex;
- }
- namespace file
- {
-
- class OOperand;
- typedef ::std::stack<OOperand*> OCodeStack;
- class OBoolOperator;
- typedef ::std::map<sal_Int32,sal_Int32> OEvaluateSet;
-
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> OFileColumns;
-
-
- class OOO_DLLPUBLIC_FILE OCode
- {
- public:
- OCode();
- virtual ~OCode();
-
- inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () )
- { return ::rtl_allocateMemory( nSize ); }
- inline static void * SAL_CALL operator new( size_t /*nSize*/,void* _pHint ) SAL_THROW( () )
- { return _pHint; }
- inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () )
- { ::rtl_freeMemory( pMem ); }
- inline static void SAL_CALL operator delete( void * /*pMem*/,void* /*_pHint*/ ) SAL_THROW( () )
- { }
-
- TYPEINFO();
- };
-
-
- // operands that the parsetree generate
- class OOO_DLLPUBLIC_FILE OOperand : public OCode
- {
- protected:
- sal_Int32 m_eDBType;
-
- OOperand(const sal_Int32& _rType) : m_eDBType(_rType){}
- OOperand() : m_eDBType(::com::sun::star::sdbc::DataType::OTHER){}
-
- public:
- virtual const ORowSetValue& getValue() const = 0;
- virtual void setValue(const ORowSetValue& _rVal) = 0;
-
- virtual sal_Int32 getDBType() const {return m_eDBType;}
- virtual OEvaluateSet* preProcess(OBoolOperator* pOp, OOperand* pRight = 0);
- inline sal_Bool isValid() const;
-
- TYPEINFO();
- };
-
- class OOO_DLLPUBLIC_FILE OOperandRow : public OOperand
- {
- sal_uInt16 m_nRowPos;
- protected:
- OValueRefRow m_pRow;
-
- OOperandRow(sal_uInt16 _nPos, sal_Int32 _rType);
- public:
- sal_uInt16 getRowPos() const {return m_nRowPos;}
- virtual const ORowSetValue& getValue() const;
- virtual void setValue(const ORowSetValue& _rVal);
- void bindValue(const OValueRefRow& _pRow); // Bindung an den Wert, den der Operand repraesentiert
-
- TYPEINFO();
- };
-
- // Attribute aus einer Ergebniszeile
- class OOO_DLLPUBLIC_FILE OOperandAttr : public OOperandRow
- {
- protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xColumn;
-
- public:
- OOperandAttr(sal_uInt16 _nPos,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn);
-
- virtual sal_Bool isIndexed() const;
- virtual OEvaluateSet* preProcess(OBoolOperator* pOp, OOperand* pRight = 0);
- TYPEINFO();
- };
-
- // Parameter fuer ein Praedikat
- class OOperandParam : public OOperandRow
- {
- public:
- OOperandParam(connectivity::OSQLParseNode* pNode, sal_Int32 _nPos);
- void describe(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn, ::rtl::Reference<connectivity::OSQLColumns> _xParamColumns);
-
- TYPEINFO();
- };
-
- // WerteOperanden
- class OOperandValue : public OOperand
- {
- protected:
- ORowSetValue m_aValue;
-
- protected:
- OOperandValue(){}
- OOperandValue(const ORowSetValue& _rVar, sal_Int32 eDbType)
- : OOperand(eDbType)
- , m_aValue(_rVar)
- {}
-
- OOperandValue(sal_Int32 eDbType) :OOperand(eDbType){}
- public:
- virtual const ORowSetValue& getValue() const;
- virtual void setValue(const ORowSetValue& _rVal);
-
- TYPEINFO();
- };
-
-
- // Konstanten
- class OOperandConst : public OOperandValue
- {
- public:
- OOperandConst(const connectivity::OSQLParseNode& rColumnRef, const rtl::OUString& aStrValue);
-
- TYPEINFO();
- };
-
-
- // Ergebnis Operanden
- class OOperandResult : public OOperandValue
- {
- protected:
- OOperandResult(const ORowSetValue& _rVar, sal_Int32 eDbType)
- :OOperandValue(_rVar, eDbType) {}
- OOperandResult(sal_Int32 eDbType)
- :OOperandValue(eDbType) {}
- public:
- OOperandResult(const ORowSetValue& _rVar)
- :OOperandValue(_rVar, _rVar.getTypeKind()) {}
- TYPEINFO();
- };
-
-
- class OOperandResultBOOL : public OOperandResult
- {
- public:
- OOperandResultBOOL(sal_Bool bResult) : OOperandResult(::com::sun::star::sdbc::DataType::BIT)
- {
- m_aValue = bResult ? 1.0 : 0.0;
- m_aValue.setBound(sal_True);
- }
- };
-
- class OOperandResultNUM : public OOperandResult
- {
- public:
- OOperandResultNUM(double fNum) : OOperandResult(::com::sun::star::sdbc::DataType::DOUBLE)
- {
- m_aValue = fNum;
- m_aValue.setBound(sal_True);
- }
- };
-
- /** special stop operand
- is appended when a list of arguments ends
- */
- class OStopOperand : public OOperandValue
- {
- public:
- OStopOperand(){}
- TYPEINFO();
- };
-
- // Operatoren
- class OOO_DLLPUBLIC_FILE OOperator : public OCode
- {
- public:
- virtual void Exec(OCodeStack&) = 0;
- virtual sal_uInt16 getRequestedOperands() const; // Anzahl benoetigter Operanden
- // Standard ist 2
- TYPEINFO();
- };
-
-
- // boolsche Operatoren
-
- class OOO_DLLPUBLIC_FILE OBoolOperator : public OOperator
- {
- public:
- TYPEINFO();
- virtual void Exec(OCodeStack&);
- virtual sal_Bool operate(const OOperand*, const OOperand*) const;
- };
-
- class OOp_NOT : public OBoolOperator
- {
- public:
- TYPEINFO();
-
- protected:
- virtual void Exec(OCodeStack&);
- virtual sal_Bool operate(const OOperand*, const OOperand* = NULL) const;
- virtual sal_uInt16 getRequestedOperands() const;
- };
-
- class OOp_AND : public OBoolOperator
- {
- public:
- TYPEINFO();
-
- protected:
- virtual sal_Bool operate(const OOperand*, const OOperand*) const;
- };
-
- class OOp_OR : public OBoolOperator
- {
- public:
- TYPEINFO();
- protected:
- virtual sal_Bool operate(const OOperand*, const OOperand*) const;
- };
-
- class OOO_DLLPUBLIC_FILE OOp_ISNULL : public OBoolOperator
- {
- public:
- TYPEINFO();
- public:
- virtual void Exec(OCodeStack&);
- virtual sal_uInt16 getRequestedOperands() const;
- virtual sal_Bool operate(const OOperand*, const OOperand* = NULL) const;
- };
-
- class OOO_DLLPUBLIC_FILE OOp_ISNOTNULL : public OOp_ISNULL
- {
- public:
- TYPEINFO();
- virtual sal_Bool operate(const OOperand*, const OOperand* = NULL) const;
- };
-
- class OOO_DLLPUBLIC_FILE OOp_LIKE : public OBoolOperator
- {
- public:
- TYPEINFO();
- protected:
- const sal_Unicode cEscape;
-
- public:
- OOp_LIKE(const sal_Unicode cEsc = L'\0'):cEscape(cEsc){};
-
- virtual sal_Bool operate(const OOperand*, const OOperand*) const;
- };
-
- class OOp_NOTLIKE : public OOp_LIKE
- {
- public:
- TYPEINFO();
- public:
- OOp_NOTLIKE(const sal_Unicode cEsc = L'\0'):OOp_LIKE(cEsc){};
-
- virtual sal_Bool operate(const OOperand*, const OOperand*) const;
- };
-
- class OOO_DLLPUBLIC_FILE OOp_COMPARE : public OBoolOperator
- {
- sal_Int32 aPredicateType;
-
- public:
- TYPEINFO();
- OOp_COMPARE(sal_Int32 aPType)
- :aPredicateType(aPType) {}
-
- inline sal_Int32 getPredicateType() const { return aPredicateType; }
- virtual sal_Bool operate(const OOperand*, const OOperand*) const;
- };
-
- // numerische Operatoren
-
- class ONumOperator : public OOperator
- {
- public:
- virtual void Exec(OCodeStack&);
-
- TYPEINFO();
-
- protected:
- virtual double operate(const double& fLeft,const double& fRight) const = 0;
- };
-
- class OOp_ADD : public ONumOperator
- {
- protected:
- virtual double operate(const double& fLeft,const double& fRight) const;
- };
-
- class OOp_SUB : public ONumOperator
- {
- protected:
- virtual double operate(const double& fLeft,const double& fRight) const;
- };
-
- class OOp_MUL : public ONumOperator
- {
- protected:
- virtual double operate(const double& fLeft,const double& fRight) const;
- };
-
- class OOp_DIV : public ONumOperator
- {
- protected:
- virtual double operate(const double& fLeft,const double& fRight) const;
- };
-
- inline sal_Bool OOperand::isValid() const
- {
- return getValue().getDouble() != double(0.0);
- }
-
- // operator
- class ONthOperator : public OOperator
- {
- public:
- virtual void Exec(OCodeStack&);
-
- TYPEINFO();
-
- protected:
- virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const = 0;
- };
-
- class OBinaryOperator : public OOperator
- {
- public:
- virtual void Exec(OCodeStack&);
-
- TYPEINFO();
-
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const = 0;
- };
-
- class OUnaryOperator : public OOperator
- {
- public:
- virtual void Exec(OCodeStack&);
- virtual sal_uInt16 getRequestedOperands() const;
- virtual ORowSetValue operate(const ORowSetValue& lhs) const = 0;
-
- TYPEINFO();
-
- };
- }
-}
-
-#endif // _CONNECTIVITY_FILE_FCODE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/fcomp.hxx b/connectivity/source/inc/file/fcomp.hxx
deleted file mode 100644
index ed0f7586b1..0000000000
--- a/connectivity/source/inc/file/fcomp.hxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_FILE_FCOMP_HXX_
-#define _CONNECTIVITY_FILE_FCOMP_HXX_
-
-#include "file/fcode.hxx"
-#include "file/filedllapi.hxx"
-#ifndef _LIST_
-#include <list>
-#endif
-
-namespace connectivity
-{
- class OSQLParseNode;
- namespace file
- {
- class OCode;
- class OOperand;
- class OSQLAnalyzer;
- typedef::std::vector<OCode*> OCodeList;
-
- class OPredicateCompiler : public ::salhelper::SimpleReferenceObject
- {
- friend class OPredicateInterpreter;
- friend class OSQLAnalyzer;
-
- OCodeList m_aCodeList;
- OFileColumns m_orgColumns; // in filecurs this are the filecolumns
- OSQLAnalyzer* m_pAnalyzer;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xIndexes;
- sal_Int32 m_nParamCounter;
- sal_Bool m_bORCondition;
- public:
- OPredicateCompiler(OSQLAnalyzer* pAnalyzer);
-
- virtual ~OPredicateCompiler();
-
- inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () )
- { return ::rtl_allocateMemory( nSize ); }
- inline static void * SAL_CALL operator new( size_t /*nSize*/,void* _pHint ) SAL_THROW( () )
- { return _pHint; }
- inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () )
- { ::rtl_freeMemory( pMem ); }
- inline static void SAL_CALL operator delete( void * /*pMem*/,void* /*_pHint*/ ) SAL_THROW( () )
- { }
- void dispose();
-
- void start(connectivity::OSQLParseNode* pSQLParseNode);
- OOperand* execute(connectivity::OSQLParseNode* pPredicateNode);
-
- void Clean();
- sal_Bool isClean() const {return m_aCodeList.empty();}
- sal_Bool hasCode() const {return !isClean();}
- sal_Bool hasORCondition() const {return m_bORCondition;}
- void setOrigColumns(const OFileColumns& rCols) { m_orgColumns = rCols; }
- const OFileColumns getOrigColumns() const { return m_orgColumns; }
- protected:
- OOperand* execute_COMPARE(connectivity::OSQLParseNode* pPredicateNode) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- OOperand* execute_LIKE(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- OOperand* execute_BETWEEN(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- OOperand* execute_ISNULL(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- OOperand* execute_Operand(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- OOperand* execute_Fold(OSQLParseNode* pPredicateNode) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- OOperand* executeFunction(OSQLParseNode* pPredicateNode) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-
-
- class OPredicateInterpreter :
- public ::salhelper::SimpleReferenceObject
- {
- OCodeStack m_aStack;
- ::rtl::Reference<OPredicateCompiler> m_rCompiler;
-
- public:
- OPredicateInterpreter(const ::rtl::Reference<OPredicateCompiler>& rComp) : m_rCompiler(rComp){}
- virtual ~OPredicateInterpreter();
-
- sal_Bool evaluate(OCodeList& rCodeList);
- void evaluateSelection(OCodeList& rCodeList,ORowSetValueDecoratorRef& _rVal);
-
- inline sal_Bool start()
- {
- return evaluate(m_rCompiler->m_aCodeList);
- }
-
- inline void startSelection(ORowSetValueDecoratorRef& _rVal)
- {
- evaluateSelection(m_rCompiler->m_aCodeList,_rVal);
- }
-
-
- };
- }
-}
-#endif // _CONNECTIVITY_FILE_FCOMP_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/filedllapi.hxx b/connectivity/source/inc/file/filedllapi.hxx
deleted file mode 100644
index 5c8e3d878e..0000000000
--- a/connectivity/source/inc/file/filedllapi.hxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_FILE_FILEDLLAPI_HXX
-#define INCLUDED_CONNECTIVITY_SOURCE_INC_FILE_FILEDLLAPI_HXX
-
-#include "sal/config.h"
-
-#include "sal/types.h"
-
-#if defined OOO_DLLIMPLEMENTATION_FILE
-#define OOO_DLLPUBLIC_FILE SAL_DLLPUBLIC_EXPORT
-#else
-#define OOO_DLLPUBLIC_FILE SAL_DLLPUBLIC_IMPORT
-#endif
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/quotedstring.hxx b/connectivity/source/inc/file/quotedstring.hxx
deleted file mode 100644
index 4bcf6e5a0f..0000000000
--- a/connectivity/source/inc/file/quotedstring.hxx
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_QUOTED_STRING_HXX
-#define CONNECTIVITY_QUOTED_STRING_HXX
-
-#include <tools/string.hxx>
-#include "file/filedllapi.hxx"
-
-namespace connectivity
-{
- //==================================================================
- // Ableitung von String mit ueberladenen GetToken/GetTokenCount-Methoden
- // Speziell fuer FLAT FILE-Format: Strings koennen gequotet sein
- //==================================================================
- class OOO_DLLPUBLIC_FILE QuotedTokenizedString
- {
- String m_sString;
- public:
- QuotedTokenizedString() {}
- QuotedTokenizedString(const String& _sString) : m_sString(_sString){}
-
- xub_StrLen GetTokenCount( sal_Unicode cTok , sal_Unicode cStrDel ) const;
- void GetTokenSpecial( String& _rStr,xub_StrLen& nStartPos, sal_Unicode cTok = ';', sal_Unicode cStrDel = '\0' ) const;
- inline String& GetString() { return m_sString; }
- inline xub_StrLen Len() const { return m_sString.Len(); }
- inline operator String&() { return m_sString; }
- };
-}
-
-#endif // CONNECTIVITY_QUOTED_STRING_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/flat/ECatalog.hxx b/connectivity/source/inc/flat/ECatalog.hxx
deleted file mode 100644
index 600b793047..0000000000
--- a/connectivity/source/inc/flat/ECatalog.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FLAT_CATALOG_HXX_
-#define _CONNECTIVITY_FLAT_CATALOG_HXX_
-
-#include "file/FCatalog.hxx"
-
-namespace connectivity
-{
- namespace flat
- {
- class OFlatConnection;
- class OFlatCatalog : public file::OFileCatalog
- {
- public:
- virtual void refreshTables();
-
- public:
- OFlatCatalog(OFlatConnection* _pCon);
- };
- }
-}
-#endif // _CONNECTIVITY_FLAT_CATALOG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/flat/EColumns.hxx b/connectivity/source/inc/flat/EColumns.hxx
deleted file mode 100644
index 93f2197349..0000000000
--- a/connectivity/source/inc/flat/EColumns.hxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FLAT_COLUMNS_HXX_
-#define _CONNECTIVITY_FLAT_COLUMNS_HXX_
-
-#include "file/FColumns.hxx"
-
-namespace connectivity
-{
- namespace flat
- {
- class OFlatColumns : public file::OColumns
- {
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- public:
- OFlatColumns(file::OFileTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector
- ) : file::OColumns(_pTable,_rMutex,_rVector)
- {}
-
- };
- }
-}
-#endif // _CONNECTIVITY_FLAT_COLUMNS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/flat/EConnection.hxx b/connectivity/source/inc/flat/EConnection.hxx
deleted file mode 100644
index 7e93db0e62..0000000000
--- a/connectivity/source/inc/flat/EConnection.hxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FLAT_ECONNECTION_HXX_
-#define _CONNECTIVITY_FLAT_ECONNECTION_HXX_
-
-#include "file/FConnection.hxx"
-
-namespace connectivity
-{
- namespace flat
- {
- class ODriver;
- class OFlatConnection : public file::OConnection
- {
- private:
- sal_Int32 m_nMaxRowsToScan;
- sal_Bool m_bHeaderLine; // column names in first row
- sal_Unicode m_cFieldDelimiter; // look at the name
- sal_Unicode m_cStringDelimiter; // delimiter for strings m_cStringDelimiter blabla m_cStringDelimiter
- sal_Unicode m_cDecimalDelimiter; // Dezimal-delimiter (Dezimalpoint)
- sal_Unicode m_cThousandDelimiter; //
- public:
- OFlatConnection(ODriver* _pDriver);
- virtual ~OFlatConnection();
-
- virtual void construct(const ::rtl::OUString& _rUrl,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo ) throw( ::com::sun::star::sdbc::SQLException);
-
- // own methods
- inline sal_Bool isHeaderLine() const { return m_bHeaderLine; }
- inline sal_Unicode getFieldDelimiter() const { return m_cFieldDelimiter; }
- inline sal_Unicode getStringDelimiter() const { return m_cStringDelimiter; }
- inline sal_Unicode getDecimalDelimiter() const { return m_cDecimalDelimiter; }
- inline sal_Unicode getThousandDelimiter() const { return m_cThousandDelimiter;}
- inline sal_Int32 getMaxRowsToScan() const { return m_nMaxRowsToScan;}
- // XServiceInfo
- DECLARE_SERVICE_INFO();
-
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_FLAT_DCONNECTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/flat/EDatabaseMetaData.hxx b/connectivity/source/inc/flat/EDatabaseMetaData.hxx
deleted file mode 100644
index c4d0bce60a..0000000000
--- a/connectivity/source/inc/flat/EDatabaseMetaData.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FLAT_EDATABASEMETADATA_HXX_
-#define _CONNECTIVITY_FLAT_EDATABASEMETADATA_HXX_
-
-#include "file/FDatabaseMetaData.hxx"
-
-namespace connectivity
-{
- namespace flat
- {
- //**************************************************************
- //************ Class: java.sql.DatabaseMetaDataDate
- //**************************************************************
-
- class OFlatDatabaseMetaData : public file::ODatabaseMetaData
- {
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw();
- protected:
- virtual ~OFlatDatabaseMetaData();
- public:
- OFlatDatabaseMetaData(file::OConnection* _pCon);
-
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_FLAT_ODATABASEMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/flat/EDriver.hxx b/connectivity/source/inc/flat/EDriver.hxx
deleted file mode 100644
index 794b4c5da1..0000000000
--- a/connectivity/source/inc/flat/EDriver.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FLAT_EDRIVER_HXX_
-#define _CONNECTIVITY_FLAT_EDRIVER_HXX_
-
-#include <cppuhelper/compbase2.hxx>
-#include "connectivity/CommonTools.hxx"
-#include "file/FDriver.hxx"
-
-namespace connectivity
-{
- namespace flat
- {
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ODriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
-
- class ODriver : public file::OFileDriver
- {
- public:
- ODriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) : file::OFileDriver(_rxFactory){}
-
- // XInterface
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- // static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-
-}
-#endif //_CONNECTIVITY_FLAT_DDRIVER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/flat/EPreparedStatement.hxx b/connectivity/source/inc/flat/EPreparedStatement.hxx
deleted file mode 100644
index 4304be59f6..0000000000
--- a/connectivity/source/inc/flat/EPreparedStatement.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FLAT_DPREPAREDSTATEMENT_HXX_
-#define _CONNECTIVITY_FLAT_DPREPAREDSTATEMENT_HXX_
-
-#include "file/FPreparedStatement.hxx"
-
-namespace connectivity
-{
- namespace flat
- {
- class OConnection;
- class OFlatPreparedStatement : public file::OPreparedStatement
- {
- protected:
- virtual file::OResultSet* createResultSet();
- public:
- OFlatPreparedStatement( file::OConnection* _pConnection) : file::OPreparedStatement( _pConnection){}
- DECLARE_SERVICE_INFO();
- };
- }
-}
-
-#endif //_CONNECTIVITY_FLAT_DPREPAREDSTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/flat/EResultSet.hxx b/connectivity/source/inc/flat/EResultSet.hxx
deleted file mode 100644
index 1d0e2eab1a..0000000000
--- a/connectivity/source/inc/flat/EResultSet.hxx
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FLAT_ERESULTSET_HXX_
-#define _CONNECTIVITY_FLAT_ERESULTSET_HXX_
-
-#include "file/FResultSet.hxx"
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace connectivity
-{
- namespace flat
- {
- class OFlatResultSet;
- // these typedef's are only necessary for the compiler
- typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XRowLocate> OFlatResultSet_BASE;
- typedef file::OResultSet OFlatResultSet_BASE2;
- typedef ::comphelper::OPropertyArrayUsageHelper<OFlatResultSet> OFlatResultSet_BASE3;
-
-
- class OFlatResultSet : public OFlatResultSet_BASE2,
- public OFlatResultSet_BASE,
- public OFlatResultSet_BASE3
- {
- sal_Bool m_bBookmarkable;
- protected:
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- public:
- DECLARE_SERVICE_INFO();
-
- OFlatResultSet( file::OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator);
-
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XRowLocate
- virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif //_CONNECTIVITY_FLAT_DRESULTSET_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/flat/EStatement.hxx b/connectivity/source/inc/flat/EStatement.hxx
deleted file mode 100644
index 018b204aae..0000000000
--- a/connectivity/source/inc/flat/EStatement.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FLAT_ESTATEMENT_HXX_
-#define _CONNECTIVITY_FLAT_ESTATEMENT_HXX_
-
-#include "file/FStatement.hxx"
-
-namespace connectivity
-{
- namespace flat
- {
- class OConnection;
- class OFlatStatement : public file::OStatement
- {
- protected:
- virtual file::OResultSet* createResultSet();
- public:
- OFlatStatement( file::OConnection* _pConnection) : file::OStatement( _pConnection){}
- DECLARE_SERVICE_INFO();
- };
- }
-}
-
-#endif //_CONNECTIVITY_FLAT_DSTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/flat/ETable.hxx b/connectivity/source/inc/flat/ETable.hxx
deleted file mode 100644
index 912f11845e..0000000000
--- a/connectivity/source/inc/flat/ETable.hxx
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FLAT_TABLE_HXX_
-#define _CONNECTIVITY_FLAT_TABLE_HXX_
-
-#include "file/FTable.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "connectivity/CommonTools.hxx"
-#include <tools/urlobj.hxx>
-#include "file/quotedstring.hxx"
-#include <unotools/syslocale.hxx>
-
-namespace connectivity
-{
- namespace flat
- {
- typedef file::OFileTable OFlatTable_BASE;
- class OFlatConnection;
-
- typedef ::std::map< ::rtl::OUString,
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed>, comphelper::UStringMixLess > OContainer;
- typedef ::std::map<sal_Int32, sal_Int32> TRowPositionsInFile;
-
- class OFlatTable : public OFlatTable_BASE
- {
- // maps a row postion to a file position
- TRowPositionsInFile m_aFilePosToEndLinePos;
- ::std::map<sal_Int32, TRowPositionsInFile::iterator>
- m_aRowPosToFilePos;
- ::std::vector<sal_Int32> m_aTypes; // holds all type for columns just to avoid to ask the propertyset
- ::std::vector<sal_Int32> m_aPrecisions; // same as aboth
- ::std::vector<sal_Int32> m_aScales;
- QuotedTokenizedString m_aCurrentLine;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xNumberFormatter;
- ::com::sun::star::util::Date m_aNullDate;
- sal_Int32 m_nStartRowFilePos;
- sal_Int32 m_nRowPos;
- sal_Int32 m_nMaxRowCount; // will be set if stream is once eof
- sal_Unicode m_cStringDelimiter; // delimiter for strings m_cStringDelimiter blabla m_cStringDelimiter
- sal_Unicode m_cFieldDelimiter; // look at the name
- bool m_bNeedToReadLine;
- private:
- void fillColumns(const ::com::sun::star::lang::Locale& _aLocale);
- sal_Bool CreateFile(const INetURLObject& aFile, sal_Bool& bCreateMemo);
- sal_Bool readLine(sal_Int32& _rnCurrentPos);
- void impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine,xub_StrLen& nStartPosFirstLine,xub_StrLen& nStartPosFirstLine2
- ,sal_Int32& io_nType,sal_Int32& io_nPrecisions,sal_Int32& io_nScales,String& o_sTypeName
- ,const sal_Unicode cDecimalDelimiter,const sal_Unicode cThousandDelimiter,const CharClass& aCharClass);
- public:
- virtual void refreshColumns();
-
- public:
- // DECLARE_CTY_DEFAULTS( OFlatTable_BASE);
- OFlatTable( sdbcx::OCollection* _pTables,OFlatConnection* _pConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description = ::rtl::OUString(),
- const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
- const ::rtl::OUString& _CatalogName = ::rtl::OUString()
- );
-
- void construct(); // can throw any exception
-
- virtual sal_Bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos);
- virtual sal_Bool fetchRow(OValueRefRow& _rRow,const OSQLColumns& _rCols, sal_Bool bIsTable,sal_Bool bRetrieveData);
- virtual void refreshHeader();
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL disposing(void);
-
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- String getEntry();
- };
- }
-}
-#endif // _CONNECTIVITY_FLAT_TABLE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/flat/ETables.hxx b/connectivity/source/inc/flat/ETables.hxx
deleted file mode 100644
index 75db907662..0000000000
--- a/connectivity/source/inc/flat/ETables.hxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_FLAT_TABLES_HXX_
-#define _CONNECTIVITY_FLAT_TABLES_HXX_
-
-#include "file/FTables.hxx"
-
-namespace connectivity
-{
- namespace flat
- {
- // namespace ::com::sun::star::sdbcx = ::com::sun::star::sdbcx;
- typedef file::OTables OFlatTables_BASE;
-
- class OFlatTables : public OFlatTables_BASE
- {
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- public:
- OFlatTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : OFlatTables_BASE(_rMetaData,_rParent,_rMutex,_rVector)
- {}
- };
- }
-}
-#endif // _CONNECTIVITY_FLAT_TABLES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HCatalog.hxx b/connectivity/source/inc/hsqldb/HCatalog.hxx
deleted file mode 100644
index 71282008b6..0000000000
--- a/connectivity/source/inc/hsqldb/HCatalog.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_HSQLDB_CATALOG_HXX
-#define CONNECTIVITY_HSQLDB_CATALOG_HXX
-
-#include "connectivity/sdbcx/VCatalog.hxx"
-#include "connectivity/StdTypeDefs.hxx"
-
-namespace connectivity
-{
- namespace hsqldb
- {
- // please don't name the class the same name as in an other namespaces
- // some compilers have problems with this task as I noticed on windows
- class OHCatalog : public connectivity::sdbcx::OCatalog
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
-
- /** calls XDatabaseMetaData::getTables.
- @param _sKindOfObject
- The type of tables to be fetched.
- @param _rNames
- The container for the names to be filled.
- */
- void refreshObjects(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _sKindOfObject,TStringVector& _rNames);
-
- public:
- // implementation of the pure virtual methods
- virtual void refreshTables();
- virtual void refreshViews() ;
- virtual void refreshGroups();
- virtual void refreshUsers() ;
-
- public:
- OHCatalog(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
-
- inline sdbcx::OCollection* getPrivateTables() const { return m_pTables;}
- inline sdbcx::OCollection* getPrivateViews() const { return m_pViews; }
- inline ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection() const { return m_xConnection; }
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- // ::cppu::OComponentHelper
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // CONNECTIVITY_HSQLDB_CATALOG_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HColumns.hxx b/connectivity/source/inc/hsqldb/HColumns.hxx
deleted file mode 100644
index 637ea8f2c2..0000000000
--- a/connectivity/source/inc/hsqldb/HColumns.hxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_HSQLDB_COLUMN_HXX
-#define CONNECTIVITY_HSQLDB_COLUMN_HXX
-#include "connectivity/TColumnsHelper.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-
-namespace connectivity
-{
- namespace hsqldb
- {
- class OHSQLColumns : public OColumnsHelper
- {
- protected:
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- public:
- OHSQLColumns( ::cppu::OWeakObject& _rParent
- ,sal_Bool _bCase
- ,::osl::Mutex& _rMutex
- ,const TStringVector &_rVector
- ,sal_Bool _bUseHardRef = sal_True
- );
- };
-
- class OHSQLColumn;
- typedef sdbcx::OColumn OHSQLColumn_BASE;
- typedef ::comphelper::OIdPropertyArrayUsageHelper<OHSQLColumn> OHSQLColumn_PROP;
-
- class OHSQLColumn : public OHSQLColumn_BASE,
- public OHSQLColumn_PROP
- {
- ::rtl::OUString m_sAutoIncrement;
- protected:
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- public:
- OHSQLColumn(sal_Bool _bCase);
- virtual void construct();
-
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // CONNECTIVITY_HSQLDB_COLUMN_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HConnection.hxx b/connectivity/source/inc/hsqldb/HConnection.hxx
deleted file mode 100644
index 5c86cf9dee..0000000000
--- a/connectivity/source/inc/hsqldb/HConnection.hxx
+++ /dev/null
@@ -1,160 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_HSQLDB_CONNECTION_HXX
-#define CONNECTIVITY_HSQLDB_CONNECTION_HXX
-
-#include "connectivity/ConnectionWrapper.hxx"
-/** === begin UNO includes === **/
-#include <com/sun/star/util/XFlushable.hpp>
-#include <com/sun/star/sdbc/XDriver.hpp>
-#ifndef __com_sun_star_sdb_application_XTableUIProvider_hpp__
-#include <com/sun/star/sdb/application/XTableUIProvider.hpp>
-#endif
-#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-/** === end UNO includes === **/
-#include <cppuhelper/compbase2.hxx>
-#include <comphelper/uno3.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
-#include <memory>
-
-namespace connectivity
-{
- namespace hsqldb
- {
- class SAL_NO_VTABLE IMethodGuardAccess
- {
- public:
- virtual ::osl::Mutex& getMutex() const = 0;
- virtual void checkDisposed() const = 0;
- };
-
- //==========================================================================
- //= OHsqlConnection - wraps all methods to the real connection from the driver
- //= but when disposed it doesn't dispose the real connection
- //==========================================================================
- typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::util::XFlushable
- , ::com::sun::star::sdb::application::XTableUIProvider
- > OHsqlConnection_BASE;
-
- class OHsqlConnection :public ::comphelper::OBaseMutex
- ,public OHsqlConnection_BASE
- ,public OConnectionWrapper
- ,public IMethodGuardAccess
- {
- private:
- ::cppu::OInterfaceContainerHelper m_aFlushListeners;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > m_xDriver;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
- bool m_bIni;
- bool m_bReadOnly;
-
- protected:
- virtual void SAL_CALL disposing(void);
- virtual ~OHsqlConnection();
-
- public:
- OHsqlConnection(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > _rxDriver,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _xORB
- );
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
- DECLARE_XTYPEPROVIDER()
- DECLARE_XINTERFACE( )
-
- // IMethodGuardAccess
- virtual ::osl::Mutex& getMutex() const;
- virtual void checkDisposed() const;
-
- // XFlushable
- virtual void SAL_CALL flush( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addFlushListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XFlushListener >& l ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeFlushListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XFlushListener >& l ) throw (::com::sun::star::uno::RuntimeException);
-
- // XTableUIProvider
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > SAL_CALL getTableIcon( const ::rtl::OUString& TableName, ::sal_Int32 ColorMode ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getTableEditor( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& DocumentUI, const ::rtl::OUString& TableName ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- private:
-
- /** retrieves our table container
- @return
- our table container. Guaranteed to not be <NULL/>.
- @throws ::com::sun::star::lang::WrappedTargetException
- if a non-RuntimeException is caught during obtaining the container.
- @throws ::com::sun::star::uno::RuntimeException
- if a serious error occurs
- @precond
- We're not disposed.
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
- impl_getTableContainer_throw();
-
- /** checks whether the given table name denotes an existing table
- @param _rTableName
- the fully name of the table to check for existence
- @throws ::com::sun::star::lang::IllegalArgumentException
- if the name does not denote an existing table
- @precond
- We're not disposed.
- */
- void impl_checkExistingTable_throw( const ::rtl::OUString& _rTableName );
-
- /** checks whether the given table name refers to a HSQL TEXT TABLE
- */
- bool impl_isTextTable_nothrow( const ::rtl::OUString& _rTableName );
-
- /** retrieves the icon for HSQL TEXT TABLEs
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
- impl_getTextTableIcon_nothrow();
- };
-
- //==========================================================================
- //= OHsqlConnection
- //==========================================================================
- class MethodGuard : public ::osl::MutexGuard
- {
- private:
- typedef ::osl::MutexGuard BaseGuard;
-
- public:
- MethodGuard( const IMethodGuardAccess& _rComponent )
- :BaseGuard( _rComponent.getMutex() )
- {
- _rComponent.checkDisposed();
- }
- };
- }
-}
-#endif // CONNECTIVITY_HSQLDB_CONNECTION_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HDriver.hxx b/connectivity/source/inc/hsqldb/HDriver.hxx
deleted file mode 100644
index e3e2296cca..0000000000
--- a/connectivity/source/inc/hsqldb/HDriver.hxx
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_HSQLDB_DRIVER_HXX
-#define CONNECTIVITY_HSQLDB_DRIVER_HXX
-
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
-#include <com/sun/star/sdbcx/XCreateCatalog.hpp>
-#include <com/sun/star/embed/XTransactionListener.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/compbase5.hxx>
-#include <comphelper/uno3.hxx>
-#include <comphelper/stl_types.hxx>
-#include <comphelper/broadcasthelper.hxx>
-#include "connectivity/CommonTools.hxx"
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- class OMetaConnection;
-
- namespace hsqldb
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ODriverDelegator_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
-
- typedef ::cppu::WeakComponentImplHelper5< ::com::sun::star::sdbc::XDriver
- ,::com::sun::star::sdbcx::XDataDefinitionSupplier
- , ::com::sun::star::lang::XServiceInfo
- , ::com::sun::star::sdbcx::XCreateCatalog
- , ::com::sun::star::embed::XTransactionListener
- > ODriverDelegator_BASE;
-
- typedef ::std::pair< ::com::sun::star::uno::WeakReferenceHelper,::com::sun::star::uno::WeakReferenceHelper> TWeakRefPair;
- typedef ::std::pair< ::rtl::OUString ,TWeakRefPair > TWeakConnectionPair;
-
- typedef ::std::pair< ::com::sun::star::uno::WeakReferenceHelper,TWeakConnectionPair> TWeakPair;
- typedef ::std::vector< TWeakPair > TWeakPairVector;
-
-
- /** delegates all calls to the orignal driver and extend the existing one with the SDBCX layer.
-
- */
- class ODriverDelegator : public ::comphelper::OBaseMutex
- ,public ODriverDelegator_BASE
- {
- TWeakPairVector m_aConnections; // vector containing a list
- // of all the Connection objects
- // for this Driver
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > m_xDriver;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
- sal_Bool m_bInShutDownConnections;
-
- /** load the driver we want to delegate.
- The <member>m_xDriver</member> may be <NULL/> if the driver could not be loaded.
- @return
- The driver which was currently selected.
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > loadDriver( );
-
- /** shut down the connection and revoke the storage from the map
- @param _aIter
- The connection to shut down and storage to revoke.
- */
- void shutdownConnection(const TWeakPairVector::iterator& _aIter);
-
- public:
- /** creates a new delegator for a HSQLDB driver
- */
- ODriverDelegator(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMajorVersion( ) throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMinorVersion( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XDataDefinitionSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& connection ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // XCreateCatalog
- virtual void SAL_CALL createCatalog( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
-
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
-
- // XTransactionListener
- virtual void SAL_CALL preCommit( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL commited( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL preRevert( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL reverted( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
-
- void shutdownConnections();
- void flushConnections();
- protected:
- /// dtor
- virtual ~ODriverDelegator();
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- /** called when we connected to a newly created embedded database
- */
- void onConnectedNewDatabase(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection
- );
- };
- }
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-#endif // CONNECTIVITY_HSQLDB_DRIVER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HStorageAccess.h b/connectivity/source/inc/hsqldb/HStorageAccess.h
deleted file mode 100755
index 01d42a8f38..0000000000
--- a/connectivity/source/inc/hsqldb/HStorageAccess.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess */
-
-#ifndef _Included_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
-#define _Included_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
-#ifdef __cplusplus
-extern "C" {
-#endif
-/* Inaccessible static: class_00024com_00024sun_00024star_00024sdbcx_00024comp_00024hsqldb_00024StorageNativeOutputStream */
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: openStream
- * Signature: (Ljava/lang/String;Ljava/lang/String;I)V
- */
-JNIEXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_openStream
- (JNIEnv *, jobject, jstring, jstring, jint);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: close
- * Signature: (Ljava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_close
- (JNIEnv *, jobject, jstring, jstring);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: getFilePointer
- * Signature: (Ljava/lang/String;Ljava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_getFilePointer
- (JNIEnv *, jobject, jstring, jstring);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: length
- * Signature: (Ljava/lang/String;Ljava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_length
- (JNIEnv *, jobject, jstring, jstring);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: read
- * Signature: (Ljava/lang/String;Ljava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_read__Ljava_lang_String_2Ljava_lang_String_2
- (JNIEnv *, jobject, jstring, jstring);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: read
- * Signature: (Ljava/lang/String;Ljava/lang/String;[BII)I
- */
-JNIEXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_read__Ljava_lang_String_2Ljava_lang_String_2_3BII
- (JNIEnv *, jobject, jstring, jstring, jbyteArray, jint, jint);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: readInt
- * Signature: (Ljava/lang/String;Ljava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_readInt
- (JNIEnv *, jobject, jstring, jstring);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: seek
- * Signature: (Ljava/lang/String;Ljava/lang/String;J)V
- */
-JNIEXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_seek
- (JNIEnv *, jobject, jstring, jstring, jlong);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: write
- * Signature: (Ljava/lang/String;Ljava/lang/String;[BII)V
- */
-JNIEXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_write
- (JNIEnv *, jobject, jstring, jstring, jbyteArray, jint, jint);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess
- * Method: writeInt
- * Signature: (Ljava/lang/String;Ljava/lang/String;I)V
- */
-JNIEXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_writeInt
- (JNIEnv *, jobject, jstring, jstring, jint);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HStorageAccess.hxx b/connectivity/source/inc/hsqldb/HStorageAccess.hxx
deleted file mode 100644
index b543e09d5c..0000000000
--- a/connectivity/source/inc/hsqldb/HStorageAccess.hxx
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_HSQLDB_STORAGEACCESS_HXX
-#define CONNECTIVITY_HSQLDB_STORAGEACCESS_HXX
-
-#include "hsqldb/HStorageAccess.h"
-
-namespace connectivity { namespace hsqldb
-{
- class DataLogFile;
-} }
-
-jint read_from_storage_stream( JNIEnv * env, jobject obj_this, jstring name, jstring key, ::connectivity::hsqldb::DataLogFile* logger = NULL );
-jint read_from_storage_stream_into_buffer( JNIEnv * env, jobject obj_this,jstring name, jstring key, jbyteArray buffer, jint off, jint len, ::connectivity::hsqldb::DataLogFile* logger = NULL );
-void write_to_storage_stream_from_buffer( JNIEnv* env, jobject obj_this, jstring name, jstring key, jbyteArray buffer, jint off, jint len, ::connectivity::hsqldb::DataLogFile* logger = NULL );
-void write_to_storage_stream( JNIEnv* env, jobject obj_this, jstring name, jstring key, jint v, ::connectivity::hsqldb::DataLogFile* logger = NULL );
-
-#endif // CONNECTIVITY_HSQLDB_STORAGEACCESS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HStorageMap.hxx b/connectivity/source/inc/hsqldb/HStorageMap.hxx
deleted file mode 100644
index ee27fff089..0000000000
--- a/connectivity/source/inc/hsqldb/HStorageMap.hxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVI_HSQLDB_HSTORAGEMAP_HXX
-#define CONNECTIVI_HSQLDB_HSTORAGEMAP_HXX
-
-#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/embed/XTransactionListener.hpp>
-#include <com/sun/star/io/XStream.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/io/XSeekable.hpp>
-#include <boost/shared_ptr.hpp>
-#include <comphelper/stl_types.hxx>
-#include <jni.h>
-//........................................................................
-namespace connectivity
-{
-//........................................................................
- namespace hsqldb
- {
- class StreamHelper
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream> m_xStream;
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable> m_xSeek;
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream> m_xOutputStream;
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream> m_xInputStream;
- public:
- StreamHelper(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream>& _xStream);
- ~StreamHelper();
-
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream> getInputStream();
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream> getOutputStream();
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable> getSeek();
- };
-
-
- DECLARE_STL_USTRINGACCESS_MAP(::boost::shared_ptr<StreamHelper>,TStreamMap);
- typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >, ::rtl::OUString > TStorageURLPair;
- typedef ::std::pair< TStorageURLPair, TStreamMap> TStoragePair;
- DECLARE_STL_USTRINGACCESS_MAP(TStoragePair,TStorages);
- /** contains all storages so far accessed.
- */
- class StorageContainer
- {
- public:
- static ::rtl::OUString registerStorage(const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage>& _xStorage,const ::rtl::OUString& _sURL);
- static TStorages::mapped_type getRegisteredStorage(const ::rtl::OUString& _sKey);
- static ::rtl::OUString getRegisteredKey(const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage>& _xStorage);
- static void revokeStorage(const ::rtl::OUString& _sKey,const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XTransactionListener>& _xListener);
-
- static TStreamMap::mapped_type registerStream(JNIEnv * env,jstring name, jstring key,sal_Int32 _nMode);
- static void revokeStream(JNIEnv * env,jstring name, jstring key);
- static TStreamMap::mapped_type getRegisteredStream( JNIEnv * env, jstring name, jstring key);
-
- static ::rtl::OUString jstring2ustring(JNIEnv * env, jstring jstr);
- static ::rtl::OUString removeURLPrefix(const ::rtl::OUString& _sURL,const ::rtl::OUString& _sFileURL);
- static ::rtl::OUString removeOldURLPrefix(const ::rtl::OUString& _sURL);
- static void throwJavaException(const ::com::sun::star::uno::Exception& _aException,JNIEnv * env);
- };
- //........................................................................
- } // namespace hsqldb
- //........................................................................
-//........................................................................
-} // namespace connectivity
-
-//........................................................................
-#endif // CONNECTIVI_HSQLDB_HSTORAGEMAP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HTable.hxx b/connectivity/source/inc/hsqldb/HTable.hxx
deleted file mode 100644
index a59f5b9b31..0000000000
--- a/connectivity/source/inc/hsqldb/HTable.hxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_HSQLDB_TABLE_HXX
-#define CONNECTIVITY_HSQLDB_TABLE_HXX
-
-#include "connectivity/TTableHelper.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include <comphelper/IdPropArrayHelper.hxx>
-
-namespace connectivity
-{
- namespace hsqldb
- {
-
- ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xColProp);
-
- class OHSQLTable;
- typedef ::comphelper::OIdPropertyArrayUsageHelper< OHSQLTable > OHSQLTable_PROP;
- class OHSQLTable : public OTableHelper
- ,public OHSQLTable_PROP
- {
- sal_Int32 m_nPrivileges; // we have to set our privileges by our own
-
- /** executes the statmenmt.
- @param _rStatement
- The statement to execute.
- */
- void executeStatement(const ::rtl::OUString& _rStatement );
- protected:
-
- /** creates the column collection for the table
- @param _rNames
- The column names.
- */
- virtual sdbcx::OCollection* createColumns(const TStringVector& _rNames);
-
- /** creates the key collection for the table
- @param _rNames
- The key names.
- */
- virtual sdbcx::OCollection* createKeys(const TStringVector& _rNames);
-
- /** creates the index collection for the table
- @param _rNames
- The index names.
- */
- virtual sdbcx::OCollection* createIndexes(const TStringVector& _rNames);
-
- /** used to implement the creation of the array helper which is shared amongst all instances of the class.
- This method needs to be implemented in derived classes.
- <BR>
- The method gets called with s_aMutex acquired.
- <BR>
- as long as IPropertyArrayHelper has no virtual destructor, the implementation of ~OPropertyArrayUsageHelper
- assumes that you created an ::cppu::OPropertyArrayHelper when deleting s_pProps.
- @return an pointer to the newly created array helper. Must not be NULL.
- */
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const;
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- public:
- OHSQLTable( sdbcx::OCollection* _pTables,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
- OHSQLTable( sdbcx::OCollection* _pTables,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description = ::rtl::OUString(),
- const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
- const ::rtl::OUString& _CatalogName = ::rtl::OUString(),
- sal_Int32 _nPrivileges = 0
- );
-
- // ODescriptor
- virtual void construct();
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XAlterTable
- virtual void SAL_CALL alterColumnByName( const ::rtl::OUString& colName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
-
- // XRename
- virtual void SAL_CALL rename( const ::rtl::OUString& newName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
-
- /**
- returns the ALTER TABLE XXX COLUMN statement
- */
- ::rtl::OUString getAlterTableColumnPart();
-
- // some methods to alter table structures
- void alterColumnType(sal_Int32 nNewType,const ::rtl::OUString& _rColName,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xDescriptor);
- void alterDefaultValue(const ::rtl::OUString& _sNewDefault,const ::rtl::OUString& _rColName);
- void dropDefaultValue(const ::rtl::OUString& _sNewDefault);
-
- };
- }
-}
-#endif // CONNECTIVITY_HSQLDB_TABLE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HTables.hxx b/connectivity/source/inc/hsqldb/HTables.hxx
deleted file mode 100644
index baec755042..0000000000
--- a/connectivity/source/inc/hsqldb/HTables.hxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_HSQLDB_TABLES_HXX
-#define CONNECTIVITY_HSQLDB_TABLES_HXX
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-namespace connectivity
-{
- namespace hsqldb
- {
- class OTables : public sdbcx::OCollection
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
-
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
-
- void createTable( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual ::rtl::OUString getNameForObject(const sdbcx::ObjectType& _xObject);
- public:
- OTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector)
- ,m_xMetaData(_rMetaData)
- {}
-
- // only the name is identical to ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- // XDrop
- void appendNew(const ::rtl::OUString& _rsNewTable);
- // some helper functions
- /**
- returns a sql string which contains the column definition part for create or alter statements
- */
- static ::rtl::OUString getColumnSqlType(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColProp);
- /**
- returns the "not null" part or the default part of the table statement
- */
- static ::rtl::OUString getColumnSqlNotNullDefault(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColProp);
- /**
- returns the corresponding typename
- can contain () which have to filled with values
- */
- static ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColProp);
- };
- }
-}
-#endif // CONNECTIVITY_HSQLDB_TABLES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HTools.hxx b/connectivity/source/inc/hsqldb/HTools.hxx
deleted file mode 100644
index 2c1b8f4d5f..0000000000
--- a/connectivity/source/inc/hsqldb/HTools.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_HTOOLS_HXX
-#define CONNECTIVITY_HTOOLS_HXX
-
-/** === begin UNO includes === **/
-/** === end UNO includes === **/
-
-#include <rtl/ustrbuf.hxx>
-
-//........................................................................
-namespace connectivity { namespace hsqldb
-{
-//........................................................................
-
- //====================================================================
- //= HTools
- //====================================================================
- class HTools
- {
- public:
- /** appens a proper WHERE clause to the given buffer, which filters
- for a given table name
-
- @param _bShortForm
- <TRUE/> if the column names of the system table which is being asked
- have the short form (TABLE_CAT instead of TABLE_CATALOG, and so on)
- */
- static void appendTableFilterCrit(
- ::rtl::OUStringBuffer& _inout_rBuffer, const ::rtl::OUString& _rCatalog,
- const ::rtl::OUString _rSchema, const ::rtl::OUString _rName,
- bool _bShortForm
- );
- };
-
-//........................................................................
-} } // namespace connectivity::hsqldb
-//........................................................................
-
-#endif // CONNECTIVITY_HTOOLS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HUser.hxx b/connectivity/source/inc/hsqldb/HUser.hxx
deleted file mode 100644
index d5201c63e8..0000000000
--- a/connectivity/source/inc/hsqldb/HUser.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_HSQLDB_USER_HXX_
-#define _CONNECTIVITY_HSQLDB_USER_HXX_
-
-#include "connectivity/sdbcx/VUser.hxx"
-#include "com/sun/star/sdbc/XConnection.hpp"
-
-namespace connectivity
-{
- namespace hsqldb
- {
- typedef connectivity::sdbcx::OUser OUser_TYPEDEF;
-
- class OHSQLUser : public OUser_TYPEDEF
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
-
- ::rtl::OUString getPrivilegeString(sal_Int32 nRights) const;
- // return the privileges and additional the grant rights
- void findPrivilegesAndGrantPrivileges(const ::rtl::OUString& objName, sal_Int32 objType,sal_Int32& nRights,sal_Int32& nRightsWithGrant) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- public:
- virtual void refreshGroups();
- public:
- OHSQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
- OHSQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,const ::rtl::OUString& _Name);
-
- // XUser
- virtual void SAL_CALL changePassword( const ::rtl::OUString& objPassword, const ::rtl::OUString& newPassword ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XAuthorizable
- virtual sal_Int32 SAL_CALL getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-
- class OUserExtend;
- typedef ::comphelper::OPropertyArrayUsageHelper<OUserExtend> OUserExtend_PROP;
-
- class OUserExtend : public OHSQLUser,
- public OUserExtend_PROP
- {
- protected:
- ::rtl::OUString m_Password;
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- public:
- OUserExtend(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
-
- virtual void construct();
- };
- }
-}
-#endif // _CONNECTIVITY_HSQLDB_USER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HUsers.hxx b/connectivity/source/inc/hsqldb/HUsers.hxx
deleted file mode 100644
index 10bfa31eb2..0000000000
--- a/connectivity/source/inc/hsqldb/HUsers.hxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_HSQLDB_USERS_HXX_
-#define _CONNECTIVITY_HSQLDB_USERS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "com/sun/star/sdbc/XConnection.hpp"
-namespace connectivity
-{
- namespace sdbcx
- {
- class IRefreshableUsers;
- }
- namespace hsqldb
- {
- class OUsers : public sdbcx::OCollection
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
- connectivity::sdbcx::IRefreshableUsers* m_pParent;
- public:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OUsers( ::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
- connectivity::sdbcx::IRefreshableUsers* _pParent);
- };
- }
-}
-
-#endif // _CONNECTIVITY_HSQLDB_USERS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HView.hxx b/connectivity/source/inc/hsqldb/HView.hxx
deleted file mode 100644
index 51117c9914..0000000000
--- a/connectivity/source/inc/hsqldb/HView.hxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_HVIEW_HXX
-#define CONNECTIVITY_HVIEW_HXX
-
-#include "connectivity/sdbcx/VView.hxx"
-
-/** === begin UNO includes === **/
-#include <com/sun/star/sdbcx/XAlterView.hpp>
-/** === end UNO includes === **/
-
-#include <comphelper/uno3.hxx>
-#include <cppuhelper/implbase1.hxx>
-
-//........................................................................
-namespace connectivity { namespace hsqldb
-{
-//........................................................................
-
- //====================================================================
- //= HView
- //====================================================================
- typedef ::connectivity::sdbcx::OView HView_Base;
- typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XAlterView > HView_IBASE;
- class HView :public HView_Base
- ,public HView_IBASE
- {
- public:
- HView(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
- sal_Bool _bCaseSensitive,
- const ::rtl::OUString& _rSchemaName,
- const ::rtl::OUString& _rName
- );
-
- // UNO
- DECLARE_XINTERFACE()
- DECLARE_XTYPEPROVIDER()
-
- // XAlterView
- virtual void SAL_CALL alterCommand( const ::rtl::OUString& NewCommand ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- protected:
- virtual ~HView();
-
- protected:
- // OPropertyContainer
- virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle ) const;
-
- private:
- /** retrieves the current command of the View
-
- @throws ::com::sun::star::lang::WrappedTargetException
- if an error occurs while retrieving the command from the database and
- <arg>_bAllowSQLExceptin</arg> is <FALSE/>
- @throws ::com::sun::star::sdbc::SQLException
- if an error occurs while retrieving the command from the database and
- <arg>_bAllowSQLException</arg> is <TRUE/>
- */
- ::rtl::OUString impl_getCommand_throw( bool _bAllowSQLException ) const;
-
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
- private:
- using HView_Base::getFastPropertyValue;
- };
-
-//........................................................................
-} } // namespace connectivity::hsqldb
-//........................................................................
-
-#endif // CONNECTIVITY_HVIEW_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/HViews.hxx b/connectivity/source/inc/hsqldb/HViews.hxx
deleted file mode 100644
index ee2f61e6ab..0000000000
--- a/connectivity/source/inc/hsqldb/HViews.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_HSQLDB_VIEWS_HXX_
-#define _CONNECTIVITY_HSQLDB_VIEWS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-namespace connectivity
-{
- namespace hsqldb
- {
- class HViews : public sdbcx::OCollection
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- sal_Bool m_bInDrop;
-
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
-
- void createView( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- public:
- HViews(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
- ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, const TStringVector &_rVector );
-
- // only the name is identical to ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- void dropByNameImpl(const ::rtl::OUString& elementName);
- };
- }
-}
-#endif // _CONNECTIVITY_HSQLDB_VIEWS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/StorageFileAccess.h b/connectivity/source/inc/hsqldb/StorageFileAccess.h
deleted file mode 100755
index c99a16f6df..0000000000
--- a/connectivity/source/inc/hsqldb/StorageFileAccess.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess */
-
-#ifndef _Included_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess
-#define _Included_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess
- * Method: isStreamElement
- * Signature: (Ljava/lang/String;Ljava/lang/String;)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_isStreamElement
- (JNIEnv *, jobject, jstring, jstring);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess
- * Method: removeElement
- * Signature: (Ljava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_removeElement
- (JNIEnv *, jobject, jstring, jstring);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess
- * Method: renameElement
- * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_renameElement
- (JNIEnv *, jobject, jstring, jstring, jstring);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/hsqldb/StorageNativeInputStream.h b/connectivity/source/inc/hsqldb/StorageNativeInputStream.h
deleted file mode 100755
index 2c635de5a1..0000000000
--- a/connectivity/source/inc/hsqldb/StorageNativeInputStream.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream */
-
-#ifndef _Included_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
-#define _Included_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
-#ifdef __cplusplus
-extern "C" {
-#endif
-/* Inaccessible static: class_00024com_00024sun_00024star_00024sdbcx_00024comp_00024hsqldb_00024StorageNativeOutputStream */
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: openStream
- * Signature: (Ljava/lang/String;Ljava/lang/String;I)V
- */
-JNIEXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_openStream
- (JNIEnv * env, jobject obj_this,jstring key, jstring name, jint);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: read
- * Signature: (Ljava/lang/String;Ljava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2
- (JNIEnv * env, jobject obj_this,jstring key, jstring name);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: read
- * Signature: (Ljava/lang/String;Ljava/lang/String;[BII)I
- */
-JNIEXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3BII
- (JNIEnv * env, jobject obj_this,jstring key, jstring name, jbyteArray, jint, jint);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: close
- * Signature: (Ljava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_close
- (JNIEnv *, jobject, jstring, jstring);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: skip
- * Signature: (Ljava/lang/String;Ljava/lang/String;J)J
- */
-JNIEXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_skip
- (JNIEnv *, jobject, jstring, jstring, jlong);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: available
- * Signature: (Ljava/lang/String;Ljava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_available
- (JNIEnv *, jobject, jstring, jstring);
-
-/*
- * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
- * Method: read
- * Signature: (Ljava/lang/String;Ljava/lang/String;[B)I
- */
-JNIEXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3B
- (JNIEnv *, jobject, jstring, jstring, jbyteArray);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/internalnode.hxx b/connectivity/source/inc/internalnode.hxx
deleted file mode 100644
index 3009dc5992..0000000000
--- a/connectivity/source/inc/internalnode.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_SQLINTERNALNODE_HXX
-#define _CONNECTIVITY_SQLINTERNALNODE_HXX
-
-#include "connectivity/dbtoolsdllapi.hxx"
-#include <connectivity/sqlnode.hxx>
-
-namespace connectivity
-{
- //==========================================================================
- //= OSQLInternalNode
- //==========================================================================
- /** special node for avoiding memory leaks
- */
- class OSQLInternalNode : public OSQLParseNode
- {
- public:
- OSQLInternalNode(const sal_Char* pNewValue,
- SQLNodeType eNodeType,
- sal_uInt32 nNodeID = 0);
- OSQLInternalNode(const ::rtl::OString& _rNewValue,
- SQLNodeType eNodeType,
- sal_uInt32 nNodeID = 0);
- OSQLInternalNode(const sal_Unicode* pNewValue,
- SQLNodeType eNodeType,
- sal_uInt32 nNodeID = 0);
- OSQLInternalNode(const ::rtl::OUString& _rNewValue,
- SQLNodeType eNodeType,
- sal_uInt32 nNodeID = 0);
-
- virtual ~OSQLInternalNode();
- };
-}
-
-#endif //_CONNECTIVITY_SQLINTERNALNODE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/ContextClassLoader.hxx b/connectivity/source/inc/java/ContextClassLoader.hxx
deleted file mode 100644
index f1f49f0af8..0000000000
--- a/connectivity/source/inc/java/ContextClassLoader.hxx
+++ /dev/null
@@ -1,106 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_CONTEXTCLASSLOADER_HXX
-#define CONNECTIVITY_CONTEXTCLASSLOADER_HXX
-
-#include "java/GlobalRef.hxx"
-
-/** === begin UNO includes === **/
-/** === end UNO includes === **/
-
-namespace comphelper
-{
- class ResourceBasedEventLogger;
-}
-
-//........................................................................
-namespace connectivity { namespace jdbc
-{
-//........................................................................
-
- //====================================================================
- //= ContextClassLoaderScope
- //====================================================================
- /**
- */
- class ContextClassLoaderScope
- {
- public:
- /** creates the instance. If isActive returns <FALSE/> afterwards, then an exception
- happend in the JVM, which should be raised as UNO exception by the caller
-
- @param environment
- the current JNI environment
- @param newClassLoader
- the new class loader to set at the current thread
- @param _rLoggerForErrors
- the logger which should be passed to java_lang_object::ThrowLoggedSQLException in case
- an error occurs
- @param _rxErrorContext
- the context which should be passed to java_lang_object::ThrowLoggedSQLException in case
- an error occurs
-
- */
- ContextClassLoaderScope(
- JNIEnv& environment,
- const GlobalRef< jobject >& newClassLoader,
- const ::comphelper::ResourceBasedEventLogger& _rLoggerForErrors,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxErrorContext
- );
-
- ~ContextClassLoaderScope() { pop(true); }
-
- void pop() { pop(false); }
-
- bool isActive() const
- {
- return ( m_currentThread.is() )
- && ( m_setContextClassLoaderMethod != NULL );
- }
-
- private:
- ContextClassLoaderScope(ContextClassLoaderScope &); // not defined
- void operator =(ContextClassLoaderScope &); // not defined
-
- void pop( bool clearExceptions );
-
- JNIEnv& m_environment;
- LocalRef< jobject > m_currentThread;
- LocalRef< jobject > m_oldContextClassLoader;
- jmethodID m_setContextClassLoaderMethod;
- };
-
-
-//........................................................................
-} } // namespace connectivity::jdbc
-//........................................................................
-
-#endif // CONNECTIVITY_CONTEXTCLASSLOADER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/GlobalRef.hxx b/connectivity/source/inc/java/GlobalRef.hxx
deleted file mode 100644
index b6db5de516..0000000000
--- a/connectivity/source/inc/java/GlobalRef.hxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_GLOBALREF_HXX
-#define CONNECTIVITY_GLOBALREF_HXX
-
-#include "java/LocalRef.hxx"
-#include "java/lang/Object.hxx"
-
-/** === begin UNO includes === **/
-/** === end UNO includes === **/
-
-#include <jvmaccess/virtualmachine.hxx>
-
-//........................................................................
-namespace connectivity { namespace jdbc
-{
-//........................................................................
-
- //====================================================================
- //= GlobalRef
- //====================================================================
- /** helper class to hold a local ref to a JNI object
- */
- template< typename T >
- class GlobalRef
- {
- public:
- GlobalRef()
- :m_object( NULL )
- {
- }
-
- GlobalRef( const GlobalRef& _source )
- :m_object( NULL )
- {
- *this = _source;
- }
-
- GlobalRef& operator=( const GlobalRef& _source )
- {
- if ( &_source == this )
- return *this;
-
- SDBThreadAttach t;
- set( t.env(), _source.get() );
- return *this;
- }
-
- ~GlobalRef()
- {
- reset();
- }
-
- void reset()
- {
- if ( m_object != NULL )
- {
- SDBThreadAttach t;
- t.env().DeleteGlobalRef( m_object );
- m_object = NULL;
- }
- }
-
- void set( JNIEnv& _environment, T _object )
- {
- if ( m_object != NULL )
- _environment.DeleteGlobalRef( m_object );
- m_object = _object;
- if ( m_object )
- m_object = static_cast< T >( _environment.NewGlobalRef( m_object ) );
- }
-
- void set( LocalRef< T >& _object )
- {
- set( _object.env(), _object.release() );
- }
-
- T get() const
- {
- return m_object;
- }
-
- bool is() const
- {
- return m_object != NULL;
- }
-
- private:
- T m_object;
- };
-
-
-//........................................................................
-} } // namespace connectivity::jdbc
-//........................................................................
-
-#endif // CONNECTIVITY_GLOBALREF_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/LocalRef.hxx b/connectivity/source/inc/java/LocalRef.hxx
deleted file mode 100644
index 6f499ced88..0000000000
--- a/connectivity/source/inc/java/LocalRef.hxx
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_LOCALREF_HXX
-#define CONNECTIVITY_LOCALREF_HXX
-
-/** === begin UNO includes === **/
-/** === end UNO includes === **/
-
-#include <jvmaccess/virtualmachine.hxx>
-
-//........................................................................
-namespace connectivity { namespace jdbc
-{
-//........................................................................
-
- //====================================================================
- //= LocalRef
- //====================================================================
- /** helper class to hold a local ref to a JNI object
-
- Note that this class never actually calls NewLocalRef. It is assumed that all objects
- passed are already acquired with a local ref (as it usually is the case if you obtain
- the object from an JNI method).
- */
- template< typename T >
- class LocalRef
- {
- public:
- explicit LocalRef( JNIEnv& environment )
- :m_environment( environment )
- ,m_object( NULL )
- {
- }
-
- LocalRef( JNIEnv& environment, T object )
- :m_environment( environment )
- ,m_object( object )
- {
- }
-
- ~LocalRef()
- {
- reset();
- }
-
- T release()
- {
- T t = m_object;
- m_object = NULL;
- return t;
- }
-
- void set( T object ) { reset(); m_object = object; }
-
- void reset()
- {
- if ( m_object != NULL )
- {
- m_environment.DeleteLocalRef( m_object );
- m_object = NULL;
- }
- }
-
- JNIEnv& env() const { return m_environment; }
- T get() const { return m_object; }
- bool is() const { return m_object != NULL; }
-
- private:
- LocalRef(LocalRef &); // not defined
- void operator =(LocalRef &); // not defined
-
- protected:
- JNIEnv& m_environment;
- T m_object;
- };
-
-//........................................................................
-} } // namespace connectivity::jdbc
-//........................................................................
-
-#endif // CONNECTIVITY_LOCALREF_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/io/InputStream.hxx b/connectivity/source/inc/java/io/InputStream.hxx
deleted file mode 100644
index d813e7c821..0000000000
--- a/connectivity/source/inc/java/io/InputStream.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_IO_INPUTSTREAM_HXX_
-#define _CONNECTIVITY_JAVA_IO_INPUTSTREAM_HXX_
-
-#include "java/lang/Object.hxx"
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/io/XInputStream.hpp>
-
-namespace connectivity
-{
-
- //**************************************************************
- //************ Class: java.io.InputStream
- //**************************************************************
- class java_io_InputStream : public java_lang_Object,
- public ::cppu::WeakImplHelper1< ::com::sun::star::io::XInputStream>
- {
- protected:
- // statische Data for the class
- static jclass theClass;
- virtual ~java_io_InputStream();
- public:
- virtual jclass getMyClass() const;
- // a Constructor, that is needed for when Returning the Object is needed:
- java_io_InputStream( JNIEnv * pEnv, jobject myObj );
- // XInputStream
- virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL available( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeInput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // _CONNECTIVITY_JAVA_IO_INPUTSTREAM_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/io/Reader.hxx b/connectivity/source/inc/java/io/Reader.hxx
deleted file mode 100644
index 9afaa703b5..0000000000
--- a/connectivity/source/inc/java/io/Reader.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_JAVA_IO_READER_HXX_
-#define _CONNECTIVITY_JAVA_IO_READER_HXX_
-
-#include "java/lang/Object.hxx"
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/io/XInputStream.hpp>
-
-namespace connectivity
-{
- //**************************************************************
- //************ Class: java.io.InputStream
- //**************************************************************
- class java_io_Reader : public java_lang_Object,
- public ::cppu::WeakImplHelper1< ::com::sun::star::io::XInputStream>
- {
- protected:
- // static Data for the Class
- static jclass theClass;
- virtual ~java_io_Reader();
- public:
- virtual jclass getMyClass() const;
- // a Constructor, that is needed for when Returning the Object is needed:
- java_io_Reader( JNIEnv * pEnv, jobject myObj );
- // XInputStream
- virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL available( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeInput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // _CONNECTIVITY_JAVA_IO_READER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/lang/Boolean.hxx b/connectivity/source/inc/java/lang/Boolean.hxx
deleted file mode 100644
index 9b7adff443..0000000000
--- a/connectivity/source/inc/java/lang/Boolean.hxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_LANG_BOOLEAN_HXX_
-#define _CONNECTIVITY_JAVA_LANG_BOOLEAN_HXX_
-
-#include "java/lang/Object.hxx"
-//**************************************************************
-//************ Class: java.lang.Boolean
-//**************************************************************
-namespace connectivity
-{
- class java_lang_Boolean : public java_lang_Object
- {
- protected:
- // static Data for the class
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_lang_Boolean();
- // a Constructor, that is needed for when Returning the Object is needed:
- java_lang_Boolean( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
-
- static jclass st_getMyClass();
- };
-}
-
-#endif // _CONNECTIVITY_JAVA_LANG_BOOLEAN_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/lang/Class.hxx b/connectivity/source/inc/java/lang/Class.hxx
deleted file mode 100644
index 3c4f3c0b8d..0000000000
--- a/connectivity/source/inc/java/lang/Class.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_LANG_CLASS_HXX_
-#define _CONNECTIVITY_JAVA_LANG_CLASS_HXX_
-//**************************************************************
-//************ Class: java.lang.Class
-//**************************************************************
-#include "java/lang/Object.hxx"
-
-namespace connectivity
-{
- class java_lang_Class : public java_lang_Object
- {
- protected:
- // static Data for the Class
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_lang_Class();
- // a Constructor, that is needed for when Returning the Object is needed:
- java_lang_Class( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
-
- static java_lang_Class * forName( const ::rtl::OUString &_par0 );
- // return the jre object
- jobject newInstanceObject();
-
- };
-}
-
-#endif // _CONNECTIVITY_JAVA_LANG_CLASS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/lang/Exception.hxx b/connectivity/source/inc/java/lang/Exception.hxx
deleted file mode 100644
index 37a0b2cb2c..0000000000
--- a/connectivity/source/inc/java/lang/Exception.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_LANG_EXCEPTION_HXX_
-#define _CONNECTIVITY_JAVA_LANG_EXCEPTION_HXX_
-
-#include "java/lang/Throwable.hxx"
-
-namespace connectivity
-{
-
- //**************************************************************
- //************ Class: java.lang.Exception
- //**************************************************************
- class java_lang_Exception : public java_lang_Throwable{
- protected:
- // statis Data for the class
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_lang_Exception();
- // a Constructor, that is needed for when Returning the Object is needed:
- java_lang_Exception( JNIEnv * pEnv, jobject myObj ) : java_lang_Throwable( pEnv, myObj ){}
-
- };
-}
-#endif // _CONNECTIVITY_JAVA_LANG_EXCEPTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/lang/Object.hxx b/connectivity/source/inc/java/lang/Object.hxx
deleted file mode 100644
index 6aa83eec5f..0000000000
--- a/connectivity/source/inc/java/lang/Object.hxx
+++ /dev/null
@@ -1,169 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_LANG_OBJECT_HXX_
-#define _CONNECTIVITY_JAVA_LANG_OBJECT_HXX_
-
-#include <cstdarg>
-#include <osl/thread.h>
-#include <com/sun/star/sdbc/SQLException.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <osl/diagnose.h>
-#include <jvmaccess/virtualmachine.hxx>
-#include <memory>
-#include <functional>
-#include <boost/shared_ptr.hpp>
-
-//=====================================================================
-
-#ifdef HAVE_64BIT_POINTERS
-#error "no 64 bit pointer"
-#endif //HAVE_64BIT_POINTERS
-
-namespace comphelper
-{
- class ResourceBasedEventLogger;
-}
-
-namespace connectivity
-{
- typedef ::boost::shared_ptr< jvmaccess::VirtualMachine::AttachGuard> TGuard;
- class SDBThreadAttach
- {
- jvmaccess::VirtualMachine::AttachGuard m_aGuard;
- SDBThreadAttach(SDBThreadAttach&);
- SDBThreadAttach& operator= (SDBThreadAttach&);
- public:
- SDBThreadAttach();
- ~SDBThreadAttach();
-
- JNIEnv* pEnv;
- static void addRef();
- static void releaseRef();
-
- public:
- JNIEnv& env() const
- {
- // according to the documentation of jvmaccess::VirtualMachine::AttachGuard, our env is never
- // NULL, so why bothering with pointer checks?
- return *pEnv;
- }
- };
- //=====================================================================
- //=====================================================================
- class java_lang_Class;
- class java_lang_Object
- {
- // Zuweisungsoperator und Copy Konstruktor sind verboten
- java_lang_Object& operator= (java_lang_Object&);
- java_lang_Object(java_lang_Object&);
-
- // nur zum Zerstoeren des C++ Pointers in vom JSbxObject
- // abgeleiteten Java Objekten
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
-
- protected:
- // der JAVA Handle zu dieser Klasse
- jobject object;
- // Klassendefinition
-
- // neu in SJ2:
- static jclass theClass; // die Klasse braucht nur einmal angefordert werden !
-
- virtual jclass getMyClass() const;
-
- public:
- // der Konstruktor, der fuer die abgeleiteten Klassen verwendet
- // werden soll.
- java_lang_Object( JNIEnv * pEnv, jobject myObj );
- // der eigentliche Konstruktor
- java_lang_Object(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory=NULL);
-
- virtual ~java_lang_Object();
-
- void saveRef( JNIEnv * pEnv, jobject myObj );
- jobject getJavaObject() const { return object; }
- java_lang_Object * GetWrapper() { return this; }
- void clearObject(JNIEnv& rEnv);
- void clearObject();
-
- virtual ::rtl::OUString toString() const;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() { return m_xFactory; }
-
- static void ThrowSQLException(JNIEnv * pEnv,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> & _rContext);
- static void ThrowLoggedSQLException(
- const ::comphelper::ResourceBasedEventLogger& _rLogger,
- JNIEnv* pEnvironment,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext
- );
-
- static ::rtl::Reference< jvmaccess::VirtualMachine > getVM(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory=NULL);
-
- static jclass findMyClass(const char* _pClassName);
- void obtainMethodId(JNIEnv* _pEnv, const char* _pMethodName, const char* _pSignature, jmethodID& _inout_MethodID) const;
-
- sal_Bool callBooleanMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) const;
- sal_Bool callBooleanMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const;
- jobject callResultSetMethod( JNIEnv& _rEnv, const char* _pMethodName, jmethodID& _inout_MethodID ) const;
- sal_Int32 callIntMethod( const char* _pMethodName, jmethodID& _inout_MethodID,bool _bIgnoreException = false ) const;
- sal_Int32 callIntMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const;
- sal_Int32 callIntMethodWithStringArg( const char* _pMethodName, jmethodID& _inout_MethodID,const ::rtl::OUString& _nArgument ) const;
- ::rtl::OUString callStringMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) const;
- ::rtl::OUString callStringMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID , sal_Int32 _nArgument) const;
- void callVoidMethod( const char* _pMethodName, jmethodID& _inout_MethodID) const;
- void callVoidMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument,bool _bIgnoreException = false ) const;
- void callVoidMethodWithBoolArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument,bool _bIgnoreException = false ) const;
- void callVoidMethodWithStringArg( const char* _pMethodName, jmethodID& _inout_MethodID, const ::rtl::OUString& _nArgument ) const;
- jobject callObjectMethod( JNIEnv * pEnv, const char* _pMethodName, const char* _pSignature, jmethodID& _inout_MethodID ) const;
- jobject callObjectMethodWithIntArg( JNIEnv * pEnv, const char* _pMethodName, const char* _pSignature, jmethodID& _inout_MethodID , sal_Int32 _nArgument) const;
-
- template< typename T >
- T callMethodWithIntArg(T (JNIEnv::*pCallMethod)( jobject obj, jmethodID methodID, ... ) ,const char* _pMethodName, const char* _pSignature, jmethodID& _inout_MethodID , sal_Int32 _nArgument) const
- {
- SDBThreadAttach t;
- obtainMethodId(t.pEnv, _pMethodName,_pSignature, _inout_MethodID);
- T out = (t.pEnv->*pCallMethod)( object, _inout_MethodID,_nArgument);
- ThrowSQLException( t.pEnv, NULL );
- return out;
- }
-
- template< typename T >
- void callVoidMethod(const char* _pMethodName, const char* _pSignature, jmethodID& _inout_MethodID,sal_Int32 _nArgument, const T& _aValue) const
- {
- SDBThreadAttach t;
- obtainMethodId(t.pEnv, _pMethodName,_pSignature, _inout_MethodID);
- t.pEnv->CallVoidMethod( object, _inout_MethodID,_nArgument,_aValue);
- ThrowSQLException( t.pEnv, NULL );
- }
-
-
- };
-}
-#endif //_CONNECTIVITY_JAVA_LANG_OBJJECT_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/lang/String.hxx b/connectivity/source/inc/java/lang/String.hxx
deleted file mode 100644
index 61be6699cf..0000000000
--- a/connectivity/source/inc/java/lang/String.hxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_LANG_STRING_HXX_
-#define _CONNECTIVITY_JAVA_LANG_STRING_HXX_
-
-#include "java/lang/Object.hxx"
-
-namespace connectivity
-{
- class java_lang_String : public java_lang_Object
- {
- protected:
- // statis Data for the Class
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_lang_String();
- // a Constructor, that is needed for when Returning the Object is needed:
- java_lang_String( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
-
- operator ::rtl::OUString();
-
- static jclass st_getMyClass();
- };
-
-}
-
-#endif // _CONNECTIVITY_JAVA_LANG_STRING_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/lang/Throwable.hxx b/connectivity/source/inc/java/lang/Throwable.hxx
deleted file mode 100644
index 3d837eb711..0000000000
--- a/connectivity/source/inc/java/lang/Throwable.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_LANG_THROWABLE_HXX_
-#define _CONNECTIVITY_JAVA_LANG_THROWABLE_HXX_
-
-#include "java/lang/Object.hxx"
-
-namespace connectivity
-{
- //**************************************************************
- //************ Class: java.lang.Throwable
- //**************************************************************
- class java_lang_Throwable : public java_lang_Object
- {
- protected:
- // static Data for the class
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_lang_Throwable();
- // a Constructor, that is needed for when Returning the Object is needed:
- java_lang_Throwable( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
- ::rtl::OUString getMessage() const;
- ::rtl::OUString getLocalizedMessage() const;
-
- static jclass st_getMyClass();
- };
-}
-#endif // _CONNECTIVITY_JAVA_LANG_THROWABLE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/math/BigDecimal.hxx b/connectivity/source/inc/java/math/BigDecimal.hxx
deleted file mode 100644
index 49a47b4585..0000000000
--- a/connectivity/source/inc/java/math/BigDecimal.hxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_MATH_BIGDECIMAL_HXX_
-#define _CONNECTIVITY_JAVA_MATH_BIGDECIMAL_HXX_
-
-#include "java/lang/Object.hxx"
-//**************************************************************
-//************ Class: java.lang.Boolean
-//**************************************************************
-namespace connectivity
-{
- class java_math_BigDecimal : public java_lang_Object
- {
- // static Data for the class
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_math_BigDecimal();
- // a Constructor, that is needed for when Returning the Object is needed:
- java_math_BigDecimal( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
-
- java_math_BigDecimal( const ::rtl::OUString& _par0 );
- java_math_BigDecimal( const double& _par0 );
- };
-}
-
-#endif // _CONNECTIVITY_JAVA_MATH_BIGDECIMAL_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/Array.hxx b/connectivity/source/inc/java/sql/Array.hxx
deleted file mode 100644
index b3e6d4ffa0..0000000000
--- a/connectivity/source/inc/java/sql/Array.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_SQL_ARRAY_HXX_
-#define _CONNECTIVITY_JAVA_SQL_ARRAY_HXX_
-
-#include "java/lang/Object.hxx"
-#include <com/sun/star/sdbc/XArray.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace connectivity
-{
-
- //**************************************************************
- //************ Class: java.sql.SQLWarning
- //**************************************************************
- class java_sql_Array : public java_lang_Object,
- public ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XArray>
- {
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_sql_Array();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_Array( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
-
- // XArray
- virtual ::rtl::OUString SAL_CALL getBaseTypeName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getBaseType( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getArray( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getArrayAtIndex( sal_Int32 index, sal_Int32 count, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getResultSet( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getResultSetAtIndex( sal_Int32 index, sal_Int32 count, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_ARRAY_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/Blob.hxx b/connectivity/source/inc/java/sql/Blob.hxx
deleted file mode 100644
index 754b38b09e..0000000000
--- a/connectivity/source/inc/java/sql/Blob.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_JAVA_SQL_BLOB_HXX_
-#define _CONNECTIVITY_JAVA_SQL_BLOB_HXX_
-
-#include "java/lang/Object.hxx"
-#include <com/sun/star/sdbc/XBlob.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace connectivity
-{
-
- //**************************************************************
- //************ Class: java.sql.SQLWarning
- //**************************************************************
- class java_sql_Blob : public java_lang_Object,
- public ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XBlob>
- {
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
- virtual ~java_sql_Blob();
- public:
- virtual jclass getMyClass() const;
-
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_Blob( JNIEnv * pEnv, jobject myObj );
-
- // XBlob
- virtual sal_Int64 SAL_CALL length( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int64 pos, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL position( const ::com::sun::star::uno::Sequence< sal_Int8 >& pattern, sal_Int64 start ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL positionOfBlob( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& pattern, sal_Int64 start ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_BLOB_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/CallableStatement.hxx b/connectivity/source/inc/java/sql/CallableStatement.hxx
deleted file mode 100644
index 00fd44c6fb..0000000000
--- a/connectivity/source/inc/java/sql/CallableStatement.hxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_SQL_CALLABLESTATEMENT_HXX_
-#define _CONNECTIVITY_JAVA_SQL_CALLABLESTATEMENT_HXX_
-
-#include "java/sql/PreparedStatement.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XOutParameters.hpp>
-
-namespace connectivity
-{
-
- //**************************************************************
- //************ Class: java.sql.CallableStatement
- //**************************************************************
-
- class java_sql_CallableStatement : public java_sql_PreparedStatement,
- public ::com::sun::star::sdbc::XRow,
- public ::com::sun::star::sdbc::XOutParameters
- {
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
- virtual void createStatement(JNIEnv* _pEnv);
-
- virtual ~java_sql_CallableStatement();
- public:
- DECLARE_SERVICE_INFO();
- virtual jclass getMyClass() const;
-
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_CallableStatement( JNIEnv * pEnv, java_sql_Connection& _rCon, const ::rtl::OUString& sql );
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XOutParameters
- virtual void SAL_CALL registerOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_CALLABLESTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/Clob.hxx b/connectivity/source/inc/java/sql/Clob.hxx
deleted file mode 100644
index 01265210c3..0000000000
--- a/connectivity/source/inc/java/sql/Clob.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_JAVA_SQL_CLOB_HXX_
-#define _CONNECTIVITY_JAVA_SQL_CLOB_HXX_
-
-#include "java/lang/Object.hxx"
-#include <com/sun/star/sdbc/XClob.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace connectivity
-{
-
- //**************************************************************
- //************ Class: java.sql.SQLWarning
- //**************************************************************
- class java_sql_Clob : public java_lang_Object,
- public ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XClob>
- {
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
- virtual ~java_sql_Clob();
- public:
- virtual jclass getMyClass() const;
-
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_Clob( JNIEnv * pEnv, jobject myObj );
-
- // XClob
- virtual sal_Int64 SAL_CALL length( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSubString( sal_Int64 pos, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL position( const ::rtl::OUString& searchstr, sal_Int32 start ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL positionOfClob( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& pattern, sal_Int64 start ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_CLOB_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/Connection.hxx b/connectivity/source/inc/java/sql/Connection.hxx
deleted file mode 100644
index 211e950a88..0000000000
--- a/connectivity/source/inc/java/sql/Connection.hxx
+++ /dev/null
@@ -1,153 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_SQL_CONNECTION_HXX_
-#define _CONNECTIVITY_JAVA_SQL_CONNECTION_HXX_
-
-#include "java/lang/Object.hxx"
-#include "TConnection.hxx"
-#include "connectivity/CommonTools.hxx"
-#include "OSubComponent.hxx"
-#include <cppuhelper/weakref.hxx>
-#include "AutoRetrievingBase.hxx"
-#include "java/sql/ConnectionLog.hxx"
-#include "java/LocalRef.hxx"
-#include "java/GlobalRef.hxx"
-
-#include <com/sun/star/beans/NamedValue.hpp>
-
-namespace connectivity
-{
- class java_sql_Driver;
-
- typedef OMetaConnection java_sql_Connection_BASE;
-
- class java_sql_Connection : public java_sql_Connection_BASE,
- public java_lang_Object,
- public OSubComponent<java_sql_Connection, java_sql_Connection_BASE>,
- public OAutoRetrievingBase
- {
- friend class OSubComponent<java_sql_Connection, java_sql_Connection_BASE>;
- const java_sql_Driver* m_pDriver;
- jobject m_pDriverobject;
- jdbc::GlobalRef< jobject >
- m_pDriverClassLoader;
-
- jclass m_Driver_theClass;
- java::sql::ConnectionLog
- m_aLogger;
- sal_Bool m_bParameterSubstitution;
- sal_Bool m_bIgnoreDriverPrivileges;
- sal_Bool m_bIgnoreCurrency;
- ::com::sun::star::uno::Any m_aCatalogRestriction;
- ::com::sun::star::uno::Any m_aSchemaRestriction;
-
- /** transform named parameter into unnamed one.
- @param _sSQL
- The SQL statement to transform.
- @return
- The new statement witgh unnamed parameters.
- */
- ::rtl::OUString transFormPreparedStatement(const ::rtl::OUString& _sSQL);
- void loadDriverFromProperties(
- const ::rtl::OUString& _sDriverClass,
- const ::rtl::OUString& _sDriverClassPath,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rSystemProperties
- );
- /** load driver class path from system configuration.
- @param _sDriverClass
- The driver class name to look for in the configuration.
- */
- ::rtl::OUString impl_getJavaDriverClassPath_nothrow(const ::rtl::OUString& _sDriverClass);
-
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
-
- virtual ~java_sql_Connection();
-
- public:
- virtual jclass getMyClass() const;
-
- DECLARE_SERVICE_INFO();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_Connection( const java_sql_Driver& _rDriver );
- sal_Bool construct( const ::rtl::OUString& url,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info);
-
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >&
- getConnectionInfo() const { return m_aConnectionInfo; }
-
- inline sal_Bool isIgnoreDriverPrivilegesEnabled() const { return m_bIgnoreDriverPrivileges;}
- inline sal_Bool isIgnoreCurrencyEnabled() const { return m_bIgnoreCurrency; }
- inline const ::com::sun::star::uno::Any& getCatalogRestriction() const { return m_aCatalogRestriction; }
- inline const ::com::sun::star::uno::Any& getSchemaRestriction() const { return m_aSchemaRestriction; }
-
- /** returns the instance used for logging events related to this connection
- */
- const java::sql::ConnectionLog& getLogger() const { return m_aLogger; }
-
- /** returns the class loader which was used to load the driver class
-
- Usually used in conjunction with a ContextClassLoaderScope instance.
- */
- const jdbc::GlobalRef< jobject >& getDriverClassLoader() const { return m_pDriverClassLoader; }
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL release() throw();
-
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL nativeSQL( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getAutoCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL commit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL rollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isClosed( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCatalog( const ::rtl::OUString& catalog ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalog( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_CONNECTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/ConnectionLog.hxx b/connectivity/source/inc/java/sql/ConnectionLog.hxx
deleted file mode 100644
index 74bddcd5b9..0000000000
--- a/connectivity/source/inc/java/sql/ConnectionLog.hxx
+++ /dev/null
@@ -1,145 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_CONNECTIONLOG_HXX
-#define CONNECTIVITY_CONNECTIONLOG_HXX
-
-/** === begin UNO includes === **/
-#include <com/sun/star/logging/LogLevel.hpp>
-/** === end UNO includes === **/
-
-#include <rtl/ustring.hxx>
-
-// Strange enough, GCC requires the following forward declarations of the various
-// convertLogArgToString flavors to be *before* the inclusion of comphelper/logging.hxx
-
-namespace com { namespace sun { namespace star { namespace util
-{
- struct Date;
- struct Time;
- struct DateTime;
-} } } }
-
-//........................................................................
-namespace comphelper { namespace log { namespace convert
-{
-//........................................................................
-
- // helpers for logging more data types than are defined in comphelper/logging.hxx
- ::rtl::OUString convertLogArgToString( const ::com::sun::star::util::Date& _rDate );
- ::rtl::OUString convertLogArgToString( const ::com::sun::star::util::Time& _rTime );
- ::rtl::OUString convertLogArgToString( const ::com::sun::star::util::DateTime& _rDateTime );
-
-//........................................................................
-} } }
-//........................................................................
-
-#include <comphelper/logging.hxx>
-
-namespace connectivity
-{
- namespace LogLevel = ::com::sun::star::logging::LogLevel;
-}
-
-//........................................................................
-namespace connectivity { namespace java { namespace sql {
-//........................................................................
-
- //====================================================================
- //= ConnectionLog
- //====================================================================
- typedef ::comphelper::ResourceBasedEventLogger ConnectionLog_Base;
- class ConnectionLog : public ConnectionLog_Base
- {
- public:
- enum ObjectType
- {
- CONNECTION = 0,
- STATEMENT,
- RESULTSET,
-
- ObjectTypeCount = RESULTSET + 1
- };
-
- private:
- const sal_Int32 m_nObjectID;
-
- public:
- /// will construct an instance of ObjectType CONNECTION
- ConnectionLog( const ::comphelper::ResourceBasedEventLogger& _rDriverLog );
- /// will create an instance with the same object ID / ObjectType as a given source instance
- ConnectionLog( const ConnectionLog& _rSourceLog );
- /// will create an instance of arbitrary ObjectType
- ConnectionLog( const ConnectionLog& _rSourceLog, ObjectType _eType );
-
- sal_Int32 getObjectID() const { return m_nObjectID; }
-
- /// logs a given message, without any arguments, or source class/method names
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID )
- {
- return ConnectionLog_Base::log( _nLogLevel, _nMessageResID, m_nObjectID );
- }
-
- template< typename ARGTYPE1 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1 ) const
- {
- return ConnectionLog_Base::log( _nLogLevel, _nMessageResID, m_nObjectID, _argument1 );
- }
-
- template< typename ARGTYPE1, typename ARGTYPE2 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
- {
- return ConnectionLog_Base::log( _nLogLevel, _nMessageResID, m_nObjectID, _argument1, _argument2 );
- }
-
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
- {
- return ConnectionLog_Base::log( _nLogLevel, _nMessageResID, m_nObjectID, _argument1, _argument2, _argument3 );
- }
-
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
- {
- return ConnectionLog_Base::log( _nLogLevel, _nMessageResID, m_nObjectID, _argument1, _argument2, _argument3, _argument4 );
- }
-
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
- {
- return ConnectionLog_Base::log( _nLogLevel, _nMessageResID, m_nObjectID, _argument1, _argument2, _argument3, _argument4, _argument5 );
- }
- };
-
-//........................................................................
-} } } // namespace connectivity::java::sql
-//........................................................................
-
-#endif // CONNECTIVITY_CONNECTIONLOG_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/DatabaseMetaData.hxx b/connectivity/source/inc/java/sql/DatabaseMetaData.hxx
deleted file mode 100644
index e0bd590cc1..0000000000
--- a/connectivity/source/inc/java/sql/DatabaseMetaData.hxx
+++ /dev/null
@@ -1,226 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_SQL_DATABASEMETADATA_HXX_
-#define _CONNECTIVITY_JAVA_SQL_DATABASEMETADATA_HXX_
-
-#include "java/lang/Object.hxx"
-#include "TDatabaseMetaDataBase.hxx"
-
-#include "java/sql/ConnectionLog.hxx"
-
-namespace connectivity
-{
- class java_sql_Connection;
- //**************************************************************
- //************ Class: java.sql.DatabaseMetaDataDate
- //**************************************************************
-
- class java_sql_DatabaseMetaData : public ODatabaseMetaDataBase,
- public java_lang_Object
- {
- java_sql_Connection* m_pConnection;
- java::sql::ConnectionLog m_aLogger;
-
- // statische Daten fuer die Klasse
- static jclass theClass;
-
- public:
- virtual jclass getMyClass() const;
- virtual ~java_sql_DatabaseMetaData();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_DatabaseMetaData( JNIEnv * pEnv, jobject myObj, java_sql_Connection& _rConnection );
-
- private:
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw();
- // cached database information
- virtual ::rtl::OUString impl_getIdentifierQuoteString_throw( );
- virtual sal_Bool impl_isCatalogAtStart_throw( );
- virtual ::rtl::OUString impl_getCatalogSeparator_throw( );
- virtual sal_Bool impl_supportsCatalogsInTableDefinitions_throw( );
- virtual sal_Bool impl_supportsSchemasInTableDefinitions_throw( ) ;
- virtual sal_Bool impl_supportsCatalogsInDataManipulation_throw( );
- virtual sal_Bool impl_supportsSchemasInDataManipulation_throw( ) ;
- virtual sal_Bool impl_supportsMixedCaseQuotedIdentifiers_throw( );
- virtual sal_Bool impl_supportsAlterTableWithAddColumn_throw( );
- virtual sal_Bool impl_supportsAlterTableWithDropColumn_throw( );
- virtual sal_Int32 impl_getMaxStatements_throw( );
- virtual sal_Int32 impl_getMaxTablesInSelect_throw( );
- virtual sal_Bool impl_storesMixedCaseQuotedIdentifiers_throw( );
-
- virtual sal_Bool SAL_CALL allProceduresAreCallable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL allTablesAreSelectable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getUserName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedLow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFiles( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSQLKeywords( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getNumericFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getStringFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSystemFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTimeDateFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSearchStringEscape( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getExtraNameCharacters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsColumnAliasing( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTypeConversion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getProcedureTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedDelete( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsStoredProcedures( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnionAll( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxConnections( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxIndexLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxRowSize( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxStatementLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getProcedures( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getProcedureColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTables( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getSchemas( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getCatalogs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTableTypes( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTablePrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getBestRowIdentifier( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope, sal_Bool nullable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getVersionColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getImportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getExportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getCrossReference( const ::com::sun::star::uno::Any& primaryCatalog, const ::rtl::OUString& primarySchema, const ::rtl::OUString& primaryTable, const ::com::sun::star::uno::Any& foreignCatalog, const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getIndexInfo( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Bool unique, sal_Bool approximate ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsBatchUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getUDTs( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern, const ::com::sun::star::uno::Sequence< sal_Int32 >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- private:
- sal_Bool impl_callBooleanMethod( const char* _pMethodName, jmethodID& _inout_MethodID );
- ::rtl::OUString impl_callStringMethod( const char* _pMethodName, jmethodID& _inout_MethodID );
- sal_Int32 impl_callIntMethod( const char* _pMethodName, jmethodID& _inout_MethodID );
- sal_Bool impl_callBooleanMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument );
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
- impl_callResultSetMethod( const char* _pMethodName, jmethodID& _inout_MethodID );
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
- impl_callResultSetMethodWithStrings( const char* _pMethodName, jmethodID& _inout_MethodID, const ::com::sun::star::uno::Any& _rCatalog,
- const ::rtl::OUString& _rSchemaPattern, const ::rtl::OUString& _rLeastPattern,
- const ::rtl::OUString* _pOptionalAdditionalString = NULL);
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_DATABASEMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/Driver.hxx b/connectivity/source/inc/java/sql/Driver.hxx
deleted file mode 100644
index 508429c301..0000000000
--- a/connectivity/source/inc/java/sql/Driver.hxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_JAVA_SQL_DRIVER_HXX_
-#define _CONNECTIVITY_JAVA_SQL_DRIVER_HXX_
-
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include "java/lang/Object.hxx"
-#include <cppuhelper/implbase2.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-#include <comphelper/logging.hxx>
-#include <comphelper/componentcontext.hxx>
-
-namespace connectivity
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL java_sql_Driver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
-
- class java_sql_Driver : public ::cppu::WeakImplHelper2< ::com::sun::star::sdbc::XDriver,::com::sun::star::lang::XServiceInfo>
- {
- ::comphelper::ComponentContext m_aContext;
- ::comphelper::ResourceBasedEventLogger m_aLogger;
-
- protected:
- virtual ~java_sql_Driver();
-
- public:
- java_sql_Driver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
-
- static rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Int32 SAL_CALL getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException) ;
- virtual sal_Int32 SAL_CALL getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
-
- const ::comphelper::ComponentContext& getContext() const { return m_aContext; }
- const ::comphelper::ResourceBasedEventLogger& getLogger() const { return m_aLogger; }
- };
-
-}
-#endif //_CONNECTIVITY_JAVA_SQL_DRIVER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/DriverPropertyInfo.hxx b/connectivity/source/inc/java/sql/DriverPropertyInfo.hxx
deleted file mode 100644
index 0e6955aa71..0000000000
--- a/connectivity/source/inc/java/sql/DriverPropertyInfo.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_JAVA_SQL_DRIVERPOPERTYINFO_HXX_
-#define _CONNECTIVITY_JAVA_SQL_DRIVERPOPERTYINFO_HXX_
-
-#include "java/lang/Object.hxx"
-#include <com/sun/star/sdbc/DriverPropertyInfo.hpp>
-
-namespace connectivity
-{
-
-//**************************************************************
-//************ Class: java.sql.DriverPropertyInfo
-//**************************************************************
- class java_sql_DriverPropertyInfo : public java_lang_Object
- {
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_sql_DriverPropertyInfo();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_DriverPropertyInfo( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
- operator ::com::sun::star::sdbc::DriverPropertyInfo();
-
- ::rtl::OUString name();
- ::rtl::OUString description();
- ::rtl::OUString value();
- sal_Bool required();
- ::com::sun::star::uno::Sequence< ::rtl::OUString> choices();
- };
-}
-
-#endif // _CONNECTIVITY_JAVA_SQL_DRIVERPOPERTYINFO_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/JStatement.hxx b/connectivity/source/inc/java/sql/JStatement.hxx
deleted file mode 100644
index 39f232c8d5..0000000000
--- a/connectivity/source/inc/java/sql/JStatement.hxx
+++ /dev/null
@@ -1,221 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_SQL_STATEMENT_HXX_
-#define _CONNECTIVITY_JAVA_SQL_STATEMENT_HXX_
-
-#include "java/lang/Object.hxx"
-#include <com/sun/star/sdbc/XStatement.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XMultipleResults.hpp>
-#include <com/sun/star/sdbc/XBatchExecution.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <com/sun/star/sdbc/XGeneratedResultSet.hpp>
-#include <comphelper/proparrhlp.hxx>
-#include <cppuhelper/compbase6.hxx>
-#include <comphelper/uno3.hxx>
-#include "connectivity/CommonTools.hxx"
-#include "OSubComponent.hxx"
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <comphelper/broadcasthelper.hxx>
-
-#include "java/sql/ConnectionLog.hxx"
-
-namespace connectivity
-{
-
- typedef ::cppu::WeakComponentImplHelper6< ::com::sun::star::sdbc::XStatement,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XGeneratedResultSet,
- ::com::sun::star::sdbc::XMultipleResults> java_sql_Statement_BASE;
-
- class java_sql_Connection;
-
- //**************************************************************
- //************ Class: java.sql.Statement
- //**************************************************************
- class java_sql_Statement_Base : public comphelper::OBaseMutex,
- public java_sql_Statement_BASE,
- public java_lang_Object,
- public ::cppu::OPropertySetHelper,
- public ::comphelper::OPropertyArrayUsageHelper<java_sql_Statement_Base>
-
- {
-
- sal_Int32 getQueryTimeOut() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getMaxFieldSize() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getMaxRows() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getResultSetConcurrency() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getResultSetType() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getFetchDirection() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getFetchSize() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- ::rtl::OUString getCursorName() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- void setQueryTimeOut(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setMaxFieldSize(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setMaxRows(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setResultSetConcurrency(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setResultSetType(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setFetchDirection(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setFetchSize(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setCursorName(const ::rtl::OUString &_par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setEscapeProcessing(sal_Bool _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement> m_xGeneratedStatement;
- java_sql_Connection* m_pConnection;
- java::sql::ConnectionLog m_aLogger;
- ::rtl::OUString m_sSqlStatement;
- // Properties
- sal_Int32 m_nResultSetConcurrency;
- sal_Int32 m_nResultSetType;
- sal_Bool m_bEscapeProcessing;
- ::cppu::OBroadcastHelper& rBHelper;
-
-
- // statische Daten fuer die Klasse
- static jclass theClass;
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- ) throw (::com::sun::star::lang::IllegalArgumentException);
-
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- ) throw (::com::sun::star::uno::Exception);
-
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle
- ) const;
-
- virtual void createStatement(JNIEnv* _pEnv) = 0;
-
- virtual ~java_sql_Statement_Base();
-
- sal_Int32 impl_getProperty(const char* _pMethodName, jmethodID& _inout_MethodID);
- sal_Int32 impl_getProperty(const char* _pMethodName, jmethodID& _inout_MethodID,sal_Int32 _nDefault);
-
- public:
- virtual jclass getMyClass() const;
-
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_Statement_Base( JNIEnv * pEnv, java_sql_Connection& _rCon );
-
- sal_Int32 getStatementObjectID() const { return m_aLogger.getObjectID(); }
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Int32 SAL_CALL executeUpdate( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL execute( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XMultipleResults
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getResultSet( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getUpdateCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getMoreResults( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- //XGeneratedResultSet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getGeneratedValues( ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- public:
- using ::cppu::OPropertySetHelper::getFastPropertyValue;
- };
-
- class OStatement_BASE2 :public java_sql_Statement_Base
- ,public OSubComponent<OStatement_BASE2, java_sql_Statement_BASE>
-
- {
- friend class OSubComponent<OStatement_BASE2, java_sql_Statement_BASE>;
- public:
- OStatement_BASE2(JNIEnv * pEnv, java_sql_Connection& _rCon ) : java_sql_Statement_Base( pEnv, _rCon ),
- OSubComponent<OStatement_BASE2, java_sql_Statement_BASE>((::cppu::OWeakObject*)(&_rCon), this){}
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL release() throw();
- };
-
- class java_sql_Statement : public OStatement_BASE2,
- public ::com::sun::star::sdbc::XBatchExecution,
- public ::com::sun::star::lang::XServiceInfo
- {
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
-
- virtual void createStatement(JNIEnv* _pEnv);
-
- virtual ~java_sql_Statement();
- public:
- DECLARE_SERVICE_INFO();
- virtual jclass getMyClass() const;
-
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_Statement( JNIEnv * pEnv, java_sql_Connection& _rCon ) : OStatement_BASE2( pEnv, _rCon){};
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- // XBatchExecution
- virtual void SAL_CALL addBatch( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_STATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/PreparedStatement.hxx b/connectivity/source/inc/java/sql/PreparedStatement.hxx
deleted file mode 100644
index f27789f6df..0000000000
--- a/connectivity/source/inc/java/sql/PreparedStatement.hxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_SQL_PREPAREDSTATEMENT_HXX_
-#define _CONNECTIVITY_JAVA_SQL_PREPAREDSTATEMENT_HXX_
-
-#include "java/sql/JStatement.hxx"
-#include <com/sun/star/sdbc/XPreparedStatement.hpp>
-#include <com/sun/star/sdbc/XParameters.hpp>
-#include <com/sun/star/sdbc/XPreparedBatchExecution.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-namespace connectivity
-{
- //**************************************************************
- //************ Class: java.sql.PreparedStatement
- //**************************************************************
-
- class java_sql_PreparedStatement : public OStatement_BASE2,
- public ::com::sun::star::sdbc::XPreparedStatement,
- public ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- public ::com::sun::star::sdbc::XParameters,
- public ::com::sun::star::sdbc::XPreparedBatchExecution,
- public ::com::sun::star::lang::XServiceInfo
- {
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
-
- virtual void createStatement(JNIEnv* _pEnv);
- virtual ~java_sql_PreparedStatement();
- public:
- DECLARE_SERVICE_INFO();
- virtual jclass getMyClass() const;
-
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_PreparedStatement( JNIEnv * pEnv, java_sql_Connection& _rCon,const ::rtl::OUString& sql );
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPreparedStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL executeUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XParameters
- virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearParameters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XPreparedBatchExecution
- virtual void SAL_CALL addBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- public:
- using java_sql_Statement_Base::executeQuery;
- using java_sql_Statement_Base::executeUpdate;
- using java_sql_Statement_Base::execute;
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_PREPAREDSTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/Ref.hxx b/connectivity/source/inc/java/sql/Ref.hxx
deleted file mode 100644
index d4479be3bb..0000000000
--- a/connectivity/source/inc/java/sql/Ref.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_JAVA_SQL_REF_HXX_
-#define _CONNECTIVITY_JAVA_SQL_REF_HXX_
-
-#include "java/lang/Object.hxx"
-#include <com/sun/star/sdbc/XRef.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace connectivity
-{
- //**************************************************************
- //************ Class: java.sql.Ref
- //**************************************************************
- class java_sql_Ref : public java_lang_Object,
- public ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XRef>
- {
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
- virtual ~java_sql_Ref();
- public:
- virtual jclass getMyClass() const;
-
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_Ref( JNIEnv * pEnv, jobject myObj );
-
- // XRef
- virtual ::rtl::OUString SAL_CALL getBaseTypeName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_REF_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/ResultSet.hxx b/connectivity/source/inc/java/sql/ResultSet.hxx
deleted file mode 100644
index 5764fec3cf..0000000000
--- a/connectivity/source/inc/java/sql/ResultSet.hxx
+++ /dev/null
@@ -1,210 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_SQL_RESULTSET_HXX_
-#define _CONNECTIVITY_JAVA_SQL_RESULTSET_HXX_
-
-#include "java/lang/Object.hxx"
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <cppuhelper/compbase10.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include "connectivity/CommonTools.hxx"
-#include "java/sql/JStatement.hxx"
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include "java/sql/ConnectionLog.hxx"
-
-namespace connectivity
-{
-
- /*
- ** java_sql_ResultSet
- */
- typedef ::cppu::WeakComponentImplHelper10< ::com::sun::star::sdbc::XResultSet,
- ::com::sun::star::sdbc::XRow,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XResultSetUpdate,
- ::com::sun::star::sdbc::XRowUpdate,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XColumnLocate,
- ::com::sun::star::lang::XServiceInfo> java_sql_ResultSet_BASE;
-
- class java_sql_Connection;
- class java_sql_ResultSet : public comphelper::OBaseMutex,
- public java_sql_ResultSet_BASE,
- public java_lang_Object,
- public ::cppu::OPropertySetHelper,
- public ::comphelper::OPropertyArrayUsageHelper<java_sql_ResultSet>
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
- java::sql::ConnectionLog m_aLogger;
- java_sql_Connection* m_pConnection;
-
- sal_Int32 getResultSetConcurrency() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getResultSetType() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getFetchDirection() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getFetchSize() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- ::rtl::OUString getCursorName() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- void setFetchDirection(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void setFetchSize(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- )
- throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle
- ) const;
- virtual ~java_sql_ResultSet();
- public:
- DECLARE_SERVICE_INFO();
- virtual jclass getMyClass() const;
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_ResultSet( JNIEnv * pEnv, jobject myObj, const java::sql::ConnectionLog& _rParentLogger,java_sql_Connection& _rConnection,
- java_sql_Statement_Base* pStmt = NULL );
-
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XResultSet
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetUpdate
- virtual void SAL_CALL insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRowUpdate
- virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XColumnLocate
- virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- public:
- using ::cppu::OPropertySetHelper::getFastPropertyValue;
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_RESULTSET_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/ResultSetMetaData.hxx b/connectivity/source/inc/java/sql/ResultSetMetaData.hxx
deleted file mode 100644
index c0f43cbb8d..0000000000
--- a/connectivity/source/inc/java/sql/ResultSetMetaData.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_SQL_RESULTSETMETADATA_HXX_
-#define _CONNECTIVITY_JAVA_SQL_RESULTSETMETADATA_HXX_
-
-#include "java/lang/Object.hxx"
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include "java/sql/ConnectionLog.hxx"
-
-namespace connectivity
-{
- //**************************************************************
- //************ Class: java.sql.ResultSetMetaData
- //**************************************************************
- class java_sql_Connection;
- class java_sql_ResultSetMetaData : public ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData>,
- public java_lang_Object
- {
- protected:
- java::sql::ConnectionLog m_aLogger;
- java_sql_Connection* m_pConnection;
- sal_Int32 m_nColumnCount;
-
- // statische Daten fuer die Klasse
- static jclass theClass;
- virtual ~java_sql_ResultSetMetaData();
- public:
- virtual jclass getMyClass() const;
-
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_ResultSetMetaData( JNIEnv * pEnv, jobject myObj, const java::sql::ConnectionLog& _rResultSetLogger, java_sql_Connection& _rCon );
-
- virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_RESULTSETMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/SQLException.hxx b/connectivity/source/inc/java/sql/SQLException.hxx
deleted file mode 100644
index 6ff404cbef..0000000000
--- a/connectivity/source/inc/java/sql/SQLException.hxx
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_SQL_SQLEXCEPTION_HXX_
-#define _CONNECTIVITY_JAVA_SQL_SQLEXCEPTION_HXX_
-
-#include "java/lang/Exception.hxx"
-#include <com/sun/star/sdbc/SQLException.hpp>
-
-namespace connectivity
-{
- namespace starsdbc = ::com::sun::star::sdbc;
- //**************************************************************
- //************ Class: java.sql.SQLException
- //**************************************************************
- class java_sql_SQLException_BASE;
- class java_sql_SQLException : public starsdbc::SQLException
- {
- public:
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_SQLException(){}
- java_sql_SQLException( const java_sql_SQLException_BASE& _rException,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> & _rContext);
- };
-
- class java_sql_SQLException_BASE : public java_lang_Exception
- {
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_sql_SQLException_BASE();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_SQLException_BASE( JNIEnv * pEnv, jobject myObj );
-
- ::rtl::OUString getSQLState() const;
- sal_Int32 getErrorCode() const;
- starsdbc::SQLException getNextException() const;
-
- static jclass st_getMyClass();
- };
-
-}
-#endif // _CONNECTIVITY_JAVA_SQL_SQLEXCEPTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/SQLWarning.hxx b/connectivity/source/inc/java/sql/SQLWarning.hxx
deleted file mode 100644
index 8026d0ac5f..0000000000
--- a/connectivity/source/inc/java/sql/SQLWarning.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_JAVA_SQL_SQLWARNING_HXX_
-#define _CONNECTIVITY_JAVA_SQL_SQLWARNING_HXX_
-
-#include "java/sql/SQLException.hxx"
-
-namespace connectivity
-{
- // namespace starsdbc = ::com::sun::star::sdbc;
- // namespace ::com::sun::star::uno = ::com::sun::star::uno;
- //**************************************************************
- //************ Class: java.sql.SQLWarning
- //**************************************************************
- class java_sql_SQLWarning_BASE : public java_sql_SQLException_BASE
- {
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_sql_SQLWarning_BASE();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_SQLWarning_BASE( JNIEnv * pEnv, jobject myObj ) : java_sql_SQLException_BASE( pEnv, myObj ){}
-
- };
-
- class java_sql_SQLWarning : public java_sql_SQLException
- {
- public:
- java_sql_SQLWarning(const java_sql_SQLWarning_BASE& _rW,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> & _rContext)
- : java_sql_SQLException(_rW,_rContext) {}
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_SQLWARNING_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/sql/Timestamp.hxx b/connectivity/source/inc/java/sql/Timestamp.hxx
deleted file mode 100644
index b9780c34c5..0000000000
--- a/connectivity/source/inc/java/sql/Timestamp.hxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_JAVA_SQL_TIMESTAMP_HXX_
-#define _CONNECTIVITY_JAVA_SQL_TIMESTAMP_HXX_
-
-#include "java/util/Date.hxx"
-#include <com/sun/star/util/Time.hpp>
-#include <com/sun/star/util/DateTime.hpp>
-
-
-namespace connectivity
-{
- //**************************************************************
- //************ Class: java.sql.Date
- //**************************************************************
-
- class java_sql_Date : public java_util_Date
- {
- protected:
- // static data for the class
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_sql_Date();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_Date( JNIEnv * pEnv, jobject myObj ) : java_util_Date(pEnv,myObj){}
- java_sql_Date( const ::com::sun::star::util::Date& _rOut );
-
- operator ::com::sun::star::util::Date();
- static jclass st_getMyClass();
- };
-
-
- //**************************************************************
- //************ Class: java.sql.Time
- //**************************************************************
-
- class java_sql_Time : public java_util_Date
- {
- protected:
- // static data for the class
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_sql_Time();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_Time( JNIEnv * pEnv, jobject myObj ) : java_util_Date( pEnv, myObj ){}
- java_sql_Time( const ::com::sun::star::util::Time& _rOut );
- operator ::com::sun::star::util::Time();
- static jclass st_getMyClass();
- };
-
- //**************************************************************
- //************ Class: java.sql.Timestamp
- //**************************************************************
- class java_sql_Timestamp : public java_util_Date
- {
- protected:
- // static data for the class
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_sql_Timestamp();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_sql_Timestamp( JNIEnv * pEnv, jobject myObj ) : java_util_Date( pEnv, myObj ){}
- java_sql_Timestamp( const ::com::sun::star::util::DateTime& _rOut);
- operator ::com::sun::star::util::DateTime();
-
- static jclass st_getMyClass();
- };
-}
-#endif // _CONNECTIVITY_JAVA_SQL_TIMESTAMP_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/tools.hxx b/connectivity/source/inc/java/tools.hxx
deleted file mode 100644
index eec4b99c0f..0000000000
--- a/connectivity/source/inc/java/tools.hxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_JAVA_TOOLS_HXX_
-#define _CONNECTIVITY_JAVA_TOOLS_HXX_
-
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/uno/Sequence.h>
-
-#include <jni.h>
-#include "java/sql/SQLException.hxx"
-#include <comphelper/uno3.hxx>
-
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/util/Time.hpp>
-#include <com/sun/star/util/Date.hpp>
-#include <com/sun/star/util/DateTime.hpp>
-
-
-namespace connectivity
-{
-
- jstring convertwchar_tToJavaString(JNIEnv *pEnv,const ::rtl::OUString& _Temp);
- ::rtl::OUString JavaString2String(JNIEnv *pEnv,jstring _Str);
- class java_util_Properties;
-
- java_util_Properties* createStringPropertyArray(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- template<class T,class JT> ::com::sun::star::uno::Sequence< T > copyArrayAndDelete(JNIEnv *pEnv,jobjectArray _Array, const T*, const JT* )
- {
- ::com::sun::star::uno::Sequence< T > xOut;
- if(_Array)
- {
- jsize nLen = pEnv->GetArrayLength(_Array);
- xOut.realloc(nLen);
- for(jsize i=0;i<nLen;++i)
- {
- JT xInfo(pEnv,pEnv->GetObjectArrayElement(_Array,i));
- java_lang_Object::ThrowSQLException(pEnv,NULL);
- xOut.getArray()[i] = xInfo;
- }
- pEnv->DeleteLocalRef(_Array);
- }
- return xOut;
- }
-
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > Map2XNameAccess(JNIEnv *pEnv,jobject _pMap);
- jobject convertTypeMapToJavaMap(JNIEnv *pEnv,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & _rMap);
-
- /** return if a exception occurred
- @param pEnv
- The native java env
- @param _bClear
- <TRUE/> if the execption should be cleared
- @return
- <TRUE/> if an exception is occurred
- */
- sal_Bool isExceptionOccurred(JNIEnv *pEnv,sal_Bool _bClear);
-
- jobject createByteInputStream(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x,sal_Int32 length);
- jobject createCharArrayReader(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x,sal_Int32 length);
-}
-
-#endif // _CONNECTIVITY_JAVA_TOOLS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/util/Date.hxx b/connectivity/source/inc/java/util/Date.hxx
deleted file mode 100644
index 7c8c7a9811..0000000000
--- a/connectivity/source/inc/java/util/Date.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_JAVA_UTIL_DATE_HXX_
-#define _CONNECTIVITY_JAVA_UTIL_DATE_HXX_
-
-#include "java/lang/Object.hxx"
-#include <com/sun/star/util/Date.hpp>
-
-namespace connectivity
-{
-
- //**************************************************************
- //************ Class: java.util.Date
- //**************************************************************
-
- class java_util_Date : public java_lang_Object
- {
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_util_Date();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_util_Date( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
- };
-}
-#endif // _CONNECTIVITY_JAVA_UTIL_DATE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/java/util/Property.hxx b/connectivity/source/inc/java/util/Property.hxx
deleted file mode 100644
index b3de8690c5..0000000000
--- a/connectivity/source/inc/java/util/Property.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_java_util_Properties
-#define CONNECTIVITY_java_util_Properties
-
-#include "java/lang/Object.hxx"
-
-namespace connectivity
-{
- class java_util_Properties : public java_lang_Object
- {
- protected:
- // statische Daten fuer die Klasse
- static jclass theClass;
- public:
- virtual jclass getMyClass() const;
- virtual ~java_util_Properties();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- java_util_Properties( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
- java_util_Properties( );
- void setProperty(const ::rtl::OUString key, const ::rtl::OUString& value);
- };
-}
-
-#endif // CONNECTIVITY_java_util_Properties
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/mysql/YCatalog.hxx b/connectivity/source/inc/mysql/YCatalog.hxx
deleted file mode 100644
index e07fce0cd3..0000000000
--- a/connectivity/source/inc/mysql/YCatalog.hxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_MYSQL_CATALOG_HXX
-#define CONNECTIVITY_MYSQL_CATALOG_HXX
-
-#include "connectivity/sdbcx/VCatalog.hxx"
-#include "connectivity/StdTypeDefs.hxx"
-
-namespace connectivity
-{
- namespace mysql
- {
- // please don't name the class the same name as in an other namespaces
- // some compilers have problems with this task as I noticed on windows
- class OAdabasConnection;
- class OMySQLCatalog : public connectivity::sdbcx::OCatalog
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
-
- /** calls XDatabaseMetaData::getTables.
- @param _sKindOfObject
- The type of tables to be fetched.
- @param _rNames
- The container for the names to be filled. <OUT/>
- */
- void refreshObjects(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _sKindOfObject,TStringVector& _rNames);
-
- public:
- // implementation of the pure virtual methods
- virtual void refreshTables();
- virtual void refreshViews() ;
- virtual void refreshGroups();
- virtual void refreshUsers() ;
-
- public:
- OMySQLCatalog(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
-
- inline sdbcx::OCollection* getPrivateTables() const { return m_pTables;}
- inline sdbcx::OCollection* getPrivateViews() const { return m_pViews; }
- inline ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection() const { return m_xConnection; }
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- // ::cppu::OComponentHelper
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // CONNECTIVITY_MYSQL_CATALOG_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/mysql/YColumns.hxx b/connectivity/source/inc/mysql/YColumns.hxx
deleted file mode 100644
index a9573a35d5..0000000000
--- a/connectivity/source/inc/mysql/YColumns.hxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_MYSQL_COLUMN_HXX
-#define CONNECTIVITY_MYSQL_COLUMN_HXX
-#include "connectivity/TColumnsHelper.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-
-namespace connectivity
-{
- namespace mysql
- {
- class OMySQLColumns : public OColumnsHelper
- {
- protected:
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- public:
- OMySQLColumns( ::cppu::OWeakObject& _rParent
- ,sal_Bool _bCase
- ,::osl::Mutex& _rMutex
- ,const TStringVector &_rVector
- ,sal_Bool _bUseHardRef = sal_True
- );
- };
-
- class OMySQLColumn;
- typedef sdbcx::OColumn OMySQLColumn_BASE;
- typedef ::comphelper::OIdPropertyArrayUsageHelper<OMySQLColumn> OMySQLColumn_PROP;
-
- class OMySQLColumn : public OMySQLColumn_BASE,
- public OMySQLColumn_PROP
- {
- ::rtl::OUString m_sAutoIncrement;
- protected:
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- public:
- OMySQLColumn(sal_Bool _bCase);
- virtual void construct();
-
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // CONNECTIVITY_MYSQL_COLUMN_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/mysql/YDriver.hxx b/connectivity/source/inc/mysql/YDriver.hxx
deleted file mode 100644
index ab523896f6..0000000000
--- a/connectivity/source/inc/mysql/YDriver.hxx
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_MYSQL_DRIVER_HXX
-#define CONNECTIVITY_MYSQL_DRIVER_HXX
-
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/compbase3.hxx>
-#include <comphelper/uno3.hxx>
-#include <comphelper/stl_types.hxx>
-#include <comphelper/broadcasthelper.hxx>
-#include "connectivity/CommonTools.hxx"
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- class OMetaConnection;
-
- namespace mysql
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ODriverDelegator_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
-
- typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbc::XDriver
- , ::com::sun::star::sdbcx::XDataDefinitionSupplier
- , ::com::sun::star::lang::XServiceInfo
- > ODriverDelegator_BASE;
-
- typedef ::std::pair< ::com::sun::star::uno::WeakReferenceHelper,OMetaConnection*> TWeakConnectionPair;
- typedef ::std::pair< ::com::sun::star::uno::WeakReferenceHelper,TWeakConnectionPair> TWeakPair;
- typedef ::std::vector< TWeakPair > TWeakPairVector;
- DECLARE_STL_USTRINGACCESS_MAP(::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver >,TJDBCDrivers);
- typedef enum
- {
- D_ODBC,
- D_JDBC,
- D_NATIVE
- } T_DRIVERTYPE;
-
-
- /** delegates all calls to the orignal driver and extend the existing one with the SDBCX layer.
-
- */
- class ODriverDelegator : public ::comphelper::OBaseMutex
- ,public ODriverDelegator_BASE
- {
- TJDBCDrivers m_aJdbcDrivers; // all jdbc drivers
- TWeakPairVector m_aConnections; // vector containing a list
- // of all the Connection objects
- // for this Driver
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > m_xODBCDriver;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > m_xNativeDriver;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
- ::rtl::OUString m_sOldDriverClass;
- T_DRIVERTYPE m_eDriverType;
-
- /** load the driver we want to delegate.
- The <member>m_xODBCDriver</member> or <member>m_xDBCDriver</member> may be <NULL/> if the driver could not be loaded.
- @param url
- The URL.
- @param info
- The property info contains which driver we have to delegate.
- @return
- The driver which was currently selected.
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > loadDriver( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info );
-
- public:
- /** creates a new delegator for a mysql driver
- */
- ODriverDelegator(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMajorVersion( ) throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMinorVersion( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XDataDefinitionSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& connection ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- protected:
- /// dtor
- virtual ~ODriverDelegator();
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- };
- }
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-#endif // CONNECTIVITY_MYSQL_DRIVER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/mysql/YTable.hxx b/connectivity/source/inc/mysql/YTable.hxx
deleted file mode 100644
index 8c718f9b06..0000000000
--- a/connectivity/source/inc/mysql/YTable.hxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_MYSQL_TABLE_HXX
-#define CONNECTIVITY_MYSQL_TABLE_HXX
-
-#include "connectivity/TTableHelper.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include <comphelper/IdPropArrayHelper.hxx>
-
-namespace connectivity
-{
- namespace mysql
- {
-
- ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xColProp);
-
- class OMySQLTable;
- typedef ::comphelper::OIdPropertyArrayUsageHelper< OMySQLTable > OMySQLTable_PROP;
- class OMySQLTable : public OTableHelper
- ,public OMySQLTable_PROP
- {
- sal_Int32 m_nPrivileges; // we have to set our privileges by our own
-
- /** executes the statmenmt.
- @param _rStatement
- The statement to execute.
- */
- void executeStatement(const ::rtl::OUString& _rStatement );
- protected:
-
- /** creates the column collection for the table
- @param _rNames
- The column names.
- */
- virtual sdbcx::OCollection* createColumns(const TStringVector& _rNames);
-
- /** creates the key collection for the table
- @param _rNames
- The key names.
- */
- virtual sdbcx::OCollection* createKeys(const TStringVector& _rNames);
-
- /** creates the index collection for the table
- @param _rNames
- The index names.
- */
- virtual sdbcx::OCollection* createIndexes(const TStringVector& _rNames);
-
- /** Returns always "RENAME TABLE " even for views.
- *
- * \return The start of the rename statement.
- * @see http://dev.mysql.com/doc/refman/5.1/de/rename-table.html
- */
- virtual ::rtl::OUString getRenameStart() const;
-
- /** used to implement the creation of the array helper which is shared amongst all instances of the class.
- This method needs to be implemented in derived classes.
- <BR>
- The method gets called with s_aMutex acquired.
- <BR>
- as long as IPropertyArrayHelper has no virtual destructor, the implementation of ~OPropertyArrayUsageHelper
- assumes that you created an ::cppu::OPropertyArrayHelper when deleting s_pProps.
- @return an pointer to the newly created array helper. Must not be NULL.
- */
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const;
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- public:
- OMySQLTable( sdbcx::OCollection* _pTables,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
- OMySQLTable( sdbcx::OCollection* _pTables,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description = ::rtl::OUString(),
- const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
- const ::rtl::OUString& _CatalogName = ::rtl::OUString(),
- sal_Int32 _nPrivileges = 0
- );
-
- // ODescriptor
- virtual void construct();
- // com::sun::star::lang::XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
-
- // XAlterTable
- virtual void SAL_CALL alterColumnByName( const ::rtl::OUString& colName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- /** returns the ALTER TABLE XXX statement
- */
- ::rtl::OUString getAlterTableColumnPart();
-
- // some methods to alter table structures
- void alterColumnType(sal_Int32 nNewType,const ::rtl::OUString& _rColName,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xDescriptor);
- void alterDefaultValue(const ::rtl::OUString& _sNewDefault,const ::rtl::OUString& _rColName);
- void dropDefaultValue(const ::rtl::OUString& _sNewDefault);
-
- virtual ::rtl::OUString getTypeCreatePattern() const;
- };
- }
-}
-#endif // CONNECTIVITY_MYSQL_TABLE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/mysql/YTables.hxx b/connectivity/source/inc/mysql/YTables.hxx
deleted file mode 100644
index 72d654137c..0000000000
--- a/connectivity/source/inc/mysql/YTables.hxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONNECTIVITY_MYSQL_TABLES_HXX
-#define CONNECTIVITY_MYSQL_TABLES_HXX
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "connectivity/SQLStatementHelper.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-namespace connectivity
-{
- namespace mysql
- {
- class OTables : public sdbcx::OCollection,
- public ::dbtools::ISQLStatementHelper
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
-
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
-
- void createTable( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual ::rtl::OUString getNameForObject(const sdbcx::ObjectType& _xObject);
- public:
- OTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector)
- ,m_xMetaData(_rMetaData)
- {}
-
- // only the name is identical to ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- // XDrop
- void appendNew(const ::rtl::OUString& _rsNewTable);
- // some helper functions
- /**
- returns a sql string which contains the column definition part for create or alter statements
- */
- static ::rtl::OUString getColumnSqlType(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColProp);
- /**
- returns the "not null" part or the default part of the table statement
- */
- static ::rtl::OUString getColumnSqlNotNullDefault(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColProp);
- /**
- returns the corresponding typename
- can contain () which have to filled with values
- */
- static ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColProp);
-
- /** convert the sql statement to fit MySQL notation
- @param _sSql in/out
- */
- static ::rtl::OUString adjustSQL(const ::rtl::OUString& _sSql);
-
- // ISQLStatementHelper
- virtual void addComment(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,::rtl::OUStringBuffer& _rOut);
- };
- }
-}
-#endif // CONNECTIVITY_MYSQL_TABLES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/mysql/YUser.hxx b/connectivity/source/inc/mysql/YUser.hxx
deleted file mode 100644
index bdc0ee8b1e..0000000000
--- a/connectivity/source/inc/mysql/YUser.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MYSQL_USER_HXX_
-#define _CONNECTIVITY_MYSQL_USER_HXX_
-
-#include "connectivity/sdbcx/VUser.hxx"
-#include "com/sun/star/sdbc/XConnection.hpp"
-
-namespace connectivity
-{
- namespace mysql
- {
- typedef connectivity::sdbcx::OUser OUser_TYPEDEF;
-
- class OMySQLUser : public OUser_TYPEDEF
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
-
- ::rtl::OUString getPrivilegeString(sal_Int32 nRights) const;
- // return the privileges and additional the grant rights
- void findPrivilegesAndGrantPrivileges(const ::rtl::OUString& objName, sal_Int32 objType,sal_Int32& nRights,sal_Int32& nRightsWithGrant) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- public:
- virtual void refreshGroups();
- public:
- OMySQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
- OMySQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,const ::rtl::OUString& _Name);
-
- // XUser
- virtual void SAL_CALL changePassword( const ::rtl::OUString& objPassword, const ::rtl::OUString& newPassword ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XAuthorizable
- virtual sal_Int32 SAL_CALL getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-
- class OUserExtend;
- typedef ::comphelper::OPropertyArrayUsageHelper<OUserExtend> OUserExtend_PROP;
-
- class OUserExtend : public OMySQLUser,
- public OUserExtend_PROP
- {
- protected:
- ::rtl::OUString m_Password;
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- public:
- OUserExtend(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
-
- virtual void construct();
- };
- }
-}
-#endif // _CONNECTIVITY_MYSQL_USER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/mysql/YUsers.hxx b/connectivity/source/inc/mysql/YUsers.hxx
deleted file mode 100644
index 59c5189122..0000000000
--- a/connectivity/source/inc/mysql/YUsers.hxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_MYSQL_USERS_HXX_
-#define _CONNECTIVITY_MYSQL_USERS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "com/sun/star/sdbc/XConnection.hpp"
-namespace connectivity
-{
- namespace sdbcx
- {
- class IRefreshableUsers;
- }
- namespace mysql
- {
- class OUsers : public sdbcx::OCollection
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
- connectivity::sdbcx::IRefreshableUsers* m_pParent;
- public:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
- public:
- OUsers( ::cppu::OWeakObject& _rParent,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
- connectivity::sdbcx::IRefreshableUsers* _pParent);
- };
- }
-}
-
-#endif // _CONNECTIVITY_MYSQL_USERS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/mysql/YViews.hxx b/connectivity/source/inc/mysql/YViews.hxx
deleted file mode 100644
index fdd95845eb..0000000000
--- a/connectivity/source/inc/mysql/YViews.hxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_MYSQL_VIEWS_HXX_
-#define _CONNECTIVITY_MYSQL_VIEWS_HXX_
-
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-namespace connectivity
-{
- namespace mysql
- {
- class OViews : public sdbcx::OCollection
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- sal_Bool m_bInDrop;
- // OCatalog* m_pParent;
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
- virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
-
- void createView( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
- public:
- OViews(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector)
- ,m_xMetaData(_rMetaData)
- ,m_bInDrop(sal_False)
- {}
-
- // only the name is identical to ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
-
- void dropByNameImpl(const ::rtl::OUString& elementName);
- };
- }
-}
-#endif // _CONNECTIVITY_MYSQL_VIEWS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/OBoundParam.hxx b/connectivity/source/inc/odbc/OBoundParam.hxx
deleted file mode 100644
index 5817aac107..0000000000
--- a/connectivity/source/inc/odbc/OBoundParam.hxx
+++ /dev/null
@@ -1,224 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_OBOUNPARAM_HXX_
-#define _CONNECTIVITY_OBOUNPARAM_HXX_
-
-#include <com/sun/star/io/XInputStream.hpp>
-#include "odbc/odbcbasedllapi.hxx"
-
-namespace connectivity
-{
- namespace odbc
- {
- class OOO_DLLPUBLIC_ODBCBASE OBoundParam
- {
-
- public:
- OBoundParam()
- {
- paramLength = NULL;
- binaryData = NULL;
- pA1=0;
- pA2=0;
- pB1=0;
- pB2=0;
- pC1=0;
- pC2=0;
- pS1=0;
- pS2=0;
- }
- ~OBoundParam()
- {
- delete [] binaryData;
- delete [] paramLength;
- }
- //--------------------------------------------------------------------
- // initialize
- // Perform an necessary initialization
- //--------------------------------------------------------------------
- void initialize ()
- {
- // Allocate storage for the length. Note - the length is
- // stored in native format, and will have to be converted
- // to a Java sal_Int32. The jdbcodbc 'C' bridge provides an
- // interface to do this.
-
- paramLength = new sal_Int8[4];
- }
-
- //--------------------------------------------------------------------
- // allocBindDataBuffer
- // Allocates and returns a new bind data buffer of the specified
- // length
- //--------------------------------------------------------------------
- sal_Int8* allocBindDataBuffer (sal_Int32 bufLen)
- {
- if ( binaryData )
- delete [] binaryData;
- binaryData = new sal_Int8[bufLen];
-
- // Reset the input stream, we are doing a new bind
- setInputStream (NULL, 0);
-
- return binaryData;
- }
-
- //--------------------------------------------------------------------
- // getBindDataBuffer
- // Returns the data buffer to be used when binding to a parameter
- //--------------------------------------------------------------------
- sal_Int8* getBindDataBuffer ()
- {
- return binaryData;
- }
-
- //--------------------------------------------------------------------
- // getBindLengthBuffer
- // Returns the length buffer to be used when binding to a parameter
- //--------------------------------------------------------------------
- sal_Int8* getBindLengthBuffer ()
- {
- return paramLength;
- }
-
- //--------------------------------------------------------------------
- // setInputStream
- // Sets the input stream for the bound parameter
- //--------------------------------------------------------------------
- void setInputStream(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& inputStream,
- sal_Int32 len)
- {
- paramInputStream = inputStream;
- paramInputStreamLen = len;
- }
-
- void setSequence(const ::com::sun::star::uno::Sequence< sal_Int8 >& _aSequence)
- {
- aSequence = _aSequence;
- }
-
- //--------------------------------------------------------------------
- // getInputStream
- // Gets the input stream for the bound parameter
- //--------------------------------------------------------------------
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream> getInputStream ()
- {
- return paramInputStream;
- }
-
- //--------------------------------------------------------------------
- // getInputStreamLen
- // Gets the input stream length for the bound parameter
- //--------------------------------------------------------------------
- sal_Int32 getInputStreamLen ()
- {
- return paramInputStreamLen;
- }
-
- //--------------------------------------------------------------------
- // setSqlType
- // Sets the Java sql type used to register an OUT parameter
- //--------------------------------------------------------------------
-
- void setSqlType(sal_Int32 type)
- {
- sqlType = type;
- }
-
- //--------------------------------------------------------------------
- // getSqlType
- // Gets the Java sql type used to register an OUT parameter
- //--------------------------------------------------------------------
-
- sal_Int32 getSqlType ()
- {
- return sqlType;
- }
-
- //--------------------------------------------------------------------
- // setOutputParameter
- // Sets the flag indicating if this is an OUTPUT parameter
- //--------------------------------------------------------------------
-
- void setOutputParameter (sal_Bool output)
- {
- outputParameter = output;
- }
-
- //--------------------------------------------------------------------
- // isOutputParameter
- // Gets the OUTPUT parameter flag
- //--------------------------------------------------------------------
-
- sal_Bool isOutputParameter ()
- {
- return outputParameter;
- }
-
- protected:
- //====================================================================
- // Data attributes
- //====================================================================
-
- sal_Int8* binaryData; // Storage area to be used
- // when binding the parameter
-
- sal_Int8* paramLength; // Storage area to be used
- // for the bound length of the
- // parameter. Note that this
- // data is in native format.
-
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream> paramInputStream;
- ::com::sun::star::uno::Sequence< sal_Int8 > aSequence;
- // When an input stream is
- // bound to a parameter, the
- // input stream is saved
- // until needed.
-
- sal_Int32 paramInputStreamLen; // Length of input stream
-
- sal_Int32 sqlType; // Java SQL type used to
- // register an OUT parameter
-
- sal_Bool outputParameter; // true for OUTPUT parameters
-
-
- sal_Int32 pA1; //pointers
- sal_Int32 pA2;
- sal_Int32 pB1;
- sal_Int32 pB2;
- sal_Int32 pC1;
- sal_Int32 pC2;
- sal_Int32 pS1;
- sal_Int32 pS2;// reserved for strings(UTFChars)
- };
- }
-}
-#endif // _CONNECTIVITY_OBOUNPARAM_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/OConnection.hxx b/connectivity/source/inc/odbc/OConnection.hxx
deleted file mode 100644
index 4b6f6b1081..0000000000
--- a/connectivity/source/inc/odbc/OConnection.hxx
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ODBC_OCONNECTION_HXX_
-#define _CONNECTIVITY_ODBC_OCONNECTION_HXX_
-
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include "odbc/OFunctiondefs.hxx"
-#include "odbc/odbcbasedllapi.hxx"
-#include "OSubComponent.hxx"
-#include "connectivity/CommonTools.hxx"
-#include "TConnection.hxx"
-#include "OTypeInfo.hxx"
-#include <cppuhelper/weakref.hxx>
-#include "AutoRetrievingBase.hxx"
-#include <osl/module.h>
-
-
-#include <map>
-
-namespace connectivity
-{
- namespace odbc
- {
-
- class OStatement_Base;
- class ODBCDriver;
- class ODatabaseMetaData;
-
- typedef connectivity::OMetaConnection OConnection_BASE;
- typedef ::std::vector< ::connectivity::OTypeInfo> TTypeInfoVector;
-
- class OOO_DLLPUBLIC_ODBCBASE OConnection :
- public OConnection_BASE,
- public connectivity::OSubComponent<OConnection, OConnection_BASE>,
- public OAutoRetrievingBase
- {
- friend class connectivity::OSubComponent<OConnection, OConnection_BASE>;
-
- protected:
- //====================================================================
- // Data attributes
- //====================================================================
- ::std::map< SQLHANDLE,OConnection*> m_aConnections; // holds all connectionas which are need for serveral statements
- TTypeInfoVector m_aTypeInfo; // vector containing an entry
- // for each row returned by
- // DatabaseMetaData.getTypeInfo.
-
-
- ::com::sun::star::sdbc::SQLWarning m_aLastWarning; // Last SQLWarning generated by
- // an operation
- ::rtl::OUString m_sUser; // the user name
- ODBCDriver* m_pDriver; // Pointer to the owning
- // driver object
-
- SQLHANDLE m_aConnectionHandle;
- SQLHANDLE m_pDriverHandleCopy; // performance reason
- sal_Int32 m_nStatementCount;
- sal_Bool m_bClosed;
- sal_Bool m_bUseCatalog; // should we use the catalog on filebased databases
- sal_Bool m_bUseOldDateFormat;
- sal_Bool m_bParameterSubstitution;
- sal_Bool m_bIgnoreDriverPrivileges;
- sal_Bool m_bPreventGetVersionColumns; // #i60273#
- sal_Bool m_bReadOnly;
-
-
- SQLRETURN OpenConnection(const ::rtl::OUString& aConnectStr,sal_Int32 nTimeOut, sal_Bool bSilent);
-
- virtual OConnection* cloneConnection(); // creates a new connection
-
- public:
- oslGenericFunction getOdbcFunction(sal_Int32 _nIndex) const;
- virtual SQLRETURN Construct( const ::rtl::OUString& url,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info) throw(::com::sun::star::sdbc::SQLException);
-
- OConnection(const SQLHANDLE _pDriverHandle,ODBCDriver* _pDriver);
- // OConnection(const SQLHANDLE _pConnectionHandle);
- virtual ~OConnection();
-
- void closeAllStatements () throw( ::com::sun::star::sdbc::SQLException);
-
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL release() throw();
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL nativeSQL( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getAutoCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL commit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL rollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isClosed( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCatalog( const ::rtl::OUString& catalog ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalog( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- //
- SQLHANDLE getConnection() { return m_aConnectionHandle; }
-
- // should we use the catalog on filebased databases
- inline sal_Bool isCatalogUsed() const { return m_bUseCatalog; }
- inline sal_Bool isParameterSubstitutionEnabled() const { return m_bParameterSubstitution; }
- inline sal_Bool isIgnoreDriverPrivilegesEnabled() const { return m_bIgnoreDriverPrivileges; }
- inline sal_Bool preventGetVersionColumns() const { return m_bPreventGetVersionColumns; }
- inline sal_Bool useOldDateFormat() const { return m_bUseOldDateFormat; }
- inline SQLHANDLE getDriverHandle() const { return m_pDriverHandleCopy;}
- inline ODBCDriver* getDriver() const { return m_pDriver;}
- inline ::rtl::OUString getUserName() const { return m_sUser; }
-
- SQLHANDLE createStatementHandle();
- // close and free the handle and set it to SQL_NULLHANDLE
- void freeStatementHandle(SQLHANDLE& _pHandle);
-
- void buildTypeInfo() throw( ::com::sun::star::sdbc::SQLException);
- const TTypeInfoVector& getTypeInfo() const { return m_aTypeInfo; }
- };
- }
-}
-#endif // _CONNECTIVITY_ODBC_OCONNECTION_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/ODatabaseMetaData.hxx b/connectivity/source/inc/odbc/ODatabaseMetaData.hxx
deleted file mode 100644
index ab4eddfa53..0000000000
--- a/connectivity/source/inc/odbc/ODatabaseMetaData.hxx
+++ /dev/null
@@ -1,226 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ODBC_ODATABASEMETADATA_HXX_
-#define _CONNECTIVITY_ODBC_ODATABASEMETADATA_HXX_
-
-#include "odbc/OConnection.hxx"
-#include "odbc/odbcbasedllapi.hxx"
-#include "TDatabaseMetaDataBase.hxx"
-
-namespace connectivity
-{
- namespace odbc
- {
- //**************************************************************
- //************ Class: ODatabaseMetaData
- //**************************************************************
-
- class OOO_DLLPUBLIC_ODBCBASE ODatabaseMetaData :
- public ODatabaseMetaDataBase
- {
- SQLHANDLE m_aConnectionHandle;
- OConnection* m_pConnection;
- sal_Bool m_bUseCatalog;
- sal_Bool m_bOdbc3;
-
- // cached database information
- virtual ::rtl::OUString impl_getIdentifierQuoteString_throw( );
- virtual sal_Bool impl_isCatalogAtStart_throw( );
- virtual ::rtl::OUString impl_getCatalogSeparator_throw( );
- virtual sal_Bool impl_supportsCatalogsInTableDefinitions_throw( );
- virtual sal_Bool impl_supportsSchemasInTableDefinitions_throw( ) ;
- virtual sal_Bool impl_supportsCatalogsInDataManipulation_throw( );
- virtual sal_Bool impl_supportsSchemasInDataManipulation_throw( ) ;
- virtual sal_Bool impl_supportsMixedCaseQuotedIdentifiers_throw( ) ;
- virtual sal_Bool impl_supportsAlterTableWithAddColumn_throw( );
- virtual sal_Bool impl_supportsAlterTableWithDropColumn_throw( );
- virtual sal_Int32 impl_getMaxStatements_throw( );
- virtual sal_Int32 impl_getMaxTablesInSelect_throw( );
- virtual sal_Bool impl_storesMixedCaseQuotedIdentifiers_throw( );
- protected:
- ::rtl::OUString getURLImpl();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw();
- virtual ~ODatabaseMetaData();
- public:
-
- inline OConnection* getOwnConnection() const { return m_pConnection; }
- inline oslGenericFunction getOdbcFunction(sal_Int32 _nIndex) const
- {
- return m_pConnection->getOdbcFunction(_nIndex);
- }
-
- ODatabaseMetaData(const SQLHANDLE _pHandle,OConnection* _pCon);
-
-
-
- // XDatabaseMetaData
- virtual sal_Bool SAL_CALL allProceduresAreCallable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL allTablesAreSelectable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getUserName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedLow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDatabaseProductVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverName( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDriverVersion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFiles( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::rtl::OUString SAL_CALL getSQLKeywords( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getNumericFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getStringFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSystemFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTimeDateFunctions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSearchStringEscape( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getExtraNameCharacters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsColumnAliasing( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTypeConversion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getProcedureTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogTerm( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedDelete( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsStoredProcedures( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnion( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsUnionAll( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxConnections( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxIndexLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxRowSize( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxStatementLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getProcedures( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getProcedureColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTables( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getSchemas( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getCatalogs( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTableTypes( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTablePrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getBestRowIdentifier( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope, sal_Bool nullable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getVersionColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getImportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getExportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getCrossReference( const ::com::sun::star::uno::Any& primaryCatalog, const ::rtl::OUString& primarySchema, const ::rtl::OUString& primaryTable, const ::com::sun::star::uno::Any& foreignCatalog, const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getIndexInfo( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Bool unique, sal_Bool approximate ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsBatchUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getUDTs( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern, const ::com::sun::star::uno::Sequence< sal_Int32 >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_ODBC_ODATABASEMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
deleted file mode 100644
index 8851f1f56e..0000000000
--- a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
+++ /dev/null
@@ -1,244 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ODBC_ADATABASEMETADATARESULTSET_HXX_
-#define _CONNECTIVITY_ODBC_ADATABASEMETADATARESULTSET_HXX_
-
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <cppuhelper/compbase7.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include "odbc/OStatement.hxx"
-#include "odbc/ODatabaseMetaData.hxx"
-#include "odbc/odbcbasedllapi.hxx"
-#include <comphelper/broadcasthelper.hxx>
-#include "connectivity/StdTypeDefs.hxx"
-
-namespace connectivity
-{
- namespace odbc
- {
- class ODatabaseMetaDataResultSetMetaData;
- /*
- ** java_sql_ResultSet
- */
- typedef ::cppu::WeakComponentImplHelper7< ::com::sun::star::sdbc::XResultSet,
- ::com::sun::star::sdbc::XRow,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XColumnLocate> ODatabaseMetaDataResultSet_BASE;
-
- class OOO_DLLPUBLIC_ODBCBASE ODatabaseMetaDataResultSet :
- public comphelper::OBaseMutex,
- public ODatabaseMetaDataResultSet_BASE,
- public ::cppu::OPropertySetHelper,
- public ::comphelper::OPropertyArrayUsageHelper<ODatabaseMetaDataResultSet>
- {
- ::connectivity::TIntVector m_aColMapping; // pos 0 is unused so we don't have to decrement 1 everytime
-
- ::std::map<sal_Int32, ::connectivity::TInt2IntMap > m_aValueRange;
- ::std::map<sal_Int32, ::connectivity::TString2IntMap > m_aStrValueRange;
-
- ::std::map<sal_Int32, ::connectivity::TInt2StringMap > m_aIntValueRange;
- ::std::map<sal_Int32,SWORD> m_aODBCColumnTypes;
-
- SQLHANDLE m_aStatementHandle;
- SQLHANDLE m_aConnectionHandle;
- ::com::sun::star::uno::WeakReferenceHelper m_aStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
- SQLUSMALLINT* m_pRowStatusArray;
- OConnection* m_pConnection;
- rtl_TextEncoding m_nTextEncoding;
- sal_Int32 m_nRowPos;
- sal_Int32 m_nLastColumnPos; // used for m_aRow just to know where we are
- sal_Int32 m_nDriverColumnCount; // column count of the driver wich can sometimes be less than the metadata count
- SQLRETURN m_nCurrentFetchState;
- sal_Bool m_bWasNull;
- sal_Bool m_bEOF; // after last record
- sal_Bool m_bFreeHandle;
-
- // set the columncount of the driver
- void checkColumnCount();
- sal_Int32 getResultSetConcurrency() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getResultSetType() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getFetchDirection() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getFetchSize() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- ::rtl::OUString getCursorName() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- SWORD impl_getColumnType_nothrow(sal_Int32 columnIndex);
-
- sal_Int32 mapColumn (sal_Int32 column);
-
- protected:
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- )
- throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle
- ) const;
- ~ODatabaseMetaDataResultSet();
- public:
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- ODatabaseMetaDataResultSet(OConnection* _pConnection);
-
-
- inline oslGenericFunction getOdbcFunction(sal_Int32 _nIndex) const
- {
- return m_pConnection->getOdbcFunction(_nIndex);
- }
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
- {
- return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(*(ODatabaseMetaDataResultSet_BASE*)this);
- }
- // XResultSet
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XColumnLocate
- virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- const ::connectivity::TIntVector& getColumnMapping() { return m_aColMapping; }
-
- void openTablesTypes( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openTypeInfo() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openCatalogs() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openSchemas() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openTables(const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types )
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openColumnPrivileges( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table, const ::rtl::OUString& columnNamePattern )throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern )throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openProcedureColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& procedureNamePattern,const ::rtl::OUString& columnNamePattern )throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openProcedures( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& procedureNamePattern)throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openVersionColumns(const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table)throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openBestRowIdentifier( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table,sal_Int32 scope,sal_Bool nullable )throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openForeignKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString* schema,const ::rtl::OUString* table,
- const ::com::sun::star::uno::Any& catalog2, const ::rtl::OUString* schema2,const ::rtl::OUString* table2)throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openExportedKeys(const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema,const ::rtl::OUString& table)throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openImportedKeys(const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema,const ::rtl::OUString& table)throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openPrimaryKeys(const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema,const ::rtl::OUString& table)throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openTablePrivileges(const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern,
- const ::rtl::OUString& tableNamePattern)throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openSpecialColumns(sal_Bool _bRowVer,const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table,sal_Int32 scope, sal_Bool nullable )throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void openIndexInfo( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema,
- const ::rtl::OUString& table,sal_Bool unique,sal_Bool approximate )throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- protected:
- using OPropertySetHelper::getFastPropertyValue;
- };
- }
-
-}
-#endif // _CONNECTIVITY_ADO_ADATABASEMETADATARESULTSET_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/ODefs3.hxx b/connectivity/source/inc/odbc/ODefs3.hxx
deleted file mode 100644
index 29a56fe4c4..0000000000
--- a/connectivity/source/inc/odbc/ODefs3.hxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_ODBC_ODEFS_HXX_
-#define _CONNECTIVITY_ODBC_ODEFS_HXX_
-
-#define N3SQLAllocHandle SQLAllocHandle
-#define N3SQLConnect SQLConnect
-#define N3SQLDriverConnect SQLDriverConnect
-#define N3SQLBrowseConnect SQLBrowseConnect
-#define N3SQLDataSources SQLDataSources
-#define N3SQLDrivers SQLDrivers
-#define N3SQLGetInfo SQLGetInfo
-#define N3SQLGetFunctions SQLGetFunctions
-#define N3SQLGetTypeInfo SQLGetTypeInfo
-#define N3SQLSetConnectAttr SQLSetConnectAttr
-#define N3SQLGetConnectAttr SQLGetConnectAttr
-#define N3SQLSetEnvAttr SQLSetEnvAttr
-#define N3SQLGetEnvAttr SQLGetEnvAttr
-#define N3SQLSetStmtAttr SQLSetStmtAttr
-#define N3SQLGetStmtAttr SQLgetStmtAttr
-#define N3SQLSetDescField SQLSetDescField
-#define N3SQLGetDescField SQLGetDescField
-#define N3SQLGetDescRec SQLGetDescRec
-#define N3SQLSetDescRec SQLSetDescRec
-#define N3SQLPrepare SQLPrepare
-#define N3SQLBindParameter SQLBindParameter
-#define N3SQLGetCursorName SQLGetCursorName
-#define N3SQLSetCursorName SQLSetCursorName
-#define N3SQLExecute SQLExecute
-#define N3SQLExecDirect SQLExecDirect
-#define N3SQLNativeSql SQLNativeSql
-#define N3SQLDescribeParam SQLDescribeParam
-#define N3SQLNumParams SQLNumParams
-#define N3SQLParamData SQLParamData
-#define N3SQLPutData SQLPutData
-#define N3SQLRowCount SQLRowCount
-#define N3SQLNumResultCols SQLNumResultCols
-#define N3SQLDescribeCol SQLDescribeCol
-#define N3SQLColAttribute SQLColAttribute
-#define N3SQLBindCol SQLBindCol
-#define N3SQLFetch SQLFetch
-#define N3SQLFetchScroll SQLFetchScroll
-#define N3SQLGetData SQLGetData
-#define N3SQLSetPos SQLSetPos
-#define N3SQLBulkOperations SQLBulkOperations
-#define N3SQLMoreResults SQLMoreResults
-#define N3SQLGetDiagField SQLGetDiagField
-#define N3SQLGetDiagRec SQLGetDiagRec
-#define N3SQLColumnPrivileges SQLColumnPrivileges
-#define N3SQLColumns SQLColumns
-#define N3SQLForeignKeys SQLForeignKeys
-#define N3SQLPrimaryKeys SQLPrimaryKeys
-#define N3SQLProcedureColumns SQLProcedureColumns
-#define N3SQLProcedures SQLProcedures
-#define N3SQLSpecialColumns SQLSpecialColumns
-#define N3SQLStatistics SQLStatistics
-#define N3SQLTablePrivileges SQLTablePrivileges
-#define N3SQLTables SQLTables
-#define N3SQLFreeStmt SQLFreeStmt
-#define N3SQLCloseCursor SQLCloseCursor
-#define N3SQLCancel SQLCancel
-#define N3SQLEndTran SQLEndTran
-#define N3SQLDisconnect SQLDisconnect
-#define N3SQLFreeHandle SQLFreeHandle
-#define N3SQLGetCursorName SQLGetCursorName
-
-#endif // _CONNECTIVITY_ODBC_ODEFS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/ODriver.hxx b/connectivity/source/inc/odbc/ODriver.hxx
deleted file mode 100644
index abdf594964..0000000000
--- a/connectivity/source/inc/odbc/ODriver.hxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ODBC_ODRIVER_HXX_
-#define _CONNECTIVITY_ODBC_ODRIVER_HXX_
-
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/compbase2.hxx>
-#include "odbc/OFunctiondefs.hxx"
-#include "odbc/odbcbasedllapi.hxx"
-#include "connectivity/CommonTools.hxx"
-#include <osl/module.h>
-
-namespace connectivity
-{
- namespace odbc
- {
- typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::sdbc::XDriver, ::com::sun::star::lang::XServiceInfo > ODriver_BASE;
-
- class OOO_DLLPUBLIC_ODBCBASE SAL_NO_VTABLE ODBCDriver : public ODriver_BASE
- {
- protected:
- ::osl::Mutex m_aMutex;
-
- connectivity::OWeakRefArray m_xConnections; // vector containing a list
- // of all the Connection objects
- // for this Driver
-
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
- SQLHANDLE m_pDriverHandle;
-
- virtual SQLHANDLE EnvironmentHandle(::rtl::OUString &_rPath) = 0;
-
- public:
-
- ODBCDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
-
- // only possibility to get the odbc functions
- virtual oslGenericFunction getOdbcFunction(sal_Int32 _nIndex) const = 0;
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
-
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const { return m_xORB; }
- };
- }
-
-}
-#endif //_CONNECTIVITY_ODBC_ODRIVER_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/OFunctiondefs.hxx b/connectivity/source/inc/odbc/OFunctiondefs.hxx
deleted file mode 100644
index 87384925a3..0000000000
--- a/connectivity/source/inc/odbc/OFunctiondefs.hxx
+++ /dev/null
@@ -1,167 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-//--------------------------------------------------------------------------
-#ifndef _CONNECTIVITY_OFUNCTIONDEFS_HXX_
-#define _CONNECTIVITY_OFUNCTIONDEFS_HXX_
-
-#if defined(WNT)
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4005)
-#endif
-
-// just to go with calling convention of windows
-#define SQL_API __stdcall
-#include <odbc/sqlext.h>
-#undef SQL_API
-#define SQL_API __stdcall
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-#ifndef SQL_C_BOOKMARK
-#define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */
-#endif
-
-#ifndef SQL_OPT_TRACE_OFF
-#define SQL_OPT_TRACE_OFF 0UL
-#endif
-
-#define SDB_ODBC_CHAR UCHAR
-
-#endif
-
-//--------------------------------------------------------------------------
-
-#ifdef OS2__00
-
-#ifdef ODBCIMP
-
-// Stub-Version: dynamische Bindung an die DLL zur Laufzeit.
-// odbcstub definiert die in den Quellen benutzten NSQL...-Methoden
-// als indirekte Funktionsaufrufe.
-// odbcimp zieht sich selbst preos2, odbc und postos2 an.
-// #include "odbc3imp.hxx"
-
-#else
-
-// Zur Zeit verwenden wir die ODBC-DLL von Watcom-SQL direkt (ueber die
-// mitgelieferte Lib).
-
-#ifndef ODBC_OS2
-#define ODBC_OS2
-#endif
-
-#include <svpm.h>
-#include <odbc.h>
-#define SQL_API __syscall
-#ifndef SQL_MAX_MESSAGE_LENGTH
-#define SQL_MAX_MESSAGE_LENGTH MAX_MESSAGE_LENGTH
-#endif
-#ifndef SQL_MAX_DSN_LENGTH
-#define SQL_MAX_DSN_LENGTH MAX_DSN_LENGTH
-#endif
-#ifndef SQL_AUTOCOMMIT_ON
-#define SQL_AUTOCOMMIT_ON 1UL
-#endif
-#ifndef SQL_AUTOCOMMIT_OFF
-#define SQL_AUTOCOMMIT_OFF 0UL
-#endif
-
-#define SQL_FETCH_PRIOR SQL_FETCH_PREV
-#define SQL_NO_TOTAL (-4)
-
-#endif
-
-// In der ODBC.H von Watcom werden Strings als char * erwartet
-// (nicht, wie sonst bei ODBC ueblich, als UCHAR *).
-#if defined( ICC )
-#define SDB_ODBC_CHAR unsigned char
-#else
-#define SDB_ODBC_CHAR char
-#endif
-
-#endif
-
-//--------------------------------------------------------------------------
-
-#ifdef UNX
-
-// Zur Zeit verwenden wir die ODBC-shared library von Q+E direkt (ueber die
-// mitgelieferte Lib).
-
-#ifndef ODBC_UNX
-#define ODBC_UNX
-#endif
-#define CALLBACK
-#define EXPORT
-#ifdef SYSTEM_ODBC_HEADERS
-#include <sqlext.h>
-#else
-#include <odbc/sqlext.h>
-#endif
-#undef sal_Bool // Ist in qeodbc.h definiert, wird aber von solar.h noch einmal
- // definiert.
-
-#define SDB_ODBC_CHAR UCHAR
-#define SQL_WCHAR (-8)
-#define SQL_WVARCHAR (-9)
-#define SQL_WLONGVARCHAR (-10)
-#define SQL_C_WCHAR SQL_WCHAR
-
-
-#endif // UNX
-
-//--------------------------------------------------------------------------
-
-#ifndef SQL_WCHAR
-#define SQL_WCHAR (-8)
-#endif
-#ifndef SQL_WVARCHAR
-#define SQL_WVARCHAR (-9)
-#endif
-#ifndef SQL_WLONGVARCHAR
-#define SQL_WLONGVARCHAR (-10)
-#endif
-#ifndef SQL_C_WCHAR
-#define SQL_C_WCHAR SQL_WCHAR
-#endif
-
-#ifdef UNICODE
-#define SQL_C_TCHAR SQL_C_WCHAR
-#else
-#define SQL_C_TCHAR SQL_C_CHAR
-#endif
-
-#endif // _CONNECTIVITY_OFUNCTIONDEFS_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/OFunctions.hxx b/connectivity/source/inc/odbc/OFunctions.hxx
deleted file mode 100644
index 6e53f332b5..0000000000
--- a/connectivity/source/inc/odbc/OFunctions.hxx
+++ /dev/null
@@ -1,558 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ODBC_OFUNCTIONS_HXX_
-#define _CONNECTIVITY_ODBC_OFUNCTIONS_HXX_
-
-#include "odbc/OFunctiondefs.hxx"
-#include <rtl/ustring.hxx>
-#include <osl/module.h>
-
-namespace connectivity
-{
-
-// sal_Bool LoadFunctions(oslModule pODBCso, sal_Bool _bDS=sal_True);
-// sal_Bool LoadLibrary_ODBC3(::rtl::OUString &_rPath);
-// sal_Bool LoadLibrary_ADABAS(::rtl::OUString &_rPath);
-
- // Connecting to a data source
- typedef SQLRETURN (SQL_API *T3SQLAllocHandle) (SQLSMALLINT HandleType,SQLHANDLE InputHandle,SQLHANDLE * OutputHandlePtr);
-
- #define N3SQLAllocHandle(a,b,c) (*(T3SQLAllocHandle)getOdbcFunction(ODBC3SQLAllocHandle))(a,b,c)
-
- typedef SQLRETURN (SQL_API *T3SQLConnect) (SQLHDBC ConnectionHandle,SQLCHAR *ServerName,SQLSMALLINT NameLength1,SQLCHAR *UserName,SQLSMALLINT NameLength2,SQLCHAR *Authentication,SQLSMALLINT NameLength3);
-
- #define N3SQLConnect(a,b,c,d,e,f,g) (*(T3SQLConnect)getOdbcFunction(ODBC3SQLConnect))(a,b,c,d,e,f,g)
-
- typedef SQLRETURN (SQL_API *T3SQLDriverConnect) ( SQLHDBC ConnectionHandle,
- HWND WindowHandle,
- SQLCHAR * InConnectionString,
- SQLSMALLINT StringLength1,
- SQLCHAR * OutConnectionString,
- SQLSMALLINT BufferLength,
- SQLSMALLINT * StringLength2Ptr,
- SQLUSMALLINT DriverCompletion);
-
- #define N3SQLDriverConnect(a,b,c,d,e,f,g,h) (*(T3SQLDriverConnect)getOdbcFunction(ODBC3SQLDriverConnect))(a,b,c,d,e,f,g,h)
-
- typedef SQLRETURN (SQL_API *T3SQLBrowseConnect) ( SQLHDBC ConnectionHandle,
- SQLCHAR * InConnectionString,
- SQLSMALLINT StringLength1,
- SQLCHAR * OutConnectionString,
- SQLSMALLINT BufferLength,
- SQLSMALLINT * StringLength2Ptr);
-
- #define N3SQLBrowseConnect(a,b,c,d,e,f) (*(T3SQLBrowseConnect)getOdbcFunction(ODBC3SQLBrowseConnect))(a,b,c,d,e,f)
-
- // Obtaining information about a driver and data source
- typedef SQLRETURN (SQL_API *T3SQLDataSources) ( SQLHENV EnvironmentHandle,
- SQLUSMALLINT Direction,
- SQLCHAR * ServerName,
- SQLSMALLINT BufferLength1,
- SQLSMALLINT * NameLength1Ptr,
- SQLCHAR * Description,
- SQLSMALLINT BufferLength2,
- SQLSMALLINT * NameLength2Ptr);
-
- #define N3SQLDataSources(a,b,c,d,e,f,g,h) (*(T3SQLDataSources)getOdbcFunction(ODBC3SQLDataSources))(a,b,c,d,e,f,g,h)
-
- typedef SQLRETURN (SQL_API *T3SQLDrivers) ( SQLHENV EnvironmentHandle,
- SQLUSMALLINT Direction,
- SQLCHAR * DriverDescription,
- SQLSMALLINT BufferLength1,
- SQLSMALLINT * DescriptionLengthPtr,
- SQLCHAR * DriverAttributes,
- SQLSMALLINT BufferLength2,
- SQLSMALLINT * AttributesLengthPtr);
-
- #define N3SQLDrivers(a,b,c,d,e,f,g,h) (*(T3SQLDrivers)getOdbcFunction(ODBC3SQLDrivers))(a,b,c,d,e,f,g,h)
-
- typedef SQLRETURN (SQL_API *T3SQLGetInfo) ( SQLHDBC ConnectionHandle,
- SQLUSMALLINT InfoType,
- SQLPOINTER InfoValuePtr,
- SQLSMALLINT BufferLength,
- SQLSMALLINT * StringLengthPtr);
-
- #define N3SQLGetInfo(a,b,c,d,e) (*(T3SQLGetInfo)getOdbcFunction(ODBC3SQLGetInfo))(a,b,c,d,e)
-
- typedef SQLRETURN (SQL_API *T3SQLGetFunctions) (SQLHDBC ConnectionHandle,
- SQLUSMALLINT FunctionId,
- SQLUSMALLINT * SupportedPtr);
-
- #define N3SQLGetFunctions(a,b,c) (*(T3SQLGetFunctions)getOdbcFunction(ODBC3SQLGetFunctions))(a,b,c)
-
- typedef SQLRETURN (SQL_API *T3SQLGetTypeInfo) ( SQLHSTMT StatementHandle,
- SQLSMALLINT DataType);
-
- #define N3SQLGetTypeInfo(a,b) (*(T3SQLGetTypeInfo)getOdbcFunction(ODBC3SQLGetTypeInfo))(a,b)
-
- // Setting and retrieving driver attributes
- typedef SQLRETURN (SQL_API *T3SQLSetConnectAttr)(SQLHDBC ConnectionHandle,
- SQLINTEGER Attribute,
- SQLPOINTER ValuePtr,
- SQLINTEGER StringLength);
-
- #define N3SQLSetConnectAttr(a,b,c,d) (*(T3SQLSetConnectAttr)getOdbcFunction(ODBC3SQLSetConnectAttr))(a,b,c,d)
-
- typedef SQLRETURN (SQL_API *T3SQLGetConnectAttr) (SQLHDBC ConnectionHandle,
- SQLINTEGER Attribute,
- SQLPOINTER ValuePtr,
- SQLINTEGER BufferLength,
- SQLINTEGER* StringLength);
-
- #define N3SQLGetConnectAttr(a,b,c,d,e) (*(T3SQLGetConnectAttr)getOdbcFunction(ODBC3SQLGetConnectAttr))(a,b,c,d,e)
-
-
- typedef SQLRETURN (SQL_API *T3SQLSetEnvAttr) ( SQLHENV EnvironmentHandle,
- SQLINTEGER Attribute,
- SQLPOINTER ValuePtr,
- SQLINTEGER StringLength);
-
- #define N3SQLSetEnvAttr(a,b,c,d) (*(T3SQLSetEnvAttr)getOdbcFunction(ODBC3SQLSetEnvAttr))(a,b,c,d)
-
- typedef SQLRETURN (SQL_API *T3SQLGetEnvAttr) ( SQLHENV EnvironmentHandle,
- SQLINTEGER Attribute,
- SQLPOINTER ValuePtr,
- SQLINTEGER BufferLength,
- SQLINTEGER* StringLength);
-
- #define N3SQLGetEnvAttr(a,b,c,d,e) (*(T3SQLGetEnvAttr)getOdbcFunction(ODBC3SQLGetEnvAttr))(a,b,c,d,e)
-
-
- typedef SQLRETURN (SQL_API *T3SQLSetStmtAttr) ( SQLHSTMT StatementHandle,
- SQLINTEGER Attribute,
- SQLPOINTER ValuePtr,
- SQLINTEGER StringLength);
-
- #define N3SQLSetStmtAttr(a,b,c,d) (*(T3SQLSetStmtAttr)getOdbcFunction(ODBC3SQLSetStmtAttr))(a,b,c,d)
-
- typedef SQLRETURN (SQL_API *T3SQLGetStmtAttr) ( SQLHSTMT StatementHandle,
- SQLINTEGER Attribute,
- SQLPOINTER ValuePtr,
- SQLINTEGER BufferLength,
- SQLINTEGER* StringLength);
-
- #define N3SQLGetStmtAttr(a,b,c,d,e) (*(T3SQLGetStmtAttr)getOdbcFunction(ODBC3SQLGetStmtAttr))(a,b,c,d,e)
-
- // Setting and retrieving descriptor fields
- /*typedef SQLRETURN (SQL_API *T3SQLSetDescField) (SQLHDESC DescriptorHandle,
- SQLSMALLINT RecNumber,
- SQLSMALLINT FieldIdentifier,
- SQLPOINTER ValuePtr,
- SQLINTEGER BufferLength);
-
- #define N3SQLSetDescField(a,b,c,d,e) (*(T3SQLSetDescField)getOdbcFunction(ODBC3SQLSetDescField))(a,b,c,d,e)
-
- typedef SQLRETURN (SQL_API *T3SQLGetDescField) ( SQLHDESC DescriptorHandle,
- SQLSMALLINT RecNumber,
- SQLSMALLINT FieldIdentifier,
- SQLPOINTER ValuePtr,
- SQLINTEGER BufferLength,
- SQLINTEGER * StringLengthPtr);
-
- #define N3SQLGetDescField(a,b,c,d,e,f) (*(T3SQLGetDescField)getOdbcFunction(ODBC3SQLGetDescField))(a,b,c,d,e,f)
-
-
- typedef SQLRETURN (SQL_API *T3SQLGetDescRec) ( SQLHDESC DescriptorHandle,
- SQLSMALLINT RecNumber,
- SQLCHAR * Name,
- SQLSMALLINT BufferLength,
- SQLSMALLINT * StringLengthPtr,
- SQLSMALLINT * TypePtr,
- SQLSMALLINT * SubTypePtr,
- SQLLEN * LengthPtr,
- SQLSMALLINT * PrecisionPtr,
- SQLSMALLINT * ScalePtr,
- SQLSMALLINT * NullablePtr);
-
- #define N3SQLGetDescRec(a,b,c,d,e,f,g,h,i,j,k) (*(T3SQLGetDescRec)getOdbcFunction(ODBC3SQLGetDescRec))(a,b,c,d,e,f,g,h,i,j,k)
-
-
- typedef SQLRETURN (SQL_API *T3SQLSetDescRec) ( SQLHDESC DescriptorHandle,
- SQLSMALLINT RecNumber,
- SQLSMALLINT Type,
- SQLSMALLINT SubType,
- SQLINTEGER Length,
- SQLSMALLINT Precision,
- SQLSMALLINT Scale,
- SQLPOINTER DataPtr,
- SQLLEN * StringLengthPtr,
- SQLLEN * IndicatorPtr);
-
- #define N3SQLSetDescRec(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSetDescRec)getOdbcFunction(ODBC3SQLSetDescRec))(a,b,c,d,e,f,g,h,i,j)
- */
-
- // Preparing SQL requests
- typedef SQLRETURN (SQL_API *T3SQLPrepare) ( SQLHSTMT StatementHandle,
- SQLCHAR * StatementText,
- SQLINTEGER TextLength);
-
- #define N3SQLPrepare(a,b,c) (*(T3SQLPrepare)getOdbcFunction(ODBC3SQLPrepare))(a,b,c)
-
- typedef SQLRETURN (SQL_API *T3SQLBindParameter) (SQLHSTMT StatementHandle,
- SQLUSMALLINT ParameterNumber,
- SQLSMALLINT InputOutputType,
- SQLSMALLINT ValueType,
- SQLSMALLINT ParameterType,
- SQLULEN ColumnSize,
- SQLSMALLINT DecimalDigits,
- SQLPOINTER ParameterValuePtr,
- SQLLEN BufferLength,
- SQLLEN * StrLen_or_IndPtr);
-
- #define N3SQLBindParameter(a,b,c,d,e,f,g,h,i,j) (*(T3SQLBindParameter)getOdbcFunction(ODBC3SQLBindParameter))(a,b,c,d,e,f,g,h,i,j)
-
- /*typedef SQLRETURN (SQL_API *T3SQLGetCursorName) (SQLHSTMT StatementHandle,
- SQLCHAR * CursorName,
- SQLSMALLINT BufferLength,
- SQLSMALLINT * NameLengthPtr);
-
- #define N3SQLGetCursorName(a,b,c,d) (*(T3SQLGetCursorName)getOdbcFunction(ODBC3SQLGetCursorName))(a,b,c,d)
- */
-
- typedef SQLRETURN (SQL_API *T3SQLSetCursorName) (SQLHSTMT StatementHandle,
- SQLCHAR * CursorName,
- SQLSMALLINT NameLength);
-
- #define N3SQLSetCursorName(a,b,c) (*(T3SQLSetCursorName)getOdbcFunction(ODBC3SQLSetCursorName))(a,b,c)
-
- // Submitting requests
- typedef SQLRETURN (SQL_API *T3SQLExecute) ( SQLHSTMT StatementHandle);
-
- #define N3SQLExecute(a) (*(T3SQLExecute)getOdbcFunction(ODBC3SQLExecute))(a)
-
- typedef SQLRETURN (SQL_API *T3SQLExecDirect) ( SQLHSTMT StatementHandle,
- SQLCHAR * StatementText,
- SQLINTEGER TextLength);
-
- #define N3SQLExecDirect(a,b,c) (*(T3SQLExecDirect)getOdbcFunction(ODBC3SQLExecDirect))(a,b,c)
-
- /*typedef SQLRETURN (SQL_API *T3SQLNativeSql) ( SQLHDBC ConnectionHandle,
- SQLCHAR * InStatementText,
- SQLINTEGER TextLength1,
- SQLCHAR * utStatementText,
- SQLINTEGER BufferLength,
- SQLINTEGER * TextLength2Ptr);
-
- #define N3SQLNativeSql(a,b,c,d,e,f) (*(T3SQLNativeSql)getOdbcFunction(ODBC3SQLNativeSql))(a,b,c,d,e,f)*/
-
- typedef SQLRETURN (SQL_API *T3SQLDescribeParam) (SQLHSTMT StatementHandle,
- SQLUSMALLINT ParameterNumber,
- SQLSMALLINT * DataTypePtr,
- SQLULEN * ParameterSizePtr,
- SQLSMALLINT * DecimalDigitsPtr,
- SQLSMALLINT * NullablePtr);
-
- #define N3SQLDescribeParam(a,b,c,d,e,f) (*(T3SQLDescribeParam)getOdbcFunction(ODBC3SQLDescribeParam))(a,b,c,d,e,f)
-
- typedef SQLRETURN (SQL_API *T3SQLNumParams) ( SQLHSTMT StatementHandle,
- SQLSMALLINT * ParameterCountPtr);
-
- #define N3SQLNumParams(a,b) (*(T3SQLNumParams)getOdbcFunction(ODBC3SQLNumParams))(a,b)
-
- typedef SQLRETURN (SQL_API *T3SQLParamData) ( SQLHSTMT StatementHandle,
- SQLPOINTER * ValuePtrPtr);
-
- #define N3SQLParamData(a,b) (*(T3SQLParamData)getOdbcFunction(ODBC3SQLParamData))(a,b)
-
- typedef SQLRETURN (SQL_API *T3SQLPutData) ( SQLHSTMT StatementHandle,
- SQLPOINTER DataPtr,
- SQLLEN StrLen_or_Ind);
-
- #define N3SQLPutData(a,b,c) (*(T3SQLPutData)getOdbcFunction(ODBC3SQLPutData))(a,b,c)
-
- // Retrieving results and information about results
- typedef SQLRETURN (SQL_API *T3SQLRowCount) ( SQLHSTMT StatementHandle,
- SQLLEN * RowCountPtr);
-
- #define N3SQLRowCount(a,b) (*(T3SQLRowCount)getOdbcFunction(ODBC3SQLRowCount))(a,b)
-
- typedef SQLRETURN (SQL_API *T3SQLNumResultCols) (SQLHSTMT StatementHandle,
- SQLSMALLINT * ColumnCountPtr);
-
- #define N3SQLNumResultCols(a,b) (*(T3SQLNumResultCols)getOdbcFunction(ODBC3SQLNumResultCols))(a,b)
-
- typedef SQLRETURN (SQL_API *T3SQLDescribeCol) ( SQLHSTMT StatementHandle,
- SQLUSMALLINT ColumnNumber,
- SQLCHAR * ColumnName,
- SQLSMALLINT BufferLength,
- SQLSMALLINT * NameLengthPtr,
- SQLSMALLINT * DataTypePtr,
- SQLULEN * ColumnSizePtr,
- SQLSMALLINT * DecimalDigitsPtr,
- SQLSMALLINT * NullablePtr);
-
- #define N3SQLDescribeCol(a,b,c,d,e,f,g,h,i) (*(T3SQLDescribeCol)getOdbcFunction(ODBC3SQLDescribeCol))(a,b,c,d,e,f,g,h,i)
-
- typedef SQLRETURN (SQL_API *T3SQLColAttribute) (SQLHSTMT StatementHandle,
- SQLUSMALLINT ColumnNumber,
- SQLUSMALLINT FieldIdentifier,
- SQLPOINTER CharacterAttributePtr,
- SQLSMALLINT BufferLength,
- SQLSMALLINT * StringLengthPtr,
- SQLLEN * NumericAttributePtr);
-
- #define N3SQLColAttribute(a,b,c,d,e,f,g) (*(T3SQLColAttribute)getOdbcFunction(ODBC3SQLColAttribute))(a,b,c,d,e,f,g)
-
- typedef SQLRETURN (SQL_API *T3SQLBindCol) ( SQLHSTMT StatementHandle,
- SQLUSMALLINT ColumnNumber,
- SQLSMALLINT TargetType,
- SQLPOINTER TargetValuePtr,
- SQLLEN BufferLength,
- SQLLEN * StrLen_or_IndPtr);
-
- #define N3SQLBindCol(a,b,c,d,e,f) (*(T3SQLBindCol)getOdbcFunction(ODBC3SQLBindCol))(a,b,c,d,e,f)
-
- typedef SQLRETURN (SQL_API *T3SQLFetch) ( SQLHSTMT StatementHandle);
-
- #define N3SQLFetch(a) (*(T3SQLFetch)getOdbcFunction(ODBC3SQLFetch))(a)
-
- typedef SQLRETURN (SQL_API *T3SQLFetchScroll) ( SQLHSTMT StatementHandle,
- SQLSMALLINT FetchOrientation,
- SQLLEN FetchOffset);
-
- #define N3SQLFetchScroll(a,b,c) (*(T3SQLFetchScroll)getOdbcFunction(ODBC3SQLFetchScroll))(a,b,c)
-
- typedef SQLRETURN (SQL_API *T3SQLGetData) ( SQLHSTMT StatementHandle,
- SQLUSMALLINT ColumnNumber,
- SQLSMALLINT TargetType,
- SQLPOINTER TargetValuePtr,
- SQLLEN BufferLength,
- SQLLEN * StrLen_or_IndPtr);
-
- #define N3SQLGetData(a,b,c,d,e,f) (*(T3SQLGetData)getOdbcFunction(ODBC3SQLGetData))(a,b,c,d,e,f)
-
- typedef SQLRETURN (SQL_API *T3SQLSetPos) ( SQLHSTMT StatementHandle,
- SQLSETPOSIROW RowNumber,
- SQLUSMALLINT Operation,
- SQLUSMALLINT LockType);
-
- #define N3SQLSetPos(a,b,c,d) (*(T3SQLSetPos)getOdbcFunction(ODBC3SQLSetPos))(a,b,c,d)
-
- typedef SQLRETURN (SQL_API *T3SQLBulkOperations) ( SQLHSTMT StatementHandle,
- SQLSMALLINT Operation);
-
- #define N3SQLBulkOperations(a,b) (*(T3SQLBulkOperations)getOdbcFunction(ODBC3SQLBulkOperations))(a,b)
-
- typedef SQLRETURN (SQL_API *T3SQLMoreResults) ( SQLHSTMT StatementHandle);
-
- #define N3SQLMoreResults(a) (*(T3SQLMoreResults)getOdbcFunction(ODBC3SQLMoreResults))(a)
-
- /*typedef SQLRETURN (SQL_API *T3SQLGetDiagField) (SQLSMALLINT HandleType,
- SQLHANDLE Handle,
- SQLSMALLINT RecNumber,
- SQLSMALLINT DiagIdentifier,
- SQLPOINTER DiagInfoPtr,
- SQLSMALLINT BufferLength,
- SQLSMALLINT * StringLengthPtr);
-
- #define N3SQLGetDiagField(a,b,c,d,e,f,g) (*(T3SQLGetDiagField)getOdbcFunction(ODBC3SQLGetDiagField))(a,b,c,d,e,f,g)*/
-
- typedef SQLRETURN (SQL_API *T3SQLGetDiagRec) ( SQLSMALLINT HandleType,
- SQLHANDLE Handle,
- SQLSMALLINT RecNumber,
- SQLCHAR * Sqlstate,
- SQLINTEGER * NativeErrorPtr,
- SQLCHAR * MessageText,
- SQLSMALLINT BufferLength,
- SQLSMALLINT * TextLengthPtr);
-
-
- #define N3SQLGetDiagRec(a,b,c,d,e,f,g,h) (*(T3SQLGetDiagRec)getOdbcFunction(ODBC3SQLGetDiagRec))(a,b,c,d,e,f,g,h)
-
- // Obtaining information about the data source's system tables (catalog functions)
- typedef SQLRETURN (SQL_API *T3SQLColumnPrivileges) (SQLHSTMT StatementHandle,
- SQLCHAR * CatalogName,
- SQLSMALLINT NameLength1,
- SQLCHAR * SchemaName,
- SQLSMALLINT NameLength2,
- SQLCHAR * TableName,
- SQLSMALLINT NameLength3,
- SQLCHAR * ColumnName,
- SQLSMALLINT NameLength4);
-
- #define N3SQLColumnPrivileges(a,b,c,d,e,f,g,h,i) (*(T3SQLColumnPrivileges)getOdbcFunction(ODBC3SQLColumnPrivileges))(a,b,c,d,e,f,g,h,i)
-
- typedef SQLRETURN (SQL_API *T3SQLColumns) ( SQLHSTMT StatementHandle,
- SQLCHAR * CatalogName,
- SQLSMALLINT NameLength1,
- SQLCHAR * SchemaName,
- SQLSMALLINT NameLength2,
- SQLCHAR * TableName,
- SQLSMALLINT NameLength3,
- SQLCHAR * ColumnName,
- SQLSMALLINT NameLength4);
-
- #define N3SQLColumns(a,b,c,d,e,f,g,h,i) (*(T3SQLColumns)getOdbcFunction(ODBC3SQLColumns))(a,b,c,d,e,f,g,h,i)
-
- typedef SQLRETURN (SQL_API *T3SQLForeignKeys) ( SQLHSTMT StatementHandle,
- SQLCHAR * PKCatalogName,
- SQLSMALLINT NameLength1,
- SQLCHAR * PKSchemaName,
- SQLSMALLINT NameLength2,
- SQLCHAR * PKTableName,
- SQLSMALLINT NameLength3,
- SQLCHAR * FKCatalogName,
- SQLSMALLINT NameLength4,
- SQLCHAR * FKSchemaName,
- SQLSMALLINT NameLength5,
- SQLCHAR * FKTableName,
- SQLSMALLINT NameLength6);
-
- #define N3SQLForeignKeys(a,b,c,d,e,f,g,h,i,j,k,l,m) (*(T3SQLForeignKeys)getOdbcFunction(ODBC3SQLForeignKeys))(a,b,c,d,e,f,g,h,i,j,k,l,m)
-
- typedef SQLRETURN (SQL_API *T3SQLPrimaryKeys) ( SQLHSTMT StatementHandle,
- SQLCHAR * CatalogName,
- SQLSMALLINT NameLength1,
- SQLCHAR * SchemaName,
- SQLSMALLINT NameLength2,
- SQLCHAR * TableName,
- SQLSMALLINT NameLength3);
-
- #define N3SQLPrimaryKeys(a,b,c,d,e,f,g) (*(T3SQLPrimaryKeys)getOdbcFunction(ODBC3SQLPrimaryKeys))(a,b,c,d,e,f,g)
-
- typedef SQLRETURN (SQL_API *T3SQLProcedureColumns) (SQLHSTMT StatementHandle,
- SQLCHAR * CatalogName,
- SQLSMALLINT NameLength1,
- SQLCHAR * SchemaName,
- SQLSMALLINT NameLength2,
- SQLCHAR * ProcName,
- SQLSMALLINT NameLength3,
- SQLCHAR * ColumnName,
- SQLSMALLINT NameLength4);
-
- #define N3SQLProcedureColumns(a,b,c,d,e,f,g,h,i) (*(T3SQLProcedureColumns)getOdbcFunction(ODBC3SQLProcedureColumns))(a,b,c,d,e,f,g,h,i)
-
- typedef SQLRETURN (SQL_API *T3SQLProcedures) ( SQLHSTMT StatementHandle,
- SQLCHAR * CatalogName,
- SQLSMALLINT NameLength1,
- SQLCHAR * SchemaName,
- SQLSMALLINT NameLength2,
- SQLCHAR * ProcName,
- SQLSMALLINT NameLength3);
-
- #define N3SQLProcedures(a,b,c,d,e,f,g) (*(T3SQLProcedures)getOdbcFunction(ODBC3SQLProcedures))(a,b,c,d,e,f,g)
-
- typedef SQLRETURN (SQL_API *T3SQLSpecialColumns) (SQLHSTMT StatementHandle,
- SQLUSMALLINT IdentifierType,
- SQLCHAR * CatalogName,
- SQLSMALLINT NameLength1,
- SQLCHAR * SchemaName,
- SQLSMALLINT NameLength2,
- SQLCHAR * TableName,
- SQLSMALLINT NameLength3,
- SQLUSMALLINT Scope,
- SQLUSMALLINT Nullable);
-
- #define N3SQLSpecialColumns(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSpecialColumns)getOdbcFunction(ODBC3SQLSpecialColumns))(a,b,c,d,e,f,g,h,i,j)
-
- typedef SQLRETURN (SQL_API *T3SQLStatistics) ( SQLHSTMT StatementHandle,
- SQLCHAR * CatalogName,
- SQLSMALLINT NameLength1,
- SQLCHAR * SchemaName,
- SQLSMALLINT NameLength2,
- SQLCHAR * TableName,
- SQLSMALLINT NameLength3,
- SQLUSMALLINT Unique,
- SQLUSMALLINT Reserved);
-
- #define N3SQLStatistics(a,b,c,d,e,f,g,h,i) (*(T3SQLStatistics)getOdbcFunction(ODBC3SQLStatistics))(a,b,c,d,e,f,g,h,i)
-
- typedef SQLRETURN (SQL_API *T3SQLTablePrivileges) (SQLHSTMT StatementHandle,
- SQLCHAR * CatalogName,
- SQLSMALLINT NameLength1,
- SQLCHAR * SchemaName,
- SQLSMALLINT NameLength2,
- SQLCHAR * TableName,
- SQLSMALLINT NameLength3);
-
- #define N3SQLTablePrivileges(a,b,c,d,e,f,g) (*(T3SQLTablePrivileges)getOdbcFunction(ODBC3SQLTablePrivileges))(a,b,c,d,e,f,g)
-
- typedef SQLRETURN (SQL_API *T3SQLTables) ( SQLHSTMT StatementHandle,
- SQLCHAR * CatalogName,
- SQLSMALLINT NameLength1,
- SQLCHAR * SchemaName,
- SQLSMALLINT NameLength2,
- SQLCHAR * TableName,
- SQLSMALLINT NameLength3,
- SQLCHAR * TableType,
- SQLSMALLINT NameLength4);
-
- #define N3SQLTables(a,b,c,d,e,f,g,h,i) (*(T3SQLTables)getOdbcFunction(ODBC3SQLTables))(a,b,c,d,e,f,g,h,i)
-
- // Terminating a statement
- typedef SQLRETURN (SQL_API *T3SQLFreeStmt) ( SQLHSTMT StatementHandle,
- SQLUSMALLINT Option);
-
- #define N3SQLFreeStmt(a,b) (*(T3SQLFreeStmt)getOdbcFunction(ODBC3SQLFreeStmt))(a,b)
-
- typedef SQLRETURN (SQL_API *T3SQLCloseCursor) (SQLHSTMT StatementHandle);
-
- #define N3SQLCloseCursor(a) (*(T3SQLCloseCursor)getOdbcFunction(ODBC3SQLCloseCursor))(a)
-
- typedef SQLRETURN (SQL_API *T3SQLCancel) ( SQLHSTMT StatementHandle);
-
- #define N3SQLCancel(a) (*(T3SQLCancel)getOdbcFunction(ODBC3SQLCancel))(a)
-
- typedef SQLRETURN (SQL_API *T3SQLEndTran) ( SQLSMALLINT HandleType,
- SQLHANDLE Handle,
- SQLSMALLINT CompletionType);
-
- #define N3SQLEndTran(a,b,c) (*(T3SQLEndTran)getOdbcFunction(ODBC3SQLEndTran))(a,b,c)
-
- // Terminating a connection
- typedef SQLRETURN (SQL_API *T3SQLDisconnect) (SQLHDBC ConnectionHandle);
-
- #define N3SQLDisconnect(a) (*(T3SQLDisconnect)getOdbcFunction(ODBC3SQLDisconnect))(a)
-
- typedef SQLRETURN (SQL_API *T3SQLFreeHandle) (SQLSMALLINT HandleType,
- SQLHANDLE Handle);
-
- #define N3SQLFreeHandle(a,b) (*(T3SQLFreeHandle)getOdbcFunction(ODBC3SQLFreeHandle))(a,b)
-
- typedef SQLRETURN (SQL_API *T3SQLGetCursorName) ( SQLHSTMT StatementHandle,
- SQLCHAR * CursorName,
- SQLSMALLINT BufferLength,
- SQLSMALLINT* NameLength2);
-
- #define N3SQLGetCursorName(a,b,c,d) (*(T3SQLGetCursorName)getOdbcFunction(ODBC3SQLGetCursorName))(a,b,c,d)
-
- typedef SQLRETURN (SQL_API *T3SQLNativeSql) ( SQLHSTMT ConnectionHandle,
- SQLCHAR * InStatementText,
- SQLINTEGER TextLength1,
- SQLCHAR * OutStatementText,
- SQLINTEGER BufferLength,
- SQLINTEGER * TextLength2Ptr);
-
- #define N3SQLNativeSql(a,b,c,d,e,f) (*(T3SQLNativeSql)getOdbcFunction(ODBC3SQLNativeSql))(a,b,c,d,e,f)
-}
-
-#endif // _CONNECTIVITY_ODBC_OFUNCTIONS_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/OPreparedStatement.hxx b/connectivity/source/inc/odbc/OPreparedStatement.hxx
deleted file mode 100644
index 1e8362834b..0000000000
--- a/connectivity/source/inc/odbc/OPreparedStatement.hxx
+++ /dev/null
@@ -1,173 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ODBC_OPREPAREDSTATEMENT_HXX_
-#define _CONNECTIVITY_ODBC_OPREPAREDSTATEMENT_HXX_
-
-#include "odbc/odbcbasedllapi.hxx"
-#include "odbc/OStatement.hxx"
-#include <com/sun/star/sdbc/XPreparedStatement.hpp>
-#include <com/sun/star/sdbc/XParameters.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XPreparedBatchExecution.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <cppuhelper/implbase5.hxx>
-
-namespace connectivity
-{
- namespace odbc
- {
-
- class OBoundParam;
- typedef ::cppu::ImplHelper5< ::com::sun::star::sdbc::XPreparedStatement,
- ::com::sun::star::sdbc::XParameters,
- ::com::sun::star::sdbc::XPreparedBatchExecution,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::lang::XServiceInfo> OPreparedStatement_BASE;
-
- class OOO_DLLPUBLIC_ODBCBASE OPreparedStatement :
- public OStatement_BASE2,
- public OPreparedStatement_BASE
- {
- protected:
- struct Parameter
- {
- ::com::sun::star::uno::Any aValue;
- sal_Int32 nDataType;
-
- Parameter(const ::com::sun::star::uno::Any& rValue,
- sal_Int32 rDataType) : aValue(rValue),nDataType(rDataType)
- {
- }
-
- };
-
- ::std::vector< Parameter> m_aParameters;
- //====================================================================
- // Data attributes
- //====================================================================
- SQLSMALLINT numParams; // Number of parameter markers
- // for the prepared statement
-
- OBoundParam* boundParams;
- // Array of bound parameter
- // objects. Each parameter
- // marker will have a
- // corresponding object to
- // hold bind information, and
- // resulting data.
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData;
- sal_Bool m_bPrepared;
-
- void FreeParams();
- void putParamData (sal_Int32 index) throw(::com::sun::star::sdbc::SQLException);
- void setStream (sal_Int32 ParameterIndex,const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x,
- SQLLEN length,sal_Int32 SQLtype) throw(::com::sun::star::sdbc::SQLException);
- sal_Int32 getParamLength ( sal_Int32 index);
- sal_Int8* getLengthBuf (sal_Int32 index);
- sal_Int8* getDataBuf (sal_Int32 index);
- sal_Int8* allocBindBuf ( sal_Int32 index, sal_Int32 bufLen);
- void initBoundParam () throw(::com::sun::star::sdbc::SQLException);
- void setParameter(sal_Int32 parameterIndex,sal_Int32 _nType,sal_Int32 _nSize,void* _pData);
-
- sal_Int32 getPrecision ( sal_Int32 sqlType);
-
- sal_Bool isPrepared() const { return m_bPrepared;}
- void prepareStatement();
- void checkParameterIndex(sal_Int32 _parameterIndex);
- void setDecimal( sal_Int32 parameterIndex, const ::rtl::OUString& x );
-
- /**
- creates the driver specific resultset (factory)
- */
- virtual OResultSet* createResulSet();
-
- protected:
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue)
- throw (::com::sun::star::uno::Exception);
- public:
- DECLARE_SERVICE_INFO();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- OPreparedStatement( OConnection* _pConnection,const ::rtl::OUString& sql);
-
- //XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPreparedStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL executeUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XParameters
- virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearParameters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XPreparedBatchExecution
- virtual void SAL_CALL addBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- public:
- using OStatement_Base::executeQuery;
- using OStatement_Base::executeUpdate;
- using OStatement_Base::execute;
- };
- }
-}
-#endif // _CONNECTIVITY_ODBC_OPREPAREDSTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/OResultSet.hxx b/connectivity/source/inc/odbc/OResultSet.hxx
deleted file mode 100644
index 7a9b399694..0000000000
--- a/connectivity/source/inc/odbc/OResultSet.hxx
+++ /dev/null
@@ -1,329 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ODBC_ORESULTSET_HXX_
-#define _CONNECTIVITY_ODBC_ORESULTSET_HXX_
-
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/XColumnLocate.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
-#include <com/sun/star/sdbcx/XDeleteRows.hpp>
-#include <cppuhelper/compbase12.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include "odbc/OFunctions.hxx"
-#include "odbc/OStatement.hxx"
-#include "odbc/odbcbasedllapi.hxx"
-#include "connectivity/CommonTools.hxx"
-#include "connectivity/FValue.hxx"
-#include "TSkipDeletedSet.hxx"
-
-namespace connectivity
-{
- namespace odbc
- {
-
- /*
- ** java_sql_ResultSet
- */
- typedef ::cppu::WeakComponentImplHelper12< ::com::sun::star::sdbc::XResultSet,
- ::com::sun::star::sdbc::XRow,
- ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XResultSetUpdate,
- ::com::sun::star::sdbc::XRowUpdate,
- ::com::sun::star::sdbcx::XRowLocate,
- ::com::sun::star::sdbcx::XDeleteRows,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XColumnLocate,
- ::com::sun::star::lang::XServiceInfo> OResultSet_BASE;
-
-
- typedef ::std::pair<sal_Int64,sal_Int32> TVoidPtr;
- typedef ::std::allocator< TVoidPtr > TVoidAlloc;
- typedef ::std::vector<TVoidPtr> TVoidVector;
- // typedef ::com::sun::star::uno::Sequence<TVoidPtr> TVoidVector;
- /// unary_function Functor object for class ZZ returntype is void
- struct OOO_DLLPUBLIC_ODBCBASE TBookmarkPosMapCompare : ::std::binary_function< ::com::sun::star::uno::Sequence<sal_Int8>, ::com::sun::star::uno::Sequence<sal_Int8>, bool >
- {
- inline bool operator()( const ::com::sun::star::uno::Sequence<sal_Int8>& _rLH,
- const ::com::sun::star::uno::Sequence<sal_Int8>& _rRH) const
- {
- if(_rLH.getLength() == _rRH.getLength())
- {
- sal_Int32 nCount = _rLH.getLength();
- if(nCount != 4)
- {
- const sal_Int8* pLHBack = _rLH.getConstArray() + nCount - 1;
- const sal_Int8* pRHBack = _rRH.getConstArray() + nCount - 1;
-
- sal_Int32 i;
- for(i=0;i < nCount;++i,--pLHBack,--pRHBack)
- {
- if(!(*pLHBack) && *pRHBack)
- return sal_True;
- else if(*pLHBack && !(*pRHBack))
- return sal_False;
- }
- for(i=0,++pLHBack,++pRHBack;i < nCount;++pLHBack,++pRHBack,++i)
- if(*pLHBack < *pRHBack)
- return sal_True;
- return sal_False;
- }
- else
- return *reinterpret_cast<const sal_Int32*>(_rLH.getConstArray()) < *reinterpret_cast<const sal_Int32*>(_rRH.getConstArray());
-
- }
- else
- return _rLH.getLength() < _rRH.getLength();
- }
- };
-
- typedef ::std::map< ::com::sun::star::uno::Sequence<sal_Int8>, sal_Int32,TBookmarkPosMapCompare > TBookmarkPosMap;
-
- class OOO_DLLPUBLIC_ODBCBASE OResultSet :
- public comphelper::OBaseMutex,
- public ::connectivity::IResultSetHelper,
- public OResultSet_BASE,
- public ::cppu::OPropertySetHelper,
- public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
- {
- protected:
- TBookmarkPosMap m_aPosToBookmarks;
- // used top hold the information about the value and the datatype to save calls to metadata
- typedef ::std::vector<ORowSetValue> TDataRow;
-
- TVoidVector m_aBindVector;
- ::std::vector<SQLLEN> m_aLengthVector;
- ::std::map<sal_Int32,SWORD> m_aODBCColumnTypes;
- ::com::sun::star::uno::Sequence<sal_Int8> m_aBookmark;
-
- TDataRow m_aRow; // only used when SQLGetData can't be called in any order
- ORowSetValue m_aEmptyValue; // needed for the getValue method when no prefetch is used
- SQLHANDLE m_aStatementHandle;
- SQLHANDLE m_aConnectionHandle;
- OStatement_Base* m_pStatement;
- OSkipDeletedSet* m_pSkipDeletedSet;
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
- SQLUSMALLINT* m_pRowStatusArray;
- rtl_TextEncoding m_nTextEncoding;
- sal_Int32 m_nRowPos;
- sal_Int32 m_nLastColumnPos; // used for m_aRow just to know where we are
- mutable sal_uInt32 m_nUseBookmarks;
- SQLRETURN m_nCurrentFetchState;
- sal_Bool m_bWasNull;
- sal_Bool m_bEOF; // after last record
- sal_Bool m_bLastRecord;
- sal_Bool m_bFreeHandle;
- sal_Bool m_bInserting;
- sal_Bool m_bFetchData; // true when SQLGetaData can be called in any order or when fetching data for m_aRow
- sal_Bool m_bRowInserted;
- sal_Bool m_bRowDeleted;
- sal_Bool m_bUseFetchScroll;
-
- sal_Bool isBookmarkable() const;
- sal_Int32 getResultSetConcurrency() const;
- sal_Int32 getResultSetType() const;
- sal_Int32 getFetchDirection() const;
- sal_Int32 getFetchSize() const;
- ::rtl::OUString getCursorName() const;
-
- void setFetchDirection(sal_Int32 _par0);
- void setFetchSize(sal_Int32 _par0);
-
-
- void fillRow(sal_Int32 _nToColumn);
- void allocBuffer();
- void releaseBuffer();
- void updateValue(sal_Int32 columnIndex,SQLSMALLINT _nType,void* _pValue) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- void fillNeededData(SQLRETURN _nRet);
- const ORowSetValue& getValue(sal_Int32 _nColumnIndex,SQLSMALLINT _nType,void* _pValue,SQLINTEGER _rSize);
- sal_Bool moveImpl(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData);
- TVoidPtr allocBindColumn(sal_Int32 _nType,sal_Int32 _nColumnIndex);
- SQLRETURN unbind(sal_Bool _bUnbindHandle = sal_True);
- SWORD impl_getColumnType_nothrow(sal_Int32 columnIndex);
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- )
- throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle
- ) const;
- public:
- DECLARE_SERVICE_INFO();
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- OResultSet( SQLHANDLE _pStatementHandle,OStatement_Base* pStmt);
- virtual ~OResultSet();
-
- void construct();
-
- inline oslGenericFunction getOdbcFunction(sal_Int32 _nIndex) const
- {
- return m_pStatement->getOdbcFunction(_nIndex);
- }
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
- {
- return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(*(OResultSet_BASE*)this);
- }
-
- inline void setMetaData(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData>& _xMetaData) { m_xMetaData = _xMetaData;}
-
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XResultSet
- virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isBeforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAfterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRow
- virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getString( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetMetaDataSupplier
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetUpdate
- virtual void SAL_CALL insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRowUpdate
- virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XColumnLocate
- virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XRowLocate
- virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XDeleteRows
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // IResultSetHelper
- virtual sal_Bool move(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData);
- virtual sal_Int32 getDriverPos() const;
- virtual sal_Bool deletedVisible() const;
- virtual sal_Bool isRowDeleted() const;
-
- protected:
- using OPropertySetHelper::getFastPropertyValue;
- };
- }
-}
-#endif // _CONNECTIVITY_ODBC_ORESULTSET_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/OResultSetMetaData.hxx b/connectivity/source/inc/odbc/OResultSetMetaData.hxx
deleted file mode 100644
index 86e2441d38..0000000000
--- a/connectivity/source/inc/odbc/OResultSetMetaData.hxx
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ODBC_ORESULTSETMETADATA_HXX_
-#define _CONNECTIVITY_ODBC_ORESULTSETMETADATA_HXX_
-
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include "odbc/OFunctions.hxx"
-#include "odbc/odbcbasedllapi.hxx"
-#ifndef _VECTOR_
-#include <vector>
-#endif
-#include "odbc/OConnection.hxx"
-
-namespace connectivity
-{
- namespace odbc
- {
- //**************************************************************
- //************ Class: ResultSetMetaData
- //**************************************************************
- typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> OResultSetMetaData_BASE;
-
- class OOO_DLLPUBLIC_ODBCBASE OResultSetMetaData :
- public OResultSetMetaData_BASE
- {
- protected:
- ::std::vector<sal_Int32> m_vMapping; // when not every column is needed
- ::std::map<sal_Int32,sal_Int32> m_aColumnTypes;
-
- SQLHANDLE m_aStatementHandle;
- OConnection* m_pConnection;
- sal_Int32 m_nColCount;
- sal_Bool m_bUseODBC2Types;
-
- ::rtl::OUString getCharColAttrib(sal_Int32 column,sal_Int32 ident) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 getNumColAttrib(sal_Int32 column,sal_Int32 ident) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- public:
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- OResultSetMetaData(OConnection* _pConnection, SQLHANDLE _pStmt )
- :m_aStatementHandle( _pStmt )
- ,m_pConnection(_pConnection)
- ,m_nColCount(-1)
- ,m_bUseODBC2Types(sal_False)
- {}
- OResultSetMetaData(OConnection* _pConnection, SQLHANDLE _pStmt ,const ::std::vector<sal_Int32> & _vMapping)
- :m_vMapping(_vMapping)
- ,m_aStatementHandle( _pStmt )
- ,m_pConnection(_pConnection)
- ,m_nColCount(_vMapping.size()-1)
- ,m_bUseODBC2Types(sal_False)
- {}
- virtual ~OResultSetMetaData();
-
-
- static SQLLEN getNumColAttrib(OConnection* _pConnection
- ,SQLHANDLE _aStatementHandle
- ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
- ,sal_Int32 _column
- ,sal_Int32 ident) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- static SQLSMALLINT getColumnODBCType(OConnection* _pConnection
- ,SQLHANDLE _aStatementHandle
- ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
- ,sal_Int32 column)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- inline oslGenericFunction getOdbcFunction(sal_Int32 _nIndex) const
- {
- return m_pConnection->getOdbcFunction(_nIndex);
- }
- /// Avoid ambigous cast error from the compiler.
- inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
- { return this; }
-
- virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_ODBC_ORESULTSETMETADATA_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/OStatement.hxx b/connectivity/source/inc/odbc/OStatement.hxx
deleted file mode 100644
index 97a1254e18..0000000000
--- a/connectivity/source/inc/odbc/OStatement.hxx
+++ /dev/null
@@ -1,250 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_ODBC_OSTATEMENT_HXX_
-#define _CONNECTIVITY_ODBC_OSTATEMENT_HXX_
-
-#include <com/sun/star/sdbc/XStatement.hpp>
-#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbc/XMultipleResults.hpp>
-#include <com/sun/star/sdbc/XBatchExecution.hpp>
-#include <com/sun/star/sdbc/XCloseable.hpp>
-#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/sdbc/XGeneratedResultSet.hpp>
-#include <com/sun/star/util/XCancellable.hpp>
-#include <comphelper/proparrhlp.hxx>
-#include <cppuhelper/compbase6.hxx>
-#include <comphelper/uno3.hxx>
-#include "connectivity/CommonTools.hxx"
-#include "odbc/OFunctions.hxx"
-#include "odbc/OConnection.hxx"
-#include "odbc/odbcbasedllapi.hxx"
-#include <list>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <comphelper/broadcasthelper.hxx>
-
-namespace connectivity
-{
- namespace odbc
- {
-
- typedef ::cppu::WeakComponentImplHelper6< ::com::sun::star::sdbc::XStatement,
- ::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::util::XCancellable,
- ::com::sun::star::sdbc::XCloseable,
- ::com::sun::star::sdbc::XGeneratedResultSet,
- ::com::sun::star::sdbc::XMultipleResults> OStatement_BASE;
-
- class OResultSet;
- //**************************************************************
- //************ Class: java.sql.Statement
- //**************************************************************
- class OOO_DLLPUBLIC_ODBCBASE OStatement_Base :
- public comphelper::OBaseMutex,
- public OStatement_BASE,
- public ::cppu::OPropertySetHelper,
- public ::comphelper::OPropertyArrayUsageHelper<OStatement_Base>
-
- {
- ::com::sun::star::sdbc::SQLWarning m_aLastWarning;
- protected:
- ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet> m_xResultSet; // The last ResultSet created
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement> m_xGeneratedStatement;
- // for this Statement
-
- ::std::list< ::rtl::OUString> m_aBatchList;
- ::rtl::OUString m_sSqlStatement;
-
- OConnection* m_pConnection;// The owning Connection object
- SQLHANDLE m_aStatementHandle;
- SQLUSMALLINT* m_pRowStatusArray;
- ::cppu::OBroadcastHelper& rBHelper;
-
- protected:
-
- sal_Int32 getQueryTimeOut() const;
- sal_Int32 getMaxFieldSize() const;
- sal_Int32 getMaxRows() const;
- sal_Int32 getResultSetConcurrency() const;
- sal_Int32 getResultSetType() const;
- sal_Int32 getFetchDirection() const;
- sal_Int32 getFetchSize() const;
- ::rtl::OUString getCursorName() const;
- sal_Bool isUsingBookmarks() const;
- sal_Bool getEscapeProcessing() const;
- sal_Int32 getStmtOption (short fOption) const;
-
- void setQueryTimeOut(sal_Int32 _par0) ;
- void setMaxFieldSize(sal_Int32 _par0) ;
- void setMaxRows(sal_Int32 _par0) ;
- void setFetchDirection(sal_Int32 _par0) ;
- void setFetchSize(sal_Int32 _par0) ;
- void setCursorName(const ::rtl::OUString &_par0);
- void setEscapeProcessing( const sal_Bool _bEscapeProc );
-
- virtual void setResultSetConcurrency(sal_Int32 _par0) ;
- virtual void setResultSetType(sal_Int32 _par0) ;
- virtual void setUsingBookmarks(sal_Bool _bUseBookmark) ;
-
- void reset () throw( ::com::sun::star::sdbc::SQLException);
- void clearMyResultSet () throw( ::com::sun::star::sdbc::SQLException);
- void setWarning (const ::com::sun::star::sdbc::SQLWarning &ex) throw( ::com::sun::star::sdbc::SQLException);
- sal_Bool lockIfNecessary (const ::rtl::OUString& sql) throw( ::com::sun::star::sdbc::SQLException);
- sal_Int32 getColumnCount () throw( ::com::sun::star::sdbc::SQLException);
-
- //--------------------------------------------------------------------
- // getResultSet
- // getResultSet returns the current result as a ResultSet. It
- // returns NULL if the current result is not a ResultSet.
- //--------------------------------------------------------------------
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > getResultSet (sal_Bool checkCount) throw( ::com::sun::star::sdbc::SQLException);
- /**
- creates the driver specific resultset (factory)
- */
- virtual OResultSet* createResulSet();
-
- SQLLEN getRowCount () throw( ::com::sun::star::sdbc::SQLException);
-
-
- void disposeResultSet();
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- ::com::sun::star::uno::Any & rConvertedValue,
- ::com::sun::star::uno::Any & rOldValue,
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue )
- throw (::com::sun::star::lang::IllegalArgumentException);
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- )
- throw (::com::sun::star::uno::Exception);
- virtual void SAL_CALL getFastPropertyValue(
- ::com::sun::star::uno::Any& rValue,
- sal_Int32 nHandle
- ) const;
- virtual ~OStatement_Base();
-
- public:
- OStatement_Base(OConnection* _pConnection );
- using OStatement_BASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
-
- inline oslGenericFunction getOdbcFunction(sal_Int32 _nIndex) const
- {
- return m_pConnection->getOdbcFunction(_nIndex);
- }
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL release() throw();
- virtual void SAL_CALL acquire() throw();
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XPropertySet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // XStatement
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL executeQuery( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Int32 SAL_CALL executeUpdate( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL execute( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ;
- // XWarningsSupplier
- virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XCancellable
- virtual void SAL_CALL cancel( ) throw(::com::sun::star::uno::RuntimeException);
- // XCloseable
- virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XMultipleResults
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getResultSet( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getUpdateCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getMoreResults( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- //XGeneratedResultSet
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getGeneratedValues( ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- // other methods
- SQLHANDLE getConnectionHandle() { return m_pConnection->getConnection(); }
- OConnection* getOwnConnection() const { return m_pConnection;}
- /** getCursorProperties return the properties for a specific cursor type
- @param _nCursorType the CursorType
- @param bFirst when true the first property set is returned
-
- @return the cursor properties
- */
- SQLUINTEGER getCursorProperties(SQLINTEGER _nCursorType,sal_Bool bFirst);
-
- protected:
- using OPropertySetHelper::getFastPropertyValue;
- };
-
- class OOO_DLLPUBLIC_ODBCBASE OStatement_BASE2 :
- public OStatement_Base
- ,public ::connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>
-
- {
- friend class OSubComponent<OStatement_BASE2, OStatement_BASE>;
- public:
- OStatement_BASE2(OConnection* _pConnection ) : OStatement_Base(_pConnection ),
- ::connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>((::cppu::OWeakObject*)_pConnection, this){}
- // OComponentHelper
- virtual void SAL_CALL disposing(void);
- // XInterface
- virtual void SAL_CALL release() throw();
- };
-
- class OOO_DLLPUBLIC_ODBCBASE OStatement :
- public OStatement_BASE2,
- public ::com::sun::star::sdbc::XBatchExecution,
- public ::com::sun::star::lang::XServiceInfo
- {
- protected:
- virtual ~OStatement(){}
- public:
- // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- OStatement( OConnection* _pConnection) : OStatement_BASE2( _pConnection){}
- DECLARE_SERVICE_INFO();
-
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
- // XBatchExecution
- virtual void SAL_CALL addBatch( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clearBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
- }
-}
-#endif // _CONNECTIVITY_ODBC_OSTATEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/OTools.hxx b/connectivity/source/inc/odbc/OTools.hxx
deleted file mode 100644
index e493cec454..0000000000
--- a/connectivity/source/inc/odbc/OTools.hxx
+++ /dev/null
@@ -1,278 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_OTOOLS_HXX_
-#define _CONNECTIVITY_OTOOLS_HXX_
-
-#include "odbc/OFunctiondefs.hxx"
-#include "odbc/odbcbasedllapi.hxx"
-#include <com/sun/star/sdbc/SQLException.hpp>
-#include <com/sun/star/util/Date.hpp>
-#include <com/sun/star/util/Time.hpp>
-#include <com/sun/star/util/DateTime.hpp>
-#include <osl/thread.h>
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <rtl/textenc.h>
-
-#define ODBC3SQLAllocHandle 1
-#define ODBC3SQLConnect 2
-#define ODBC3SQLDriverConnect 3
-#define ODBC3SQLBrowseConnect 4
-#define ODBC3SQLDataSources 5
-#define ODBC3SQLDrivers 6
-#define ODBC3SQLGetInfo 7
-#define ODBC3SQLGetFunctions 8
-#define ODBC3SQLGetTypeInfo 9
-#define ODBC3SQLSetConnectAttr 10
-#define ODBC3SQLGetConnectAttr 11
-#define ODBC3SQLSetEnvAttr 12
-#define ODBC3SQLGetEnvAttr 13
-#define ODBC3SQLSetStmtAttr 14
-#define ODBC3SQLGetStmtAttr 15
-#define ODBC3SQLPrepare 16
-#define ODBC3SQLBindParameter 17
-#define ODBC3SQLSetCursorName 18
-#define ODBC3SQLExecute 19
-#define ODBC3SQLExecDirect 20
-#define ODBC3SQLDescribeParam 21
-#define ODBC3SQLNumParams 22
-#define ODBC3SQLParamData 23
-#define ODBC3SQLPutData 24
-#define ODBC3SQLRowCount 25
-#define ODBC3SQLNumResultCols 26
-#define ODBC3SQLDescribeCol 27
-#define ODBC3SQLColAttribute 28
-#define ODBC3SQLBindCol 29
-#define ODBC3SQLFetch 30
-#define ODBC3SQLFetchScroll 31
-#define ODBC3SQLGetData 32
-#define ODBC3SQLSetPos 33
-#define ODBC3SQLBulkOperations 34
-#define ODBC3SQLMoreResults 35
-#define ODBC3SQLGetDiagRec 36
-#define ODBC3SQLColumnPrivileges 37
-#define ODBC3SQLColumns 38
-#define ODBC3SQLForeignKeys 39
-#define ODBC3SQLPrimaryKeys 40
-#define ODBC3SQLProcedureColumns 41
-#define ODBC3SQLProcedures 42
-#define ODBC3SQLSpecialColumns 43
-#define ODBC3SQLStatistics 44
-#define ODBC3SQLTablePrivileges 45
-#define ODBC3SQLTables 46
-#define ODBC3SQLFreeStmt 47
-#define ODBC3SQLCloseCursor 48
-#define ODBC3SQLCancel 49
-#define ODBC3SQLEndTran 50
-#define ODBC3SQLDisconnect 51
-#define ODBC3SQLFreeHandle 52
-#define ODBC3SQLGetCursorName 53
-#define ODBC3SQLNativeSql 54
-
-namespace connectivity
-{
- namespace odbc
- {
- class OConnection;
-
- const sal_uInt32 ODBC_FRACTION_UNITS_PER_HSECOND = 10000000L;
- const sal_Int32 MAX_PUT_DATA_LENGTH = 2000;
-
- class OOO_DLLPUBLIC_ODBCBASE OTools
- {
- public:
- static void ThrowException( OConnection* _pConnection,
- SQLRETURN _rRetCode,
- SQLHANDLE _pContext,
- SQLSMALLINT _nHandleType,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- sal_Bool _bNoFound=sal_True,
- rtl_TextEncoding _nTextEncoding = RTL_TEXTENCODING_MS_1252)
- throw(::com::sun::star::sdbc::SQLException);
-
- static void GetInfo(OConnection* _pConnection,
- SQLHANDLE _aConnectionHandle,
- SQLUSMALLINT _nInfo,
- ::rtl::OUString &_rValue,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- static void GetInfo(OConnection* _pConnection,
- SQLHANDLE _aConnectionHandle,
- SQLUSMALLINT _nInfo,
- sal_Int32 &_rValue,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- static void GetInfo(OConnection* _pConnection,
- SQLHANDLE _aConnectionHandle,
- SQLUSMALLINT _nInfo,
- SQLUSMALLINT &_rValue,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- static void GetInfo(OConnection* _pConnection,
- SQLHANDLE _aConnectionHandle,
- SQLUSMALLINT _nInfo,
- SQLUINTEGER &_rValue,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- static void GetInfo(OConnection* _pConnection,
- SQLHANDLE _aConnectionHandle,
- SQLUSMALLINT _nInfo,
- sal_Bool &_rValue,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- static sal_Int32 MapOdbcType2Jdbc(sal_Int32 _nType);
- static sal_Int32 jdbcTypeToOdbc(sal_Int32 jdbcType);
-
- static DATE_STRUCT DateToOdbcDate(const ::com::sun::star::util::Date& x)
- {
- DATE_STRUCT aVal;
- aVal.year = x.Year;
- aVal.month = x.Month;
- aVal.day = x.Day;
- return aVal;
- }
- static TIME_STRUCT TimeToOdbcTime(const ::com::sun::star::util::Time& x)
- {
- TIME_STRUCT aVal;
- aVal.hour = x.Hours;
- aVal.minute = x.Minutes;
- aVal.second = x.Seconds;
- return aVal;
- }
- static TIMESTAMP_STRUCT DateTimeToTimestamp(const ::com::sun::star::util::DateTime& x)
- {
- TIMESTAMP_STRUCT aVal;
- aVal.year = x.Year;
- aVal.month = x.Month;
- aVal.day = x.Day;
- aVal.hour = x.Hours;
- aVal.minute = x.Minutes;
- aVal.second = x.Seconds;
- aVal.fraction = x.HundredthSeconds * ODBC_FRACTION_UNITS_PER_HSECOND;
- return aVal;
- }
- /**
- getBindTypes set the ODBC type for C
- @param _bUseWChar true when Unicode should be used
- @param _bUseOldTimeDate true when the old datetime format should be used
- @param _nOdbcType the ODBC sql type
- @param fCType the C type for the ODBC type
- @param fSqlType the SQL type for the ODBC type
- */
- static void getBindTypes(sal_Bool _bUseWChar,
- sal_Bool _bUseOldTimeDate,
- SQLSMALLINT _nOdbcType,
- SQLSMALLINT& fCType,
- SQLSMALLINT& fSqlType);
-
- static ::rtl::OUString getStringValue( OConnection* _pConnection,
- SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _fSqlType,
- sal_Bool &_bWasNull,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- static ::com::sun::star::uno::Sequence<sal_Int8> getBytesValue(OConnection* _pConnection,
- SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _fSqlType,
- sal_Bool &_bWasNull,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- static void getValue( OConnection* _pConnection,
- SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _nType,
- sal_Bool &_bWasNull,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- void* _pValue,
- SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- /**
- bindData copies the from pValue to pData
- @param _nOdbcType the ODBC sql type
- @param _bUseWChar true when Unicode should be used
- @param _pData contains a copy of the data to be set
- @param _pValue contains the data to be copied
- @param _nTextEncoding the text encoding
- @param _nColumnSize the columnsize which is a out param
- */
- static void bindData( SQLSMALLINT _nOdbcType,
- sal_Bool _bUseWChar,
- sal_Int8 *&_pData,
- SQLLEN*& pLen,
- const void* _pValue,
- rtl_TextEncoding _nTextEncoding,
- SQLULEN& _nColumnSize);
-
- static void bindParameter( OConnection* _pConnection,
- SQLHANDLE _hStmt,
- sal_Int32 nPos,
- sal_Int8*& pDataBuffer,
- sal_Int8* pLenBuffer,
- SQLSMALLINT _nJDBCtype,
- sal_Bool _bUseWChar,
- sal_Bool _bUseOldTimeDate,
- const void* _pValue,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- static void bindValue( OConnection* _pConnection,
- SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _nType,
- SQLSMALLINT _nMaxLen,
- const void* _pValue,
- void* _pData,
- SQLLEN *pLen,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding,
- sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-
- template <class T> void getValue( OConnection* _pConnection,
- SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _nType,
- sal_Bool &_bWasNull,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- T& _rValue) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
- {
- OTools::getValue(_pConnection,_aStatementHandle,columnIndex,_nType,_bWasNull,_xInterface,&_rValue,sizeof _rValue);
- }
- //-----------------------------------------------------------------------------
-
-
- }
-}
-#endif // _CONNECTIVITY_OTOOLS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/odbc/odbcbasedllapi.hxx b/connectivity/source/inc/odbc/odbcbasedllapi.hxx
deleted file mode 100644
index 31ac8636e6..0000000000
--- a/connectivity/source/inc/odbc/odbcbasedllapi.hxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ODBC_ODBCBASEDLLAPI_HXX
-#define INCLUDED_CONNECTIVITY_SOURCE_INC_ODBC_ODBCBASEDLLAPI_HXX
-
-#include "sal/config.h"
-
-#include "sal/types.h"
-
-#if defined OOO_DLLIMPLEMENTATION_ODBCBASE
-#define OOO_DLLPUBLIC_ODBCBASE SAL_DLLPUBLIC_EXPORT
-#else
-#define OOO_DLLPUBLIC_ODBCBASE SAL_DLLPUBLIC_IMPORT
-#endif
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/propertyids.hxx b/connectivity/source/inc/propertyids.hxx
deleted file mode 100644
index eaa2f3e08b..0000000000
--- a/connectivity/source/inc/propertyids.hxx
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_
-#define _CONNECTIVITY_PROPERTYIDS_HXX_
-
-// this define has to be set to split the names into different dll's or so's
-// every dll has his own set of property names
-#include <rtl/ustring.hxx>
-#ifndef _MAP_
-#include <map>
-#endif
-#include "connectivity/dbtoolsdllapi.hxx"
-
-namespace dbtools
-{
- class OOO_DLLPUBLIC_DBTOOLS OPropertyMap
- {
- ::std::map<sal_Int32 , rtl_uString*> m_aPropertyMap;
-
- ::rtl::OUString fillValue(sal_Int32 _nIndex);
- public:
- OPropertyMap()
- {
- }
- ~OPropertyMap();
- ::rtl::OUString getNameByIndex(sal_Int32 _nIndex) const;
- };
-}
-
-namespace connectivity
-{
- namespace CONNECTIVITY_PROPERTY_NAME_SPACE
- {
- typedef const sal_Char* (*PVFN)();
-
- struct OOO_DLLPUBLIC_DBTOOLS UStringDescription
- {
- const sal_Char* pZeroTerminatedName;
- sal_Int32 nLength;
-
- UStringDescription(PVFN _fCharFkt);
- operator ::rtl::OUString() const { return ::rtl::OUString(pZeroTerminatedName,nLength,RTL_TEXTENCODING_ASCII_US); }
- ~UStringDescription();
- private:
- UStringDescription();
- };
- }
-}
-
-
-//------------------------------------------------------------------------------
-#define DECL_PROP1IMPL(varname, type) \
-pProperties[nPos++] = ::com::sun::star::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getCppuType(reinterpret_cast< type*>(NULL)),
-//------------------------------------------------------------------------------
-#define DECL_PROP0(varname, type) \
- DECL_PROP1IMPL(varname, type) 0)
-//------------------------------------------------------------------------------
-#define DECL_BOOL_PROP1IMPL(varname) \
- pProperties[nPos++] = ::com::sun::star::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getBooleanCppuType(),
-//------------------------------------------------------------------------------
-#define DECL_BOOL_PROP0(varname) \
- DECL_BOOL_PROP1IMPL(varname) 0)
-
-
-#define PROPERTY_ID_QUERYTIMEOUT 1
-#define PROPERTY_ID_MAXFIELDSIZE 2
-#define PROPERTY_ID_MAXROWS 3
-#define PROPERTY_ID_CURSORNAME 4
-#define PROPERTY_ID_RESULTSETCONCURRENCY 5
-#define PROPERTY_ID_RESULTSETTYPE 6
-#define PROPERTY_ID_FETCHDIRECTION 7
-#define PROPERTY_ID_FETCHSIZE 8
-#define PROPERTY_ID_ESCAPEPROCESSING 9
-#define PROPERTY_ID_USEBOOKMARKS 10
-// Column
-#define PROPERTY_ID_NAME 11
-#define PROPERTY_ID_TYPE 12
-#define PROPERTY_ID_TYPENAME 13
-#define PROPERTY_ID_PRECISION 14
-#define PROPERTY_ID_SCALE 15
-#define PROPERTY_ID_ISNULLABLE 16
-#define PROPERTY_ID_ISAUTOINCREMENT 17
-#define PROPERTY_ID_ISROWVERSION 18
-#define PROPERTY_ID_DESCRIPTION 19
-#define PROPERTY_ID_DEFAULTVALUE 20
-
-#define PROPERTY_ID_REFERENCEDTABLE 21
-#define PROPERTY_ID_UPDATERULE 22
-#define PROPERTY_ID_DELETERULE 23
-#define PROPERTY_ID_CATALOG 24
-#define PROPERTY_ID_ISUNIQUE 25
-#define PROPERTY_ID_ISPRIMARYKEYINDEX 26
-#define PROPERTY_ID_ISCLUSTERED 27
-#define PROPERTY_ID_ISASCENDING 28
-#define PROPERTY_ID_SCHEMANAME 29
-#define PROPERTY_ID_CATALOGNAME 30
-
-#define PROPERTY_ID_COMMAND 31
-#define PROPERTY_ID_CHECKOPTION 32
-#define PROPERTY_ID_PASSWORD 33
-#define PROPERTY_ID_RELATEDCOLUMN 34
-
-#define PROPERTY_ID_FUNCTION 35
-#define PROPERTY_ID_TABLENAME 36
-#define PROPERTY_ID_REALNAME 37
-#define PROPERTY_ID_DBASEPRECISIONCHANGED 38
-#define PROPERTY_ID_ISCURRENCY 39
-#define PROPERTY_ID_ISBOOKMARKABLE 40
-
-#define PROPERTY_ID_INVALID_INDEX 41
-#define PROPERTY_ID_HY010 43
-#define PROPERTY_ID_LABEL 44
-#define PROPERTY_ID_DELIMITER 45
-#define PROPERTY_ID_FORMATKEY 46
-#define PROPERTY_ID_LOCALE 47
-#define PROPERTY_ID_IM001 48
-
-#define PROPERTY_ID_AUTOINCREMENTCREATION 49
-
-#define PROPERTY_ID_PRIVILEGES 50
-#define PROPERTY_ID_HAVINGCLAUSE 51
-
-#define PROPERTY_ID_ISSIGNED 52
-#define PROPERTY_ID_AGGREGATEFUNCTION 53
-#define PROPERTY_ID_ISSEARCHABLE 54
-
-#define PROPERTY_ID_APPLYFILTER 55
-#define PROPERTY_ID_FILTER 56
-#define PROPERTY_ID_MASTERFIELDS 57
-#define PROPERTY_ID_DETAILFIELDS 58
-#define PROPERTY_ID_FIELDTYPE 59
-#define PROPERTY_ID_VALUE 60
-#define PROPERTY_ID_ACTIVE_CONNECTION 61
-
-#endif // _CONNECTIVITY_PROPERTYIDS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/resource/adabas_res.hrc b/connectivity/source/inc/resource/adabas_res.hrc
deleted file mode 100755
index edceb2658c..0000000000
--- a/connectivity/source/inc/resource/adabas_res.hrc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_RESOURCE_ADABAS_HRC
-#define CONNECTIVITY_RESOURCE_ADABAS_HRC
-
-#include "resource/conn_shared_res.hrc"
-#include "resource/common_res.hrc"
-
-// ============================================================================
-// = the Adabas D driver's resource strings
-// ============================================================================
-#define STR_NO_DISK_SPACE ( STR_ADABAS_BASE + 1 )
-#define STR_COMMAND_NOT_FOUND ( STR_ADABAS_BASE + 2 )
-#define STR_DATABASE_NEEDS_CONVERTING ( STR_ADABAS_BASE + 3 )
-#define STR_USER_NO_DELETE ( STR_ADABAS_BASE + 9 )
-
-#endif // CONNECTIVITY_RESOURCE_ADABAS_HRC
-
diff --git a/connectivity/source/inc/resource/ado_res.hrc b/connectivity/source/inc/resource/ado_res.hrc
deleted file mode 100755
index 115936ea37..0000000000
--- a/connectivity/source/inc/resource/ado_res.hrc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_RESOURCE_ADO_HRC
-#define CONNECTIVITY_RESOURCE_ADO_HRC
-
-#include "resource/conn_shared_res.hrc"
-#include "resource/common_res.hrc"
-
-// ============================================================================
-// = the ado driver's resource strings
-// ============================================================================
-#define STR_INVALID_COLUMN_DESCRIPTOR_ERROR ( STR_ADO_BASE + 1 )
-#define STR_INVALID_GROUP_DESCRIPTOR_ERROR ( STR_ADO_BASE + 2 )
-#define STR_INVALID_INDEX_DESCRIPTOR_ERROR ( STR_ADO_BASE + 3 )
-#define STR_INVALID_KEY_DESCRIPTOR_ERROR ( STR_ADO_BASE + 4 )
-#define STR_INVALID_TABLE_DESCRIPTOR_ERROR ( STR_ADO_BASE + 5 )
-#define STR_INVALID_USER_DESCRIPTOR_ERROR ( STR_ADO_BASE + 6 )
-#define STR_INVALID_VIEW_DESCRIPTOR_ERROR ( STR_ADO_BASE + 7 )
-#define STR_VIEW_NO_COMMAND_ERROR ( STR_ADO_BASE + 8 )
-#define STR_TYPE_NOT_CONVERT ( STR_ADO_BASE + 9 )
-#define STR_NO_CONNECTION ( STR_ADO_BASE + 10 )
-
-
-#endif // CONNECTIVITY_RESOURCE_ADO_HRC
-
diff --git a/connectivity/source/inc/resource/calc_res.hrc b/connectivity/source/inc/resource/calc_res.hrc
deleted file mode 100755
index fbb86e5fa4..0000000000
--- a/connectivity/source/inc/resource/calc_res.hrc
+++ /dev/null
@@ -1,41 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_RESOURCE_CALC_HRC
-#define CONNECTIVITY_RESOURCE_CALC_HRC
-
-#include "resource/conn_shared_res.hrc"
-#include "resource/common_res.hrc"
-
-// ============================================================================
-// = the calc driver's resource strings
-// ============================================================================
-
-#define STR_LOAD_FILE_ERROR_MESSAGE ( STR_CALC_BASE + 0 )
-
-#endif // CONNECTIVITY_RESOURCE_CALC_HRC
-
diff --git a/connectivity/source/inc/resource/common_res.hrc b/connectivity/source/inc/resource/common_res.hrc
deleted file mode 100755
index 543231c4e1..0000000000
--- a/connectivity/source/inc/resource/common_res.hrc
+++ /dev/null
@@ -1,78 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_RESOURCE_COMMON_HRC
-#define CONNECTIVITY_RESOURCE_COMMON_HRC
-
-#ifndef CONNECTIVITY_SHARED_RES_HRC
-#include "resource/conn_shared_res.hrc"
-#endif
-
-// ============================================================================
-// = common strings
-// ============================================================================
-
-#define STR_STRING_LENGTH_EXCEEDED ( STR_COMMON_BASE + 1 )
-#define STR_CANNOT_CONVERT_STRING ( STR_COMMON_BASE + 2 )
-#define STR_URI_SYNTAX_ERROR ( STR_COMMON_BASE + 3 )
-#define STR_COULD_NOT_LOAD_FILE ( STR_COMMON_BASE + 4 )
-#define STR_QUERY_TOO_COMPLEX ( STR_COMMON_BASE + 5 )
-#define STR_OPERATOR_TOO_COMPLEX ( STR_COMMON_BASE + 6 )
-#define STR_QUERY_INVALID_LIKE_COLUMN ( STR_COMMON_BASE + 7 )
-#define STR_QUERY_INVALID_LIKE_STRING ( STR_COMMON_BASE + 8 )
-#define STR_QUERY_NOT_LIKE_TOO_COMPLEX ( STR_COMMON_BASE + 9 )
-#define STR_QUERY_LIKE_WILDCARD ( STR_COMMON_BASE + 10 )
-#define STR_QUERY_LIKE_WILDCARD_MANY ( STR_COMMON_BASE + 11 )
-#define STR_INVALID_COLUMNNAME ( STR_COMMON_BASE + 12 )
-#define STR_NO_CLASSNAME ( STR_COMMON_BASE + 13 )
-#define STR_NO_CLASSNAME_PATH ( STR_COMMON_BASE + 14 )
-#define STR_UNKNOWN_PARA_TYPE ( STR_COMMON_BASE + 15 )
-#define STR_INVALID_COLUMN_SELECTION ( STR_COMMON_BASE + 16 )
-#define STR_PARA_ONLY_PREPARED ( STR_COMMON_BASE + 17 )
-#define STR_COLUMN_NOT_UPDATEABLE ( STR_COMMON_BASE + 18 )
-#define STR_ROW_ALREADY_DELETED ( STR_COMMON_BASE + 19 )
-#define STR_UNKNOWN_COLUMN_TYPE ( STR_COMMON_BASE + 20 )
-#define STR_FORMULA_WRONG ( STR_COMMON_BASE + 21 )
-#define STR_NO_JAVA ( STR_COMMON_BASE + 22 )
-#define STR_NO_RESULTSET ( STR_COMMON_BASE + 23 )
-#define STR_NO_ROWCOUNT ( STR_COMMON_BASE + 24 )
-#define STR_ERRORMSG_SEQUENCE ( STR_COMMON_BASE + 25 )
-#define STR_INVALID_INDEX ( STR_COMMON_BASE + 26 )
-#define STR_UNSUPPORTED_FUNCTION ( STR_COMMON_BASE + 27 )
-#define STR_UNSUPPORTED_FEATURE ( STR_COMMON_BASE + 28 )
-#define STR_UNKNOWN_COLUMN_NAME ( STR_COMMON_BASE + 29 )
-#define STR_INVALID_PARA_COUNT ( STR_COMMON_BASE + 30 )
-#define STR_PRIVILEGE_NOT_GRANTED ( STR_COMMON_BASE + 31 )
-#define STR_PRIVILEGE_NOT_REVOKED ( STR_COMMON_BASE + 32 )
-#define STR_INVALID_BOOKMARK ( STR_COMMON_BASE + 33 )
-#define STR_NO_ELEMENT_NAME ( STR_COMMON_BASE + 34 )
-#define STR_NO_INPUTSTREAM ( STR_COMMON_BASE + 35 )
-#define STR_INPUTSTREAM_WRONG_LEN ( STR_COMMON_BASE + 36 )
-#define STR_WRONG_PARAM_INDEX ( STR_COMMON_BASE + 37 )
-#define STR_NO_CONNECTION_GIVEN ( STR_COMMON_BASE + 38 )
-
-#endif // CONNECTIVITY_RESOURCE_COMMON_HRC
diff --git a/connectivity/source/inc/resource/conn_shared_res.hrc b/connectivity/source/inc/resource/conn_shared_res.hrc
deleted file mode 100755
index 45f8399259..0000000000
--- a/connectivity/source/inc/resource/conn_shared_res.hrc
+++ /dev/null
@@ -1,73 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_SHARED_RES_HRC
-#define CONNECTIVITY_SHARED_RES_HRC
-
-// ============================================================================
-// = normal resource ids, per driver
-
-// Mozilla driver resource ids
-#define STR_MOZAB_BASE 1000
-
-// common resource ids
-#define STR_COMMON_BASE 1200
-
-// Spreadsheet driver resource ids
-#define STR_CALC_BASE 1300
-
-// DBase driver resource ids
-#define STR_DBASE_BASE 1400
-
-// ADO driver resource ids
-#define STR_ADO_BASE 1450
-
-// EVOAB2 driver resource ids
-#define STR_EVOAB2_BASE 1500
-
-// FILE driver resource ids
-#define STR_FILE_BASE 1550
-
-// KAB driver resource ids
-#define STR_KAB_BASE 1600
-
-// MACAB driver resource ids
-#define STR_MACAB_BASE 1650
-
-// Adabas D driver resource ids
-#define STR_ADABAS_BASE 1700
-
-// hsqldb driver resource ids
-#define STR_HSQLDB_BASE 1750
-// ============================================================================
-// = resource ids for log messages
-#define STR_LOG_MESSAGE_BASE 10000
-
-// log messages for the jdbc driver
-#define STR_JDBC_LOG_MESSAGE_BASE STR_LOG_MESSAGE_BASE + 500
-
-#endif
diff --git a/connectivity/source/inc/resource/dbase_res.hrc b/connectivity/source/inc/resource/dbase_res.hrc
deleted file mode 100755
index 698f31dd7a..0000000000
--- a/connectivity/source/inc/resource/dbase_res.hrc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_RESOURCE_DBASE_HRC
-#define CONNECTIVITY_RESOURCE_DBASE_HRC
-
-#include "resource/conn_shared_res.hrc"
-#include "resource/common_res.hrc"
-
-// ============================================================================
-// = the calc driver's resource strings
-// ============================================================================
-
-#define STR_COULD_NOT_DELETE_INDEX ( STR_DBASE_BASE + 0 )
-#define STR_COULD_NOT_CREATE_INDEX_NOT_UNIQUE ( STR_DBASE_BASE + 1 )
-#define STR_SQL_NAME_ERROR ( STR_DBASE_BASE + 2 )
-#define STR_COULD_NOT_DELETE_FILE ( STR_DBASE_BASE + 3 )
-#define STR_INVALID_COLUMN_TYPE ( STR_DBASE_BASE + 4 )
-#define STR_INVALID_COLUMN_PRECISION ( STR_DBASE_BASE + 5 )
-#define STR_INVALID_PRECISION_SCALE ( STR_DBASE_BASE + 6 )
-#define STR_INVALID_COLUMN_NAME_LENGTH ( STR_DBASE_BASE + 7 )
-#define STR_DUPLICATE_VALUE_IN_COLUMN ( STR_DBASE_BASE + 8 )
-#define STR_INVALID_COLUMN_DECIMAL_VALUE ( STR_DBASE_BASE + 9 )
-#define STR_COLUMN_NOT_ALTERABLE ( STR_DBASE_BASE + 10 )
-#define STR_COLUMN_NOT_ADDABLE ( STR_DBASE_BASE + 11 )
-#define STR_COLUMN_NOT_DROP ( STR_DBASE_BASE + 12 )
-#define STR_COULD_NOT_ALTER_TABLE ( STR_DBASE_BASE + 13 )
-#define STR_INVALID_DBASE_FILE ( STR_DBASE_BASE + 14 )
-#define STR_ONL_ONE_COLUMN_PER_INDEX ( STR_DBASE_BASE + 15 )
-#define STR_COULD_NOT_CREATE_INDEX ( STR_DBASE_BASE + 16 )
-#define STR_COULD_NOT_CREATE_INDEX_NAME ( STR_DBASE_BASE + 17 )
-#define STR_INVALID_COLUMN_VALUE ( STR_DBASE_BASE + 18 )
-#define STR_TABLE_NOT_DROP ( STR_DBASE_BASE + 19 )
-#define STR_COULD_NOT_CREATE_INDEX_KEYSIZE ( STR_DBASE_BASE + 20 )
-
-#endif // CONNECTIVITY_RESOURCE_DBASE_HRC
-
diff --git a/connectivity/source/inc/resource/evoab2_res.hrc b/connectivity/source/inc/resource/evoab2_res.hrc
deleted file mode 100755
index 73f6214c24..0000000000
--- a/connectivity/source/inc/resource/evoab2_res.hrc
+++ /dev/null
@@ -1,42 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_RESOURCE_EVOAB2_HRC
-#define CONNECTIVITY_RESOURCE_EVOAB2_HRC
-
-#include "resource/conn_shared_res.hrc"
-#include "resource/common_res.hrc"
-
-// ============================================================================
-// = the calc driver's resource strings
-// ============================================================================
-
-#define STR_CANNOT_OPEN_BOOK ( STR_EVOAB2_BASE + 0 )
-#define STR_SORT_BY_COL_ONLY ( STR_EVOAB2_BASE + 1 )
-
-#endif // CONNECTIVITY_RESOURCE_CALC_HRC
-
diff --git a/connectivity/source/inc/resource/file_res.hrc b/connectivity/source/inc/resource/file_res.hrc
deleted file mode 100755
index b5b7b98073..0000000000
--- a/connectivity/source/inc/resource/file_res.hrc
+++ /dev/null
@@ -1,48 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_RESOURCE_FILE_HRC
-#define CONNECTIVITY_RESOURCE_FILE_HRC
-
-#include "resource/conn_shared_res.hrc"
-#include "resource/common_res.hrc"
-// ============================================================================
-// = the file driver's resource strings
-// ============================================================================
-
-#define STR_QUERY_COMPLEX_COUNT ( STR_FILE_BASE + 0 )
-#define STR_QUERY_INVALID_BETWEEN ( STR_FILE_BASE + 1 )
-#define STR_TABLE_READONLY ( STR_FILE_BASE + 2 )
-#define STR_DELETE_ROW ( STR_FILE_BASE + 3 )
-#define STR_NO_VALID_FILE_URL ( STR_FILE_BASE + 4 )
-#define STR_QUERY_MORE_TABLES ( STR_FILE_BASE + 5 )
-#define STR_QUERY_NO_TABLE ( STR_FILE_BASE + 6 )
-#define STR_QUERY_NO_COLUMN ( STR_FILE_BASE + 7 )
-#define STR_QUERY_FUNCTION_NOT_SUPPORTED ( STR_FILE_BASE + 8 )
-
-#endif // CONNECTIVITY_RESOURCE_FILE_HRC
-
diff --git a/connectivity/source/inc/resource/hsqldb_res.hrc b/connectivity/source/inc/resource/hsqldb_res.hrc
deleted file mode 100755
index c2b1f07769..0000000000
--- a/connectivity/source/inc/resource/hsqldb_res.hrc
+++ /dev/null
@@ -1,47 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_RESOURCE_HSQLDB_HRC
-#define CONNECTIVITY_RESOURCE_HSQLDB_HRC
-
-#include "resource/conn_shared_res.hrc"
-#include "resource/common_res.hrc"
-
-// ============================================================================
-// = the hsqldb driver's resource strings
-// ============================================================================
-
-#define STR_NO_STROAGE ( STR_HSQLDB_BASE + 0 )
-#define STR_INVALID_FILE_URL ( STR_HSQLDB_BASE + 1 )
-#define STR_NO_TABLE_CONTAINER ( STR_HSQLDB_BASE + 2 )
-#define STR_NO_TABLE_EDITOR_DIALOG ( STR_HSQLDB_BASE + 3 )
-#define STR_NO_TABLENAME ( STR_HSQLDB_BASE + 4 )
-#define STR_NO_DOCUMENTUI ( STR_HSQLDB_BASE + 5 )
-#define STR_ERROR_NEW_VERSION ( STR_HSQLDB_BASE + 6 )
-
-#endif // CONNECTIVITY_RESOURCE_HSQLDB_HRC
-
diff --git a/connectivity/source/inc/resource/jdbc_log.hrc b/connectivity/source/inc/resource/jdbc_log.hrc
deleted file mode 100755
index e12e91516a..0000000000
--- a/connectivity/source/inc/resource/jdbc_log.hrc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_RESOURCE_JDBC_LOG_HRC
-#define CONNECTIVITY_RESOURCE_JDBC_LOG_HRC
-
-#include "resource/conn_shared_res.hrc"
-
-#define STR_LOG_DRIVER_CONNECTING_URL ( STR_JDBC_LOG_MESSAGE_BASE + 1 )
-#define STR_LOG_DRIVER_SUCCESS ( STR_JDBC_LOG_MESSAGE_BASE + 2 )
-#define STR_LOG_CREATE_STATEMENT ( STR_JDBC_LOG_MESSAGE_BASE + 3 )
-#define STR_LOG_CREATED_STATEMENT_ID ( STR_JDBC_LOG_MESSAGE_BASE + 4 )
-#define STR_LOG_PREPARE_STATEMENT ( STR_JDBC_LOG_MESSAGE_BASE + 5 )
-#define STR_LOG_PREPARED_STATEMENT_ID ( STR_JDBC_LOG_MESSAGE_BASE + 6 )
-#define STR_LOG_PREPARE_CALL ( STR_JDBC_LOG_MESSAGE_BASE + 7 )
-#define STR_LOG_PREPARED_CALL_ID ( STR_JDBC_LOG_MESSAGE_BASE + 8 )
-#define STR_LOG_NATIVE_SQL ( STR_JDBC_LOG_MESSAGE_BASE + 9 )
-#define STR_LOG_LOADING_DRIVER ( STR_JDBC_LOG_MESSAGE_BASE + 10 )
-#define STR_LOG_NO_DRIVER_CLASS ( STR_JDBC_LOG_MESSAGE_BASE + 11 )
-#define STR_LOG_CONN_SUCCESS ( STR_JDBC_LOG_MESSAGE_BASE + 12 )
-#define STR_LOG_NO_SYSTEM_CONNECTION ( STR_JDBC_LOG_MESSAGE_BASE + 13 )
-#define STR_LOG_GOT_JDBC_CONNECTION ( STR_JDBC_LOG_MESSAGE_BASE + 14 )
-#define STR_LOG_SHUTDOWN_CONNECTION ( STR_JDBC_LOG_MESSAGE_BASE + 15 )
-#define STR_LOG_GENERATED_VALUES ( STR_JDBC_LOG_MESSAGE_BASE + 16 )
-#define STR_LOG_GENERATED_VALUES_FALLBACK ( STR_JDBC_LOG_MESSAGE_BASE + 17 )
-#define STR_LOG_EXECUTE_STATEMENT ( STR_JDBC_LOG_MESSAGE_BASE + 18 )
-#define STR_LOG_EXECUTE_QUERY ( STR_JDBC_LOG_MESSAGE_BASE + 19 )
-#define STR_LOG_CLOSING_STATEMENT ( STR_JDBC_LOG_MESSAGE_BASE + 20 )
-#define STR_LOG_EXECUTE_UPDATE ( STR_JDBC_LOG_MESSAGE_BASE + 21 )
-#define STR_LOG_UPDATE_COUNT ( STR_JDBC_LOG_MESSAGE_BASE + 22 )
-#define STR_LOG_RESULT_SET_CONCURRENCY ( STR_JDBC_LOG_MESSAGE_BASE + 23 )
-#define STR_LOG_RESULT_SET_TYPE ( STR_JDBC_LOG_MESSAGE_BASE + 24 )
-#define STR_LOG_FETCH_DIRECTION ( STR_JDBC_LOG_MESSAGE_BASE + 25 )
-#define STR_LOG_FETCH_SIZE ( STR_JDBC_LOG_MESSAGE_BASE + 26 )
-#define STR_LOG_SET_ESCAPE_PROCESSING ( STR_JDBC_LOG_MESSAGE_BASE + 27 )
-#define STR_LOG_EXECUTING_PREPARED ( STR_JDBC_LOG_MESSAGE_BASE + 28 )
-#define STR_LOG_EXECUTING_PREPARED_UPDATE ( STR_JDBC_LOG_MESSAGE_BASE + 29 )
-#define STR_LOG_EXECUTING_PREPARED_QUERY ( STR_JDBC_LOG_MESSAGE_BASE + 30 )
-#define STR_LOG_STRING_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 31 )
-#define STR_LOG_BOOLEAN_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 32 )
-#define STR_LOG_BYTE_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 33 )
-#define STR_LOG_DATE_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 34 )
-#define STR_LOG_TIME_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 35 )
-#define STR_LOG_TIMESTAMP_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 36 )
-#define STR_LOG_DOUBLE_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 37 )
-#define STR_LOG_FLOAT_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 38 )
-#define STR_LOG_INT_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 39 )
-#define STR_LOG_LONG_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 40 )
-#define STR_LOG_NULL_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 41 )
-#define STR_LOG_OBJECT_NULL_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 42 )
-#define STR_LOG_SHORT_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 43 )
-#define STR_LOG_BYTES_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 44 )
-#define STR_LOG_CHARSTREAM_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 45 )
-#define STR_LOG_BINARYSTREAM_PARAMETER ( STR_JDBC_LOG_MESSAGE_BASE + 46 )
-#define STR_LOG_CLEAR_PARAMETERS ( STR_JDBC_LOG_MESSAGE_BASE + 47 )
-#define STR_LOG_META_DATA_METHOD ( STR_JDBC_LOG_MESSAGE_BASE + 48 )
-#define STR_LOG_META_DATA_METHOD_ARG1 ( STR_JDBC_LOG_MESSAGE_BASE + 49 )
-#define STR_LOG_META_DATA_METHOD_ARG2 ( STR_JDBC_LOG_MESSAGE_BASE + 50 )
-#define STR_LOG_META_DATA_METHOD_ARG3 ( STR_JDBC_LOG_MESSAGE_BASE + 51 )
-#define STR_LOG_META_DATA_METHOD_ARG4 ( STR_JDBC_LOG_MESSAGE_BASE + 52 )
-#define STR_LOG_META_DATA_RESULT ( STR_JDBC_LOG_MESSAGE_BASE + 53 )
-#define STR_LOG_META_DATA_SUCCESS ( STR_JDBC_LOG_MESSAGE_BASE + 54 )
-#define STR_LOG_THROWING_EXCEPTION ( STR_JDBC_LOG_MESSAGE_BASE + 55 )
-#define STR_LOG_SETTING_SYSTEM_PROPERTY ( STR_JDBC_LOG_MESSAGE_BASE + 56 )
-
-#endif // CONNECTIVITY_RESOURCE_JDBC_LOG_HRC
diff --git a/connectivity/source/inc/resource/kab_res.hrc b/connectivity/source/inc/resource/kab_res.hrc
deleted file mode 100755
index 789d4a832d..0000000000
--- a/connectivity/source/inc/resource/kab_res.hrc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_RESOURCE_KAB_HRC
-#define CONNECTIVITY_RESOURCE_KAB_HRC
-
-#include "resource/conn_shared_res.hrc"
-#include "resource/common_res.hrc"
-// ============================================================================
-// = the kab driver's resource strings
-// ============================================================================
-
-#define STR_NO_KDE_INST ( STR_KAB_BASE + 0 )
-#define STR_KDE_VERSION_TOO_OLD ( STR_KAB_BASE + 1 )
-#define STR_KDE_VERSION_TOO_NEW ( STR_KAB_BASE + 2 )
-#define STR_KDE_VERSION_TOO_NEW_WORK_AROUND ( STR_KAB_BASE + 3 )
-
-#endif // CONNECTIVITY_RESOURCE_KAB_HRC
-
diff --git a/connectivity/source/inc/resource/macab_res.hrc b/connectivity/source/inc/resource/macab_res.hrc
deleted file mode 100755
index fca426111c..0000000000
--- a/connectivity/source/inc/resource/macab_res.hrc
+++ /dev/null
@@ -1,41 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_RESOURCE_MACAB_HRC
-#define CONNECTIVITY_RESOURCE_MACAB_HRC
-
-#include "resource/conn_shared_res.hrc"
-#include "resource/common_res.hrc"
-// ============================================================================
-// = the macab driver's resource strings
-// ============================================================================
-
-#define STR_NO_TABLE ( STR_MACAB_BASE + 0 )
-#define STR_NO_MAC_OS_FOUND ( STR_MACAB_BASE + 1 )
-
-#endif // CONNECTIVITY_RESOURCE_MACAB_HRC
-
diff --git a/connectivity/source/inc/resource/mozab_res.hrc b/connectivity/source/inc/resource/mozab_res.hrc
deleted file mode 100755
index 30aaa791f7..0000000000
--- a/connectivity/source/inc/resource/mozab_res.hrc
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_RESOURCE_MOZAB_HRC
-#define CONNECTIVITY_RESOURCE_MOZAB_HRC
-
-#ifndef CONNECTIVITY_SHARED_RES_HRC
-#include "resource/conn_shared_res.hrc"
-#endif
-
-// ============================================================================
-// = the mozab driver's resource strings
-// ============================================================================
-
-#define STR_MOZILLA_ADDRESSBOOKS ( STR_MOZAB_BASE + 0 )
-#define STR_THUNDERBIRD_ADDRESSBOOKS ( STR_MOZAB_BASE + 1 )
-#define STR_OE_ADDRESSBOOK ( STR_MOZAB_BASE + 2 )
-#define STR_OUTLOOK_MAPI_ADDRESSBOOK ( STR_MOZAB_BASE + 3 )
- // FREE
-#define STR_NO_TABLE_CREATION_SUPPORT ( STR_MOZAB_BASE + 5 )
-#define STR_MOZILLA_IS_RUNNING ( STR_MOZAB_BASE + 6 )
-#define STR_COULD_NOT_RETRIEVE_AB_ENTRY ( STR_MOZAB_BASE + 7 )
-#define STR_COULD_NOT_GET_DIRECTORY_NAME ( STR_MOZAB_BASE + 8 )
-#define STR_TIMEOUT_WAITING ( STR_MOZAB_BASE + 9 )
-#define STR_ERR_EXECUTING_QUERY ( STR_MOZAB_BASE + 10 )
-#define STR_MOZILLA_IS_RUNNIG_NO_CHANGES ( STR_MOZAB_BASE + 11 )
-#define STR_FOREIGN_PROCESS_CHANGED_AB ( STR_MOZAB_BASE + 12 )
-#define STR_CANT_FIND_ROW ( STR_MOZAB_BASE + 13 )
-#define STR_CANT_FIND_CARD_FOR_ROW ( STR_MOZAB_BASE + 14 )
-#define STR_QUERY_INVALID_IS_NULL_COLUMN ( STR_MOZAB_BASE + 15 )
-#define STR_NO_HOSTNAME ( STR_MOZAB_BASE + 16 )
-#define STR_NO_BASEDN ( STR_MOZAB_BASE + 17 )
-#define STR_COULD_NOT_CONNECT_LDAP ( STR_MOZAB_BASE + 18 )
-#define STR_ERROR_REFRESH_ROW ( STR_MOZAB_BASE + 19 )
-#define STR_ILLEGAL_MOVEMENT ( STR_MOZAB_BASE + 20 )
-#define STR_ERROR_GET_ROW ( STR_MOZAB_BASE + 21 )
-#define STR_COMMIT_ROW ( STR_MOZAB_BASE + 22 )
-#define STR_INVALID_ROW_UPDATE ( STR_MOZAB_BASE + 23 )
-#define STR_ROW_CAN_NOT_SAVE ( STR_MOZAB_BASE + 24 )
-#define STR_CAN_NOT_CANCEL_ROW_UPDATE ( STR_MOZAB_BASE + 25 )
-#define STR_CAN_NOT_CREATE_ROW ( STR_MOZAB_BASE + 26 )
-#define STR_QUERY_AT_LEAST_ONE_TABLES ( STR_MOZAB_BASE + 27 )
-#define STR_NO_COUNT_SUPPORT ( STR_MOZAB_BASE + 28 )
-#define STR_STMT_TYPE_NOT_SUPPORTED ( STR_MOZAB_BASE + 29 )
-#define STR_COULD_NOT_LOAD_LIB ( STR_MOZAB_BASE + 30 )
-#define STR_UNSPECIFIED_ERROR ( STR_MOZAB_BASE + 31 )
-#define STR_COULD_NOT_CREATE_ADDRESSBOOK ( STR_MOZAB_BASE + 32 )
-
-#endif // CONNECTIVITY_RESOURCE_MOZAB_HRC
-
diff --git a/connectivity/source/inc/resource/sharedresources.hxx b/connectivity/source/inc/resource/sharedresources.hxx
deleted file mode 100644
index ae6a770ce5..0000000000
--- a/connectivity/source/inc/resource/sharedresources.hxx
+++ /dev/null
@@ -1,166 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_SHAREDRESOURCES_HXX
-#define CONNECTIVITY_SHAREDRESOURCES_HXX
-
-/** === begin UNO includes === **/
-/** === end UNO includes === **/
-
-#include <rtl/ustring.hxx>
-#include <list>
-#include "connectivity/dbtoolsdllapi.hxx"
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- typedef sal_uInt16 ResourceId;
- //====================================================================
- //= SharedResources
- //====================================================================
- /** helper class for accessing resources shared by different libraries
- in the connectivity module
- */
- class OOO_DLLPUBLIC_DBTOOLS SharedResources
- {
- public:
- SharedResources();
- ~SharedResources();
-
- /** loads a string from the shared resource file
- @param _nResId
- the resource ID of the string
- @return
- the string from the resource file
- */
- ::rtl::OUString
- getResourceString(
- ResourceId _nResId
- ) const;
-
- /** loads a string from the shared resource file, and replaces
- a given ASCII pattern with a given string
-
- @param _nResId
- the resource ID of the string to load
- @param _pAsciiPatternToReplace
- the ASCII string which is to search in the string. Must not be <NULL/>.
- @param _rStringToSubstitute
- the String which should substitute the ASCII pattern.
-
- @return
- the string from the resource file, with applied string substitution
- */
- ::rtl::OUString
- getResourceStringWithSubstitution(
- ResourceId _nResId,
- const sal_Char* _pAsciiPatternToReplace,
- const ::rtl::OUString& _rStringToSubstitute
- ) const;
-
- /** loads a string from the shared resource file, and replaces
- a given ASCII pattern with a given string
-
- @param _nResId
- the resource ID of the string to load
- @param _pAsciiPatternToReplace1
- the ASCII string (1) which is to search in the string. Must not be <NULL/>.
- @param _rStringToSubstitute1
- the String which should substitute the ASCII pattern (1)
- @param _pAsciiPatternToReplace2
- the ASCII string (2) which is to search in the string. Must not be <NULL/>.
- @param _rStringToSubstitute2
- the String which should substitute the ASCII pattern (2)
-
- @return
- the string from the resource file, with applied string substitution
- */
- ::rtl::OUString
- getResourceStringWithSubstitution(
- ResourceId _nResId,
- const sal_Char* _pAsciiPatternToReplace1,
- const ::rtl::OUString& _rStringToSubstitute1,
- const sal_Char* _pAsciiPatternToReplace2,
- const ::rtl::OUString& _rStringToSubstitute2
- ) const;
-
- /** loads a string from the shared resource file, and replaces
- a given ASCII pattern with a given string
-
- @param _nResId
- the resource ID of the string to load
- @param _pAsciiPatternToReplace1
- the ASCII string (1) which is to search in the string. Must not be <NULL/>.
- @param _rStringToSubstitute1
- the String which should substitute the ASCII pattern (1)
- @param _pAsciiPatternToReplace2
- the ASCII string (2) which is to search in the string. Must not be <NULL/>.
- @param _rStringToSubstitute2
- the String which should substitute the ASCII pattern (2)
- @param _pAsciiPatternToReplace3
- the ASCII string (3) which is to search in the string. Must not be <NULL/>.
- @param _rStringToSubstitute3
- the String which should substitute the ASCII pattern (3)
-
- @return
- the string from the resource file, with applied string substitution
- */
- ::rtl::OUString
- getResourceStringWithSubstitution(
- ResourceId _nResId,
- const sal_Char* _pAsciiPatternToReplace1,
- const ::rtl::OUString& _rStringToSubstitute1,
- const sal_Char* _pAsciiPatternToReplace2,
- const ::rtl::OUString& _rStringToSubstitute2,
- const sal_Char* _pAsciiPatternToReplace3,
- const ::rtl::OUString& _rStringToSubstitute3
- ) const;
-
- /** loads a string from the shared resource file, and replaces a given ASCII pattern with a given string
-
- @param _nResId
- the resource ID of the string to load
- @param _aStringToSubstitutes
- A list of substitutions.
-
- @return
- the string from the resource file, with applied string substitution
- */
- ::rtl::OUString getResourceStringWithSubstitution( ResourceId _nResId,
- const ::std::list< ::std::pair<const sal_Char* , ::rtl::OUString > > _aStringToSubstitutes) const;
- };
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-#endif // CONNECTIVITY_SHAREDRESOURCES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/sqlscan.hxx b/connectivity/source/inc/sqlscan.hxx
deleted file mode 100644
index 6456711f3a..0000000000
--- a/connectivity/source/inc/sqlscan.hxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONNECTIVITY_SQLSCAN_HXX
-#define _CONNECTIVITY_SQLSCAN_HXX
-
-#include <stdarg.h>
-#include "connectivity/IParseContext.hxx"
-#include "connectivity/dbtoolsdllapi.hxx"
-
-namespace connectivity
-{
- //==========================================================================
- //= OSQLScanner
- //==========================================================================
- /** Scanner for SQL92
- */
- class OOO_DLLPUBLIC_DBTOOLS OSQLScanner
- {
- const IParseContext* m_pContext; // context for parse, knows all international stuff
- ::rtl::OString m_sStatement; // statement to parse
- ::rtl::OUString m_sErrorMessage;
-
- sal_Int32 m_nCurrentPos; // next position to read from the statement
- sal_Bool m_bInternational; // do we have a statement which may uses
- sal_Int32 m_nRule; // rule to be set
-
- public:
- OSQLScanner();
- virtual ~OSQLScanner();
-
- inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () )
- { return ::rtl_allocateMemory( nSize ); }
- inline static void * SAL_CALL operator new( size_t,void* _pHint ) SAL_THROW( () )
- { return _pHint; }
- inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () )
- { ::rtl_freeMemory( pMem ); }
- inline static void SAL_CALL operator delete( void *,void* ) SAL_THROW( () )
- { }
-
- virtual sal_Int32 SQLyygetc(void);
- virtual void SQLyyerror(char *fmt);
- virtual void output(sal_Int32) { OSL_FAIL("Internal error in sdblex.l: output not possible"); }
- virtual void ECHO(void) { OSL_FAIL("Internal error in sdblex.l: ECHO not possible"); }
- virtual IParseContext::InternationalKeyCode getInternationalTokenID(const char* sToken) const;
-
- // setting the new information before scanning
- void prepareScan(const ::rtl::OUString & rNewStatement, const IParseContext* pContext, sal_Bool bInternational);
- const ::rtl::OUString& getErrorMessage() const {return m_sErrorMessage;}
- ::rtl::OString getStatement() const { return m_sStatement; }
-
- sal_Int32 SQLlex();
- // set this as scanner for flex
- void setScanner(sal_Bool _bNull=sal_False);
- // rules settings
- void SetRule(sal_Int32 nRule) {m_nRule = nRule;}
- sal_Int32 GetCurrentRule() const;
- sal_Int32 GetGERRule() const;
- sal_Int32 GetENGRule() const;
- sal_Int32 GetSQLRule() const;
- sal_Int32 GetDATERule() const;
- sal_Int32 GetSTRINGRule() const;
- inline sal_Int32 GetCurrentPos() const { return m_nCurrentPos; }
- };
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/manager/exports.dxp b/connectivity/source/manager/exports.dxp
deleted file mode 100755
index 7003307892..0000000000
--- a/connectivity/source/manager/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-component_getFactory
diff --git a/connectivity/source/manager/makefile.mk b/connectivity/source/manager/makefile.mk
deleted file mode 100755
index 4880407952..0000000000
--- a/connectivity/source/manager/makefile.mk
+++ /dev/null
@@ -1,85 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=..
-PRJNAME=connectivity
-TARGET=sdbc
-
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/version.mk
-
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/mdrivermanager.obj \
- $(SLO)$/mregistration.obj \
-
-# --- Library -----------------------------------
-
-SHL1TARGET= $(SDBC_TARGET)$(SDBC_MAJOR)
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(COMPHELPERLIB) \
- $(DBTOOLSLIB) \
- $(UNOTOOLSLIB) \
- $(SALLIB)
-
-SHL1DEPN=
-SHL1IMPLIB= i$(SHL1TARGET)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
-ALLTAR : $(MISC)/sdbc2.component
-
-$(MISC)/sdbc2.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- sdbc2.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt sdbc2.component
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx
deleted file mode 100644
index d71eb86985..0000000000
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ /dev/null
@@ -1,714 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-
-#include "mdrivermanager.hxx"
-#include <com/sun/star/sdbc/XDriver.hpp>
-#include <com/sun/star/container/XContentEnumerationAccess.hpp>
-#include <com/sun/star/container/ElementExistException.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
-
-#include <tools/diagnose_ex.h>
-#include <comphelper/extract.hxx>
-#include <comphelper/stl_types.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/weakref.hxx>
-#include <osl/diagnose.h>
-
-#include <algorithm>
-
-#include <o3tl/compat_functional.hxx>
-
-namespace drivermanager
-{
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::logging;
-using namespace ::osl;
-
-#define SERVICE_SDBC_DRIVER ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.Driver"))
-
-void throwNoSuchElementException() throw(NoSuchElementException)
-{
- throw NoSuchElementException();
-}
-
-//==========================================================================
-//= ODriverEnumeration
-//==========================================================================
-class ODriverEnumeration : public ::cppu::WeakImplHelper1< XEnumeration >
-{
- friend class OSDBCDriverManager;
-
- DECLARE_STL_VECTOR( SdbcDriver, DriverArray );
- DriverArray m_aDrivers;
- ConstDriverArrayIterator m_aPos;
- // order matters!
-
-protected:
- virtual ~ODriverEnumeration();
-public:
- ODriverEnumeration(const DriverArray& _rDriverSequence);
-
-// XEnumeration
- virtual sal_Bool SAL_CALL hasMoreElements( ) throw(RuntimeException);
- virtual Any SAL_CALL nextElement( ) throw(NoSuchElementException, WrappedTargetException, RuntimeException);
-};
-
-//--------------------------------------------------------------------------
-ODriverEnumeration::ODriverEnumeration(const DriverArray& _rDriverSequence)
- :m_aDrivers( _rDriverSequence )
- ,m_aPos( m_aDrivers.begin() )
-{
-}
-
-//--------------------------------------------------------------------------
-ODriverEnumeration::~ODriverEnumeration()
-{
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL ODriverEnumeration::hasMoreElements( ) throw(RuntimeException)
-{
- return m_aPos != m_aDrivers.end();
-}
-
-//--------------------------------------------------------------------------
-Any SAL_CALL ODriverEnumeration::nextElement( ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
-{
- if ( !hasMoreElements() )
- throwNoSuchElementException();
-
- return makeAny( *m_aPos++ );
-}
-
- //=====================================================================
- //= helper
- //=====================================================================
-
- /// an STL functor which ensures that a SdbcDriver described by a DriverAccess is loaded
- struct EnsureDriver : public ::std::unary_function< DriverAccess, DriverAccess >
- {
- const DriverAccess& operator()( const DriverAccess& _rDescriptor ) const
- {
- if ( !_rDescriptor.xDriver.is() )
- // we did not load this driver, yet
- if ( _rDescriptor.xComponentFactory.is() )
- // we have a factory for it
- const_cast< DriverAccess& >( _rDescriptor ).xDriver = _rDescriptor.xDriver.query( _rDescriptor.xComponentFactory->createInstance() );
- return _rDescriptor;
- }
- };
-
- /// an STL functor which extracts a SdbcDriver from a DriverAccess
- struct ExtractDriverFromAccess : public ::std::unary_function< DriverAccess, SdbcDriver >
- {
- SdbcDriver operator()( const DriverAccess& _rAccess ) const
- {
- return _rAccess.xDriver;
- }
- };
-
- typedef ::o3tl::unary_compose< ExtractDriverFromAccess, EnsureDriver > ExtractAfterLoad_BASE;
- /// an STL functor which loads a driver described by a DriverAccess, and extracts the SdbcDriver
- struct ExtractAfterLoad : public ExtractAfterLoad_BASE
- {
- ExtractAfterLoad() : ExtractAfterLoad_BASE( ExtractDriverFromAccess(), EnsureDriver() ) { }
- };
-
- struct ExtractDriverFromCollectionElement : public ::std::unary_function< DriverCollection::value_type, SdbcDriver >
- {
- SdbcDriver operator()( const DriverCollection::value_type& _rElement ) const
- {
- return _rElement.second;
- }
- };
-
- // predicate for checking whether or not a driver accepts a given URL
- class AcceptsURL : public ::std::unary_function< SdbcDriver, bool >
- {
- protected:
- const ::rtl::OUString& m_rURL;
-
- public:
- // ctor
- AcceptsURL( const ::rtl::OUString& _rURL ) : m_rURL( _rURL ) { }
-
- //.................................................................
- bool operator()( const SdbcDriver& _rDriver ) const
- {
- // ask the driver
- if ( _rDriver.is() && _rDriver->acceptsURL( m_rURL ) )
- return true;
-
- // does not accept ...
- return false;
- }
- };
-
- static sal_Int32 lcl_getDriverPrecedence( const ::comphelper::ComponentContext& _rContext, Sequence< ::rtl::OUString >& _rPrecedence )
- {
- _rPrecedence.realloc( 0 );
- try
- {
- // some strings we need
- const ::rtl::OUString sConfigurationProviderServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ));
- const ::rtl::OUString sDriverManagerConfigLocation( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.DataAccess/DriverManager" ));
- const ::rtl::OUString sDriverPreferenceLocation( RTL_CONSTASCII_USTRINGPARAM( "DriverPrecedence" ));
- const ::rtl::OUString sNodePathArgumentName( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
- const ::rtl::OUString sNodeAccessServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" ));
-
- // create a configuration provider
- Reference< XMultiServiceFactory > xConfigurationProvider;
- if ( !_rContext.createComponent( sConfigurationProviderServiceName, xConfigurationProvider ) )
- throw ServiceNotRegisteredException( sConfigurationProviderServiceName, NULL );
-
- // one argument for creating the node access: the path to the configuration node
- Sequence< Any > aCreationArgs(1);
- aCreationArgs[0] <<= NamedValue( sNodePathArgumentName, makeAny( sDriverManagerConfigLocation ) );
-
- // create the node access
- Reference< XNameAccess > xDriverManagerNode(xConfigurationProvider->createInstanceWithArguments(sNodeAccessServiceName, aCreationArgs), UNO_QUERY);
-
- OSL_ENSURE(xDriverManagerNode.is(), "lcl_getDriverPrecedence: could not open my configuration node!");
- if (xDriverManagerNode.is())
- {
- // obtain the preference list
- Any aPreferences = xDriverManagerNode->getByName(sDriverPreferenceLocation);
-#if OSL_DEBUG_LEVEL > 0
- sal_Bool bSuccess =
-#endif
- aPreferences >>= _rPrecedence;
- OSL_ENSURE(bSuccess || !aPreferences.hasValue(), "lcl_getDriverPrecedence: invalid value for the preferences node (no string sequence but not NULL)!");
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- return _rPrecedence.getLength();
- }
-
- /// an STL argorithm compatible predicate comparing two DriverAccess instances by their implementation names
- struct CompareDriverAccessByName : public ::std::binary_function< DriverAccess, DriverAccess, bool >
- {
- //.................................................................
- bool operator()( const DriverAccess& lhs, const DriverAccess& rhs )
- {
- return lhs.sImplementationName < rhs.sImplementationName ? true : false;
- }
- };
-
- /// and STL argorithm compatible predicate comparing a DriverAccess' impl name to a string
- struct CompareDriverAccessToName : public ::std::binary_function< DriverAccess, ::rtl::OUString, bool >
- {
- //.................................................................
- bool operator()( const DriverAccess& lhs, const ::rtl::OUString& rhs )
- {
- return lhs.sImplementationName < rhs ? true : false;
- }
- //.................................................................
- bool operator()( const ::rtl::OUString& lhs, const DriverAccess& rhs )
- {
- return lhs < rhs.sImplementationName ? true : false;
- }
- };
-
- /// and STL argorithm compatible predicate comparing a DriverAccess' impl name to a string
- struct EqualDriverAccessToName : public ::std::binary_function< DriverAccess, ::rtl::OUString, bool >
- {
- ::rtl::OUString m_sImplName;
- EqualDriverAccessToName(const ::rtl::OUString& _sImplName) : m_sImplName(_sImplName){}
- //.................................................................
- bool operator()( const DriverAccess& lhs)
- {
- return lhs.sImplementationName.equals(m_sImplName);
- }
- };
-
-//==========================================================================
-//= OSDBCDriverManager
-//==========================================================================
-//--------------------------------------------------------------------------
-OSDBCDriverManager::OSDBCDriverManager( const Reference< XComponentContext >& _rxContext )
- :m_aContext( _rxContext )
- ,m_aEventLogger( _rxContext, "org.openoffice.logging.sdbc.DriverManager" )
- ,m_aDriverConfig(m_aContext.getLegacyServiceFactory())
- ,m_nLoginTimeout(0)
-{
- // bootstrap all objects supporting the .sdb.Driver service
- bootstrapDrivers();
-
- // initialize the drivers order
- initializeDriverPrecedence();
-}
-
-//---------------------------------------------------------------------
-OSDBCDriverManager::~OSDBCDriverManager()
-{
-}
-
-void OSDBCDriverManager::bootstrapDrivers()
-{
- Reference< XContentEnumerationAccess > xEnumAccess( m_aContext.getLegacyServiceFactory(), UNO_QUERY );
- Reference< XEnumeration > xEnumDrivers;
- if (xEnumAccess.is())
- xEnumDrivers = xEnumAccess->createContentEnumeration(SERVICE_SDBC_DRIVER);
-
- OSL_ENSURE( xEnumDrivers.is(), "OSDBCDriverManager::bootstrapDrivers: no enumeration for the drivers available!" );
- if (xEnumDrivers.is())
- {
- Reference< XSingleServiceFactory > xFactory;
- Reference< XServiceInfo > xSI;
- while (xEnumDrivers->hasMoreElements())
- {
- ::cppu::extractInterface( xFactory, xEnumDrivers->nextElement() );
- OSL_ENSURE( xFactory.is(), "OSDBCDriverManager::bootstrapDrivers: no factory extracted" );
-
- if ( xFactory.is() )
- {
- // we got a factory for the driver
- DriverAccess aDriverDescriptor;
- sal_Bool bValidDescriptor = sal_False;
-
- // can it tell us something about the implementation name?
- xSI = xSI.query( xFactory );
- if ( xSI.is() )
- { // yes -> no need to load the driver immediately (load it later when needed)
- aDriverDescriptor.sImplementationName = xSI->getImplementationName();
- aDriverDescriptor.xComponentFactory = xFactory;
- bValidDescriptor = sal_True;
-
- m_aEventLogger.log( LogLevel::CONFIG,
- "found SDBC driver $1$, no need to load it",
- aDriverDescriptor.sImplementationName
- );
- }
- else
- {
- // no -> create the driver
- Reference< XDriver > xDriver( xFactory->createInstance(), UNO_QUERY );
- OSL_ENSURE( xDriver.is(), "OSDBCDriverManager::bootstrapDrivers: a driver which is no driver?!" );
-
- if ( xDriver.is() )
- {
- aDriverDescriptor.xDriver = xDriver;
- // and obtain it's implementation name
- xSI = xSI.query( xDriver );
- OSL_ENSURE( xSI.is(), "OSDBCDriverManager::bootstrapDrivers: a driver without service info?" );
- if ( xSI.is() )
- {
- aDriverDescriptor.sImplementationName = xSI->getImplementationName();
- bValidDescriptor = sal_True;
-
- m_aEventLogger.log( LogLevel::CONFIG,
- "found SDBC driver $1$, needed to load it",
- aDriverDescriptor.sImplementationName
- );
- }
- }
- }
-
- if ( bValidDescriptor )
- {
- m_aDriversBS.push_back( aDriverDescriptor );
- }
- }
- }
- }
-}
-
-//--------------------------------------------------------------------------
-void OSDBCDriverManager::initializeDriverPrecedence()
-{
- if ( m_aDriversBS.empty() )
- // nothing to do
- return;
-
- try
- {
- // get the precedence of the drivers from the configuration
- Sequence< ::rtl::OUString > aDriverOrder;
- if ( 0 == lcl_getDriverPrecedence( m_aContext, aDriverOrder ) )
- // nothing to do
- return;
-
- // aDriverOrder now is the list of driver implementation names in the order they should be used
-
- if ( m_aEventLogger.isLoggable( LogLevel::CONFIG ) )
- {
- sal_Int32 nOrderedCount = aDriverOrder.getLength();
- for ( sal_Int32 i=0; i<nOrderedCount; ++i )
- m_aEventLogger.log( LogLevel::CONFIG,
- "configuration's driver order: driver $1$ of $2$: $3$",
- (sal_Int32)(i + 1), nOrderedCount, aDriverOrder[i]
- );
- }
-
- // sort our bootstrapped drivers
- ::std::sort( m_aDriversBS.begin(), m_aDriversBS.end(), CompareDriverAccessByName() );
-
- // loop through the names in the precedence order
- const ::rtl::OUString* pDriverOrder = aDriverOrder.getConstArray();
- const ::rtl::OUString* pDriverOrderEnd = pDriverOrder + aDriverOrder.getLength();
-
- // the first driver for which there is no preference
- DriverAccessArrayIterator aNoPrefDriversStart = m_aDriversBS.begin();
- // at the moment this is the first of all drivers we know
-
- for ( ; ( pDriverOrder < pDriverOrderEnd ) && ( aNoPrefDriversStart != m_aDriversBS.end() ); ++pDriverOrder )
- {
- // look for the impl name in the DriverAccess array
- ::std::pair< DriverAccessArrayIterator, DriverAccessArrayIterator > aPos =
- ::std::equal_range( aNoPrefDriversStart, m_aDriversBS.end(), *pDriverOrder, CompareDriverAccessToName() );
-
- if ( aPos.first != aPos.second )
- { // we have a DriverAccess with this impl name
-
- OSL_ENSURE( ::std::distance( aPos.first, aPos.second ) == 1,
- "OSDBCDriverManager::initializeDriverPrecedence: more than one driver with this impl name? How this?" );
- // move the DriverAccess pointed to by aPos.first to the position pointed to by aNoPrefDriversStart
-
- if ( aPos.first != aNoPrefDriversStart )
- { // if this does not hold, the DriverAccess alread has the correct position
-
- // rotate the range [aNoPrefDriversStart, aPos.second) right 1 element
- ::std::rotate( aNoPrefDriversStart, aPos.second - 1, aPos.second );
- }
-
- // next round we start searching and pos right
- ++aNoPrefDriversStart;
- }
- }
- }
- catch (Exception&)
- {
- OSL_FAIL("OSDBCDriverManager::initializeDriverPrecedence: caught an exception while sorting the drivers!");
- }
-}
-
-//--------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL OSDBCDriverManager::getConnection( const ::rtl::OUString& _rURL ) throw(SQLException, RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
-
- m_aEventLogger.log( LogLevel::INFO,
- "connection requested for URL $1$",
- _rURL
- );
-
- Reference< XConnection > xConnection;
- Reference< XDriver > xDriver = implGetDriverForURL(_rURL);
- if (xDriver.is())
- {
- // TODO : handle the login timeout
- xConnection = xDriver->connect(_rURL, Sequence< PropertyValue >());
- // may throw an exception
- m_aEventLogger.log( LogLevel::INFO,
- "connection retrieved for URL $1$",
- _rURL
- );
- }
-
- return xConnection;
-}
-
-//--------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL OSDBCDriverManager::getConnectionWithInfo( const ::rtl::OUString& _rURL, const Sequence< PropertyValue >& _rInfo ) throw(SQLException, RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
-
- m_aEventLogger.log( LogLevel::INFO,
- "connection with info requested for URL $1$",
- _rURL
- );
-
- Reference< XConnection > xConnection;
- Reference< XDriver > xDriver = implGetDriverForURL(_rURL);
- if (xDriver.is())
- {
- // TODO : handle the login timeout
- xConnection = xDriver->connect(_rURL, _rInfo);
- // may throw an exception
- m_aEventLogger.log( LogLevel::INFO,
- "connection with info retrieved for URL $1$",
- _rURL
- );
- }
-
- return xConnection;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OSDBCDriverManager::setLoginTimeout( sal_Int32 seconds ) throw(RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
- m_nLoginTimeout = seconds;
-}
-
-//--------------------------------------------------------------------------
-sal_Int32 SAL_CALL OSDBCDriverManager::getLoginTimeout( ) throw(RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
- return m_nLoginTimeout;
-}
-
-//--------------------------------------------------------------------------
-Reference< XEnumeration > SAL_CALL OSDBCDriverManager::createEnumeration( ) throw(RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
-
- ODriverEnumeration::DriverArray aDrivers;
-
- // ensure that all our bootstrapped drivers are instantiated
- ::std::for_each( m_aDriversBS.begin(), m_aDriversBS.end(), EnsureDriver() );
-
- // copy the bootstrapped drivers
- ::std::transform(
- m_aDriversBS.begin(), // "copy from" start
- m_aDriversBS.end(), // "copy from" end
- ::std::back_inserter( aDrivers ), // insert into
- ExtractDriverFromAccess() // transformation to apply (extract a driver from a driver access)
- );
-
- // append the runtime drivers
- ::std::transform(
- m_aDriversRT.begin(), // "copy from" start
- m_aDriversRT.end(), // "copy from" end
- ::std::back_inserter( aDrivers ), // insert into
- ExtractDriverFromCollectionElement() // transformation to apply (extract a driver from a driver access)
- );
-
- return new ODriverEnumeration( aDrivers );
-}
-
-//--------------------------------------------------------------------------
-::com::sun::star::uno::Type SAL_CALL OSDBCDriverManager::getElementType( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::getCppuType(static_cast< Reference< XDriver >* >(NULL));
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OSDBCDriverManager::hasElements( ) throw(::com::sun::star::uno::RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
- return !(m_aDriversBS.empty() && m_aDriversRT.empty());
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OSDBCDriverManager::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_static();
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OSDBCDriverManager::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-
-//--------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL OSDBCDriverManager::getSupportedServiceNames( ) throw(RuntimeException)
-{
- return getSupportedServiceNames_static();
-}
-
-//--------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL OSDBCDriverManager::Create( const Reference< XMultiServiceFactory >& _rxFactory )
-{
- ::comphelper::ComponentContext aContext( _rxFactory );
- return *( new OSDBCDriverManager( aContext.getUNOContext() ) );
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OSDBCDriverManager::getImplementationName_static( ) throw(RuntimeException)
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdbc.OSDBCDriverManager"));
-}
-
-//--------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL OSDBCDriverManager::getSupportedServiceNames_static( ) throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(1);
- aSupported[0] = getSingletonName_static();
- return aSupported;
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OSDBCDriverManager::getSingletonName_static( ) throw(RuntimeException)
-{
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbc.DriverManager" ) );
-}
-
-//--------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL OSDBCDriverManager::getRegisteredObject( const ::rtl::OUString& _rName ) throw(Exception, RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
- ConstDriverCollectionIterator aSearch = m_aDriversRT.find(_rName);
- if (aSearch == m_aDriversRT.end())
- throwNoSuchElementException();
-
- return aSearch->second.get();
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OSDBCDriverManager::registerObject( const ::rtl::OUString& _rName, const Reference< XInterface >& _rxObject ) throw(Exception, RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
-
- m_aEventLogger.log( LogLevel::INFO,
- "attempt to register new driver for name $1$",
- _rName
- );
-
- ConstDriverCollectionIterator aSearch = m_aDriversRT.find(_rName);
- if (aSearch == m_aDriversRT.end())
- {
- Reference< XDriver > xNewDriver(_rxObject, UNO_QUERY);
- if (xNewDriver.is())
- m_aDriversRT.insert(DriverCollection::value_type(_rName, xNewDriver));
- else
- throw IllegalArgumentException();
- }
- else
- throw ElementExistException();
-
- m_aEventLogger.log( LogLevel::INFO,
- "new driver registered for name $1$",
- _rName
- );
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OSDBCDriverManager::revokeObject( const ::rtl::OUString& _rName ) throw(Exception, RuntimeException)
-{
- MutexGuard aGuard(m_aMutex);
-
- m_aEventLogger.log( LogLevel::INFO,
- "attempt to revoke driver for name $1$",
- _rName
- );
-
- DriverCollectionIterator aSearch = m_aDriversRT.find(_rName);
- if (aSearch == m_aDriversRT.end())
- throwNoSuchElementException();
-
- m_aDriversRT.erase(aSearch); // we already have the iterator so we could use it
-
- m_aEventLogger.log( LogLevel::INFO,
- "driver revoked for name $1$",
- _rName
- );
-}
-
-//--------------------------------------------------------------------------
-Reference< XDriver > SAL_CALL OSDBCDriverManager::getDriverByURL( const ::rtl::OUString& _rURL ) throw(RuntimeException)
-{
- m_aEventLogger.log( LogLevel::INFO,
- "driver requested for URL $1$",
- _rURL
- );
-
- Reference< XDriver > xDriver( implGetDriverForURL( _rURL ) );
-
- if ( xDriver.is() )
- m_aEventLogger.log( LogLevel::INFO,
- "driver obtained for URL $1$",
- _rURL
- );
-
- return xDriver;
-}
-
-//--------------------------------------------------------------------------
-Reference< XDriver > OSDBCDriverManager::implGetDriverForURL(const ::rtl::OUString& _rURL)
-{
- Reference< XDriver > xReturn;
-
- {
- const ::rtl::OUString sDriverFactoryName = m_aDriverConfig.getDriverFactoryName(_rURL);
-
- EqualDriverAccessToName aEqual(sDriverFactoryName);
- DriverAccessArray::iterator aFind = ::std::find_if(m_aDriversBS.begin(),m_aDriversBS.end(),aEqual);
- if ( aFind == m_aDriversBS.end() )
- {
- // search all bootstrapped drivers
- aFind = ::std::find_if(
- m_aDriversBS.begin(), // begin of search range
- m_aDriversBS.end(), // end of search range
- o3tl::unary_compose< AcceptsURL, ExtractAfterLoad >( AcceptsURL( _rURL ), ExtractAfterLoad() )
- // compose two functors: extract the driver from the access, then ask the resulting driver for acceptance
- );
- } // if ( m_aDriversBS.find(sDriverFactoryName ) == m_aDriversBS.end() )
- else
- {
- EnsureDriver aEnsure;
- aEnsure(*aFind);
- }
-
- // found something?
- if ( m_aDriversBS.end() != aFind && aFind->xDriver.is() && aFind->xDriver->acceptsURL(_rURL) )
- xReturn = aFind->xDriver;
- }
-
- if ( !xReturn.is() )
- {
- // no -> search the runtime drivers
- DriverCollectionIterator aPos = ::std::find_if(
- m_aDriversRT.begin(), // begin of search range
- m_aDriversRT.end(), // end of search range
- o3tl::unary_compose< AcceptsURL, ExtractDriverFromCollectionElement >( AcceptsURL( _rURL ), ExtractDriverFromCollectionElement() )
- // compose two functors: extract the driver from the access, then ask the resulting driver for acceptance
- );
-
- if ( m_aDriversRT.end() != aPos )
- xReturn = aPos->second;
- }
-
- return xReturn;
-}
-
-} // namespace drivermanager
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/manager/mdrivermanager.hxx b/connectivity/source/manager/mdrivermanager.hxx
deleted file mode 100644
index ec6f38645b..0000000000
--- a/connectivity/source/manager/mdrivermanager.hxx
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_DRIVERMANAGER_HXX_
-#define _CONNECTIVITY_DRIVERMANAGER_HXX_
-
-#include <com/sun/star/sdbc/XDriverManager.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/container/XEnumerationAccess.hpp>
-#include <com/sun/star/uno/XNamingService.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/sdbc/XDriverAccess.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-
-#include <cppuhelper/implbase5.hxx>
-#include <comphelper/stl_types.hxx>
-#include <comphelper/logging.hxx>
-#include <comphelper/componentcontext.hxx>
-#include <osl/mutex.hxx>
-#include "connectivity/DriversConfig.hxx"
-
-namespace drivermanager
-{
-
- //======================================================================
- //= various
- //======================================================================
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > SdbcDriver;
- DECLARE_STL_USTRINGACCESS_MAP( SdbcDriver, DriverCollection );
-
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > DriverFactory;
- struct DriverAccess
- {
- ::rtl::OUString sImplementationName; /// the implementation name of the driver
- DriverFactory xComponentFactory; /// the factory to create the driver component (if not already done so)
- SdbcDriver xDriver; /// the driver itself
- };
-
- //==========================================================================
- //= OSDBCDriverManager - the one-instance service for managing SDBC drivers
- //==========================================================================
- typedef ::cppu::WeakImplHelper5 < ::com::sun::star::sdbc::XDriverManager
- , ::com::sun::star::sdbc::XDriverAccess
- , ::com::sun::star::container::XEnumerationAccess
- , ::com::sun::star::lang::XServiceInfo
- , ::com::sun::star::uno::XNamingService
- > OSDBCDriverManager_Base;
-
- class OSDBCDriverManager : public OSDBCDriverManager_Base
- {
- friend class ODriverEnumeration;
-
- ::osl::Mutex m_aMutex;
- ::comphelper::ComponentContext m_aContext;
- ::comphelper::EventLogger m_aEventLogger;
-
- DECLARE_STL_VECTOR(DriverAccess, DriverAccessArray);
- DriverAccessArray m_aDriversBS;
-
- // for drivers registered at runtime (not bootstrapped) we don't require an XServiceInfo interface,
- // so we have to remember their impl-name in another way
- DECLARE_STL_USTRINGACCESS_MAP(SdbcDriver, DriverCollection);
- DriverCollection m_aDriversRT;
-
- ::connectivity::DriversConfig m_aDriverConfig;
- sal_Int32 m_nLoginTimeout;
-
- private:
- OSDBCDriverManager(
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext );
- ~OSDBCDriverManager();
-
- public:
-
- // XDriverManager
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnection( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getConnectionWithInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLoginTimeout( sal_Int32 seconds ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getLoginTimeout( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XDriverAccess
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > SAL_CALL getDriverByURL( const ::rtl::OUString& url ) throw(::com::sun::star::uno::RuntimeException);
-
- // XEnumerationAccess
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XElementAccess
- virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XServiceInfo - static methods
- static ::rtl::OUString SAL_CALL getImplementationName_static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::rtl::OUString SAL_CALL getSingletonName_static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxContext );
-
- // XNamingService
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getRegisteredObject( const ::rtl::OUString& Name ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL registerObject( const ::rtl::OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Object ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL revokeObject( const ::rtl::OUString& Name ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > implGetDriverForURL(const ::rtl::OUString& _rURL);
-
- /** retrieve the driver order preferences from the configuration and
- sort m_aDriversBS accordingly.
- */
- void initializeDriverPrecedence();
-
- void bootstrapDrivers();
- };
-
-} // namespace drivermanager
-
-#endif // _CONNECTIVITY_DRIVERMANAGER_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/manager/mregistration.cxx b/connectivity/source/manager/mregistration.cxx
deleted file mode 100644
index c06ebe853a..0000000000
--- a/connectivity/source/manager/mregistration.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "mdrivermanager.hxx"
-
-#include <cppuhelper/factory.hxx>
-
-#include <stdio.h>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-
-//==========================================================================
-//= registration
-//==========================================================================
-extern "C"
-{
-
-//---------------------------------------------------------------------------------------
-SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/)
-{
- void* pRet = NULL;
-
- if (::drivermanager::OSDBCDriverManager::getImplementationName_static().compareToAscii(_pImplName) == 0)
- {
- Reference< XSingleServiceFactory > xFactory(
- ::cppu::createOneInstanceFactory(
- _pServiceManager,
- ::drivermanager::OSDBCDriverManager::getImplementationName_static(),
- ::drivermanager::OSDBCDriverManager::Create,
- ::drivermanager::OSDBCDriverManager::getSupportedServiceNames_static()
- )
- );
- if (xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
-
- return pRet;
-}
-
-} // extern "C"
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/manager/sdbc.mxp.map b/connectivity/source/manager/sdbc.mxp.map
deleted file mode 100755
index 4a6ae43142..0000000000
--- a/connectivity/source/manager/sdbc.mxp.map
+++ /dev/null
@@ -1,51 +0,0 @@
-component_getFactory
-__mh_dylib_header
-___builtin_delete
-___builtin_new
-___check_eh_spec
-___cp_pop_exception
-___cp_push_exception
-___eh_alloc
-___eh_rtime_match
-___get_eh_context
-___pure_virtual
-___rtti_class
-___rtti_si
-___rtti_user
-___sjthrow
-___start_cp_handler
-___terminate
-_terminate__Fv
-dyld_stub_binding_helper
-rest_world
-save_world
-__._9bad_alloc
-___tf9bad_alloc
-___vt_9bad_alloc
-___vt_9exception
-__keymgr_get_per_thread_data
-__._10bad_typeid
-__._8bad_cast
-___get_eh_info
-___is_pointer__FPv
-___throw_type_match_rtti
-___vt_10bad_typeid
-___vt_8bad_cast
-__keymgr_set_per_thread_data
-___tf9exception
-___ti9exception
-_what__C9exception
-__._9type_info
-___eq__C9type_infoRCB0
-___tf16__user_type_info
-___tf9type_info
-___ti9type_info
-___vt_9type_info
-___18OSDBCDriverManagerRCQ53com3sun4star3unot9Reference1ZQ53com3sun4star4lang20XMultiServiceFactory
-___18ODriverEnumerationRCQ24_STLt6vector2ZQ53com3sun4star3unot9Reference1ZQ53com3sun4star4sdbc7XDriverZQ24_STLt9allocator1ZB2
-_implGetDriverForURL__18OSDBCDriverManagerRCQ23rtl8OUString
-___tf13bad_exception
-___uncatch_exception
-___eh_free
-___tfv
-___dynamic_cast
diff --git a/connectivity/source/manager/sdbc2.component b/connectivity/source/manager/sdbc2.component
deleted file mode 100755
index 6cce2b1d9f..0000000000
--- a/connectivity/source/manager/sdbc2.component
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.sdbc.OSDBCDriverManager">
- <service name="com.sun.star.sdbc.DriverManager"/>
- </implementation>
-</component>
diff --git a/connectivity/source/parse/PColumn.cxx b/connectivity/source/parse/PColumn.cxx
deleted file mode 100644
index 0c1c95fa7f..0000000000
--- a/connectivity/source/parse/PColumn.cxx
+++ /dev/null
@@ -1,298 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "connectivity/PColumn.hxx"
-#include "connectivity/dbtools.hxx"
-#include "TConnection.hxx"
-
-#include <comphelper/types.hxx>
-#include <tools/diagnose_ex.h>
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace dbtools;
-using namespace connectivity::parse;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-
-// -------------------------------------------------------------------------
-OParseColumn::OParseColumn(const Reference<XPropertySet>& _xColumn,sal_Bool _bCase)
- : connectivity::sdbcx::OColumn( getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)))
- , getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)))
- , getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)))
- , getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)))
- , getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)))
- , getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)))
- , getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)))
- , getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)))
- , getBOOL(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)))
- , sal_False
- , getBOOL(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)))
- , _bCase
- )
- , m_bFunction(sal_False)
- , m_bDbasePrecisionChanged(sal_False)
- , m_bAggregateFunction(sal_False)
- , m_bIsSearchable( sal_True )
-{
- construct();
-}
-
-// -------------------------------------------------------------------------
-OParseColumn::OParseColumn( const ::rtl::OUString& _Name,
- const ::rtl::OUString& _TypeName,
- const ::rtl::OUString& _DefaultValue,
- const ::rtl::OUString& _Description,
- sal_Int32 _IsNullable,
- sal_Int32 _Precision,
- sal_Int32 _Scale,
- sal_Int32 _Type,
- sal_Bool _IsAutoIncrement,
- sal_Bool _IsCurrency,
- sal_Bool _bCase
- ) : connectivity::sdbcx::OColumn(_Name,
- _TypeName,
- _DefaultValue,
- _Description,
- _IsNullable,
- _Precision,
- _Scale,
- _Type,
- _IsAutoIncrement,
- sal_False,
- _IsCurrency,
- _bCase)
- , m_bFunction(sal_False)
- , m_bDbasePrecisionChanged(sal_False)
- , m_bAggregateFunction(sal_False)
- , m_bIsSearchable( sal_True )
-{
- construct();
-}
-
-// -------------------------------------------------------------------------
-::rtl::Reference< OSQLColumns > OParseColumn::createColumnsForResultSet( const Reference< XResultSetMetaData >& _rxResMetaData,
- const Reference< XDatabaseMetaData >& _rxDBMetaData,const Reference< XNameAccess>& i_xQueryColumns )
-{
- sal_Int32 nColumnCount = _rxResMetaData->getColumnCount();
- ::rtl::Reference< OSQLColumns > aReturn( new OSQLColumns ); aReturn->get().reserve( nColumnCount );
-
- StringMap aColumnMap;
- for ( sal_Int32 i = 1; i <= nColumnCount; ++i )
- {
- OParseColumn* pColumn = createColumnForResultSet( _rxResMetaData, _rxDBMetaData, i,aColumnMap );
- aReturn->get().push_back( pColumn );
- if ( i_xQueryColumns.is() && i_xQueryColumns->hasByName(pColumn->getRealName()) )
- {
- Reference<XPropertySet> xColumn(i_xQueryColumns->getByName(pColumn->getRealName()),UNO_QUERY_THROW);
- ::rtl::OUString sLabel;
- xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_LABEL)) >>= sLabel;
- if ( sLabel.getLength() )
- pColumn->setLabel(sLabel);
- }
- }
-
- return aReturn;
-}
-
-// -------------------------------------------------------------------------
-OParseColumn* OParseColumn::createColumnForResultSet( const Reference< XResultSetMetaData >& _rxResMetaData,
- const Reference< XDatabaseMetaData >& _rxDBMetaData, sal_Int32 _nColumnPos,StringMap& _rColumns )
-{
- ::rtl::OUString sLabel = _rxResMetaData->getColumnLabel( _nColumnPos );
- // retrieve the name of the column
- // check for duplicate entries
- if(_rColumns.find(sLabel) != _rColumns.end())
- {
- ::rtl::OUString sAlias(sLabel);
- sal_Int32 searchIndex=1;
- while(_rColumns.find(sAlias) != _rColumns.end())
- {
- (sAlias = sLabel) += ::rtl::OUString::valueOf(searchIndex++);
- }
- sLabel = sAlias;
- }
- _rColumns.insert(StringMap::value_type(sLabel,0));
- OParseColumn* pColumn = new OParseColumn(
- sLabel,
- _rxResMetaData->getColumnTypeName( _nColumnPos ),
- ::rtl::OUString(),
- ::rtl::OUString(),
- _rxResMetaData->isNullable( _nColumnPos ),
- _rxResMetaData->getPrecision( _nColumnPos ),
- _rxResMetaData->getScale( _nColumnPos ),
- _rxResMetaData->getColumnType( _nColumnPos ),
- _rxResMetaData->isAutoIncrement( _nColumnPos ),
- _rxResMetaData->isCurrency( _nColumnPos ),
- _rxDBMetaData->supportsMixedCaseQuotedIdentifiers()
- );
- const ::rtl::OUString sTableName = _rxResMetaData->getTableName( _nColumnPos );
- if ( sTableName.getLength() )
- pColumn->setTableName( ::dbtools::composeTableName( _rxDBMetaData,
- _rxResMetaData->getCatalogName( _nColumnPos ),
- _rxResMetaData->getSchemaName( _nColumnPos ),
- sTableName,
- sal_False,
- eComplete
- ) );
- pColumn->setIsSearchable( _rxResMetaData->isSearchable( _nColumnPos ) );
- pColumn->setRealName(_rxResMetaData->getColumnName( _nColumnPos ));
- pColumn->setLabel(sLabel);
- return pColumn;
-}
-
-// -------------------------------------------------------------------------
-OParseColumn::~OParseColumn()
-{
-}
-// -------------------------------------------------------------------------
-void OParseColumn::construct()
-{
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION), PROPERTY_ID_FUNCTION, 0, &m_bFunction, ::getCppuType(reinterpret_cast< sal_Bool*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_AGGREGATEFUNCTION), PROPERTY_ID_AGGREGATEFUNCTION, 0, &m_bAggregateFunction, ::getCppuType(reinterpret_cast< sal_Bool*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TABLENAME), PROPERTY_ID_TABLENAME, 0, &m_aTableName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME), PROPERTY_ID_REALNAME, 0, &m_aRealName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DBASEPRECISIONCHANGED), PROPERTY_ID_DBASEPRECISIONCHANGED, 0, &m_bDbasePrecisionChanged, ::getCppuType(reinterpret_cast<sal_Bool*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISSEARCHABLE), PROPERTY_ID_ISSEARCHABLE, 0, &m_bIsSearchable, ::getCppuType(reinterpret_cast< sal_Bool*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_LABEL), PROPERTY_ID_LABEL, 0, &m_sLabel, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OParseColumn::createArrayHelper() const
-{
- return doCreateArrayHelper();
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & SAL_CALL OParseColumn::getInfoHelper()
-{
- OSL_ENSURE( !isNew(), "OParseColumn::getInfoHelper: a *new* ParseColumn?" );
- return *OParseColumn_PROP::getArrayHelper();
-}
-
-// -----------------------------------------------------------------------------
-namespace
-{
- ::rtl::OUString lcl_getColumnTableName( const Reference< XPropertySet >& i_parseColumn )
- {
- ::rtl::OUString sColumnTableName;
- try
- {
- OSL_VERIFY( i_parseColumn->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_TABLENAME ) ) >>= sColumnTableName );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return sColumnTableName;
- }
-}
-
-// -----------------------------------------------------------------------------
-OOrderColumn::OOrderColumn( const Reference<XPropertySet>& _xColumn, const ::rtl::OUString& i_rOriginatingTableName,
- sal_Bool _bCase, sal_Bool _bAscending )
- : connectivity::sdbcx::OColumn(
- getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))),
- getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME))),
- getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE))),
- getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION))),
- getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))),
- getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))),
- getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))),
- getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))),
- getBOOL(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT))),
- sal_False,
- getBOOL(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY))),
- _bCase
- )
- ,m_bAscending(_bAscending)
- ,m_sTableName( i_rOriginatingTableName )
-{
- construct();
-}
-
-// -----------------------------------------------------------------------------
-OOrderColumn::OOrderColumn( const Reference<XPropertySet>& _xColumn, sal_Bool _bCase, sal_Bool _bAscending )
- : connectivity::sdbcx::OColumn(
- getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))),
- getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME))),
- getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE))),
- getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION))),
- getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))),
- getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))),
- getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))),
- getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))),
- getBOOL(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT))),
- sal_False,
- getBOOL(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY))),
- _bCase
- )
- ,m_bAscending(_bAscending)
- ,m_sTableName( lcl_getColumnTableName( _xColumn ) )
-{
- construct();
-}
-
-// -------------------------------------------------------------------------
-OOrderColumn::~OOrderColumn()
-{
-}
-
-// -------------------------------------------------------------------------
-void OOrderColumn::construct()
-{
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISASCENDING), PROPERTY_ID_ISASCENDING,
- PropertyAttribute::READONLY, const_cast< sal_Bool* >( &m_bAscending ), ::getCppuType( reinterpret_cast< sal_Bool* >( NULL ) ) );
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TABLENAME), PROPERTY_ID_TABLENAME,
- PropertyAttribute::READONLY, const_cast< ::rtl::OUString* >( &m_sTableName ), ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OOrderColumn::createArrayHelper() const
-{
- return doCreateArrayHelper();
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & SAL_CALL OOrderColumn::getInfoHelper()
-{
- OSL_ENSURE( !isNew(), "OOrderColumn::getInfoHelper: a *new* OrderColumn?" );
- return *OOrderColumn_PROP::getArrayHelper();
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OOrderColumn::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1);
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OrderColumn"));
-
- return aSupported;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/parse/internalnode.cxx b/connectivity/source/parse/internalnode.cxx
deleted file mode 100644
index a6c84f72a0..0000000000
--- a/connectivity/source/parse/internalnode.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "internalnode.hxx"
-
-#include <algorithm>
-#include <connectivity/sqlparse.hxx>
-
-using namespace connectivity;
-
-//-----------------------------------------------------------------------------
-OSQLInternalNode::OSQLInternalNode(const sal_Char* pNewValue,
- SQLNodeType eNodeType,
- sal_uInt32 nNodeID)
- : OSQLParseNode(pNewValue,eNodeType,nNodeID)
-{
- OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
- (*OSQLParser::s_pGarbageCollector)->push_back(this);
-}
-
-//-----------------------------------------------------------------------------
-OSQLInternalNode::OSQLInternalNode(const ::rtl::OString &_NewValue,
- SQLNodeType eNodeType,
- sal_uInt32 nNodeID)
- :OSQLParseNode(_NewValue,eNodeType,nNodeID)
-{
- OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
- (*OSQLParser::s_pGarbageCollector)->push_back(this);
-}
-
-//-----------------------------------------------------------------------------
-OSQLInternalNode::OSQLInternalNode(const sal_Unicode* pNewValue,
- SQLNodeType eNodeType,
- sal_uInt32 nNodeID)
- :OSQLParseNode(pNewValue,eNodeType,nNodeID)
-{
- OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
- (*OSQLParser::s_pGarbageCollector)->push_back(this);
-}
-
-//-----------------------------------------------------------------------------
-OSQLInternalNode::OSQLInternalNode(const ::rtl::OUString &_NewValue,
- SQLNodeType eNodeType,
- sal_uInt32 nNodeID)
- :OSQLParseNode(_NewValue,eNodeType,nNodeID)
-{
- OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
- (*OSQLParser::s_pGarbageCollector)->push_back(this);
-}
-
-
-//-----------------------------------------------------------------------------
-OSQLInternalNode::~OSQLInternalNode()
-{
- // remove the node from the garbage list
-
- OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
- (*OSQLParser::s_pGarbageCollector)->erase(this);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/parse/makefile.mk b/connectivity/source/parse/makefile.mk
deleted file mode 100755
index 510fbb2fc2..0000000000
--- a/connectivity/source/parse/makefile.mk
+++ /dev/null
@@ -1,67 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=connectivity
-TARGET=sql
-INCPRE=$(MISC)
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/dbtools.pmk
-
-# --- Files --------------------------------------------------------
-
-YACCTARGET= $(MISC)$/sqlbison.cxx
-YACCFILES= sqlbison.y
-YACCFLAGS=-v -d -l -pSQLyy -bsql
-
-EXCEPTIONSFILES = \
- $(SLO)$/PColumn.obj \
- $(SLO)$/internalnode.obj \
- $(SLO)$/sqliterator.obj \
- $(SLO)$/sqlnode.obj \
- $(SLO)$/wrap_sqlbison.obj \
- $(SLO)$/wrap_sqlflex.obj
-
-SLOFILES = \
- $(EXCEPTIONSFILES)
-
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-$(MISC)$/%.cxx: %.l
- flex -i -8 -PSQLyy -L -o$(MISC)$/sqlflex.cxx sqlflex.l
-
-$(INCCOM)$/sqlbison.hxx : $(YACCTARGET)
-$(EXCEPTIONSFILES) : $(INCCOM)$/sqlbison.hxx
-$(SLO)$/wrap_sqlbison.obj : $(YACCTARGET)
-$(SLO)$/wrap_sqlflex.obj : $(MISC)$/sqlflex.cxx $(INCCOM)$/sqlbison.hxx
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
deleted file mode 100755
index 1f2c577b8d..0000000000
--- a/connectivity/source/parse/sqlbison.y
+++ /dev/null
@@ -1,4828 +0,0 @@
-%{
-//--------------------------------------------------------------------------
-//
-// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-//
-// Copyright 2000, 2010 Oracle and/or its affiliates.
-//
-// OpenOffice.org - a multi-platform office productivity suite
-//
-// This file is part of OpenOffice.org.
-//
-// OpenOffice.org is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License version 3
-// only, as published by the Free Software Foundation.
-//
-// OpenOffice.org is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Lesser General Public License version 3 for more details
-// (a copy is included in the LICENSE file that accompanied this code).
-//
-// You should have received a copy of the GNU Lesser General Public License
-// version 3 along with OpenOffice.org. If not, see
-// <http://www.openoffice.org/license.html>
-// for a copy of the LGPLv3 License.
-//
-//--------------------------------------------------------------------------
-
-#include <vector>
-#include <string.h>
-
-#ifndef _CONNECTIVITY_SQLNODE_HXX
-#include <connectivity/sqlnode.hxx>
-#endif
-#ifndef _CONNECTIVITY_SQLPARSE_HXX
-#include <connectivity/sqlparse.hxx>
-#endif
-#ifndef _CONNECTIVITY_SQLINTERNALNODE_HXX
-#include <internalnode.hxx>
-#endif
-#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
-#include <com/sun/star/lang/Locale.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_
-#include <com/sun/star/sdbc/DataType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UTIL_DATE_HPP_
-#include <com/sun/star/util/Date.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UTIL_DATETIME_HPP_
-#include <com/sun/star/util/DateTime.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UTIL_TIME_HPP_
-#include <com/sun/star/util/Time.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_
-#include <com/sun/star/util/XNumberFormatter.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATS_HPP_
-#include <com/sun/star/util/XNumberFormats.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UTIL_NUMBERFORMAT_HPP_
-#include <com/sun/star/util/NumberFormat.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTYPES_HPP_
-#include <com/sun/star/util/XNumberFormatTypes.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
-#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#ifndef _COM_SUN_STAR_I18N_KPARSETYPE_HPP_
-#include <com/sun/star/i18n/KParseType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_I18N_KPARSETOKENS_HPP_
-#include <com/sun/star/i18n/KParseTokens.hpp>
-#endif
-#ifndef _CONNECTIVITY_SQLSCAN_HXX
-#include "sqlscan.hxx"
-#endif
-#ifndef _OSL_DIAGNOSE_H_
-#include <osl/diagnose.h>
-#endif
-#ifndef _DBHELPER_DBCONVERSION_HXX_
-#include "connectivity/dbconversion.hxx"
-#endif
-#include <rtl/ustrbuf.hxx>
-#include <sal/macros.h>
-
-#if defined __GNUC__
- #pragma GCC system_header
-#elif defined __SUNPRO_CC
-#pragma disable_warn
-#elif defined _MSC_VER
-#pragma warning(push, 1)
-#pragma warning(disable:4273 4701 4706)
-#endif
-
-static ::rtl::OUString aEmptyString;
-
-static connectivity::OSQLInternalNode* newNode(const sal_Char* pNewValue,
- const connectivity::SQLNodeType eNodeType,
- const sal_uInt32 nNodeID = 0)
-{
- return new connectivity::OSQLInternalNode(pNewValue, eNodeType, nNodeID);
-}
-
-static connectivity::OSQLInternalNode* newNode(const ::rtl::OString& _NewValue,
- const connectivity::SQLNodeType eNodeType,
- const sal_uInt32 nNodeID = 0)
-{
- return new connectivity::OSQLInternalNode(_NewValue, eNodeType, nNodeID);
-}
-
-static connectivity::OSQLInternalNode* newNode(const ::rtl::OUString& _NewValue,
- const connectivity::SQLNodeType eNodeType,
- const sal_uInt32 nNodeID = 0)
-{
- return new connectivity::OSQLInternalNode(_NewValue, eNodeType, nNodeID);
-}
-
-
-// yyi ist die interne Nr. der Regel, die gerade reduziert wird.
-// Ueber die Mapping-Tabelle yyrmap wird daraus eine externe Regel-Nr.
-#define SQL_NEW_RULE newNode(aEmptyString, SQL_NODE_RULE, yyr1[yyn])
-#define SQL_NEW_LISTRULE newNode(aEmptyString, SQL_NODE_LISTRULE, yyr1[yyn])
-#define SQL_NEW_COMMALISTRULE newNode(aEmptyString, SQL_NODE_COMMALISTRULE, yyr1[yyn])
-
-
-connectivity::OSQLParser* xxx_pGLOBAL_SQLPARSER;
-
-#define YYERROR_VERBOSE
-
-#define SQLyyerror(s) \
-{ \
- xxx_pGLOBAL_SQLPARSER->error(s); \
-}
-
-using namespace connectivity;
-#define SQLyylex xxx_pGLOBAL_SQLPARSER->SQLlex
-%}
- /* symbolic tokens */
-
-%union {
- connectivity::OSQLParseNode * pParseNode;
-}
-%type <pParseNode> '(' ')' ',' ':' ';' '?' '[' ']' '{' '}' '.' 'K' 'M' 'G' 'T' 'P'
-
-%token <pParseNode> SQL_TOKEN_STRING SQL_TOKEN_ACCESS_DATE SQL_TOKEN_INT SQL_TOKEN_REAL_NUM
-%token <pParseNode> SQL_TOKEN_INTNUM SQL_TOKEN_APPROXNUM SQL_TOKEN_NOT SQL_TOKEN_NAME
-
-
-%nonassoc <pParseNode> SQL_TOKEN_UMINUS
-
-
-
- /* literal keyword tokens */
-
-%token <pParseNode> SQL_TOKEN_ALL SQL_TOKEN_ALTER SQL_TOKEN_AMMSC SQL_TOKEN_ANY SQL_TOKEN_AS SQL_TOKEN_ASC SQL_TOKEN_AT SQL_TOKEN_AUTHORIZATION SQL_TOKEN_AVG
-
-%token <pParseNode> SQL_TOKEN_BETWEEN SQL_TOKEN_BIT SQL_TOKEN_BOTH SQL_TOKEN_BY
-
-%token <pParseNode> SQL_TOKEN_CAST SQL_TOKEN_CHARACTER SQL_TOKEN_CHECK SQL_TOKEN_COLLATE SQL_TOKEN_COMMIT SQL_TOKEN_CONTINUE SQL_TOKEN_CONVERT SQL_TOKEN_COUNT SQL_TOKEN_CREATE SQL_TOKEN_CROSS
-%token <pParseNode> SQL_TOKEN_CURRENT SQL_TOKEN_CURSOR
-
-%token <pParseNode> SQL_TOKEN_DATE SQL_TOKEN_DATEVALUE SQL_TOKEN_DAY SQL_TOKEN_DEC SQL_TOKEN_DECIMAL SQL_TOKEN_DECLARE SQL_TOKEN_DEFAULT SQL_TOKEN_DELETE SQL_TOKEN_DESC
-%token <pParseNode> SQL_TOKEN_DISTINCT SQL_TOKEN_DOUBLE SQL_TOKEN_DROP
-
-%token <pParseNode> SQL_TOKEN_ESCAPE SQL_TOKEN_EXCEPT SQL_TOKEN_EXISTS SQL_TOKEN_FALSE SQL_TOKEN_FETCH SQL_TOKEN_FLOAT SQL_TOKEN_FOR SQL_TOKEN_FOREIGN SQL_TOKEN_FOUND SQL_TOKEN_FROM SQL_TOKEN_FULL
-
-%token <pParseNode> SQL_TOKEN_GRANT SQL_TOKEN_GROUP SQL_TOKEN_HAVING SQL_TOKEN_IN SQL_TOKEN_INDICATOR SQL_TOKEN_INNER SQL_TOKEN_INTEGER SQL_TOKEN_INTO SQL_TOKEN_IS SQL_TOKEN_INTERSECT
-
-%token <pParseNode> SQL_TOKEN_JOIN SQL_TOKEN_KEY SQL_TOKEN_LEADING SQL_TOKEN_LIKE SQL_TOKEN_LOCAL SQL_TOKEN_LOWER
-%token <pParseNode> SQL_TOKEN_MAX SQL_TOKEN_MIN SQL_TOKEN_NATURAL SQL_TOKEN_NCHAR SQL_TOKEN_NULL SQL_TOKEN_NUMERIC
-
-%token <pParseNode> SQL_TOKEN_OCTET_LENGTH SQL_TOKEN_OF SQL_TOKEN_ON SQL_TOKEN_OPTION SQL_TOKEN_ORDER SQL_TOKEN_OUTER
-
-%token <pParseNode> SQL_TOKEN_PRECISION SQL_TOKEN_PRIMARY SQL_TOKEN_PRIVILEGES SQL_TOKEN_PROCEDURE SQL_TOKEN_PUBLIC
-%token <pParseNode> SQL_TOKEN_REAL SQL_TOKEN_REFERENCES SQL_TOKEN_ROLLBACK
-
-%token <pParseNode> SQL_TOKEN_SCHEMA SQL_TOKEN_SELECT SQL_TOKEN_SET SQL_TOKEN_SIZE SQL_TOKEN_SMALLINT SQL_TOKEN_SOME SQL_TOKEN_SQLCODE SQL_TOKEN_SQLERROR SQL_TOKEN_SUM
-
-%token <pParseNode> SQL_TOKEN_TABLE SQL_TOKEN_TIME SQL_TOKEN_TIMESTAMP SQL_TOKEN_TIMEZONE_HOUR SQL_TOKEN_TIMEZONE_MINUTE SQL_TOKEN_TO SQL_TOKEN_TRAILING SQL_TOKEN_TRANSLATE SQL_TOKEN_TRIM SQL_TOKEN_TRUE SQL_TOKEN_UNION
-%token <pParseNode> SQL_TOKEN_UNIQUE SQL_TOKEN_UNKNOWN SQL_TOKEN_UPDATE SQL_TOKEN_UPPER SQL_TOKEN_USAGE SQL_TOKEN_USER SQL_TOKEN_USING SQL_TOKEN_VALUES SQL_TOKEN_VIEW
-%token <pParseNode> SQL_TOKEN_WHERE SQL_TOKEN_WITH SQL_TOKEN_WORK SQL_TOKEN_ZONE
-
-/* ODBC KEYWORDS */
-%token <pParseNode> SQL_TOKEN_CALL SQL_TOKEN_D SQL_TOKEN_FN SQL_TOKEN_T SQL_TOKEN_TS SQL_TOKEN_OJ
-/* string functions */
-%token <pParseNode> SQL_TOKEN_ASCII SQL_TOKEN_BIT_LENGTH SQL_TOKEN_CHAR SQL_TOKEN_CHAR_LENGTH SQL_TOKEN_SQL_TOKEN_INTNUM
-%token <pParseNode> SQL_TOKEN_CONCAT
-%token <pParseNode> SQL_TOKEN_DIFFERENCE SQL_TOKEN_INSERT SQL_TOKEN_LCASE SQL_TOKEN_LEFT SQL_TOKEN_LENGTH SQL_TOKEN_LOCATE
-%token <pParseNode> SQL_TOKEN_LOCATE_2 SQL_TOKEN_LTRIM SQL_TOKEN_POSITION SQL_TOKEN_REPEAT SQL_TOKEN_REPLACE
-%token <pParseNode> SQL_TOKEN_RIGHT SQL_TOKEN_RTRIM SQL_TOKEN_SOUNDEX SQL_TOKEN_SPACE SQL_TOKEN_SUBSTRING SQL_TOKEN_UCASE
-
-/* time and date functions */
-%token <pParseNode> SQL_TOKEN_CURRENT_DATE SQL_TOKEN_CURRENT_TIME SQL_TOKEN_CURRENT_TIMESTAMP SQL_TOKEN_CURDATE SQL_TOKEN_CURTIME
-%token <pParseNode> SQL_TOKEN_DAYNAME SQL_TOKEN_DAYOFMONTH SQL_TOKEN_DAYOFWEEK SQL_TOKEN_DAYOFYEAR SQL_TOKEN_EXTRACT
-%token <pParseNode> SQL_TOKEN_HOUR SQL_TOKEN_MINUTE SQL_TOKEN_MONTH SQL_TOKEN_MONTHNAME SQL_TOKEN_NOW SQL_TOKEN_QUARTER SQL_TOKEN_DATEDIFF
-%token <pParseNode> SQL_TOKEN_SECOND SQL_TOKEN_TIMESTAMPADD SQL_TOKEN_TIMESTAMPDIFF SQL_TOKEN_TIMEVALUE SQL_TOKEN_WEEK SQL_TOKEN_YEAR
-
-/* numeric functions */
-%token <pParseNode> SQL_TOKEN_ABS SQL_TOKEN_ACOS SQL_TOKEN_ASIN SQL_TOKEN_ATAN SQL_TOKEN_ATAN2 SQL_TOKEN_CEILING
-%token <pParseNode> SQL_TOKEN_COS SQL_TOKEN_COT SQL_TOKEN_DEGREES SQL_TOKEN_EXP SQL_TOKEN_FLOOR SQL_TOKEN_LOGF SQL_TOKEN_LOG SQL_TOKEN_LN
-%token <pParseNode> SQL_TOKEN_LOG10 SQL_TOKEN_MOD SQL_TOKEN_PI SQL_TOKEN_POWER SQL_TOKEN_RADIANS SQL_TOKEN_RAND SQL_TOKEN_ROUNDMAGIC
-%token <pParseNode> SQL_TOKEN_ROUND SQL_TOKEN_SIGN SQL_TOKEN_SIN SQL_TOKEN_SQRT SQL_TOKEN_TAN SQL_TOKEN_TRUNCATE
-
-// computational operation
-%token <pParseNode> SQL_TOKEN_EVERY SQL_TOKEN_INTERSECTION SQL_TOKEN_FUSION SQL_TOKEN_COLLECT SQL_TOKEN_VAR_POP SQL_TOKEN_VAR_SAMP
-%token <pParseNode> SQL_TOKEN_STDDEV_SAMP SQL_TOKEN_STDDEV_POP
-
-%token <pParseNode> SQL_TOKEN_RANK SQL_TOKEN_DENSE_RANK SQL_TOKEN_PERCENT_RANK SQL_TOKEN_CUME_DIST SQL_TOKEN_PERCENTILE_CONT SQL_TOKEN_PERCENTILE_DISC SQL_TOKEN_WITHIN SQL_TOKEN_ARRAY_AGG
-%token <pParseNode> SQL_TOKEN_CASE SQL_TOKEN_THEN SQL_TOKEN_END SQL_TOKEN_NULLIF SQL_TOKEN_COALESCE SQL_TOKEN_WHEN SQL_TOKEN_ELSE
-%token <pParseNode> SQL_TOKEN_BEFORE SQL_TOKEN_AFTER SQL_TOKEN_INSTEAD SQL_TOKEN_EACH SQL_TOKEN_REFERENCING SQL_TOKEN_BEGIN SQL_TOKEN_ATOMIC SQL_TOKEN_TRIGGER SQL_TOKEN_ROW SQL_TOKEN_STATEMENT
-%token <pParseNode> SQL_TOKEN_NEW SQL_TOKEN_OLD
-%token <pParseNode> SQL_TOKEN_VALUE SQL_TOKEN_CURRENT_CATALOG SQL_TOKEN_CURRENT_DEFAULT_TRANSFORM_GROUP SQL_TOKEN_CURRENT_PATH SQL_TOKEN_CURRENT_ROLE SQL_TOKEN_CURRENT_SCHEMA SQL_TOKEN_CURRENT_USER
-%token <pParseNode> SQL_TOKEN_SESSION_USER SQL_TOKEN_SYSTEM_USER SQL_TOKEN_VARCHAR SQL_TOKEN_VARBINARY SQL_TOKEN_VARYING SQL_TOKEN_OBJECT SQL_TOKEN_NCLOB SQL_TOKEN_NATIONAL
-%token <pParseNode> SQL_TOKEN_LARGE SQL_TOKEN_CLOB SQL_TOKEN_BLOB SQL_TOKEN_BIGINT SQL_TOKEN_BINARY SQL_TOKEN_WITHOUT SQL_TOKEN_BOOLEAN SQL_TOKEN_INTERVAL
-// window function
-%token <pParseNode> SQL_TOKEN_OVER SQL_TOKEN_ROW_NUMBER SQL_TOKEN_NTILE SQL_TOKEN_LEAD SQL_TOKEN_LAG SQL_TOKEN_RESPECT SQL_TOKEN_IGNORE SQL_TOKEN_NULLS
-%token <pParseNode> SQL_TOKEN_FIRST_VALUE SQL_TOKEN_LAST_VALUE SQL_TOKEN_NTH_VALUE SQL_TOKEN_FIRST SQL_TOKEN_LAST
-%token <pParseNode> SQL_TOKEN_EXCLUDE SQL_TOKEN_OTHERS SQL_TOKEN_TIES SQL_TOKEN_FOLLOWING SQL_TOKEN_UNBOUNDED SQL_TOKEN_PRECEDING SQL_TOKEN_RANGE SQL_TOKEN_ROWS
-%token <pParseNode> SQL_TOKEN_PARTITION SQL_TOKEN_WINDOW SQL_TOKEN_NO
-// LIMIT and OFFSEt
-%token <pParseNode> SQL_TOKEN_LIMIT SQL_TOKEN_OFFSET SQL_TOKEN_NEXT SQL_TOKEN_ONLY
-
- /* operators */
-%left SQL_TOKEN_NAME
-%left <pParseNode> SQL_TOKEN_OR
-%left <pParseNode> SQL_TOKEN_AND
-
-%left <pParseNode> SQL_LESSEQ SQL_GREATEQ SQL_NOTEQUAL SQL_LESS SQL_GREAT SQL_EQUAL /* '<' '>' = <> < > <= >= != */
-%left <pParseNode> '+' '-' SQL_CONCAT
-%left <pParseNode> '*' '/'
-%left SQL_TOKEN_NATURAL SQL_TOKEN_CROSS SQL_TOKEN_FULL SQL_TOKEN_LEFT SQL_TOKEN_RIGHT
-%left ')'
-%right '='
-%right '.'
-%right '('
-
-
-%token <pParseNode> SQL_TOKEN_INVALIDSYMBOL
-
-/*%type <pParseNode> sql_single_statement */
-
-%type <pParseNode> sql /*schema */
-%type <pParseNode> column_def_opt_list column_def_opt table_constraint_def column_commalist
-%type <pParseNode> view_def opt_with_check_option opt_column_commalist privilege_def
-%type <pParseNode> opt_with_grant_option privileges operation_commalist operation
-%type <pParseNode> grantee_commalist grantee opt_order_by_clause ordering_spec_commalist
-%type <pParseNode> ordering_spec opt_asc_desc manipulative_statement commit_statement
-%type <pParseNode> /*delete_statement_positioned*/ delete_statement_searched fetch_statement
-%type <pParseNode> insert_statement values_or_query_spec
-%type <pParseNode> rollback_statement select_statement_into opt_all_distinct
-%type <pParseNode> /*update_statement_positioned*/ assignment_commalist assignment
-%type <pParseNode> update_statement_searched target_commalist target opt_where_clause
-%type <pParseNode> select_statement selection table_exp from_clause table_ref_commalist table_ref
-%type <pParseNode> where_clause opt_group_by_clause column_ref_commalist opt_having_clause
-%type <pParseNode> search_condition predicate comparison_predicate comparison_predicate_part_2 between_predicate between_predicate_part_2
-%type <pParseNode> like_predicate opt_escape test_for_null null_predicate_part_2 in_predicate in_predicate_part_2 character_like_predicate_part_2 other_like_predicate_part_2
-%type <pParseNode> all_or_any_predicate any_all_some existence_test subquery quantified_comparison_predicate_part_2
-%type <pParseNode> scalar_exp_commalist parameter_ref literal parenthesized_boolean_value_expression
-%type <pParseNode> column_ref data_type column cursor parameter range_variable user /*like_check*/
-/* neue Regeln bei OJ */
-%type <pParseNode> derived_column as_clause table_name num_primary term num_value_exp
-%type <pParseNode> value_exp_primary num_value_fct unsigned_value_spec cast_spec set_fct_spec scalar_subquery
-%type <pParseNode> position_exp extract_exp length_exp general_value_spec
-%type <pParseNode> general_set_fct set_fct_type query_exp non_join_query_exp joined_table
-%type <pParseNode> non_join_query_term non_join_query_primary simple_table
-%type <pParseNode> table_value_const_list row_value_constructor row_value_const_list row_value_constructor_elem
-%type <pParseNode> qualified_join value_exp query_term join_type outer_join_type join_condition boolean_term
-%type <pParseNode> boolean_factor truth_value boolean_test boolean_primary named_columns_join join_spec
-%type <pParseNode> cast_operand cast_target factor datetime_value_exp /*interval_value_exp*/ datetime_term datetime_factor
-%type <pParseNode> datetime_primary datetime_value_fct time_zone time_zone_specifier /*interval_term*/ interval_qualifier
-%type <pParseNode> start_field non_second_datetime_field end_field single_datetime_field extract_field datetime_field time_zone_field
-%type <pParseNode> extract_source char_length_exp octet_length_exp bit_length_exp select_sublist string_value_exp
-%type <pParseNode> char_value_exp concatenation char_factor char_primary string_value_fct char_substring_fct fold
-%type <pParseNode> form_conversion char_translation trim_fct trim_operands trim_spec bit_value_fct bit_substring_fct op_column_commalist
-%type <pParseNode> /*bit_concatenation*/ bit_value_exp bit_factor bit_primary collate_clause char_value_fct unique_spec value_exp_commalist in_predicate_value unique_test update_source
-%type <pParseNode> function_arg_commalist3 string_function_3Argument function_arg_commalist4 string_function_4Argument function_arg_commalist2 string_function_1Argument string_function_2Argument
-%type <pParseNode> date_function_0Argument date_function_1Argument function_name12 function_name23 function_name1 function_name2 function_name3 function_name0 numeric_function_0Argument numeric_function_1Argument numeric_function_2Argument
-%type <pParseNode> all query_primary sql_not for_length upper_lower comparison column_val cross_union /*opt_schema_element_list*/
-%type <pParseNode> /*op_authorization op_schema*/ nil_fkt schema_element base_table_def base_table_element base_table_element_commalist
-%type <pParseNode> column_def odbc_fct_spec odbc_call_spec odbc_fct_type op_parameter union_statement
-%type <pParseNode> op_odbc_call_parameter odbc_parameter_commalist odbc_parameter function_args_commalist function_arg
-%type <pParseNode> catalog_name schema_name table_node numeric_function string_function function_name date_function table_primary_as_range_column opt_as
-%type <pParseNode> ordered_set_function inverse_distribution_function hypothetical_set_function hypothetical_set_function_value_expression_list rank_function_type within_group_specification inverse_distribution_function_type array_aggregate_function inverse_distribution_function_argument
-%type <pParseNode> case_expression else_clause result_expression result case_abbreviation case_specification searched_when_clause simple_when_clause searched_case simple_case
-%type <pParseNode> when_operand_list when_operand case_operand
-%type <pParseNode> trigger_definition trigger_name trigger_action_time trigger_event transition_table_or_variable_list triggered_action trigger_column_list triggered_when_clause triggered_SQL_statement SQL_procedure_statement old_transition_variable_name new_transition_variable_name
-%type <pParseNode> op_referencing op_trigger_columnlist op_triggered_action_for opt_row trigger_for SQL_procedure_statement_list transition_table_or_variable old_transition_table_name new_transition_table_name transition_table_name
-%type <pParseNode> searched_when_clause_list simple_when_clause_list predefined_type opt_char_set_spec opt_collate_clause character_string_type national_character_string_type
-%type <pParseNode> binary_string_type numeric_type boolean_type datetime_type interval_type opt_paren_precision paren_char_length opt_paren_char_large_length paren_character_large_object_length
-%type <pParseNode> large_object_length opt_multiplier character_large_object_type national_character_large_object_type binary_large_object_string_type opt_with_or_without_time_zone
-%type <pParseNode> approximate_numeric_type exact_numeric_type opt_paren_precision_scale
-/* window function rules */
-%type <pParseNode> window_function window_function_type ntile_function number_of_tiles lead_or_lag_function lead_or_lag lead_or_lag_extent offset default_expression null_treatment
-%type <pParseNode> first_or_last_value_function first_or_last_value nth_value_function nth_row from_first_or_last window_name_or_specification in_line_window_specification opt_lead_or_lag_function
-%type <pParseNode> opt_null_treatment opt_from_first_or_last simple_value_specification dynamic_parameter_specification window_name window_clause window_definition_list window_definition
-%type <pParseNode> new_window_name window_specification_details existing_window_name window_partition_clause window_partition_column_reference_list window_partition_column_reference window_frame_clause
-%type <pParseNode> window_frame_units window_frame_extent window_frame_start window_frame_preceding window_frame_between window_frame_bound_1 window_frame_bound_2 window_frame_bound window_frame_following window_frame_exclusion
-%type <pParseNode> opt_window_frame_clause opt_window_partition_clause opt_existing_window_name window_specification opt_window_frame_exclusion opt_window_clause opt_offset
-%type <pParseNode> opt_fetch_first_row_count fetch_first_clause offset_row_count fetch_first_row_count first_or_next row_or_rows opt_result_offset_clause result_offset_clause
-/* LIMIT and OFFSET */
-%type <pParseNode> opt_limit_offset_clause limit_offset_clause opt_fetch_first_clause
-%%
-
-/* Parse Tree an OSQLParser zurueckliefern
- * (der Zugriff ueber yyval nach Aufruf des Parsers scheitert,
- *
- */
-sql_single_statement:
- sql
- { xxx_pGLOBAL_SQLPARSER->setParseTree( $1 ); }
- | sql ';'
- { xxx_pGLOBAL_SQLPARSER->setParseTree( $1 ); }
- ;
-
- /* schema definition language */
- /* Note: other ``sql:sal_Unicode() rules appear later in the grammar */
-
-sql:
- manipulative_statement
- | schema_element
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-
-/***
-
-op_authorization:
- {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_AUTHORIZATION user
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-op_schema:
- {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_NAME
- | SQL_TOKEN_NAME '.' SQL_TOKEN_NAME
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- ;
-
-schema:
- SQL_TOKEN_CREATE SQL_TOKEN_SCHEMA op_schema op_authorization opt_schema_element_list
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- }
- ;
-
-opt_schema_element_list:
- {$$ = SQL_NEW_RULE;}
- | schema_glement_list
- ;
-
-schema_element_list:
- schema_element
- {$$ = SQL_NEW_LISTRULE;
- $$->append($1);}
- | schema_element_list schema_element
- {$1->append($2);
- $$ = $1;}
- ;
-*/
-
-schema_element:
- base_table_def
- | view_def
- | privilege_def
- | trigger_definition
- ;
-
-base_table_def:
- SQL_TOKEN_CREATE SQL_TOKEN_TABLE table_node '(' base_table_element_commalist ')'
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($5);
- $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));}
- ;
-
-base_table_element_commalist:
- base_table_element
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | base_table_element_commalist ',' base_table_element
- {$1->append($3);
- $$ = $1;}
- ;
-
-base_table_element:
- column_def
- | table_constraint_def
- ;
-
-column_def:
- column data_type column_def_opt_list
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-
-column_def_opt_list:
- /* empty */ {$$ = SQL_NEW_LISTRULE;}
- | column_def_opt_list column_def_opt
- {$1->append($2);
- $$ = $1;}
- ;
-
-nil_fkt:
- datetime_value_fct
- ;
-unique_spec:
- SQL_TOKEN_UNIQUE
- | SQL_TOKEN_PRIMARY SQL_TOKEN_KEY
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-column_def_opt:
- SQL_TOKEN_NOT SQL_TOKEN_NULL
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- | unique_spec
- | SQL_TOKEN_DEFAULT literal
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- | SQL_TOKEN_DEFAULT SQL_TOKEN_NULL
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- | SQL_TOKEN_DEFAULT SQL_TOKEN_USER
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- | SQL_TOKEN_DEFAULT nil_fkt
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_CHECK
- | SQL_TOKEN_CHECK '(' search_condition ')'
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));}
- | SQL_TOKEN_REFERENCES table_node
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- | SQL_TOKEN_REFERENCES table_node '(' column_commalist ')'
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($4);
- $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));}
- ;
-
-table_constraint_def:
- unique_spec '(' column_commalist ')'
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));}
- | SQL_TOKEN_FOREIGN SQL_TOKEN_KEY '(' column_commalist ')' SQL_TOKEN_REFERENCES table_node
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($4);
- $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
- $$->append($6);
- $$->append($7);}
- | SQL_TOKEN_FOREIGN SQL_TOKEN_KEY '(' column_commalist ')' SQL_TOKEN_REFERENCES table_node '(' column_commalist ')'
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($4);
- $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
- $$->append($6);
- $$->append($7);
- $$->append($8 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($9);
- $$->append($10 = newNode(")", SQL_NODE_PUNCTUATION));}
- | SQL_TOKEN_CHECK '(' search_condition ')'
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));}
- ;
-op_column_commalist:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | '(' column_commalist ')'
- {$$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-column_commalist:
- column_commalist ',' column
- {$1->append($3);
- $$ = $1;}
- | column
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- ;
-
-view_def:
- SQL_TOKEN_CREATE SQL_TOKEN_VIEW table_node opt_column_commalist SQL_TOKEN_AS select_statement opt_with_check_option
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6);
- $$->append($7);}
- ;
-
-opt_with_check_option:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_WITH SQL_TOKEN_CHECK SQL_TOKEN_OPTION
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);}
- ;
-
-opt_column_commalist:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | '(' column_commalist ')'
- {$$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));}
- ;
-
-privilege_def:
- SQL_TOKEN_GRANT privileges SQL_TOKEN_ON table_node SQL_TOKEN_TO grantee_commalist
- opt_with_grant_option
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6);
- $$->append($7);}
- ;
-
-opt_with_grant_option:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_WITH SQL_TOKEN_GRANT SQL_TOKEN_OPTION
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);}
- ;
-
-privileges:
- SQL_TOKEN_ALL SQL_TOKEN_PRIVILEGES
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- | operation_commalist
- ;
-
-operation_commalist:
- operation
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | operation_commalist ',' operation
- {$1->append($3);
- $$ = $1;}
- ;
-
-operation:
- SQL_TOKEN_SELECT
- | SQL_TOKEN_INSERT opt_column_commalist
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- | SQL_TOKEN_DELETE
- | SQL_TOKEN_UPDATE opt_column_commalist
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- | SQL_TOKEN_REFERENCES opt_column_commalist
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- | SQL_TOKEN_USAGE
- ;
-
-
-grantee_commalist:
- grantee
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | grantee_commalist ',' grantee
- {$1->append($3);
- $$ = $1;}
- ;
-
-grantee:
- SQL_TOKEN_PUBLIC
- | user
- ;
-
- /* module language */
-
-opt_order_by_clause:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_ORDER SQL_TOKEN_BY ordering_spec_commalist
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);}
- ;
-
-ordering_spec_commalist:
- ordering_spec
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | ordering_spec_commalist ',' ordering_spec
- {$1->append($3);
- $$ = $1;}
- ;
-
-ordering_spec:
-/* SQL_TOKEN_INTNUM opt_asc_desc
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
-*/
- predicate opt_asc_desc
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
-
- | row_value_constructor_elem opt_asc_desc
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- ;
-
-opt_asc_desc:
- {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_ASC
- | SQL_TOKEN_DESC
- ;
-
-
-/***
-manipulative_statement_list:
- manipulative_statement
- {$$ = SQL_NEW_LISTRULE;
- $$->append($1);}
- | manipulative_statement_list manipulative_statement
- {$1->append($2);
- $$ = $1;}
- ;
-***/
-
-sql_not:
- {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_NOT
- ;
-
-/* manipulative statements */
-
-manipulative_statement:
- commit_statement
-/* | delete_statement_positioned*/
- | delete_statement_searched
- | fetch_statement
- | insert_statement
- | rollback_statement
- | select_statement_into
-/* | update_statement_positioned*/
- | update_statement_searched
- | union_statement
- | '{' odbc_call_spec '}'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("{", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode("}", SQL_NODE_PUNCTUATION));
- }
- ;
-
-union_statement:
- select_statement
- | union_statement SQL_TOKEN_UNION all select_statement
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-commit_statement:
- SQL_TOKEN_COMMIT SQL_TOKEN_WORK
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- ;
-/*
-delete_statement_positioned:
- SQL_TOKEN_DELETE SQL_TOKEN_FROM table_node SQL_TOKEN_WHERE SQL_TOKEN_CURRENT SQL_TOKEN_OF cursor
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6);
- $$->append($7);}
- ;
-*/
-delete_statement_searched:
- SQL_TOKEN_DELETE SQL_TOKEN_FROM table_node opt_where_clause
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);}
- ;
-
-fetch_statement:
- SQL_TOKEN_FETCH cursor SQL_TOKEN_INTO target_commalist
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);}
- ;
-
-insert_statement:
- SQL_TOKEN_INSERT SQL_TOKEN_INTO table_node opt_column_commalist values_or_query_spec
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);}
- ;
-values_or_query_spec:
- SQL_TOKEN_VALUES '(' table_value_const_list ')'
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-
-table_value_const_list:
- row_value_constructor
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | table_value_const_list ',' row_value_constructor
- {$1->append($3);
- $$ = $1;}
- ;
-row_value_const_list:
- row_value_constructor_elem
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | row_value_const_list ',' row_value_constructor_elem
- {$1->append($3);
- $$ = $1;}
- ;
-row_value_constructor:
- row_value_constructor_elem
-/* | '(' row_value_const_list ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- */
- ;
-row_value_constructor_elem:
- value_exp /*[^')']*/
- | SQL_TOKEN_DEFAULT
- ;
-
-
-rollback_statement:
- SQL_TOKEN_ROLLBACK SQL_TOKEN_WORK
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- ;
-
-
- /* INTO target_commalist herausgenommen */
-select_statement_into:
- SQL_TOKEN_SELECT opt_all_distinct selection SQL_TOKEN_INTO target_commalist table_exp
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6); }
- ;
-
-opt_all_distinct:
- {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_ALL
- | SQL_TOKEN_DISTINCT
-
- ;
-/*
-update_statement_positioned:
- SQL_TOKEN_UPDATE table_node SQL_TOKEN_SET assignment_commalist
- SQL_TOKEN_WHERE SQL_TOKEN_CURRENT SQL_TOKEN_OF cursor
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6);
- $$->append($7);
- $$->append($8);}
- ;
-*/
-assignment_commalist:
- assignment
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | assignment_commalist ',' assignment
- {$1->append($3);
- $$ = $1;}
- ;
-
-assignment:
- column SQL_EQUAL update_source
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);}
- ;
-update_source:
- value_exp
- | SQL_TOKEN_DEFAULT
- ;
-update_statement_searched:
- SQL_TOKEN_UPDATE table_node SQL_TOKEN_SET assignment_commalist opt_where_clause
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);}
- ;
-
-target_commalist:
- target
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | target_commalist ',' target
- {$1->append($3);
- $$ = $1;}
- ;
-
-target:
- parameter_ref
- ;
-
-opt_where_clause:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | where_clause
- ;
-
- /* query expressions */
-
-query_term:
- non_join_query_term
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-/* SELECT STATEMENT */
-select_statement:
- SQL_TOKEN_SELECT opt_all_distinct selection table_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-
-selection:
- '*'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("*", SQL_NODE_PUNCTUATION));
- }
- | scalar_exp_commalist
- ;
-opt_result_offset_clause:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | result_offset_clause
- ;
-result_offset_clause:
- SQL_TOKEN_OFFSET offset_row_count row_or_rows
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-opt_fetch_first_row_count:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | fetch_first_row_count
- ;
-first_or_next:
- SQL_TOKEN_FIRST
- | SQL_TOKEN_NEXT
- ;
-row_or_rows:
- SQL_TOKEN_ROW
- | SQL_TOKEN_ROWS
- ;
-opt_fetch_first_clause:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | fetch_first_clause
- ;
-fetch_first_clause:
- SQL_TOKEN_FETCH first_or_next opt_fetch_first_row_count row_or_rows SQL_TOKEN_ONLY
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- }
- ;
-offset_row_count:
- literal
- ;
-fetch_first_row_count:
- literal
- ;
-
-opt_limit_offset_clause:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | limit_offset_clause
- ;
-opt_offset:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_OFFSET SQL_TOKEN_INTNUM
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-limit_offset_clause:
- SQL_TOKEN_LIMIT SQL_TOKEN_INTNUM opt_offset
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-table_exp:
- from_clause opt_where_clause opt_group_by_clause opt_having_clause opt_window_clause opt_order_by_clause opt_limit_offset_clause opt_result_offset_clause opt_fetch_first_clause
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6);
- $$->append($7);
- $$->append($8);
- $$->append($9);
- }
- ;
-
-from_clause:
- SQL_TOKEN_FROM table_ref_commalist
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- ;
-
-table_ref_commalist:
-
- table_ref
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | table_ref_commalist ',' table_ref
- {$1->append($3);
- $$ = $1;}
- ;
-
-opt_as:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_AS
- ;
-opt_row:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_ROW
- ;
-table_primary_as_range_column:
- {$$ = SQL_NEW_RULE;}
- | opt_as SQL_TOKEN_NAME op_column_commalist
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-table_ref:
- table_node table_primary_as_range_column
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | subquery range_variable op_column_commalist
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | joined_table
- | '{' SQL_TOKEN_OJ joined_table '}'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("{", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3);
- $$->append($4 = newNode("}", SQL_NODE_PUNCTUATION));
- }
- | '(' joined_table ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-where_clause:
- SQL_TOKEN_WHERE search_condition
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- ;
-
-opt_group_by_clause:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_GROUP SQL_TOKEN_BY column_ref_commalist
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);}
- ;
-
-column_ref_commalist:
- column_ref
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | set_fct_spec
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | column_ref_commalist ',' column_ref
- {$1->append($3);
- $$ = $1;}
- | column_ref_commalist ',' set_fct_spec
- {$1->append($3);
- $$ = $1;}
- ;
-
-opt_having_clause:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_HAVING search_condition
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- ;
-
- /* search conditions */
-truth_value:
- SQL_TOKEN_TRUE
- | SQL_TOKEN_FALSE
- | SQL_TOKEN_UNKNOWN
- | SQL_TOKEN_NULL
- ;
-boolean_primary:
- predicate
- | '(' search_condition ')'
- { // boolean_primary: rule 2
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | row_value_constructor_elem /*[^')' ',']*/
- {
- if(xxx_pGLOBAL_SQLPARSER->inPredicateCheck())// boolean_primary: rule 3
- {
- $$ = SQL_NEW_RULE;
- sal_Int16 nErg = xxx_pGLOBAL_SQLPARSER->buildComparsionRule($$,$1);
- if(nErg == 1)
- {
- OSQLParseNode* pTemp = $$;
- $$ = pTemp->removeAt((sal_uInt32)0);
- delete pTemp;
- }
- else
- {
- delete $$;
- if(nErg)
- YYERROR;
- else
- YYABORT;
- }
- }
- else
- YYERROR;
- }
- ;
-parenthesized_boolean_value_expression:
- '(' search_condition ')'
- { // boolean_primary: rule 2
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-boolean_test:
- boolean_primary
- | boolean_primary SQL_TOKEN_IS sql_not truth_value
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-boolean_factor:
- boolean_test
- | SQL_TOKEN_NOT boolean_test
- { // boolean_factor: rule 1
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-boolean_term:
- boolean_factor
- | boolean_term SQL_TOKEN_AND boolean_factor
- {
- $$ = SQL_NEW_RULE; // boolean_term: rule 1
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-search_condition:
- boolean_term
- | search_condition SQL_TOKEN_OR boolean_term
- {
- $$ = SQL_NEW_RULE; // search_condition
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-predicate:
- comparison_predicate
- | between_predicate
- | all_or_any_predicate
- | existence_test
- | unique_test
- | test_for_null
- | in_predicate
- | like_predicate
- ;
-comparison_predicate_part_2:
- comparison row_value_constructor
- {
- $$ = SQL_NEW_RULE; // comparison_predicate: rule 1
- $$->append($1);
- $$->append($2);
- }
-comparison_predicate:
- row_value_constructor comparison row_value_constructor
- {
- $$ = SQL_NEW_RULE; // comparison_predicate: rule 1
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | comparison row_value_constructor
- {
- if(xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // comparison_predicate: rule 2
- {
- $$ = SQL_NEW_RULE;
- sal_Int16 nErg = xxx_pGLOBAL_SQLPARSER->buildPredicateRule($$,$2,$1);
- if(nErg == 1)
- {
- OSQLParseNode* pTemp = $$;
- $$ = pTemp->removeAt((sal_uInt32)0);
- delete pTemp;
- }
- else
- {
- delete $$;
- YYABORT;
- }
- }
- else
- {
- YYERROR;
- }
- }
- ;
-comparison:
- SQL_LESS
- | SQL_NOTEQUAL
- | SQL_EQUAL
- | SQL_GREAT
- | SQL_LESSEQ
- | SQL_GREATEQ
- ;
-between_predicate_part_2:
- sql_not SQL_TOKEN_BETWEEN row_value_constructor SQL_TOKEN_AND row_value_constructor
- {
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // between_predicate: rule 2
- {
- $$ = SQL_NEW_RULE;
-
- sal_Int16 nErg = xxx_pGLOBAL_SQLPARSER->buildPredicateRule($$,$3,$2,$5);
- if(nErg == 1)
- {
- OSQLParseNode* pTemp = $$;
- $$ = pTemp->removeAt((sal_uInt32)0);
- OSQLParseNode* pColumnRef = $$->removeAt((sal_uInt32)0);
- $$->insert(0,$1);
- OSQLParseNode* pBetween_predicate = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::between_predicate));
- pBetween_predicate->append(pColumnRef);
- pBetween_predicate->append($$);
- $$ = pBetween_predicate;
-
- delete pTemp;
- delete $4;
- }
- else
- {
- delete $$;
- YYABORT;
- }
- }
- else
- {
- $$ = SQL_NEW_RULE; // between_predicate: rule 1
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- }
- }
-between_predicate:
- row_value_constructor between_predicate_part_2
- {
- $$ = SQL_NEW_RULE; // between_predicate: rule 1
- $$->append($1);
- $$->append($2);
- }
- | between_predicate_part_2
- ;
-character_like_predicate_part_2:
- sql_not SQL_TOKEN_LIKE string_value_exp opt_escape
- {
- $$ = SQL_NEW_RULE; // like_predicate: rule 1
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-other_like_predicate_part_2:
- sql_not SQL_TOKEN_LIKE value_exp_primary opt_escape
- {
- $$ = SQL_NEW_RULE; // like_predicate: rule 1
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-like_predicate:
- row_value_constructor character_like_predicate_part_2
- {
- $$ = SQL_NEW_RULE; // like_predicate: rule 1
- $$->append($1);
- $$->append($2);
- }
- | row_value_constructor other_like_predicate_part_2
- {
- $$ = SQL_NEW_RULE; // like_predicate: rule 3
- $$->append($1);
- $$->append($2);
- }
- | character_like_predicate_part_2
- {
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // like_predicate: rule 5
- {
- OSQLParseNode* pColumnRef = newNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::column_ref));
- pColumnRef->append(newNode(xxx_pGLOBAL_SQLPARSER->getFieldName(),SQL_NODE_NAME));
-
- $$ = SQL_NEW_RULE;
- $$->append(pColumnRef);
- $$->append($1);
- OSQLParseNode* p2nd = $1->removeAt(2);
- OSQLParseNode* p3rd = $1->removeAt(2);
- if ( !xxx_pGLOBAL_SQLPARSER->buildLikeRule($1,p2nd,p3rd) )
- {
- delete $$;
- YYABORT;
- }
- $1->append(p3rd);
- }
- else
- YYERROR;
- }
- | other_like_predicate_part_2
- {
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // like_predicate: rule 6
- {
- OSQLParseNode* pColumnRef = newNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::column_ref));
- pColumnRef->append(newNode(xxx_pGLOBAL_SQLPARSER->getFieldName(),SQL_NODE_NAME));
-
- $$ = SQL_NEW_RULE;
- $$->append(pColumnRef);
- $$->append($1);
- OSQLParseNode* p2nd = $1->removeAt(2);
- OSQLParseNode* p3rd = $1->removeAt(2);
- if ( !xxx_pGLOBAL_SQLPARSER->buildLikeRule($1,p2nd,p3rd) )
- {
- delete $$;
- YYABORT;
- }
- $1->append(p3rd);
- }
- else
- YYERROR;
- }
- ;
-
-opt_escape:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_ESCAPE string_value_exp
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- | '{' SQL_TOKEN_ESCAPE SQL_TOKEN_STRING '}'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("{", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3);
- $$->append($4 = newNode("}", SQL_NODE_PUNCTUATION));
- }
- ;
-
-null_predicate_part_2:
- SQL_TOKEN_IS sql_not SQL_TOKEN_NULL
- {
- $$ = SQL_NEW_RULE; // test_for_null: rule 1
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-test_for_null:
- row_value_constructor null_predicate_part_2
- {
- $$ = SQL_NEW_RULE; // test_for_null: rule 1
- $$->append($1);
- $$->append($2);
- }
- | null_predicate_part_2
- {
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())// test_for_null: rule 2
- {
- OSQLParseNode* pColumnRef = newNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::column_ref));
- pColumnRef->append(newNode(xxx_pGLOBAL_SQLPARSER->getFieldName(),SQL_NODE_NAME));
-
- $$ = SQL_NEW_RULE;
- $$->append(pColumnRef);
- $$->append($1);
- }
- else
- YYERROR;
- }
- ;
-in_predicate_value:
- subquery
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | '(' value_exp_commalist ')'
- {$$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-in_predicate_part_2:
- sql_not SQL_TOKEN_IN in_predicate_value
- {
- $$ = SQL_NEW_RULE;// in_predicate: rule 1
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-in_predicate:
- row_value_constructor in_predicate_part_2
- {
- $$ = SQL_NEW_RULE;// in_predicate: rule 1
- $$->append($1);
- $$->append($2);
- }
- | in_predicate_part_2
- {
- if ( xxx_pGLOBAL_SQLPARSER->inPredicateCheck() )// in_predicate: rule 2
- {
- OSQLParseNode* pColumnRef = newNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::column_ref));
- pColumnRef->append(newNode(xxx_pGLOBAL_SQLPARSER->getFieldName(),SQL_NODE_NAME));
-
- $$ = SQL_NEW_RULE;
- $$->append(pColumnRef);
- $$->append($1);
- }
- else
- YYERROR;
- }
- ;
-quantified_comparison_predicate_part_2:
- comparison any_all_some subquery
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-all_or_any_predicate:
- row_value_constructor quantified_comparison_predicate_part_2
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | quantified_comparison_predicate_part_2
- {
- if(xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
- {
- OSQLParseNode* pColumnRef = newNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::column_ref));
- pColumnRef->append(newNode(xxx_pGLOBAL_SQLPARSER->getFieldName(),SQL_NODE_NAME));
-
- $$ = SQL_NEW_RULE;
- $$->append(pColumnRef);
- $$->append($1);
- }
- else
- YYERROR;
- }
- ;
-
-any_all_some:
- SQL_TOKEN_ANY
- | SQL_TOKEN_ALL
- | SQL_TOKEN_SOME
- ;
-
-existence_test:
- SQL_TOKEN_EXISTS subquery
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- ;
-unique_test:
- SQL_TOKEN_UNIQUE subquery
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);}
- ;
-subquery:
- '(' query_exp ')'
- {$$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));}
- ;
-
- /* scalar expressions */
-scalar_exp_commalist:
- select_sublist
- {
- $$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);
- }
- | scalar_exp_commalist ',' select_sublist
- {
- $1->append($3);
- $$ = $1;
- }
- ;
-select_sublist:
-/* table_node '.' '*'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($3 = newNode("*", SQL_NODE_PUNCTUATION));
- }
-*/
- derived_column
-
- ;
-
-parameter_ref:
- parameter
- ;
-
-/*
-op_like:
- '*'
- {
- $$ = newNode("*", SQL_NODE_PUNCTUATION);
- }
- | '?'
- {
- $$ = newNode("?", SQL_NODE_PUNCTUATION);
- }
- | op_like '*'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("*", SQL_NODE_PUNCTUATION));
- xxx_pGLOBAL_SQLPARSER->reduceLiteral($$, sal_False);
- }
- | op_like '?'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("?", SQL_NODE_PUNCTUATION));
- xxx_pGLOBAL_SQLPARSER->reduceLiteral($$, sal_False);
- }
- ;
-*/
-
-literal:
-/* SQL_TOKEN_STRING
- | */SQL_TOKEN_INT
- | SQL_TOKEN_REAL_NUM
- | SQL_TOKEN_INTNUM
- | SQL_TOKEN_APPROXNUM
- | SQL_TOKEN_ACCESS_DATE
-/* rules for predicate check */
- | literal SQL_TOKEN_STRING
- {
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- xxx_pGLOBAL_SQLPARSER->reduceLiteral($$, sal_True);
- }
- else
- YYERROR;
- }
- | literal SQL_TOKEN_INT
- {
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- xxx_pGLOBAL_SQLPARSER->reduceLiteral($$, sal_True);
- }
- else
- YYERROR;
- }
- | literal SQL_TOKEN_REAL_NUM
- {
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- xxx_pGLOBAL_SQLPARSER->reduceLiteral($$, sal_True);
- }
- else
- YYERROR;
- }
- | literal SQL_TOKEN_APPROXNUM
- {
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- xxx_pGLOBAL_SQLPARSER->reduceLiteral($$, sal_True);
- }
- else
- YYERROR;
- }
- ;
-
- /* miscellaneous */
-as_clause:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_AS column
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | column
- ;
-position_exp:
- SQL_TOKEN_POSITION '(' value_exp SQL_TOKEN_IN value_exp ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | SQL_TOKEN_POSITION '(' value_exp_commalist ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-num_value_fct:
- position_exp
- | extract_exp
- | length_exp
- ;
-char_length_exp:
- SQL_TOKEN_CHAR_LENGTH '(' value_exp ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | SQL_TOKEN_SQL_TOKEN_INTNUM '(' value_exp ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
-
- ;
-octet_length_exp:
- SQL_TOKEN_OCTET_LENGTH '(' value_exp ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-bit_length_exp:
- SQL_TOKEN_BIT_LENGTH '(' value_exp ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-length_exp:
- char_length_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | octet_length_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | bit_length_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-datetime_field:
- non_second_datetime_field
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | SQL_TOKEN_SECOND
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-extract_field:
- time_zone_field
- | datetime_field
- | value_exp
- ;
-time_zone_field:
- SQL_TOKEN_TIMEZONE_HOUR
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | SQL_TOKEN_TIMEZONE_MINUTE
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-extract_source:
- datetime_value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
-/* | interval_value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- } */
- ;
-extract_exp:
- SQL_TOKEN_EXTRACT '(' extract_field SQL_TOKEN_FROM value_exp ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-unsigned_value_spec:
- general_value_spec
- | literal
- ;
-general_value_spec:
- parameter
- | SQL_TOKEN_USER
- /* | SQL_TOKEN_NULL*/
- | SQL_TOKEN_FALSE
- | SQL_TOKEN_TRUE
- | SQL_TOKEN_VALUE
- | SQL_TOKEN_CURRENT_CATALOG
- | SQL_TOKEN_CURRENT_DEFAULT_TRANSFORM_GROUP
- | SQL_TOKEN_CURRENT_PATH
- | SQL_TOKEN_CURRENT_ROLE
- | SQL_TOKEN_CURRENT_SCHEMA
- | SQL_TOKEN_CURRENT_USER
- | SQL_TOKEN_SESSION_USER
- | SQL_TOKEN_SYSTEM_USER
- ;
-set_fct_spec:
- general_set_fct
- | '{' odbc_fct_spec '}'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("{", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode("}", SQL_NODE_PUNCTUATION));
- }
- | function_name '(' ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | function_name0 '(' ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | function_name1 '(' function_arg ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | function_name2 '(' function_arg_commalist2 ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | function_name3 '(' function_arg_commalist3 ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | string_function_4Argument '(' function_arg_commalist4 ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | function_name '(' function_args_commalist ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | function_name12 '(' function_args_commalist ')'
- {
- if ( $3->count() == 1 || $3->count() == 2 )
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- else
- YYERROR;
- }
- | function_name23 '(' function_args_commalist ')'
- {
- if ( $3->count() == 2 || $3->count() == 3)
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- else
- YYERROR;
- }
- ;
-function_name0:
- date_function_0Argument
- | numeric_function_0Argument
- ;
-function_name1:
- string_function_1Argument
- | date_function_1Argument
- | numeric_function_1Argument
- ;
-function_name2:
- string_function_2Argument
- | numeric_function_2Argument
- ;
-function_name12:
- SQL_TOKEN_ROUND
- | SQL_TOKEN_WEEK
- | SQL_TOKEN_LOGF
- | SQL_TOKEN_LOG
- ;
-function_name23:
- SQL_TOKEN_LOCATE
- | SQL_TOKEN_DATEDIFF
- ;
-function_name3:
- string_function_3Argument
- ;
-function_name:
- string_function
- | date_function
- | numeric_function
- | SQL_TOKEN_NAME
- ;
-string_function_1Argument:
- SQL_TOKEN_LENGTH
- | SQL_TOKEN_ASCII
- | SQL_TOKEN_LCASE
- | SQL_TOKEN_LTRIM
- | SQL_TOKEN_RTRIM
- | SQL_TOKEN_SPACE
- | SQL_TOKEN_UCASE
- ;
-
-string_function_2Argument:
- SQL_TOKEN_REPEAT
- | SQL_TOKEN_LEFT
- | SQL_TOKEN_RIGHT
- ;
-string_function_3Argument:
- SQL_TOKEN_REPLACE
- ;
-string_function_4Argument:
- SQL_TOKEN_INSERT
- ;
-
-string_function:
- SQL_TOKEN_CHAR
- | SQL_TOKEN_CONCAT
- | SQL_TOKEN_DIFFERENCE
- | SQL_TOKEN_LOCATE_2
- | SQL_TOKEN_SOUNDEX
- ;
-date_function_0Argument:
- SQL_TOKEN_CURDATE
- | SQL_TOKEN_CURTIME
- | SQL_TOKEN_NOW
- ;
-date_function_1Argument:
- SQL_TOKEN_DAYOFWEEK
- | SQL_TOKEN_DAYOFMONTH
- | SQL_TOKEN_DAYOFYEAR
- | SQL_TOKEN_MONTH
- | SQL_TOKEN_DAYNAME
- | SQL_TOKEN_MONTHNAME
- | SQL_TOKEN_QUARTER
- | SQL_TOKEN_HOUR
- | SQL_TOKEN_MINUTE
- | SQL_TOKEN_SECOND
- | SQL_TOKEN_YEAR
- | SQL_TOKEN_DAY
- | SQL_TOKEN_TIMEVALUE
- | SQL_TOKEN_DATEVALUE
- ;
-
-date_function:
- SQL_TOKEN_TIMESTAMPADD
- | SQL_TOKEN_TIMESTAMPDIFF
- ;
-numeric_function_0Argument:
- SQL_TOKEN_PI
- ;
-numeric_function_1Argument:
- SQL_TOKEN_ABS
- | SQL_TOKEN_ACOS
- | SQL_TOKEN_ASIN
- | SQL_TOKEN_ATAN
- | SQL_TOKEN_CEILING
- | SQL_TOKEN_COS
- | SQL_TOKEN_COT
- | SQL_TOKEN_DEGREES
- | SQL_TOKEN_FLOOR
- | SQL_TOKEN_SIGN
- | SQL_TOKEN_SIN
- | SQL_TOKEN_SQRT
- | SQL_TOKEN_TAN
- | SQL_TOKEN_EXP
- | SQL_TOKEN_LOG10
- | SQL_TOKEN_LN
- | SQL_TOKEN_RADIANS
- | SQL_TOKEN_ROUNDMAGIC
- ;
-numeric_function_2Argument:
- SQL_TOKEN_ATAN2
- | SQL_TOKEN_MOD
- | SQL_TOKEN_POWER
- ;
-numeric_function:
- SQL_TOKEN_RAND
- | SQL_TOKEN_TRUNCATE
- ;
-
-window_function:
- window_function_type SQL_TOKEN_OVER window_name_or_specification
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-window_function_type :
- rank_function_type '(' ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | SQL_TOKEN_ROW_NUMBER '(' ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | general_set_fct
- | ntile_function
- | lead_or_lag_function
- | first_or_last_value_function
- | nth_value_function
-;
-ntile_function :
- SQL_TOKEN_NTILE '(' number_of_tiles ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-dynamic_parameter_specification:
- parameter
- ;
-simple_value_specification:
- literal
- ;
-number_of_tiles :
- simple_value_specification
- | dynamic_parameter_specification
- ;
-opt_lead_or_lag_function:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | ',' offset
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode(",", SQL_NODE_PUNCTUATION));
- $$->append($2);
- }
- | ',' offset ',' default_expression
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode(",", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(",", SQL_NODE_PUNCTUATION));
- $$->append($4);
- }
- ;
-opt_null_treatment:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | null_treatment
- ;
-
-lead_or_lag_function:
- lead_or_lag '(' lead_or_lag_extent opt_lead_or_lag_function ')' opt_null_treatment
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4);
- $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
- $$->append($6);
- }
- ;
-lead_or_lag:
- SQL_TOKEN_LEAD
- | SQL_TOKEN_LAG
- ;
-lead_or_lag_extent:
- value_exp
- ;
-offset:
- SQL_TOKEN_INTNUM
- ;
-default_expression:
- value_exp
- ;
-null_treatment:
- SQL_TOKEN_RESPECT SQL_TOKEN_NULLS
- | SQL_TOKEN_IGNORE SQL_TOKEN_NULLS
- ;
-first_or_last_value_function:
- first_or_last_value '(' value_exp ')' opt_null_treatment
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- $$->append($5);
- }
- ;
-first_or_last_value :
- SQL_TOKEN_FIRST_VALUE
- | SQL_TOKEN_LAST_VALUE
- ;
-opt_from_first_or_last:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | from_first_or_last
- ;
-nth_value_function:
- SQL_TOKEN_NTH_VALUE '(' value_exp ',' nth_row ')' opt_from_first_or_last opt_null_treatment
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(",", SQL_NODE_PUNCTUATION));
- $$->append($5);
- $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));
- $$->append($7);
- $$->append($8);
- }
- ;
-nth_row:
- simple_value_specification
- | dynamic_parameter_specification
- ;
-from_first_or_last:
- SQL_TOKEN_FROM SQL_TOKEN_FIRST
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_FROM SQL_TOKEN_LAST
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-window_name:
- SQL_TOKEN_NAME
- ;
-window_name_or_specification:
- window_name
- | in_line_window_specification
- ;
-in_line_window_specification:
- window_specification
- ;
-opt_window_clause:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | window_clause
- ;
-window_clause:
- SQL_TOKEN_WINDOW window_definition_list
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-window_definition_list:
- window_definition_list ',' window_definition
- {$1->append($3);
- $$ = $1;}
- | window_definition
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- ;
-window_definition:
- new_window_name SQL_TOKEN_AS window_specification
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-new_window_name:
- window_name
- ;
-window_specification:
- '(' window_specification_details ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-opt_existing_window_name:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | existing_window_name
- ;
-opt_window_partition_clause:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | window_partition_clause
- ;
-opt_window_frame_clause:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | window_frame_clause
- ;
-window_specification_details:
- opt_existing_window_name
- opt_window_partition_clause
- opt_order_by_clause
- opt_window_frame_clause
- ;
-existing_window_name:
- window_name
- ;
-window_partition_clause:
- SQL_TOKEN_PARTITION SQL_TOKEN_BY window_partition_column_reference_list
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-window_partition_column_reference_list:
- window_partition_column_reference_list ',' window_partition_column_reference
- {$1->append($3);
- $$ = $1;}
- | window_partition_column_reference
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- ;
-window_partition_column_reference:
- column_ref opt_collate_clause
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-opt_window_frame_exclusion:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | window_frame_exclusion
- ;
-window_frame_clause:
- window_frame_units window_frame_extent opt_window_frame_exclusion
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-window_frame_units:
- SQL_TOKEN_ROWS
- | SQL_TOKEN_RANGE
- ;
-window_frame_extent:
- window_frame_start
- | window_frame_between
- ;
-window_frame_start:
- SQL_TOKEN_UNBOUNDED SQL_TOKEN_PRECEDING
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | window_frame_preceding
- | SQL_TOKEN_CURRENT SQL_TOKEN_ROW
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-window_frame_preceding:
- unsigned_value_spec SQL_TOKEN_PRECEDING
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-window_frame_between:
- SQL_TOKEN_BETWEEN window_frame_bound_1 SQL_TOKEN_AND window_frame_bound_2
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-window_frame_bound_1:
- window_frame_bound
- ;
-window_frame_bound_2:
- window_frame_bound
- ;
-window_frame_bound:
- window_frame_start
- | SQL_TOKEN_UNBOUNDED SQL_TOKEN_FOLLOWING
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | window_frame_following
- ;
-window_frame_following:
- unsigned_value_spec SQL_TOKEN_FOLLOWING
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-window_frame_exclusion:
- SQL_TOKEN_EXCLUDE SQL_TOKEN_CURRENT SQL_TOKEN_ROW
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | SQL_TOKEN_EXCLUDE SQL_TOKEN_GROUP
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_EXCLUDE SQL_TOKEN_TIES
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_EXCLUDE SQL_TOKEN_NO SQL_TOKEN_OTHERS
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-op_parameter:
- {$$ = SQL_NEW_RULE;}
- | '?' SQL_EQUAL
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("?", SQL_NODE_PUNCTUATION));
- $$->append($2);
- }
- ;
-odbc_call_spec:
- op_parameter SQL_TOKEN_CALL table_node op_odbc_call_parameter
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-
-op_odbc_call_parameter:
- {$$ = SQL_NEW_RULE;}
- | '(' odbc_parameter_commalist ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-
-odbc_parameter_commalist:
- odbc_parameter
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | odbc_parameter_commalist ',' odbc_parameter
- {
- $1->append($3);
- $$ = $1;
- }
- ;
-odbc_parameter:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | literal
- | parameter
- ;
-
-odbc_fct_spec:
- odbc_fct_type SQL_TOKEN_STRING
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_FN set_fct_spec
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-
-odbc_fct_type:
- SQL_TOKEN_D
- | SQL_TOKEN_T
- | SQL_TOKEN_TS
- ;
-
-general_set_fct:
- set_fct_type '(' opt_all_distinct function_arg ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4);
- $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | SQL_TOKEN_COUNT '(' '*' ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3 = newNode("*", SQL_NODE_PUNCTUATION));
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | SQL_TOKEN_COUNT '(' opt_all_distinct function_arg ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4);
- $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | ordered_set_function
- | array_aggregate_function
- ;
-set_fct_type:
- SQL_TOKEN_AVG
- | SQL_TOKEN_MAX
- | SQL_TOKEN_MIN
- | SQL_TOKEN_SUM
- | SQL_TOKEN_EVERY
- | SQL_TOKEN_ANY
- | SQL_TOKEN_SOME
- | SQL_TOKEN_STDDEV_POP
- | SQL_TOKEN_STDDEV_SAMP
- | SQL_TOKEN_VAR_SAMP
- | SQL_TOKEN_VAR_POP
- | SQL_TOKEN_COLLECT
- | SQL_TOKEN_FUSION
- | SQL_TOKEN_INTERSECTION
- ;
-
-ordered_set_function:
- hypothetical_set_function
- | inverse_distribution_function
- ;
-hypothetical_set_function:
- rank_function_type '(' hypothetical_set_function_value_expression_list ')' within_group_specification
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- $$->append($5);
- }
- | rank_function_type '(' hypothetical_set_function_value_expression_list SQL_TOKEN_BY value_exp_commalist ')' within_group_specification
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));
- $$->append($7);
- }
- ;
-
-within_group_specification:
- {
- $$ = SQL_NEW_RULE;
- }
- | SQL_TOKEN_WITHIN SQL_TOKEN_GROUP '(' opt_order_by_clause ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($4);
- $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-hypothetical_set_function_value_expression_list:
- value_exp_commalist
- ;
-
-inverse_distribution_function:
- inverse_distribution_function_type '('inverse_distribution_function_argument ')' within_group_specification
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-inverse_distribution_function_argument:
- num_value_exp
- ;
-inverse_distribution_function_type:
- SQL_TOKEN_PERCENTILE_CONT
- | SQL_TOKEN_PERCENTILE_DISC
- ;
-
-array_aggregate_function:
- SQL_TOKEN_ARRAY_AGG '(' value_exp opt_order_by_clause ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4);
- $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-
-rank_function_type:
- SQL_TOKEN_RANK
- | SQL_TOKEN_DENSE_RANK
- | SQL_TOKEN_PERCENT_RANK
- | SQL_TOKEN_CUME_DIST
- ;
-outer_join_type:
- SQL_TOKEN_LEFT %prec SQL_TOKEN_LEFT
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | SQL_TOKEN_RIGHT %prec SQL_TOKEN_RIGHT
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | SQL_TOKEN_FULL %prec SQL_TOKEN_FULL
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-join_condition:
- SQL_TOKEN_ON search_condition
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-join_spec:
- join_condition
- | named_columns_join
- ;
-join_type:
- /* empty */ {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_INNER
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | outer_join_type
- | outer_join_type SQL_TOKEN_OUTER
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-cross_union:
- table_ref SQL_TOKEN_CROSS SQL_TOKEN_JOIN table_ref
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-
-qualified_join:
- /* wenn SQL_TOKEN_NATURAL, dann keine join_spec */
- table_ref SQL_TOKEN_NATURAL join_type SQL_TOKEN_JOIN table_ref
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- }
- | table_ref join_type SQL_TOKEN_JOIN table_ref join_spec
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- }
- | cross_union
- ;
-joined_table:
- qualified_join
- ;
-named_columns_join:
- SQL_TOKEN_USING '(' column_commalist ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-simple_table:
- select_statement
- | values_or_query_spec
- ;
-
-non_join_query_primary:
- simple_table
- | '(' non_join_query_exp ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-non_join_query_term:
- non_join_query_primary
- | query_term SQL_TOKEN_INTERSECT all query_primary
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-query_primary:
- non_join_query_primary
- ;
-non_join_query_exp:
- non_join_query_term
- | query_exp SQL_TOKEN_UNION all query_term
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- | query_exp SQL_TOKEN_EXCEPT all query_term
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-all:
- /* empty*/ {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_ALL
- ;
-query_exp:
- non_join_query_exp /*[^')']*/
- ;
-scalar_subquery:
- subquery
- ;
-cast_operand:
- value_exp
- ;
-cast_target:
- table_node
- | data_type
- ;
-cast_spec:
- SQL_TOKEN_CAST '(' cast_operand SQL_TOKEN_AS cast_target ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-value_exp_primary:
- unsigned_value_spec
- | column_ref
- | set_fct_spec
- | scalar_subquery
- | case_expression
- | window_function
- | '(' value_exp ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | cast_spec
- ;
-
-num_primary:
- value_exp_primary
- | num_value_fct
- ;
-factor:
- num_primary
- | '-' num_primary %prec SQL_TOKEN_UMINUS
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("-", SQL_NODE_PUNCTUATION));
- $$->append($2);
- }
- | '+' num_primary %prec SQL_TOKEN_UMINUS
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("+", SQL_NODE_PUNCTUATION));
- $$->append($2);
- }
- ;
-
-term:
- factor
- | term '*' factor
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("*", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- | term '/' factor
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("/", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- ;
-
-num_value_exp:
- term
- | num_value_exp '+' term
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("+", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- | num_value_exp '-' term
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("-", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- ;
-datetime_primary:
-/* value_exp_primary
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- |*/ datetime_value_fct
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-datetime_value_fct:
- SQL_TOKEN_CURRENT_DATE
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | SQL_TOKEN_CURRENT_TIME
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | SQL_TOKEN_CURRENT_TIMESTAMP
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-time_zone:
- SQL_TOKEN_AT time_zone_specifier
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-time_zone_specifier:
- SQL_TOKEN_LOCAL
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
-/* | SQL_TOKEN_TIME SQL_TOKEN_ZONE interval_value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }*/
- ;
-datetime_factor:
- datetime_primary
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | datetime_primary time_zone
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-datetime_term:
- datetime_factor
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-/*
-interval_term:
- literal
- | interval_term '*' factor
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("*", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- | interval_term '/' factor
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("/", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- ;
-*/
-datetime_value_exp:
- datetime_term
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
-/* | interval_value_exp '+' datetime_term
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("+", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- | datetime_value_exp '+' interval_term
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("+", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- | datetime_value_exp '-' interval_term
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("-", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
-*/ ;
-/*
-interval_value_exp:
- interval_term
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | interval_value_exp '+' interval_term
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("+", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- | interval_value_exp '-' interval_term
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("-", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- | '(' datetime_value_exp '-' datetime_term ')' interval_qualifier
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode("-", SQL_NODE_PUNCTUATION));
- $$->append($4);
- $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
- $$->append($6);
- }
- ;
-*/
-non_second_datetime_field:
- SQL_TOKEN_YEAR
- | SQL_TOKEN_MONTH
- | SQL_TOKEN_DAY
- | SQL_TOKEN_HOUR
- | SQL_TOKEN_MINUTE
- ;
-start_field:
- non_second_datetime_field opt_paren_precision
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-end_field:
- non_second_datetime_field
- | SQL_TOKEN_SECOND opt_paren_precision
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-
-single_datetime_field:
- non_second_datetime_field opt_paren_precision
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_SECOND opt_paren_precision_scale
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-
-interval_qualifier:
- start_field SQL_TOKEN_TO end_field
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | single_datetime_field
- ;
-
-function_arg_commalist2:
- function_arg ',' function_arg
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);
- $$->append($3);}
- ;
-function_arg_commalist3:
- function_arg ',' function_arg ',' function_arg
- {
- $$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);
- $$->append($3);
- $$->append($5);
- }
- ;
-function_arg_commalist4:
- function_arg ',' function_arg ',' function_arg ',' function_arg
- {
- $$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);
- $$->append($3);
- $$->append($5);
- $$->append($7);
- }
- ;
-value_exp_commalist:
- value_exp
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | value_exp_commalist ',' value_exp
- {$1->append($3);
- $$ = $1;}
- /* this rule is only valid if we check predicates */
- | value_exp_commalist ';' value_exp
- {
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
- {
- $1->append($3);
- $$ = $1;
- }
- else
- YYERROR;
- }
- ;
-function_arg:
- result
- | value_exp comparison value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | value_exp SQL_TOKEN_USING value_exp comparison value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- | value_exp SQL_TOKEN_BY value_exp_commalist
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-function_args_commalist:
- function_arg
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | function_args_commalist ',' function_arg
- {$1->append($3);
- $$ = $1;}
- /* this rule is only valid if we check predicates */
- | function_args_commalist ';' function_arg
- {
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
- {
- $1->append($3);
- $$ = $1;
- }
- else
- YYERROR;
- }
- ;
-
-value_exp:
- num_value_exp /*[^')']*/
- | string_value_exp
- | datetime_value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-string_value_exp:
- char_value_exp
-/* | bit_value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
-*/ ;
-char_value_exp:
- char_factor
- | concatenation
- ;
-concatenation:
- char_value_exp '+' char_factor
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("+", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- | value_exp SQL_CONCAT value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-
-char_primary:
- SQL_TOKEN_STRING
- | string_value_fct
- ;
-collate_clause:
- SQL_TOKEN_COLLATE table_node
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-char_factor:
- char_primary
- | char_primary collate_clause
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-string_value_fct:
- char_value_fct
- | bit_value_fct
- ;
-bit_value_fct:
- bit_substring_fct
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-bit_substring_fct:
- SQL_TOKEN_SUBSTRING '(' bit_value_exp SQL_TOKEN_FROM string_value_exp for_length ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6);
- $$->append($7 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-bit_value_exp:
- bit_factor
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-/*
- bit_concatenation
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- |
-bit_concatenation:
- bit_value_exp '+' bit_factor
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("+", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- ;
-*/
-bit_factor:
- bit_primary
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-bit_primary:
- {$$ = SQL_NEW_RULE;}
-/* value_exp_primary
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | string_value_fct
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }*/
- ;
-char_value_fct:
- char_substring_fct
- | fold
- | form_conversion
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | char_translation
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- | trim_fct
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- }
- ;
-for_length:
- {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_FOR value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-char_substring_fct:
- SQL_TOKEN_SUBSTRING '(' value_exp SQL_TOKEN_FROM value_exp for_length ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6);
- $$->append($7 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | SQL_TOKEN_SUBSTRING '(' value_exp_commalist ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-upper_lower:
- SQL_TOKEN_UPPER
- | SQL_TOKEN_LOWER
- ;
-fold:
- upper_lower '(' value_exp ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-form_conversion:
- SQL_TOKEN_CONVERT '(' string_value_exp SQL_TOKEN_USING table_node ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | SQL_TOKEN_CONVERT '(' cast_operand ',' cast_target ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($2 = newNode(",", SQL_NODE_PUNCTUATION));
- $$->append($5);
- $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-char_translation:
- SQL_TOKEN_TRANSLATE '(' string_value_exp SQL_TOKEN_USING table_node ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-trim_fct:
- SQL_TOKEN_TRIM '(' trim_operands ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-trim_operands:
- trim_spec value_exp SQL_TOKEN_FROM value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- | trim_spec SQL_TOKEN_FROM value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | value_exp SQL_TOKEN_FROM value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | SQL_TOKEN_FROM value_exp
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | value_exp
- ;
-
-trim_spec:
- SQL_TOKEN_BOTH
- | SQL_TOKEN_LEADING
- | SQL_TOKEN_TRAILING
- ;
-
-derived_column:
- value_exp as_clause
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-/* Tabellenname */
-table_node:
- table_name
- | schema_name
- | catalog_name
-;
-catalog_name:
- SQL_TOKEN_NAME '.' schema_name
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- | SQL_TOKEN_NAME ':' schema_name
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode(":", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
-;
-schema_name:
- SQL_TOKEN_NAME '.' table_name
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
-;
-
-table_name:
- SQL_TOKEN_NAME
- {$$ = SQL_NEW_RULE;
- $$->append($1);}
-;
-/* Columns */
-column_ref:
- column
- {$$ = SQL_NEW_RULE;
- $$->append($1);}
-/* | table_node '.' column_val %prec '.'
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($3);}
-*/
- | SQL_TOKEN_NAME '.' column_val %prec '.'
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($3);
- }
- | SQL_TOKEN_NAME '.' SQL_TOKEN_NAME '.' column_val %prec '.'
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($5);}
- | SQL_TOKEN_NAME '.' SQL_TOKEN_NAME '.' SQL_TOKEN_NAME '.' column_val %prec '.'
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2= newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($5);
- $$->append($6 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($7);
- }
- | SQL_TOKEN_NAME ':' SQL_TOKEN_NAME '.' SQL_TOKEN_NAME '.' column_val %prec '.'
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2= newNode(":", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($5);
- $$->append($6 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($7);
- }
-/* | SQL_TOKEN_NAME ';' SQL_TOKEN_NAME '.' SQL_TOKEN_NAME '.' column_val
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2= newNode(";", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($5);
- $$->append($6 = newNode(".", SQL_NODE_PUNCTUATION));
- $$->append($7);
- }
-*/ ;
-
- /* data types */
-column_val:
- column
- {$$ = SQL_NEW_RULE;
- $$->append($1);}
- | '*'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("*", SQL_NODE_PUNCTUATION));
- }
- ;
-data_type:
- predefined_type
- ;
-opt_char_set_spec:
- {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_CHARACTER SQL_TOKEN_SET SQL_TOKEN_NAME
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-opt_collate_clause:
- {$$ = SQL_NEW_RULE;}
- | collate_clause
- ;
-predefined_type:
- character_string_type opt_char_set_spec opt_collate_clause
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | national_character_string_type opt_collate_clause
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | binary_string_type
- | numeric_type
- | boolean_type
- | datetime_type
- | interval_type
- ;
-character_string_type:
- SQL_TOKEN_CHARACTER opt_paren_precision
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_CHAR opt_paren_precision
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_CHARACTER SQL_TOKEN_VARYING paren_char_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | SQL_TOKEN_CHAR SQL_TOKEN_VARYING paren_char_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | SQL_TOKEN_VARCHAR paren_char_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | character_large_object_type
- ;
-opt_paren_precision:
- {$$ = SQL_NEW_RULE;}
- | paren_char_length
- ;
-paren_char_length:
- '(' SQL_TOKEN_INTNUM ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-opt_paren_char_large_length:
- {$$ = SQL_NEW_RULE;}
- | paren_character_large_object_length
- ;
-paren_character_large_object_length:
- '(' large_object_length ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-
-large_object_length:
- SQL_TOKEN_INTNUM opt_multiplier
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-opt_multiplier:
- {$$ = SQL_NEW_RULE;}
- | 'K'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("K", SQL_NODE_PUNCTUATION));
- }
- | 'M'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("M", SQL_NODE_PUNCTUATION));
- }
- | 'G'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("G", SQL_NODE_PUNCTUATION));
- }
- | 'T'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("T", SQL_NODE_PUNCTUATION));
- }
- | 'P'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("P", SQL_NODE_PUNCTUATION));
- }
- ;
-character_large_object_type:
- SQL_TOKEN_CHARACTER SQL_TOKEN_LARGE SQL_TOKEN_OBJECT opt_paren_char_large_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- | SQL_TOKEN_CHAR SQL_TOKEN_LARGE SQL_TOKEN_OBJECT opt_paren_char_large_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- | SQL_TOKEN_CLOB opt_paren_char_large_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-national_character_string_type:
- SQL_TOKEN_NATIONAL SQL_TOKEN_CHARACTER opt_paren_precision
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | SQL_TOKEN_NATIONAL SQL_TOKEN_CHAR opt_paren_precision
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | SQL_TOKEN_NCHAR opt_paren_precision
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_NATIONAL SQL_TOKEN_CHARACTER SQL_TOKEN_VARYING paren_char_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- | SQL_TOKEN_NATIONAL SQL_TOKEN_CHAR SQL_TOKEN_VARYING paren_char_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- | SQL_TOKEN_NCHAR SQL_TOKEN_VARYING paren_char_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | national_character_large_object_type
- ;
-national_character_large_object_type:
- SQL_TOKEN_NATIONAL SQL_TOKEN_CHARACTER SQL_TOKEN_LARGE SQL_TOKEN_OBJECT opt_paren_char_large_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- }
- | SQL_TOKEN_NCHAR SQL_TOKEN_LARGE SQL_TOKEN_OBJECT opt_paren_char_large_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- | SQL_TOKEN_NCLOB opt_paren_char_large_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-binary_string_type:
- SQL_TOKEN_BINARY opt_paren_precision
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_BINARY SQL_TOKEN_VARYING paren_char_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | SQL_TOKEN_VARBINARY paren_char_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | binary_large_object_string_type
- ;
-binary_large_object_string_type:
- SQL_TOKEN_BINARY SQL_TOKEN_LARGE SQL_TOKEN_OBJECT opt_paren_char_large_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- | SQL_TOKEN_BLOB opt_paren_char_large_length
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-numeric_type:
- exact_numeric_type
- | approximate_numeric_type
- ;
-opt_paren_precision_scale:
- {$$ = SQL_NEW_RULE;}
- | '(' SQL_TOKEN_INTNUM ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | '(' SQL_TOKEN_INTNUM ',' SQL_TOKEN_INTNUM ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode(",", SQL_NODE_PUNCTUATION));
- $$->append($4);
- $$->append($5 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-exact_numeric_type:
- SQL_TOKEN_NUMERIC opt_paren_precision_scale
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_DECIMAL opt_paren_precision_scale
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_DEC opt_paren_precision_scale
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- | SQL_TOKEN_SMALLINT
- | SQL_TOKEN_INTEGER
- | SQL_TOKEN_INT
- | SQL_TOKEN_BIGINT
- ;
-approximate_numeric_type:
- SQL_TOKEN_FLOAT '(' SQL_TOKEN_INTNUM ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | SQL_TOKEN_FLOAT
- | SQL_TOKEN_REAL
- | SQL_TOKEN_DOUBLE
- | SQL_TOKEN_DOUBLE SQL_TOKEN_PRECISION
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-boolean_type:
- SQL_TOKEN_BOOLEAN
-;
-datetime_type:
- SQL_TOKEN_DATE
- | SQL_TOKEN_TIME opt_paren_precision opt_with_or_without_time_zone
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | SQL_TOKEN_TIMESTAMP opt_paren_precision opt_with_or_without_time_zone
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-opt_with_or_without_time_zone:
- {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_WITH SQL_TOKEN_TIME SQL_TOKEN_ZONE
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- | SQL_TOKEN_WITHOUT SQL_TOKEN_TIME SQL_TOKEN_ZONE
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-interval_type:
- SQL_TOKEN_INTERVAL interval_qualifier
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
- /* the various things you can name */
-
-column:
- SQL_TOKEN_NAME
- | SQL_TOKEN_POSITION
- {
- sal_uInt32 nNod = $$->getRuleID();
- delete $$;
- $$ = newNode(xxx_pGLOBAL_SQLPARSER->TokenIDToStr(nNod), SQL_NODE_NAME);
- }
- | SQL_TOKEN_CHAR_LENGTH
- {
- sal_uInt32 nNod = $$->getRuleID();
- delete $$;
- $$ = newNode(xxx_pGLOBAL_SQLPARSER->TokenIDToStr(nNod), SQL_NODE_NAME);
- }
- | SQL_TOKEN_EXTRACT
- {
- sal_uInt32 nNod = $$->getRuleID();
- delete $$;
- $$ = newNode(xxx_pGLOBAL_SQLPARSER->TokenIDToStr(nNod), SQL_NODE_NAME);
- }
- ;
-case_expression:
- case_abbreviation
- | case_specification
- ;
-case_abbreviation:
- SQL_TOKEN_NULLIF '(' value_exp_commalist ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | SQL_TOKEN_COALESCE '(' value_exp ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- | SQL_TOKEN_COALESCE '(' value_exp_commalist ')'
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
- $$->append($3);
- $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
- }
- ;
-case_specification:
- simple_case
- | searched_case
- ;
-simple_case:
- SQL_TOKEN_CASE case_operand simple_when_clause_list else_clause SQL_TOKEN_END
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- }
- ;
-searched_case:
- SQL_TOKEN_CASE searched_when_clause_list else_clause SQL_TOKEN_END
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-simple_when_clause_list:
- simple_when_clause
- {
- $$ = SQL_NEW_LISTRULE;
- $$->append($1);
- }
- | searched_when_clause_list simple_when_clause
- {
- $1->append($2);
- $$ = $1;
- }
- ;
-simple_when_clause:
- SQL_TOKEN_WHEN when_operand_list SQL_TOKEN_THEN result
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-when_operand_list:
- when_operand
- {$$ = SQL_NEW_COMMALISTRULE;
- $$->append($1);}
- | when_operand_list ',' when_operand
- {$1->append($3);
- $$ = $1;}
- ;
-when_operand:
- row_value_constructor_elem
- | comparison_predicate_part_2
- | between_predicate_part_2
- | in_predicate_part_2
- | character_like_predicate_part_2
- | null_predicate_part_2
-;
-searched_when_clause_list:
- searched_when_clause
- {
- $$ = SQL_NEW_LISTRULE;
- $$->append($1);
- }
- | searched_when_clause_list searched_when_clause
- {
- $1->append($2);
- $$ = $1;
- }
- ;
-searched_when_clause:
- SQL_TOKEN_WHEN search_condition SQL_TOKEN_THEN result
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- ;
-else_clause:
- {$$ = SQL_NEW_RULE;}
- | SQL_TOKEN_ELSE result
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-result:
- result_expression
- | SQL_TOKEN_NULL
- ;
-result_expression:
- value_exp
- ;
-case_operand:
- row_value_constructor_elem
- ;
-
-cursor: SQL_TOKEN_NAME
- {$$ = SQL_NEW_RULE;
- $$->append($1);}
- ;
-
-/***
-module: SQL_TOKEN_NAME
- {$$ = SQL_NEW_RULE;
- $$->append($1);}
- ;
-***/
-
-parameter:
- ':' SQL_TOKEN_NAME
- {$$ = SQL_NEW_RULE;
- $$->append($1 = newNode(":", SQL_NODE_PUNCTUATION));
- $$->append($2);}
- | '?'
- {$$ = SQL_NEW_RULE; // test
- $$->append($1 = newNode("?", SQL_NODE_PUNCTUATION));}
- | '[' SQL_TOKEN_NAME ']'
- {$$ = SQL_NEW_RULE;
- $$->append($1 = newNode("[", SQL_NODE_PUNCTUATION));
- $$->append($2);
- $$->append($3 = newNode("]", SQL_NODE_PUNCTUATION));}
- ;
-
-/***
-procedure: SQL_TOKEN_NAME
- {$$ = SQL_NEW_RULE;
- $$->append($1);}
- ;
-***/
-
-range_variable:
- {$$ = SQL_NEW_RULE;}
- | opt_as SQL_TOKEN_NAME
- {$$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-
-user: SQL_TOKEN_NAME
- ;
-
-/* PREDICATECHECK RULES */
-sql:
- search_condition /* checking predicats */
- {
- if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck()) // sql: rule 1
- {
- $$ = $1;
- if ( SQL_ISRULE($$,search_condition) )
- {
- $$->insert(0,newNode("(", SQL_NODE_PUNCTUATION));
- $$->append(newNode(")", SQL_NODE_PUNCTUATION));
- }
- }
- else
- YYERROR;
- }
- | '(' sql ')' /* checking predicats */
- ;
-trigger_definition:
- SQL_TOKEN_CREATE SQL_TOKEN_TRIGGER trigger_name trigger_action_time trigger_event SQL_TOKEN_ON table_name op_referencing triggered_action
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- $$->append($5);
- $$->append($6);
- $$->append($7);
- $$->append($8);
- $$->append($9);
- }
- ;
-op_referencing:
- {
- $$ = SQL_NEW_RULE;
- }
- | SQL_TOKEN_REFERENCING transition_table_or_variable_list
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-trigger_action_time:
- SQL_TOKEN_BEFORE
- | SQL_TOKEN_AFTER
- | SQL_TOKEN_INSTEAD SQL_TOKEN_OF
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
-;
-trigger_event:
- SQL_TOKEN_INSERT
- | SQL_TOKEN_DELETE
- | SQL_TOKEN_UPDATE op_trigger_columnlist
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-op_trigger_columnlist:
- {
- $$ = SQL_NEW_RULE;
- }
- | SQL_TOKEN_OF trigger_column_list
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-trigger_column_list:
- column_commalist
- ;
-triggered_action:
- op_triggered_action_for triggered_when_clause triggered_SQL_statement
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-op_triggered_action_for:
- {
- $$ = SQL_NEW_RULE;
- }
- | SQL_TOKEN_FOR SQL_TOKEN_EACH trigger_for
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- }
- ;
-trigger_for:
- SQL_TOKEN_ROW
- | SQL_TOKEN_STATEMENT
- ;
-triggered_when_clause:
- {
- $$ = SQL_NEW_RULE;
- }
- | SQL_TOKEN_WHEN parenthesized_boolean_value_expression
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- }
- ;
-triggered_SQL_statement:
- SQL_procedure_statement
- | SQL_TOKEN_BEGIN SQL_TOKEN_ATOMIC SQL_procedure_statement_list ';' SQL_TOKEN_END
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4 = newNode(";", SQL_NODE_PUNCTUATION));
- $$->append($5);
- }
- ;
-SQL_procedure_statement_list:
- SQL_procedure_statement
- {
- $$ = SQL_NEW_LISTRULE;
- $$->append($1);
- }
- | SQL_procedure_statement_list ';' SQL_procedure_statement
- {
- $1->append($3);
- $$ = $1;
- }
- ;
-SQL_procedure_statement:
- sql
- ;
-
-transition_table_or_variable_list:
- transition_table_or_variable
- {
- $$ = SQL_NEW_LISTRULE;
- $$->append($1);
- }
- | transition_table_or_variable_list transition_table_or_variable
- {
- $1->append($2);
- $$ = $1;
- }
- ;
-
-transition_table_or_variable:
- SQL_TOKEN_OLD opt_row opt_as old_transition_variable_name
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- | SQL_TOKEN_NEW opt_row opt_as new_transition_variable_name
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- | SQL_TOKEN_OLD SQL_TOKEN_TABLE opt_as old_transition_table_name
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
- | SQL_TOKEN_NEW SQL_TOKEN_TABLE opt_as new_transition_table_name
- {
- $$ = SQL_NEW_RULE;
- $$->append($1);
- $$->append($2);
- $$->append($3);
- $$->append($4);
- }
-;
-old_transition_table_name:
- transition_table_name
-;
-new_transition_table_name:
- transition_table_name
-;
-transition_table_name:
- SQL_TOKEN_NAME
-;
-old_transition_variable_name:
- SQL_TOKEN_NAME
-;
-new_transition_variable_name:
- SQL_TOKEN_NAME
-;
-trigger_name:
- SQL_TOKEN_NAME
-;
-%%
-
-
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::i18n;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::util;
-using namespace ::osl;
-using namespace ::dbtools;
-
-//============================================================
-//= a helper for static ascii pseudo-unicode strings
-//============================================================
-// string constants
-struct _ConstAsciiString_
-{
- sal_Int32 length;
- sal_Char const* str;
-
- operator rtl::OUString () const { return rtl::OUString(str, length, RTL_TEXTENCODING_ASCII_US); }
- operator const sal_Char * () const { return str; }
- operator ::rtl::OString() const { return str; }
-};
-
-#define IMPLEMENT_CONSTASCII_STRING( name, string ) \
- _ConstAsciiString_ const name = { sizeof(string)-1, string }
-
-IMPLEMENT_CONSTASCII_STRING(ERROR_STR_GENERAL, "Syntax error in SQL expression");
-IMPLEMENT_CONSTASCII_STRING(ERROR_STR_VALUE_NO_LIKE, "The value #1 can not be used with LIKE.");
-IMPLEMENT_CONSTASCII_STRING(ERROR_STR_FIELD_NO_LIKE, "LIKE can not be used with this field.");
-IMPLEMENT_CONSTASCII_STRING(ERROR_STR_INVALID_COMPARE, "The entered criterion can not be compared with this field.");
-IMPLEMENT_CONSTASCII_STRING(ERROR_STR_INVALID_DATE_COMPARE, "The field can not be compared with a date.");
-IMPLEMENT_CONSTASCII_STRING(ERROR_STR_INVALID_REAL_COMPARE, "The field can not be compared with a floating point number.");
-IMPLEMENT_CONSTASCII_STRING(ERROR_STR_INVALID_INT_COMPARE, "The field can not be compared with a number.");
-IMPLEMENT_CONSTASCII_STRING(ERROR_STR_INVALID_TABLE, "The database does not contain a table named \"#\".");
-IMPLEMENT_CONSTASCII_STRING(ERROR_STR_INVALID_TABLE_OR_QUERY, "The database does contain neither a table nor a query named \"#\".");
-IMPLEMENT_CONSTASCII_STRING(ERROR_STR_INVALID_COLUMN, "The column \"#1\" is unknown in the table \"#2\".");
-IMPLEMENT_CONSTASCII_STRING(ERROR_STR_INVALID_TABLE_EXIST, "The database already contains a table or view with name \"#\".");
-IMPLEMENT_CONSTASCII_STRING(ERROR_STR_INVALID_QUERY_EXIST, "The database already contains a query with name \"#\".");
-
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_LIKE, "LIKE");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_NOT, "NOT");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_NULL, "NULL");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_TRUE, "True");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_FALSE, "False");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_IS, "IS");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_BETWEEN, "BETWEEN");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_OR, "OR");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_AND, "AND");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_AVG, "AVG");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_COUNT, "COUNT");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_MAX, "MAX");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_MIN, "MIN");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_SUM, "SUM");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_EVERY, "EVERY");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_ANY, "ANY");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_SOME, "SOME");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_STDDEV_POP, "STDDEV_POP");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_STDDEV_SAMP, "STDDEV_SAMP");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_VAR_SAMP, "VAR_SAMP");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_VAR_POP, "VAR_POP");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_COLLECT, "COLLECT");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_FUSION, "FUSION");
-IMPLEMENT_CONSTASCII_STRING(KEY_STR_INTERSECTION, "INTERSECTION");
-
-IMPLEMENT_CONSTASCII_STRING(FIELD_STR_NULLDATE, "NullDate");
-
-IMPLEMENT_CONSTASCII_STRING(STR_SQL_TOKEN, "SQL_TOKEN_");
-
-//==========================================================================
-//= OParseContext
-//==========================================================================
-//-----------------------------------------------------------------------------
-OParseContext::OParseContext()
-{
-}
-
-//-----------------------------------------------------------------------------
-OParseContext::~OParseContext()
-{
-}
-
-//-----------------------------------------------------------------------------
-::rtl::OUString OParseContext::getErrorMessage(ErrorCode _eCode) const
-{
- ::rtl::OUString aMsg;
- switch (_eCode)
- {
- case ERROR_GENERAL: aMsg = ERROR_STR_GENERAL; break;
- case ERROR_VALUE_NO_LIKE: aMsg = ERROR_STR_VALUE_NO_LIKE; break;
- case ERROR_FIELD_NO_LIKE: aMsg = ERROR_STR_FIELD_NO_LIKE; break;
- case ERROR_INVALID_COMPARE: aMsg = ERROR_STR_INVALID_COMPARE; break;
- case ERROR_INVALID_INT_COMPARE: aMsg = ERROR_STR_INVALID_INT_COMPARE; break;
- case ERROR_INVALID_DATE_COMPARE: aMsg = ERROR_STR_INVALID_DATE_COMPARE; break;
- case ERROR_INVALID_REAL_COMPARE: aMsg = ERROR_STR_INVALID_REAL_COMPARE; break;
- case ERROR_INVALID_TABLE: aMsg = ERROR_STR_INVALID_TABLE; break;
- case ERROR_INVALID_TABLE_OR_QUERY: aMsg = ERROR_STR_INVALID_TABLE_OR_QUERY; break;
- case ERROR_INVALID_COLUMN: aMsg = ERROR_STR_INVALID_COLUMN; break;
- case ERROR_INVALID_TABLE_EXIST: aMsg = ERROR_STR_INVALID_TABLE_EXIST; break;
- case ERROR_INVALID_QUERY_EXIST: aMsg = ERROR_STR_INVALID_QUERY_EXIST; break;
- default:
- OSL_FAIL( "OParseContext::getErrorMessage: unknown error code!" );
- break;
- }
- return aMsg;
-}
-
-//-----------------------------------------------------------------------------
-::rtl::OString OParseContext::getIntlKeywordAscii(InternationalKeyCode _eKey) const
-{
- ::rtl::OString aKeyword;
- switch (_eKey)
- {
- case KEY_LIKE: aKeyword = KEY_STR_LIKE; break;
- case KEY_NOT: aKeyword = KEY_STR_NOT; break;
- case KEY_NULL: aKeyword = KEY_STR_NULL; break;
- case KEY_TRUE: aKeyword = KEY_STR_TRUE; break;
- case KEY_FALSE: aKeyword = KEY_STR_FALSE; break;
- case KEY_IS: aKeyword = KEY_STR_IS; break;
- case KEY_BETWEEN: aKeyword = KEY_STR_BETWEEN; break;
- case KEY_OR: aKeyword = KEY_STR_OR; break;
- case KEY_AND: aKeyword = KEY_STR_AND; break;
- case KEY_AVG: aKeyword = KEY_STR_AVG; break;
- case KEY_COUNT: aKeyword = KEY_STR_COUNT; break;
- case KEY_MAX: aKeyword = KEY_STR_MAX; break;
- case KEY_MIN: aKeyword = KEY_STR_MIN; break;
- case KEY_SUM: aKeyword = KEY_STR_SUM; break;
- case KEY_EVERY: aKeyword = KEY_STR_EVERY; break;
- case KEY_ANY: aKeyword = KEY_STR_ANY; break;
- case KEY_SOME: aKeyword = KEY_STR_SOME; break;
- case KEY_STDDEV_POP: aKeyword = KEY_STR_STDDEV_POP; break;
- case KEY_STDDEV_SAMP: aKeyword = KEY_STR_STDDEV_SAMP; break;
- case KEY_VAR_SAMP: aKeyword = KEY_STR_VAR_SAMP; break;
- case KEY_VAR_POP: aKeyword = KEY_STR_VAR_POP; break;
- case KEY_COLLECT: aKeyword = KEY_STR_COLLECT; break;
- case KEY_FUSION: aKeyword = KEY_STR_FUSION; break;
- case KEY_INTERSECTION:aKeyword = KEY_STR_INTERSECTION; break;
- case KEY_NONE: break;
- default:
- OSL_FAIL( "OParseContext::getIntlKeywordAscii: unknown key!" );
- break;
- }
- return aKeyword;
-}
-
-//-----------------------------------------------------------------------------
-IParseContext::InternationalKeyCode OParseContext::getIntlKeyCode(const ::rtl::OString& rToken) const
-{
- static IParseContext::InternationalKeyCode Intl_TokenID[] =
- {
- KEY_LIKE, KEY_NOT, KEY_NULL, KEY_TRUE,
- KEY_FALSE, KEY_IS, KEY_BETWEEN, KEY_OR,
- KEY_AND, KEY_AVG, KEY_COUNT, KEY_MAX,
- KEY_MIN, KEY_SUM, KEY_EVERY,KEY_ANY,KEY_SOME,
- KEY_STDDEV_POP,KEY_STDDEV_SAMP,KEY_VAR_SAMP,
- KEY_VAR_POP,KEY_COLLECT,KEY_FUSION,KEY_INTERSECTION
- };
-
- sal_uInt32 nCount = SAL_N_ELEMENTS( Intl_TokenID );
- for (sal_uInt32 i = 0; i < nCount; i++)
- {
- ::rtl::OString aKey = getIntlKeywordAscii(Intl_TokenID[i]);
- if (rToken.equalsIgnoreAsciiCase(aKey))
- return Intl_TokenID[i];
- }
-
- return KEY_NONE;
-}
-
-//------------------------------------------------------------------------------
-static Locale& impl_getLocaleInstance( )
-{
- static Locale s_aLocale(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "en" ) ),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "US" ) ),
- ::rtl::OUString( )
- );
- return s_aLocale;
-}
-
-//------------------------------------------------------------------------------
-void OParseContext::setDefaultLocale( const ::com::sun::star::lang::Locale& _rLocale )
-{
- impl_getLocaleInstance() = _rLocale;
-}
-
-//------------------------------------------------------------------------------
-Locale OParseContext::getPreferredLocale( ) const
-{
- return getDefaultLocale();
-}
-
-//------------------------------------------------------------------------------
-const Locale& OParseContext::getDefaultLocale()
-{
- return impl_getLocaleInstance();
-}
-
-//==========================================================================
-//= misc
-//==========================================================================
-// Der (leider globale) yylval fuer die Uebergabe von
-// Werten vom Scanner an den Parser. Die globale Variable
-// wird nur kurzzeitig verwendet, der Parser liest die Variable
-// sofort nach dem Scanner-Aufruf in eine gleichnamige eigene
-// Member-Variable.
-
-const double fMilliSecondsPerDay = 86400000.0;
-
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------
-::rtl::OUString ConvertLikeToken(const OSQLParseNode* pTokenNode, const OSQLParseNode* pEscapeNode, sal_Bool bInternational)
-{
- ::rtl::OUStringBuffer aMatchStr;
- if (pTokenNode->isToken())
- {
- sal_Unicode cEscape = 0;
- if (pEscapeNode->count())
- cEscape = pEscapeNode->getChild(1)->getTokenValue().toChar();
-
- // Platzhalter austauschen
- aMatchStr = pTokenNode->getTokenValue();
- const sal_Int32 nLen = aMatchStr.getLength();
- ::rtl::OUStringBuffer sSearch,sReplace;
- if ( bInternational )
- {
- sSearch.appendAscii("%_",2);
- sReplace.appendAscii("*?",2);
- }
- else
- {
- sSearch.appendAscii("*?",2);
- sReplace.appendAscii("%_",2);
- }
-
- for (sal_Int32 i = 0; i < nLen; i++)
- {
- const sal_Unicode c = aMatchStr.charAt(i);
- if (c == sSearch.charAt(0) || c == sSearch.charAt(1))
- {
- if (i > 0 && aMatchStr.charAt(i-1) == cEscape)
- continue;
- else
- {
- const sal_Unicode cCharacter = sReplace.charAt( (c == sSearch.charAt(0)) ? 0 : 1);
- aMatchStr.setCharAt(i , cCharacter);
- }
- }
- }
- }
- return aMatchStr.makeStringAndClear();
-}
-
-//==========================================================================
-//= OSQLParser
-//==========================================================================
-
-sal_uInt32 OSQLParser::s_nRuleIDs[OSQLParseNode::rule_count + 1];
-OSQLParser::RuleIDMap OSQLParser::s_aReverseRuleIDLookup;
-OParseContext OSQLParser::s_aDefaultContext;
-
-sal_Int32 OSQLParser::s_nRefCount = 0;
-// ::osl::Mutex OSQLParser::s_aMutex;
-OSQLScanner* OSQLParser::s_pScanner = 0;
-OSQLParseNodesGarbageCollector* OSQLParser::s_pGarbageCollector = 0;
-::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData> OSQLParser::s_xLocaleData = NULL;
-//-----------------------------------------------------------------------------
-void setParser(OSQLParser* _pParser)
-{
- xxx_pGLOBAL_SQLPARSER = _pParser;
-}
-// -------------------------------------------------------------------------
-void OSQLParser::setParseTree(OSQLParseNode * pNewParseTree)
-{
- ::osl::MutexGuard aGuard(getMutex());
- m_pParseTree = pNewParseTree;
-}
-//-----------------------------------------------------------------------------
-OSQLParseNode* OSQLParser::parseTree(::rtl::OUString& rErrorMessage,
- const ::rtl::OUString& rStatement,
- sal_Bool bInternational)
-{
-
-
- // Guard the parsing
- ::osl::MutexGuard aGuard(getMutex());
- // must be reset
- setParser(this);
-
- // defines how to scan
- s_pScanner->SetRule(s_pScanner->GetSQLRule()); // initial
- s_pScanner->prepareScan(rStatement, m_pContext, bInternational);
-
- SQLyylval.pParseNode = NULL;
- // SQLyypvt = NULL;
- m_pParseTree = NULL;
- m_sErrorMessage = ::rtl::OUString();
-
- // ... und den Parser anwerfen ...
- if (SQLyyparse() != 0)
- {
- // only set the error message, if it's not already set
- if (!m_sErrorMessage.getLength())
- m_sErrorMessage = s_pScanner->getErrorMessage();
- if (!m_sErrorMessage.getLength())
- m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_GENERAL);
-
- rErrorMessage = m_sErrorMessage;
-
- // clear the garbage collector
- (*s_pGarbageCollector)->clearAndDelete();
- return NULL;
- }
- else
- {
- (*s_pGarbageCollector)->clear();
-
- // Das Ergebnis liefern (den Root Parse Node):
-
- // OSL_ENSURE(Sdbyyval.pParseNode != NULL,"OSQLParser: Parser hat keinen ParseNode geliefert");
- // return Sdbyyval.pParseNode;
- // geht nicht wegen Bug in MKS YACC-erzeugtem Code (es wird ein falscher ParseNode
- // geliefert).
-
- // Stattdessen setzt die Parse-Routine jetzt den Member pParseTree
- // - einfach diesen zurueckliefern:
- OSL_ENSURE(m_pParseTree != NULL,"OSQLParser: Parser hat keinen ParseTree geliefert");
- return m_pParseTree;
- }
-}
-//-----------------------------------------------------------------------------
-::rtl::OString OSQLParser::TokenIDToStr(sal_uInt32 nTokenID, const IParseContext* pContext)
-{
- ::rtl::OString aStr;
- if (pContext)
- {
- IParseContext::InternationalKeyCode eKeyCode = IParseContext::KEY_NONE;
- switch( nTokenID )
- {
- case SQL_TOKEN_LIKE: eKeyCode = IParseContext::KEY_LIKE; break;
- case SQL_TOKEN_NOT: eKeyCode = IParseContext::KEY_NOT; break;
- case SQL_TOKEN_NULL: eKeyCode = IParseContext::KEY_NULL; break;
- case SQL_TOKEN_TRUE: eKeyCode = IParseContext::KEY_TRUE; break;
- case SQL_TOKEN_FALSE: eKeyCode = IParseContext::KEY_FALSE; break;
- case SQL_TOKEN_IS: eKeyCode = IParseContext::KEY_IS; break;
- case SQL_TOKEN_BETWEEN: eKeyCode = IParseContext::KEY_BETWEEN; break;
- case SQL_TOKEN_OR: eKeyCode = IParseContext::KEY_OR; break;
- case SQL_TOKEN_AND: eKeyCode = IParseContext::KEY_AND; break;
- case SQL_TOKEN_AVG: eKeyCode = IParseContext::KEY_AVG; break;
- case SQL_TOKEN_COUNT: eKeyCode = IParseContext::KEY_COUNT; break;
- case SQL_TOKEN_MAX: eKeyCode = IParseContext::KEY_MAX; break;
- case SQL_TOKEN_MIN: eKeyCode = IParseContext::KEY_MIN; break;
- case SQL_TOKEN_SUM: eKeyCode = IParseContext::KEY_SUM; break;
- }
- if ( eKeyCode != IParseContext::KEY_NONE )
- aStr = pContext->getIntlKeywordAscii(eKeyCode);
- }
-
- if (!aStr.getLength())
- {
- aStr = yytname[YYTRANSLATE(nTokenID)];
- if(!aStr.compareTo("SQL_TOKEN_",10))
- aStr = aStr.copy(10);
- }
- return aStr;
-}
-
-//-----------------------------------------------------------------------------
-::rtl::OUString OSQLParser::RuleIDToStr(sal_uInt32 nRuleID)
-{
- OSL_ENSURE(nRuleID < SAL_N_ELEMENTS(yytname), "OSQLParser::RuleIDToStr: Invalid nRuleId!");
- return ::rtl::OUString::createFromAscii(yytname[nRuleID]);
-}
-
-//-----------------------------------------------------------------------------
-sal_uInt32 OSQLParser::StrToRuleID(const ::rtl::OString & rValue)
-{
- // In yysvar nach dem angegebenen Namen suchen, den Index zurueckliefern
- // (oder 0, wenn nicht gefunden)
- static sal_uInt32 nLen = SAL_N_ELEMENTS(yytname);
- for (sal_uInt32 i = YYTRANSLATE(SQL_TOKEN_INVALIDSYMBOL); i < (nLen-1); i++)
- {
- if (yytname && rValue == yytname[i])
- return i;
- }
-
- // Nicht gefunden
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-OSQLParseNode::Rule OSQLParser::RuleIDToRule( sal_uInt32 _nRule )
-{
- return s_aReverseRuleIDLookup[ _nRule ];
-}
-
-//-----------------------------------------------------------------------------
-sal_uInt32 OSQLParser::RuleID(OSQLParseNode::Rule eRule)
-{
- return s_nRuleIDs[(sal_uInt16)eRule];
-}
-// -------------------------------------------------------------------------
-sal_Int16 OSQLParser::buildNode(OSQLParseNode*& pAppend,OSQLParseNode* pCompare,OSQLParseNode* pLiteral,OSQLParseNode* pLiteral2)
-{
- OSQLParseNode* pColumnRef = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::column_ref));
- pColumnRef->append(new OSQLInternalNode(m_sFieldName,SQL_NODE_NAME));
- OSQLParseNode* pComp = NULL;
- if ( SQL_ISTOKEN( pCompare, BETWEEN) && pLiteral2 )
- pComp = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::between_predicate_part_2));
- else
- pComp = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::comparison_predicate));
-
- pComp->append(pColumnRef);
- pComp->append(pCompare);
- pComp->append(pLiteral);
- if ( pLiteral2 )
- {
- pComp->append(new OSQLInternalNode(aEmptyString, SQL_NODE_KEYWORD,SQL_TOKEN_AND));
- pComp->append(pLiteral2);
- }
- pAppend->append(pComp);
- return 1;
-}
-//-----------------------------------------------------------------------------
-sal_Int16 OSQLParser::buildStringNodes(OSQLParseNode*& pLiteral)
-{
- if(!pLiteral)
- return 1;
-
- if(SQL_ISRULE(pLiteral,set_fct_spec) || SQL_ISRULE(pLiteral,general_set_fct) || SQL_ISRULE(pLiteral,column_ref)
- || SQL_ISRULE(pLiteral,subquery))
- return 1; // here I have a function that I can't transform into a string
-
- if(pLiteral->getNodeType() == SQL_NODE_INTNUM || pLiteral->getNodeType() == SQL_NODE_APPROXNUM || pLiteral->getNodeType() == SQL_NODE_ACCESS_DATE)
- {
- OSQLParseNode* pParent = pLiteral->getParent();
-
- OSQLParseNode* pNewNode = new OSQLInternalNode(pLiteral->getTokenValue(), SQL_NODE_STRING);
- pParent->replace(pLiteral, pNewNode);
- delete pLiteral;
- pLiteral = NULL;
- return 1;
- }
-
- for(sal_uInt32 i=0;i<pLiteral->count();++i)
- {
- OSQLParseNode* pChild = pLiteral->getChild(i);
- buildStringNodes(pChild);
- }
- if(SQL_ISRULE(pLiteral,term) || SQL_ISRULE(pLiteral,value_exp_primary))
- {
- m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_INVALID_COMPARE);
- return 0;
- }
- return 1;
-}
-//-----------------------------------------------------------------------------
-sal_Int16 OSQLParser::buildComparsionRule(OSQLParseNode*& pAppend,OSQLParseNode* pLiteral)
-{
- OSQLParseNode* pComp = new OSQLInternalNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("=")), SQL_NODE_EQUAL);
- return buildPredicateRule(pAppend,pLiteral,pComp);
-}
-
-
-//-----------------------------------------------------------------------------
-void OSQLParser::reduceLiteral(OSQLParseNode*& pLiteral, sal_Bool bAppendBlank)
-{
- OSL_ENSURE(pLiteral->isRule(), "This is no ::com::sun::star::chaos::Rule");
- OSL_ENSURE(pLiteral->count() == 2, "OSQLParser::ReduceLiteral() Invalid count");
- OSQLParseNode* pTemp = pLiteral;
- ::rtl::OUStringBuffer aValue(pLiteral->getChild(0)->getTokenValue());
- if (bAppendBlank)
- {
- aValue.appendAscii(" ");
- }
-
- aValue.append(pLiteral->getChild(1)->getTokenValue());
-
- pLiteral = new OSQLInternalNode(aValue.makeStringAndClear(),SQL_NODE_STRING);
- delete pTemp;
-}
-
-// -------------------------------------------------------------------------
-void OSQLParser::error(const sal_Char *fmt)
-{
- if(!m_sErrorMessage.getLength())
- {
- ::rtl::OUString sStr(fmt,strlen(fmt),RTL_TEXTENCODING_UTF8);
- ::rtl::OUString sSQL_TOKEN(RTL_CONSTASCII_USTRINGPARAM("SQL_TOKEN_"));
-
- sal_Int32 nPos1 = sStr.indexOf(sSQL_TOKEN);
- if(nPos1 != -1)
- {
- ::rtl::OUString sFirst = sStr.copy(0,nPos1);
- sal_Int32 nPos2 = sStr.indexOf(sSQL_TOKEN,nPos1+1);
- if(nPos2 != -1)
- {
- ::rtl::OUString sSecond = sStr.copy(nPos1+sSQL_TOKEN.getLength(),nPos2-nPos1-sSQL_TOKEN.getLength());
- sFirst += sSecond;
- sFirst += sStr.copy(nPos2+sSQL_TOKEN.getLength());
- }
- else
- sFirst += sStr.copy(nPos1+sSQL_TOKEN.getLength());
-
- m_sErrorMessage = sFirst;
- }
- else
- m_sErrorMessage = sStr;
-
- ::rtl::OUString aError = s_pScanner->getErrorMessage();
- if(aError.getLength())
- {
- m_sErrorMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", "));
- m_sErrorMessage += aError;
- }
- }
-}
-// -------------------------------------------------------------------------
-int OSQLParser::SQLlex()
-{
- return s_pScanner->SQLlex();
-}
-
-#if defined __SUNPRO_CC
-#pragma enable_warn
-#elif defined _MSC_VER
-#pragma warning(pop)
-#endif
diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l
deleted file mode 100755
index 85296a8633..0000000000
--- a/connectivity/source/parse/sqlflex.l
+++ /dev/null
@@ -1,836 +0,0 @@
-%{
-
-//--------------------------------------------------------------------------
-//
-// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-//
-// Copyright 2000, 2010 Oracle and/or its affiliates.
-//
-// OpenOffice.org - a multi-platform office productivity suite
-//
-// This file is part of OpenOffice.org.
-//
-// OpenOffice.org is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License version 3
-// only, as published by the Free Software Foundation.
-//
-// OpenOffice.org is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Lesser General Public License version 3 for more details
-// (a copy is included in the LICENSE file that accompanied this code).
-//
-// You should have received a copy of the GNU Lesser General Public License
-// version 3 along with OpenOffice.org. If not, see
-// <http://www.openoffice.org/license.html>
-// for a copy of the LGPLv3 License.
-//
-//--------------------------------------------------------------------------
-
-#define YY_EXIT 1 // YY_FATAL will not halt the application
-
-#ifndef _CSTDARG_
-#include <cstdarg> // std::va_list
-#endif
-
-#ifndef _INC_STRING
-#include <string.h>
-#endif
-
-#include "internalnode.hxx"
-
-#ifndef _CONNECTIVITY_SQLYACC_HXX
-#define _CONNECTIVITY_SQLYACC_HXX
-
-#ifndef SQLYYDEBUG
-#define SQLYYDEBUG 1
-#endif
-
-#include "sqlbison.hxx"
-#endif
-#include "sqlscan.hxx"
-#include <osl/diagnose.h>
-#include <rtl/strbuf.hxx>
-#include <connectivity/sqlparse.hxx>
-
-#if defined __GNUC__
- #pragma GCC system_header
-#elif defined __SUNPRO_CC
-#pragma disable_warn
-#elif defined _MSC_VER
-#pragma warning(push, 1)
-/**/
-#ifdef yywrap
-#undef yywrap
-#define yywrap() 1
-#endif
-/**/
-#endif
-
-using namespace connectivity;
-
-//=============================================================================
-//
-// Erzeugung der Blaetter fuer die Token
-// Blaetter werden generell vom Lexer erzeugt
-
-static ::rtl::OUString aEmptyString;
-
-static sal_Int32 gatherString(sal_Int32 delim, sal_Int32 nTyp);
-static sal_Int32 gatherName(const sal_Char*);
-static sal_Int32 gatherNamePre(const sal_Char* );
-// has to be set before the parser starts
-OSQLScanner* xxx_pGLOBAL_SQLSCAN = NULL;
-
-#define SQL_NEW_NODE(text, token) \
- SQLyylval.pParseNode = new OSQLInternalNode(text, token);
-
-#define SQL_NEW_KEYWORD(token) \
- SQLyylval.pParseNode = new OSQLInternalNode(aEmptyString, SQL_NODE_KEYWORD, (token)); return token;
-
-#define SQL_NEW_INTNUM SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_INTNUM); return SQL_TOKEN_INTNUM;
-#define SQL_NEW_APPROXNUM SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_APPROXNUM); return SQL_TOKEN_APPROXNUM;
-#define SQL_NEW_DATE SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_ACCESS_DATE); return SQL_TOKEN_ACCESS_DATE;
-
-#define YY_INPUT(buf,result,max_size) \
-{ \
- buf[0] = xxx_pGLOBAL_SQLSCAN->SQLyygetc(); \
- result = buf[0] != -1; \
-}
-
-#define YY_FATAL_ERROR(msg) \
-{ \
- xxx_pGLOBAL_SQLSCAN->SQLyyerror(msg); \
-}
-
-//
-//=============================================================================
-
-%}
-
-%s SQL
-%s PREDICATE_ENG
-%s PREDICATE_GER
-%s DATE
-%s STRING
-
-%option noyywrap
-%option never-interactive
-%%
-
-ABS {SQL_NEW_KEYWORD(SQL_TOKEN_ABS); }
-ACOS {SQL_NEW_KEYWORD(SQL_TOKEN_ACOS); }
-AFTER {SQL_NEW_KEYWORD(SQL_TOKEN_AFTER); }
-ALL {SQL_NEW_KEYWORD(SQL_TOKEN_ALL); }
-ALTER {SQL_NEW_KEYWORD(SQL_TOKEN_ALTER); }
-AND {SQL_NEW_KEYWORD(SQL_TOKEN_AND); }
-ANY {SQL_NEW_KEYWORD(SQL_TOKEN_ANY); }
-ARRAY_AGG {SQL_NEW_KEYWORD(SQL_TOKEN_ARRAY_AGG); }
-AS {SQL_NEW_KEYWORD(SQL_TOKEN_AS); }
-ASC {SQL_NEW_KEYWORD(SQL_TOKEN_ASC); }
-ASCII {SQL_NEW_KEYWORD(SQL_TOKEN_ASCII); }
-ASIN {SQL_NEW_KEYWORD(SQL_TOKEN_ASIN); }
-AT {SQL_NEW_KEYWORD(SQL_TOKEN_AT); }
-ATAN {SQL_NEW_KEYWORD(SQL_TOKEN_ATAN); }
-ATAN2 {SQL_NEW_KEYWORD(SQL_TOKEN_ATAN2); }
-ATOMIC {SQL_NEW_KEYWORD(SQL_TOKEN_ATOMIC); }
-AUTHORIZATION {SQL_NEW_KEYWORD(SQL_TOKEN_AUTHORIZATION); }
-AVG {SQL_NEW_KEYWORD(SQL_TOKEN_AVG); }
-
-BEFORE {SQL_NEW_KEYWORD(SQL_TOKEN_BEFORE); }
-BEGIN {SQL_NEW_KEYWORD(SQL_TOKEN_BEGIN); }
-BETWEEN {SQL_NEW_KEYWORD(SQL_TOKEN_BETWEEN); }
-BIGINT {SQL_NEW_KEYWORD(SQL_TOKEN_BIGINT); }
-BINARY {SQL_NEW_KEYWORD(SQL_TOKEN_BINARY); }
-BIT {SQL_NEW_KEYWORD(SQL_TOKEN_BIT); }
-BIT_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_BIT_LENGTH); }
-BLOB {SQL_NEW_KEYWORD(SQL_TOKEN_BLOB); }
-BOTH {SQL_NEW_KEYWORD(SQL_TOKEN_BOTH); }
-BY {SQL_NEW_KEYWORD(SQL_TOKEN_BY); }
-
-CALL {SQL_NEW_KEYWORD(SQL_TOKEN_CALL); }
-CASE {SQL_NEW_KEYWORD(SQL_TOKEN_CASE); }
-CAST {SQL_NEW_KEYWORD(SQL_TOKEN_CAST); }
-CEILING {SQL_NEW_KEYWORD(SQL_TOKEN_CEILING); }
-CHAR {SQL_NEW_KEYWORD(SQL_TOKEN_CHAR); }
-CHARACTER {SQL_NEW_KEYWORD(SQL_TOKEN_CHARACTER); }
-CHAR(ACTER)?_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_CHAR_LENGTH); }
-CHECK {SQL_NEW_KEYWORD(SQL_TOKEN_CHECK); }
-CLOB {SQL_NEW_KEYWORD(SQL_TOKEN_CLOB); }
-COALESCE {SQL_NEW_KEYWORD(SQL_TOKEN_COALESCE); }
-COLLATE {SQL_NEW_KEYWORD(SQL_TOKEN_COLLATE); }
-COLLECT {SQL_NEW_KEYWORD(SQL_TOKEN_COLLECT); }
-COMMIT {SQL_NEW_KEYWORD(SQL_TOKEN_COMMIT); }
-CONCAT {SQL_NEW_KEYWORD(SQL_TOKEN_CONCAT); }
-CONTINUE {SQL_NEW_KEYWORD(SQL_TOKEN_CONTINUE); }
-CONVERT {SQL_NEW_KEYWORD(SQL_TOKEN_CONVERT); }
-COS {SQL_NEW_KEYWORD(SQL_TOKEN_COS); }
-COT {SQL_NEW_KEYWORD(SQL_TOKEN_COT); }
-COUNT {SQL_NEW_KEYWORD(SQL_TOKEN_COUNT); }
-CREATE {SQL_NEW_KEYWORD(SQL_TOKEN_CREATE); }
-CROSS {SQL_NEW_KEYWORD(SQL_TOKEN_CROSS); }
-CUME_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_CUME_DIST); }
-CURRENT {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT); }
-CURRENT_DATE {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_DATE); }
-CURRENT_CATALOG {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_CATALOG); }
-CURRENT_DEFAULT_TRANSFORM_GROUP {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_DEFAULT_TRANSFORM_GROUP); }
-CURRENT_PATH {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_PATH); }
-CURRENT_ROLE {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_ROLE); }
-CURRENT_SCHEMA {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_SCHEMA); }
-CURRENT_USER {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_USER); }
-CURDATE {SQL_NEW_KEYWORD(SQL_TOKEN_CURDATE); }
-CURRENT_TIME {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_TIME); }
-CURTIME {SQL_NEW_KEYWORD(SQL_TOKEN_CURTIME); }
-CURRENT_TIMESTAMP {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_TIMESTAMP); }
-CURSOR {SQL_NEW_KEYWORD(SQL_TOKEN_CURSOR); }
-
-D {SQL_NEW_KEYWORD(SQL_TOKEN_D); }
-DATE {SQL_NEW_KEYWORD(SQL_TOKEN_DATE); }
-DATEDIFF {SQL_NEW_KEYWORD(SQL_TOKEN_DATEDIFF); }
-DATEVALUE {SQL_NEW_KEYWORD(SQL_TOKEN_DATEVALUE); }
-DAY {SQL_NEW_KEYWORD(SQL_TOKEN_DAY); }
-DAYNAME {SQL_NEW_KEYWORD(SQL_TOKEN_DAYNAME); }
-DAYOFMONTH {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFMONTH); }
-DAYOFWEEK {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFWEEK); }
-DAYOFYEAR {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFYEAR); }
-DEC {SQL_NEW_KEYWORD(SQL_TOKEN_DEC); }
-DECIMAL {SQL_NEW_KEYWORD(SQL_TOKEN_DECIMAL); }
-DECLARE {SQL_NEW_KEYWORD(SQL_TOKEN_DECLARE); }
-DEFAULT {SQL_NEW_KEYWORD(SQL_TOKEN_DEFAULT); }
-DEGREES {SQL_NEW_KEYWORD(SQL_TOKEN_DEGREES); }
-DELETE {SQL_NEW_KEYWORD(SQL_TOKEN_DELETE); }
-DENSE_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_DENSE_RANK); }
-DESC {SQL_NEW_KEYWORD(SQL_TOKEN_DESC); }
-DIFFERENCE {SQL_NEW_KEYWORD(SQL_TOKEN_DIFFERENCE); }
-DISTINCT {SQL_NEW_KEYWORD(SQL_TOKEN_DISTINCT); }
-DOUBLE {SQL_NEW_KEYWORD(SQL_TOKEN_DOUBLE); }
-DROP {SQL_NEW_KEYWORD(SQL_TOKEN_DROP); }
-
-EACH {SQL_NEW_KEYWORD(SQL_TOKEN_EACH); }
-ELSE {SQL_NEW_KEYWORD(SQL_TOKEN_ELSE); }
-END {SQL_NEW_KEYWORD(SQL_TOKEN_END); }
-EVERY {SQL_NEW_KEYWORD(SQL_TOKEN_EVERY); }
-ESCAPE {SQL_NEW_KEYWORD(SQL_TOKEN_ESCAPE); }
-EXCEPT {SQL_NEW_KEYWORD(SQL_TOKEN_EXCEPT); }
-EXCLUDE {SQL_NEW_KEYWORD(SQL_TOKEN_EXCLUDE); }
-EXISTS {SQL_NEW_KEYWORD(SQL_TOKEN_EXISTS); }
-EXP {SQL_NEW_KEYWORD(SQL_TOKEN_EXP); }
-EXTRACT {SQL_NEW_KEYWORD(SQL_TOKEN_EXTRACT); }
-
-FALSE {SQL_NEW_KEYWORD(SQL_TOKEN_FALSE); }
-FETCH {SQL_NEW_KEYWORD(SQL_TOKEN_FETCH); }
-FIRST {SQL_NEW_KEYWORD(SQL_TOKEN_FIRST); }
-FIRST_VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_FIRST_VALUE); }
-FLOAT {SQL_NEW_KEYWORD(SQL_TOKEN_FLOAT); }
-FLOOR {SQL_NEW_KEYWORD(SQL_TOKEN_FLOOR); }
-FN {SQL_NEW_KEYWORD(SQL_TOKEN_FN); }
-FOLLOWING {SQL_NEW_KEYWORD(SQL_TOKEN_FOLLOWING); }
-FOR {SQL_NEW_KEYWORD(SQL_TOKEN_FOR); }
-FOREIGN {SQL_NEW_KEYWORD(SQL_TOKEN_FOREIGN); }
-FOUND {SQL_NEW_KEYWORD(SQL_TOKEN_FOUND); }
-FROM {SQL_NEW_KEYWORD(SQL_TOKEN_FROM); }
-FULL {SQL_NEW_KEYWORD(SQL_TOKEN_FULL); }
-FUSION {SQL_NEW_KEYWORD(SQL_TOKEN_FUSION); }
-
-GRANT {SQL_NEW_KEYWORD(SQL_TOKEN_GRANT); }
-GROUP {SQL_NEW_KEYWORD(SQL_TOKEN_GROUP); }
-
-HAVING {SQL_NEW_KEYWORD(SQL_TOKEN_HAVING); }
-HOUR {SQL_NEW_KEYWORD(SQL_TOKEN_HOUR); }
-
-IGNORE {SQL_NEW_KEYWORD(SQL_TOKEN_IGNORE); }
-IN {SQL_NEW_KEYWORD(SQL_TOKEN_IN); }
-INNER {SQL_NEW_KEYWORD(SQL_TOKEN_INNER); }
-INSERT {SQL_NEW_KEYWORD(SQL_TOKEN_INSERT); }
-INSTEAD {SQL_NEW_KEYWORD(SQL_TOKEN_INSTEAD); }
-INT(EGER)? {SQL_NEW_KEYWORD(SQL_TOKEN_INTEGER); }
-INTERSECT {SQL_NEW_KEYWORD(SQL_TOKEN_INTERSECT); }
-INTERVAL {SQL_NEW_KEYWORD(SQL_TOKEN_INTERVAL); }
-INTERSECTION {SQL_NEW_KEYWORD(SQL_TOKEN_INTERSECTION); }
-INTO {SQL_NEW_KEYWORD(SQL_TOKEN_INTO); }
-IS {SQL_NEW_KEYWORD(SQL_TOKEN_IS); }
-
-JOIN {SQL_NEW_KEYWORD(SQL_TOKEN_JOIN); }
-
-KEY {SQL_NEW_KEYWORD(SQL_TOKEN_KEY); }
-
-LAG {SQL_NEW_KEYWORD(SQL_TOKEN_LAG); }
-LARGE {SQL_NEW_KEYWORD(SQL_TOKEN_LARGE); }
-LAST {SQL_NEW_KEYWORD(SQL_TOKEN_LAST); }
-LAST_VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_LAST_VALUE); }
-LCASE {SQL_NEW_KEYWORD(SQL_TOKEN_LCASE); }
-LEAD {SQL_NEW_KEYWORD(SQL_TOKEN_LEAD); }
-LEADING {SQL_NEW_KEYWORD(SQL_TOKEN_LEADING); }
-LEFT {SQL_NEW_KEYWORD(SQL_TOKEN_LEFT); }
-LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_LENGTH); }
-LIKE {SQL_NEW_KEYWORD(SQL_TOKEN_LIKE); }
-LIMIT {SQL_NEW_KEYWORD(SQL_TOKEN_LIMIT); }
-LN {SQL_NEW_KEYWORD(SQL_TOKEN_LN); }
-LOCAL {SQL_NEW_KEYWORD(SQL_TOKEN_LOCAL); }
-LOCATE {SQL_NEW_KEYWORD(SQL_TOKEN_LOCATE); }
-LOG {SQL_NEW_KEYWORD(SQL_TOKEN_LOG); }
-LOGF {SQL_NEW_KEYWORD(SQL_TOKEN_LOGF); }
-LOG10 {SQL_NEW_KEYWORD(SQL_TOKEN_LOG10); }
-LOWER {SQL_NEW_KEYWORD(SQL_TOKEN_LOWER); }
-LTRIM {SQL_NEW_KEYWORD(SQL_TOKEN_LTRIM); }
-
-MAX {SQL_NEW_KEYWORD(SQL_TOKEN_MAX); }
-MIN {SQL_NEW_KEYWORD(SQL_TOKEN_MIN); }
-MINUTE {SQL_NEW_KEYWORD(SQL_TOKEN_MINUTE); }
-MOD {SQL_NEW_KEYWORD(SQL_TOKEN_MOD); }
-MONTH {SQL_NEW_KEYWORD(SQL_TOKEN_MONTH); }
-MONTHNAME {SQL_NEW_KEYWORD(SQL_TOKEN_MONTHNAME); }
-
-NATIONAL {SQL_NEW_KEYWORD(SQL_TOKEN_NATIONAL); }
-NATURAL {SQL_NEW_KEYWORD(SQL_TOKEN_NATURAL); }
-NCHAR {SQL_NEW_KEYWORD(SQL_TOKEN_NCHAR); }
-NCLOB {SQL_NEW_KEYWORD(SQL_TOKEN_NCLOB); }
-NEW {SQL_NEW_KEYWORD(SQL_TOKEN_NEW); }
-NEXT {SQL_NEW_KEYWORD(SQL_TOKEN_NEXT); }
-NO {SQL_NEW_KEYWORD(SQL_TOKEN_NO); }
-NOT {SQL_NEW_KEYWORD(SQL_TOKEN_NOT); }
-NOW {SQL_NEW_KEYWORD(SQL_TOKEN_NOW); }
-NTH_VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_NTH_VALUE); }
-NTILE {SQL_NEW_KEYWORD(SQL_TOKEN_NTILE); }
-NULL {SQL_NEW_KEYWORD(SQL_TOKEN_NULL); }
-NULLIF {SQL_NEW_KEYWORD(SQL_TOKEN_NULLIF); }
-NULLS {SQL_NEW_KEYWORD(SQL_TOKEN_NULLS); }
-NUMERIC {SQL_NEW_KEYWORD(SQL_TOKEN_NUMERIC); }
-
-OBJECT {SQL_NEW_KEYWORD(SQL_TOKEN_OBJECT); }
-OCTET_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_OCTET_LENGTH); }
-OF {SQL_NEW_KEYWORD(SQL_TOKEN_OF); }
-OFFSET {SQL_NEW_KEYWORD(SQL_TOKEN_OFFSET); }
-OJ {SQL_NEW_KEYWORD(SQL_TOKEN_OJ); }
-OLD {SQL_NEW_KEYWORD(SQL_TOKEN_OLD); }
-ON {SQL_NEW_KEYWORD(SQL_TOKEN_ON); }
-ONLY {SQL_NEW_KEYWORD(SQL_TOKEN_ONLY); }
-OPTION {SQL_NEW_KEYWORD(SQL_TOKEN_OPTION); }
-OR {SQL_NEW_KEYWORD(SQL_TOKEN_OR); }
-ORDER {SQL_NEW_KEYWORD(SQL_TOKEN_ORDER); }
-OTHERS {SQL_NEW_KEYWORD(SQL_TOKEN_OTHERS); }
-OUTER {SQL_NEW_KEYWORD(SQL_TOKEN_OUTER); }
-OVER {SQL_NEW_KEYWORD(SQL_TOKEN_OVER); }
-
-PARTITION {SQL_NEW_KEYWORD(SQL_TOKEN_PARTITION); }
-PERCENT_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENT_RANK); }
-PERCENTILE_CONT {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENTILE_CONT); }
-PERCENTILE_DISC {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENTILE_DISC); }
-PI {SQL_NEW_KEYWORD(SQL_TOKEN_PI); }
-POSITION {SQL_NEW_KEYWORD(SQL_TOKEN_POSITION); }
-POWER {SQL_NEW_KEYWORD(SQL_TOKEN_POWER); }
-PRECEDING {SQL_NEW_KEYWORD(SQL_TOKEN_PRECEDING); }
-PRECISION {SQL_NEW_KEYWORD(SQL_TOKEN_PRECISION); }
-PRIMARY {SQL_NEW_KEYWORD(SQL_TOKEN_PRIMARY); }
-PRIVILEGES {SQL_NEW_KEYWORD(SQL_TOKEN_PRIVILEGES); }
-PROCEDURE {SQL_NEW_KEYWORD(SQL_TOKEN_PROCEDURE); }
-PUBLIC {SQL_NEW_KEYWORD(SQL_TOKEN_PUBLIC); }
-
-QUARTER {SQL_NEW_KEYWORD(SQL_TOKEN_QUARTER); }
-
-RADIANS {SQL_NEW_KEYWORD(SQL_TOKEN_RADIANS); }
-RAND {SQL_NEW_KEYWORD(SQL_TOKEN_RAND); }
-RANGE {SQL_NEW_KEYWORD(SQL_TOKEN_RANGE); }
-RANK {SQL_NEW_KEYWORD(SQL_TOKEN_RANK); }
-REAL {SQL_NEW_KEYWORD(SQL_TOKEN_REAL); }
-REFERENCES {SQL_NEW_KEYWORD(SQL_TOKEN_REFERENCES); }
-REFERENCING {SQL_NEW_KEYWORD(SQL_TOKEN_REFERENCING); }
-REPEAT {SQL_NEW_KEYWORD(SQL_TOKEN_REPEAT); }
-REPLACE {SQL_NEW_KEYWORD(SQL_TOKEN_REPLACE); }
-RESPECT {SQL_NEW_KEYWORD(SQL_TOKEN_RESPECT); }
-ROLLBACK {SQL_NEW_KEYWORD(SQL_TOKEN_ROLLBACK); }
-ROUND {SQL_NEW_KEYWORD(SQL_TOKEN_ROUND); }
-ROUNDMAGIC {SQL_NEW_KEYWORD(SQL_TOKEN_ROUNDMAGIC); }
-ROW {SQL_NEW_KEYWORD(SQL_TOKEN_ROW); }
-ROWS {SQL_NEW_KEYWORD(SQL_TOKEN_ROWS); }
-ROW_NUMBER {SQL_NEW_KEYWORD(SQL_TOKEN_ROW_NUMBER); }
-RIGHT {SQL_NEW_KEYWORD(SQL_TOKEN_RIGHT); }
-RTRIM {SQL_NEW_KEYWORD(SQL_TOKEN_RTRIM); }
-
-SCHEMA {SQL_NEW_KEYWORD(SQL_TOKEN_SCHEMA); }
-SECOND {SQL_NEW_KEYWORD(SQL_TOKEN_SECOND); }
-SELECT {SQL_NEW_KEYWORD(SQL_TOKEN_SELECT); }
-SET {SQL_NEW_KEYWORD(SQL_TOKEN_SET); }
-SIZE {SQL_NEW_KEYWORD(SQL_TOKEN_SIZE); }
-SIGN {SQL_NEW_KEYWORD(SQL_TOKEN_SIGN); }
-SIN {SQL_NEW_KEYWORD(SQL_TOKEN_SIN); }
-SMALLINT {SQL_NEW_KEYWORD(SQL_TOKEN_SMALLINT); }
-SOME {SQL_NEW_KEYWORD(SQL_TOKEN_SOME); }
-SOUNDEX {SQL_NEW_KEYWORD(SQL_TOKEN_SOUNDEX); }
-SPACE {SQL_NEW_KEYWORD(SQL_TOKEN_SPACE); }
-SQRT {SQL_NEW_KEYWORD(SQL_TOKEN_SQRT); }
-STDDEV_POP {SQL_NEW_KEYWORD(SQL_TOKEN_STDDEV_POP); }
-STDDEV_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_STDDEV_SAMP); }
-STATEMENT {SQL_NEW_KEYWORD(SQL_TOKEN_STATEMENT); }
-SUBSTRING {SQL_NEW_KEYWORD(SQL_TOKEN_SUBSTRING); }
-SUM {SQL_NEW_KEYWORD(SQL_TOKEN_SUM); }
-SESSION_USER {SQL_NEW_KEYWORD(SQL_TOKEN_SESSION_USER); }
-SYSTEM_USER {SQL_NEW_KEYWORD(SQL_TOKEN_SYSTEM_USER); }
-
-TABLE {SQL_NEW_KEYWORD(SQL_TOKEN_TABLE); }
-TAN {SQL_NEW_KEYWORD(SQL_TOKEN_TAN); }
-THEN {SQL_NEW_KEYWORD(SQL_TOKEN_THEN); }
-TIES {SQL_NEW_KEYWORD(SQL_TOKEN_TIES); }
-TIME {SQL_NEW_KEYWORD(SQL_TOKEN_TIME); }
-TIMESTAMP {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMP); }
-TIMESTAMPADD {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPADD); }
-TIMESTAMPDIFF {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPDIFF); }
-TIMEVALUE {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEVALUE); }
-TIMEZONE_HOUR {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEZONE_HOUR); }
-TIMEZONE_MINUTE {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEZONE_MINUTE); }
-TO {SQL_NEW_KEYWORD(SQL_TOKEN_TO); }
-TRAILING {SQL_NEW_KEYWORD(SQL_TOKEN_TRAILING); }
-TRANSLATE {SQL_NEW_KEYWORD(SQL_TOKEN_TRANSLATE); }
-TRIGGER {SQL_NEW_KEYWORD(SQL_TOKEN_TRIGGER); }
-TRIM {SQL_NEW_KEYWORD(SQL_TOKEN_TRIM); }
-TRUE {SQL_NEW_KEYWORD(SQL_TOKEN_TRUE); }
-TRUNCATE {SQL_NEW_KEYWORD(SQL_TOKEN_TRUNCATE); }
-TS {SQL_NEW_KEYWORD(SQL_TOKEN_TS); }
-T {SQL_NEW_KEYWORD(SQL_TOKEN_T); }
-
-UCASE {SQL_NEW_KEYWORD(SQL_TOKEN_UCASE); }
-UNBOUNDED {SQL_NEW_KEYWORD(SQL_TOKEN_UNBOUNDED); }
-UNION {SQL_NEW_KEYWORD(SQL_TOKEN_UNION); }
-UNIQUE {SQL_NEW_KEYWORD(SQL_TOKEN_UNIQUE); }
-UNKNOWN {SQL_NEW_KEYWORD(SQL_TOKEN_UNKNOWN); }
-UPDATE {SQL_NEW_KEYWORD(SQL_TOKEN_UPDATE); }
-UPPER {SQL_NEW_KEYWORD(SQL_TOKEN_UPPER); }
-USAGE {SQL_NEW_KEYWORD(SQL_TOKEN_USAGE); }
-USER {SQL_NEW_KEYWORD(SQL_TOKEN_USER); }
-USING {SQL_NEW_KEYWORD(SQL_TOKEN_USING); }
-
-VARBINARY {SQL_NEW_KEYWORD(SQL_TOKEN_VARBINARY); }
-VARCHAR {SQL_NEW_KEYWORD(SQL_TOKEN_VARCHAR); }
-VARYING {SQL_NEW_KEYWORD(SQL_TOKEN_VARYING); }
-VAR_POP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_POP); }
-VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_SAMP); }
-VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_VALUE); }
-VALUES {SQL_NEW_KEYWORD(SQL_TOKEN_VALUES); }
-VIEW {SQL_NEW_KEYWORD(SQL_TOKEN_VIEW); }
-
-WEEK {SQL_NEW_KEYWORD(SQL_TOKEN_WEEK); }
-WHEN {SQL_NEW_KEYWORD(SQL_TOKEN_WHEN); }
-WHERE {SQL_NEW_KEYWORD(SQL_TOKEN_WHERE); }
-WITH {SQL_NEW_KEYWORD(SQL_TOKEN_WITH); }
-WITHIN {SQL_NEW_KEYWORD(SQL_TOKEN_WITHIN); }
-WITHOUT {SQL_NEW_KEYWORD(SQL_TOKEN_WITHOUT); }
-WORK {SQL_NEW_KEYWORD(SQL_TOKEN_WORK); }
-
-YEAR {SQL_NEW_KEYWORD(SQL_TOKEN_YEAR); }
-
-ZONE {SQL_NEW_KEYWORD(SQL_TOKEN_ZONE); }
-
-"<" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_LESS);return SQL_LESS;}
-">" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_GREAT);return SQL_GREAT;}
-"=" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_EQUAL);return SQL_EQUAL;}
-"<=" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_LESSEQ);return SQL_LESSEQ;}
-">=" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_GREATEQ);return SQL_GREATEQ;}
-"<>" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_NOTEQUAL);return SQL_NOTEQUAL;}
-"!=" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_NOTEQUAL);return SQL_NOTEQUAL;}
-"||" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_CONCAT);return SQL_CONCAT;}
-
-
-[-+*/:(),.;?{}] { return SQLyytext[0]; }
-
-
-<SQL>[A-Za-z\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375][A-Za-z\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375_0-9]* {return gatherName( SQLyytext);}
-
-<SQL>([0-9]+) |
-<SQL>([0-9]+"."[0-9]*) |
-<SQL>("."[0-9]*) {SQL_NEW_INTNUM; }
-
-<SQL>[0-9]+[eE][+-]?[0-9]+ |
-<SQL>[0-9]+"."[0-9]*[eE][+-]?[0-9]+ |
-<SQL>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; }
-
-<PREDICATE_GER,PREDICATE_ENG,DATE>[A-Za-z\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375][A-Za-z0-9_%.,*?\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375]* {return gatherNamePre(SQLyytext);}
-
-<PREDICATE_GER,PREDICATE_ENG>([0-9]+) {SQL_NEW_INTNUM; }
-<PREDICATE_ENG>([0-9]{1,3}(","[0-9]{3})+) {SQL_NEW_INTNUM; }
-<PREDICATE_GER>([0-9]{1,3}("."[0-9]{3})+) {SQL_NEW_INTNUM; }
-
-<PREDICATE_ENG>([0-9]+"."[0-9]+) |
-<PREDICATE_ENG>([0-9]{1,3}(","[0-9]{3})+"."[0-9]+) |
-<PREDICATE_ENG>("."[0-9]+) {SQL_NEW_APPROXNUM; }
-<PREDICATE_ENG>[0-9]+[eE][+-]?[0-9]+ |
-<PREDICATE_ENG>[0-9]+"."[0-9]*[eE][+-]?[0-9]+ |
-<PREDICATE_ENG>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; }
-
-<PREDICATE_GER>([0-9]+","[0-9]+) |
-<PREDICATE_GER>([0-9]{1,3}("."[0-9]{3})+","[0-9]+) |
-<PREDICATE_GER>(","[0-9]+) {SQL_NEW_APPROXNUM; }
-<PREDICATE_GER>[0-9]+[eE][+-]?[0-9]+ |
-<PREDICATE_GER>[0-9]+","[0-9]*[eE][+-]?[0-9]+ |
-<PREDICATE_GER>","[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; }
-
-<PREDICATE_GER,PREDICATE_ENG>[0-9.,][A-Za-z0-9_.,%]* {return gatherNamePre(SQLyytext);}
-
-<SQL>\" { return gatherString('\"',0); }
-<SQL>` { return gatherString('`' ,0); }
-
-<PREDICATE_GER,PREDICATE_ENG,DATE,SQL>"[" { return gatherString(']' ,0);}
-
-\' { return gatherString('\'',1); }
-
-<PREDICATE_GER,PREDICATE_ENG,DATE># { return gatherString('#' ,2); }
-
-<DATE>[0-9]{1,4}[^ ]*[0-9] |
-<DATE>[0-9]{1,4}[^ ]*[0-9][ ][0-9]{1,4}[^ ]*[0-9] { SQL_NEW_DATE; }
-
-<STRING>["-""+""*""/"":""("")"",""."";""?""{""}"] { return SQLyytext[0]; } /* */
-<STRING>"[" { return gatherString(']' ,0); }
-<STRING>[^ ':["?"]* { return gatherNamePre(SQLyytext); }
-
-\n {}
-
-[ \t\r]+ {}
-
-"--".*$ {}
-
-. {YY_FATAL_ERROR("Invalid symbol"); return SQL_TOKEN_INVALIDSYMBOL;}
-
-%%
-
-// Kludge around a bug (well, Posix incompatibility) in flex 2.5.x
-// http://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=189332
-#if YY_FLEX_MAJOR_VERSION >= 2 && YY_FLEX_MINOR_VERSION >= 5
-
- #ifndef YY_FLUSH_BUFFER
- #define YY_FLUSH_BUFFER SQLyy_flush_buffer(YY_CURRENT_BUFFER )
- #endif
-
- #ifndef yytext_ptr
- #define yytext_ptr SQLyytext
- #endif
-
-#endif
-
-// Versions of flex apparently differ in whether input() resp. yyinput() returns
-// zero or EOF upon end of file:
-inline bool checkeof(int c) { return c == 0 || c == EOF; }
-
-/*
- * Read SQL string literal
- * Valid strings:
- * '' 'a string' 'quote '' within string'
- * "" "a string" "quote "" within string"
- * nTyp == 0 -> SQL_NODE_NAME
- * nTyp == 1 -> SQL_NODE_STRING
- * nTyp == 2 -> SQL_NODE_ACCESS_DATE
- */
-sal_Int32 gatherString( sal_Int32 delim, sal_Int32 nTyp)
-{
- sal_Char ch;
- ::rtl::OStringBuffer sBuffer(256);
-
- while (!checkeof(ch = yyinput()))
- {
- if (ch == delim)
- {
- if ((ch = yyinput()) != delim)
- {
- if (!checkeof(ch))
- unput(ch);
-
- switch(nTyp)
- {
- case 0:
- SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME);
- return SQL_TOKEN_NAME;
- case 1:
- SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_STRING);
- return SQL_TOKEN_STRING;
- case 2:
- SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_ACCESS_DATE);
- return SQL_TOKEN_ACCESS_DATE;
- }
- }
- else
- {
- sBuffer.append(ch);
- }
-
- }
- else if (nTyp != 1 && (ch == '\r' || ch == '\n') )
- break;
- else
- {
- sBuffer.append(ch);
- }
- }
- YY_FATAL_ERROR("Unterminated name string");
- return SQL_TOKEN_INVALIDSYMBOL;
-}
-
-sal_Int32 mapEnumToToken(IParseContext::InternationalKeyCode _eKeyCode )
-{
- sal_Int32 nTokenID = 0;
- switch( _eKeyCode )
- {
- case IParseContext::KEY_LIKE: nTokenID = SQL_TOKEN_LIKE; break;
- case IParseContext::KEY_NOT: nTokenID = SQL_TOKEN_NOT; break;
- case IParseContext::KEY_NULL: nTokenID = SQL_TOKEN_NULL; break;
- case IParseContext::KEY_TRUE: nTokenID = SQL_TOKEN_TRUE; break;
- case IParseContext::KEY_FALSE: nTokenID = SQL_TOKEN_FALSE; break;
- case IParseContext::KEY_IS: nTokenID = SQL_TOKEN_IS; break;
- case IParseContext::KEY_BETWEEN: nTokenID = SQL_TOKEN_BETWEEN; break;
- case IParseContext::KEY_OR: nTokenID = SQL_TOKEN_OR; break;
- case IParseContext::KEY_AND: nTokenID = SQL_TOKEN_AND; break;
- case IParseContext::KEY_AVG: nTokenID = SQL_TOKEN_AVG; break;
- case IParseContext::KEY_COUNT: nTokenID = SQL_TOKEN_COUNT; break;
- case IParseContext::KEY_MAX: nTokenID = SQL_TOKEN_MAX; break;
- case IParseContext::KEY_MIN: nTokenID = SQL_TOKEN_MIN; break;
- case IParseContext::KEY_SUM: nTokenID = SQL_TOKEN_SUM; break;
- case IParseContext::KEY_EVERY: nTokenID = SQL_TOKEN_EVERY; break;
- case IParseContext::KEY_ANY: nTokenID = SQL_TOKEN_ANY; break;
- case IParseContext::KEY_SOME: nTokenID = SQL_TOKEN_SOME; break;
- case IParseContext::KEY_STDDEV_POP: nTokenID = SQL_TOKEN_STDDEV_POP; break;
- case IParseContext::KEY_STDDEV_SAMP: nTokenID = SQL_TOKEN_STDDEV_SAMP; break;
- case IParseContext::KEY_VAR_SAMP: nTokenID = SQL_TOKEN_VAR_SAMP; break;
- case IParseContext::KEY_VAR_POP: nTokenID = SQL_TOKEN_VAR_POP; break;
- case IParseContext::KEY_COLLECT: nTokenID = SQL_TOKEN_COLLECT; break;
- case IParseContext::KEY_FUSION: nTokenID = SQL_TOKEN_FUSION; break;
- case IParseContext::KEY_INTERSECTION: nTokenID = SQL_TOKEN_INTERSECTION; break;
- default:
- OSL_FAIL( "mapEnumToToken: unsupported key!" );
- }
- return nTokenID;
-}
-/*
- * Read SQL Name literal
- * Valid Names or internatioanl keywords:
- * As we have international keywords, we test first on them
- */
-sal_Int32 gatherName(const sal_Char* text)
-{
- sal_Int32 nToken;
- OSL_ENSURE(xxx_pGLOBAL_SQLSCAN,"You forgot to set the scanner!");
- IParseContext::InternationalKeyCode eKeyCode = xxx_pGLOBAL_SQLSCAN->getInternationalTokenID(text);
- switch (eKeyCode)
- {
- case IParseContext::KEY_LIKE:
- case IParseContext::KEY_NOT:
- case IParseContext::KEY_NULL:
- case IParseContext::KEY_TRUE:
- case IParseContext::KEY_FALSE:
- case IParseContext::KEY_IS:
- case IParseContext::KEY_BETWEEN:
- case IParseContext::KEY_OR:
- case IParseContext::KEY_AND:
- case IParseContext::KEY_COUNT:
- case IParseContext::KEY_AVG:
- case IParseContext::KEY_MAX:
- case IParseContext::KEY_MIN:
- case IParseContext::KEY_SUM:
- case IParseContext::KEY_EVERY:
- case IParseContext::KEY_ANY:
- case IParseContext::KEY_SOME:
- case IParseContext::KEY_STDDEV_POP:
- case IParseContext::KEY_STDDEV_SAMP:
- case IParseContext::KEY_VAR_SAMP:
- case IParseContext::KEY_VAR_POP:
- case IParseContext::KEY_COLLECT:
- case IParseContext::KEY_FUSION:
- case IParseContext::KEY_INTERSECTION:
- nToken = mapEnumToToken(eKeyCode);
- SQL_NEW_KEYWORD(nToken);
- break;
- default:
- SQL_NEW_NODE(::rtl::OUString(text,strlen(text),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME);
- return SQL_TOKEN_NAME;
- }
-}
-/**
- Read SQL Name literal for predicate check
- Valid Names or internatioanl keywords:
- As we have international keywords, we test first on them
-*/
-sal_Int32 gatherNamePre(const sal_Char* text)
-{
- sal_Int32 nToken;
- OSL_ENSURE(xxx_pGLOBAL_SQLSCAN,"You forgot to set the scanner!");
- IParseContext::InternationalKeyCode eKeyCode = xxx_pGLOBAL_SQLSCAN->getInternationalTokenID(text);
- switch (eKeyCode)
- {
- case IParseContext::KEY_LIKE:
- case IParseContext::KEY_NOT:
- case IParseContext::KEY_NULL:
- case IParseContext::KEY_TRUE:
- case IParseContext::KEY_FALSE:
- case IParseContext::KEY_IS:
- case IParseContext::KEY_BETWEEN:
- case IParseContext::KEY_OR:
- case IParseContext::KEY_AND:
- case IParseContext::KEY_COUNT:
- case IParseContext::KEY_AVG:
- case IParseContext::KEY_MAX:
- case IParseContext::KEY_MIN:
- case IParseContext::KEY_SUM:
- case IParseContext::KEY_EVERY:
- case IParseContext::KEY_ANY:
- case IParseContext::KEY_SOME:
- case IParseContext::KEY_STDDEV_POP:
- case IParseContext::KEY_STDDEV_SAMP:
- case IParseContext::KEY_VAR_SAMP:
- case IParseContext::KEY_VAR_POP:
- case IParseContext::KEY_COLLECT:
- case IParseContext::KEY_FUSION:
- case IParseContext::KEY_INTERSECTION:
- nToken = mapEnumToToken(eKeyCode);
- SQL_NEW_KEYWORD(nToken);
- break;
- default:
- // we need a special handling for parameter
- {
- ::rtl::OString sStmt = xxx_pGLOBAL_SQLSCAN->getStatement();
- sal_Int32 nLength = strlen(text);
- sal_Int32 nPos = xxx_pGLOBAL_SQLSCAN->GetCurrentPos() - nLength - 2;
- if (sStmt.getStr()[nPos] == ':')
- {
- SQL_NEW_NODE(::rtl::OUString(text,nLength,RTL_TEXTENCODING_UTF8), SQL_NODE_NAME);
- nToken = SQL_TOKEN_NAME;
- }
- else
- {
- SQL_NEW_NODE(::rtl::OUString(text,nLength,RTL_TEXTENCODING_UTF8), SQL_NODE_STRING);
- nToken = SQL_TOKEN_STRING;
- }
- }
- }
- return nToken;
-}
-
-using namespace connectivity;
-
-static sal_uInt32 Intl_TokenID[] =
-{
- SQL_TOKEN_LIKE, SQL_TOKEN_NOT, SQL_TOKEN_NULL, SQL_TOKEN_TRUE,
- SQL_TOKEN_FALSE, SQL_TOKEN_IS, SQL_TOKEN_BETWEEN, SQL_TOKEN_OR,
- SQL_TOKEN_AND, SQL_TOKEN_AVG, SQL_TOKEN_COUNT, SQL_TOKEN_MAX,
- SQL_TOKEN_MIN, SQL_TOKEN_SUM
-};
-static bool IN_SQLyyerror;
-//------------------------------------------------------------------------------
-OSQLScanner::OSQLScanner()
- : m_nCurrentPos(0)
- , m_bInternational(sal_False)
- , m_pContext(NULL)
- , m_nRule(0) // 0 is INITIAL
-{
- IN_SQLyyerror = false;
-}
-
-//------------------------------------------------------------------------------
-OSQLScanner::~OSQLScanner()
-{
-}
-//------------------------------------------------------------------------------
-void OSQLScanner::SQLyyerror(sal_Char *fmt)
-{
-
- if(IN_SQLyyerror)
- return;
- IN_SQLyyerror = true;
-
- OSL_ENSURE(m_pContext, "OSQLScanner::SQLyyerror: No Context set");
- m_sErrorMessage = ::rtl::OUString(fmt,strlen(fmt),RTL_TEXTENCODING_UTF8);
- if (m_nCurrentPos < m_sStatement.getLength())
- {
- m_sErrorMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(": "));
-
- ::rtl::OUString aError;
- static sal_Int32 BUFFERSIZE = 256;
- static sal_Char* Buffer = 0;
- if(!Buffer)
- Buffer = new sal_Char[BUFFERSIZE];
-
- sal_Char *s = Buffer;
- sal_Int32 nPos = 1;
- sal_Int32 ch = SQLyytext ? (SQLyytext[0] == 0 ? ' ' : SQLyytext[0]): ' ';
- *s++ = ch;
- while (!checkeof(ch = yyinput()))
- {
- if (ch == ' ')
- {
- if ((ch = yyinput()) != ' ')
- {
- if (!checkeof(ch))
- unput(ch);
- }
- *s = '\0';
- aError = ::rtl::OUString(Buffer,nPos,RTL_TEXTENCODING_UTF8);
- break;
- }
- else
- {
- *s++ = ch;
- if (++nPos == BUFFERSIZE)
- {
- ::rtl::OString aBuf(Buffer);
- delete[] Buffer;
- BUFFERSIZE *=2;
- Buffer = new sal_Char[BUFFERSIZE];
- for(sal_Int32 i=0;i<aBuf.getLength();++i,++Buffer)
- *Buffer = aBuf.getStr()[i];
- s = &Buffer[nPos];
- }
- }
- }
- m_sErrorMessage += aError;
- delete[] Buffer;
- Buffer = NULL;
- }
- IN_SQLyyerror = false;
- YY_FLUSH_BUFFER;
-}
-
-//------------------------------------------------------------------------------
-void OSQLScanner::prepareScan(const ::rtl::OUString & rNewStatement, const IParseContext* pContext, sal_Bool bInternational)
-{
- YY_FLUSH_BUFFER;
- BEGIN(m_nRule);
-
- m_sErrorMessage = ::rtl::OUString();
- m_sStatement = ::rtl::OString(rNewStatement,rNewStatement.getLength(), RTL_TEXTENCODING_UTF8);
- m_nCurrentPos = 0;
- m_bInternational = bInternational;
- m_pContext = pContext;
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 OSQLScanner::SQLyygetc(void)
-{
- sal_Int32 nPos = (m_nCurrentPos >= m_sStatement.getLength()) ? -1 : m_sStatement.getStr()[m_nCurrentPos];
- m_nCurrentPos++;
- return nPos;
-}
-
-//------------------------------------------------------------------------------
-IParseContext::InternationalKeyCode OSQLScanner::getInternationalTokenID(const sal_Char* sToken) const
-{
- OSL_ENSURE(m_pContext, "OSQLScanner::getInternationalTokenID: No Context set");
- return (m_bInternational) ? m_pContext->getIntlKeyCode(::rtl::OString(sToken) ) : IParseContext::KEY_NONE;
-}
-// -------------------------------------------------------------------------
-sal_Int32 OSQLScanner::GetCurrentRule() const { return m_nRule; }
-sal_Int32 OSQLScanner::GetGERRule() const { return PREDICATE_GER; }
-sal_Int32 OSQLScanner::GetENGRule() const { return PREDICATE_ENG; }
-sal_Int32 OSQLScanner::GetSQLRule() const { return SQL; }
-sal_Int32 OSQLScanner::GetDATERule() const { return DATE; }
-sal_Int32 OSQLScanner::GetSTRINGRule() const { return STRING; }
-// -------------------------------------------------------------------------
-void OSQLScanner::setScanner(sal_Bool _bNull)
-{
- xxx_pGLOBAL_SQLSCAN = _bNull ? NULL : this;
-}
-// -------------------------------------------------------------------------
-sal_Int32 OSQLScanner::SQLlex()
-{
- return SQLyylex();
-}
-
-#if defined __SUNPRO_CC
-#pragma enable_warn
-#elif defined _MSC_VER
-#pragma warning(pop)
-#endif
diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx
deleted file mode 100644
index 62554d6d77..0000000000
--- a/connectivity/source/parse/sqliterator.cxx
+++ /dev/null
@@ -1,2249 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/sqliterator.hxx"
-#include "connectivity/sdbcx/VTable.hxx"
-#include <connectivity/sqlparse.hxx>
-#include <connectivity/dbtools.hxx>
-#include <connectivity/sqlerror.hxx>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdb/XQueriesSupplier.hpp>
-#include <com/sun/star/sdb/ErrorCondition.hpp>
-#ifdef SQL_TEST_PARSETREEITERATOR
-#include <iostream>
-#endif
-#include "connectivity/PColumn.hxx"
-#include "connectivity/dbtools.hxx"
-#include <tools/diagnose_ex.h>
-#include "TConnection.hxx"
-#include <comphelper/types.hxx>
-#include <connectivity/dbmetadata.hxx>
-#include <com/sun/star/sdb/SQLFilterOperator.hpp>
-#include "diagnose_ex.h"
-#include <rtl/logfile.hxx>
-
-#define SQL_ISRULEOR2(pParseNode, e1,e2) ((pParseNode)->isRule() && (\
- (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e1) || \
- (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e2)))
-
-using namespace ::comphelper;
-using namespace ::connectivity;
-using namespace ::connectivity::sdbcx;
-using namespace ::dbtools;
-using namespace ::connectivity::parse;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdb;
-
-namespace connectivity
-{
- struct OSQLParseTreeIteratorImpl
- {
- ::std::vector< TNodePair > m_aJoinConditions;
- Reference< XConnection > m_xConnection;
- Reference< XDatabaseMetaData > m_xDatabaseMetaData;
- Reference< XNameAccess > m_xTableContainer;
- Reference< XNameAccess > m_xQueryContainer;
-
- ::boost::shared_ptr< OSQLTables > m_pTables; /// all tables which participate in the SQL statement
- ::boost::shared_ptr< OSQLTables > m_pSubTables; /// all tables from sub queries not the tables from the select tables
- ::boost::shared_ptr< QueryNameSet > m_pForbiddenQueryNames;
-
- sal_uInt32 m_nIncludeMask;
-
- bool m_bIsCaseSensitive;
-
- OSQLParseTreeIteratorImpl( const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxTables )
- :m_xConnection( _rxConnection )
- ,m_nIncludeMask( OSQLParseTreeIterator::All )
- ,m_bIsCaseSensitive( true )
- {
- OSL_PRECOND( m_xConnection.is(), "OSQLParseTreeIteratorImpl::OSQLParseTreeIteratorImpl: invalid connection!" );
- m_xDatabaseMetaData = m_xConnection->getMetaData();
-
- m_bIsCaseSensitive = m_xDatabaseMetaData.is() && m_xDatabaseMetaData->supportsMixedCaseQuotedIdentifiers();
- m_pTables.reset( new OSQLTables( m_bIsCaseSensitive ) );
- m_pSubTables.reset( new OSQLTables( m_bIsCaseSensitive ) );
-
- m_xTableContainer = _rxTables;
-
- DatabaseMetaData aMetaData( m_xConnection );
- if ( aMetaData.supportsSubqueriesInFrom() )
- {
- // connections might support the XQueriesSupplier interface, if they implement the css.sdb.Connection
- // service
- Reference< XQueriesSupplier > xSuppQueries( m_xConnection, UNO_QUERY );
- if ( xSuppQueries.is() )
- m_xQueryContainer = xSuppQueries->getQueries();
- }
- }
-
- public:
- inline bool isQueryAllowed( const ::rtl::OUString& _rQueryName )
- {
- if ( !m_pForbiddenQueryNames.get() )
- return true;
- if ( m_pForbiddenQueryNames->find( _rQueryName ) == m_pForbiddenQueryNames->end() )
- return true;
- return false;
- }
- };
-
- //-------------------------------------------------------------------------
- /** helper class for temporarily adding a query name to a list of forbidden query names
- */
- class ForbidQueryName
- {
- ::boost::shared_ptr< QueryNameSet >& m_rpAllForbiddenNames;
- ::rtl::OUString m_sForbiddenQueryName;
-
- public:
- ForbidQueryName( OSQLParseTreeIteratorImpl& _rIteratorImpl, const ::rtl::OUString _rForbiddenQueryName )
- :m_rpAllForbiddenNames( _rIteratorImpl.m_pForbiddenQueryNames )
- ,m_sForbiddenQueryName( _rForbiddenQueryName )
- {
- if ( !m_rpAllForbiddenNames.get() )
- m_rpAllForbiddenNames.reset( new QueryNameSet );
- m_rpAllForbiddenNames->insert( m_sForbiddenQueryName );
- }
-
- ~ForbidQueryName()
- {
- m_rpAllForbiddenNames->erase( m_sForbiddenQueryName );
- }
- };
-}
-//-----------------------------------------------------------------------------
-OSQLParseTreeIterator::OSQLParseTreeIterator(const Reference< XConnection >& _rxConnection,
- const Reference< XNameAccess >& _rxTables,
- const OSQLParser& _rParser,
- const OSQLParseNode* pRoot )
- :m_rParser( _rParser )
- ,m_pImpl( new OSQLParseTreeIteratorImpl( _rxConnection, _rxTables ) )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::OSQLParseTreeIterator" );
- setParseTree(pRoot);
-}
-
-//-----------------------------------------------------------------------------
-OSQLParseTreeIterator::OSQLParseTreeIterator( const OSQLParseTreeIterator& _rParentIterator, const OSQLParser& _rParser, const OSQLParseNode* pRoot )
- :m_rParser( _rParser )
- ,m_pImpl( new OSQLParseTreeIteratorImpl( _rParentIterator.m_pImpl->m_xConnection, _rParentIterator.m_pImpl->m_xTableContainer ) )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::OSQLParseTreeIterator" );
- m_pImpl->m_pForbiddenQueryNames = _rParentIterator.m_pImpl->m_pForbiddenQueryNames;
- setParseTree( pRoot );
-}
-
-//-----------------------------------------------------------------------------
-OSQLParseTreeIterator::~OSQLParseTreeIterator()
-{
- dispose();
-}
-
-// -----------------------------------------------------------------------------
-const OSQLTables& OSQLParseTreeIterator::getTables() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getTables" );
- return *m_pImpl->m_pTables;
-}
-
-// -----------------------------------------------------------------------------
-bool OSQLParseTreeIterator::isCaseSensitive() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::isCaseSensitive" );
- return m_pImpl->m_bIsCaseSensitive;
-}
-
-// -----------------------------------------------------------------------------
-void OSQLParseTreeIterator::dispose()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::dispose" );
- m_aSelectColumns = NULL;
- m_aGroupColumns = NULL;
- m_aOrderColumns = NULL;
- m_aParameters = NULL;
- m_pImpl->m_xTableContainer = NULL;
- m_pImpl->m_xDatabaseMetaData = NULL;
- m_aCreateColumns = NULL;
- m_pImpl->m_pTables->clear();
- m_pImpl->m_pSubTables->clear();
-}
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::setParseTree(const OSQLParseNode * pNewParseTree)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::setParseTree" );
- m_pImpl->m_pTables->clear();
- m_pImpl->m_pSubTables->clear();
-
- m_aSelectColumns = new OSQLColumns();
- m_aGroupColumns = new OSQLColumns();
- m_aOrderColumns = new OSQLColumns();
- m_aParameters = new OSQLColumns();
- m_aCreateColumns = new OSQLColumns();
-
- m_pParseTree = pNewParseTree;
- if (!m_pParseTree)
- {
- m_eStatementType = SQL_STATEMENT_UNKNOWN;
- return;
- }
-
- // falls m_pParseTree aber keine Connection, dann Fehler
- if ( !m_pImpl->m_xTableContainer.is() )
- return;
-
- m_aErrors = SQLException();
-
-
- // Statement-Typ ermitteln ...
- if (SQL_ISRULE(m_pParseTree,select_statement) || SQL_ISRULE(m_pParseTree,union_statement) )
- {
- m_eStatementType = SQL_STATEMENT_SELECT;
- }
- else if (SQL_ISRULE(m_pParseTree,insert_statement))
- {
- m_eStatementType = SQL_STATEMENT_INSERT;
- }
- else if (SQL_ISRULE(m_pParseTree,update_statement_searched))
- {
- m_eStatementType = SQL_STATEMENT_UPDATE;
- }
- else if (SQL_ISRULE(m_pParseTree,delete_statement_searched))
- {
- m_eStatementType = SQL_STATEMENT_DELETE;
- }
- else if (m_pParseTree->count() == 3 && SQL_ISRULE(m_pParseTree->getChild(1),odbc_call_spec))
- {
- m_eStatementType = SQL_STATEMENT_ODBC_CALL;
- }
- else if (SQL_ISRULE(m_pParseTree->getChild(0),base_table_def))
- {
- m_eStatementType = SQL_STATEMENT_CREATE_TABLE;
- m_pParseTree = m_pParseTree->getChild(0);
- }
- else
- {
- m_eStatementType = SQL_STATEMENT_UNKNOWN;
- //aIteratorStatus.setInvalidStatement();
- return;
- }
-}
-
-//-----------------------------------------------------------------------------
-namespace
-{
- //.........................................................................
- static void impl_getRowString( const Reference< XRow >& _rxRow, const sal_Int32 _nColumnIndex, ::rtl::OUString& _out_rString )
- {
- _out_rString = _rxRow->getString( _nColumnIndex );
- if ( _rxRow->wasNull() )
- _out_rString= ::rtl::OUString();
- }
-
- //.........................................................................
- static ::rtl::OUString lcl_findTableInMetaData(
- const Reference< XDatabaseMetaData >& _rxDBMeta, const ::rtl::OUString& _rCatalog,
- const ::rtl::OUString& _rSchema, const ::rtl::OUString& _rTableName )
- {
- ::rtl::OUString sComposedName;
-
- static const ::rtl::OUString s_sTableTypeView(RTL_CONSTASCII_USTRINGPARAM("VIEW"));
- static const ::rtl::OUString s_sTableTypeTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
- static const ::rtl::OUString s_sWildcard( RTL_CONSTASCII_USTRINGPARAM( "%" ));
-
- // we want all catalogues, all schemas, all tables
- Sequence< ::rtl::OUString > sTableTypes(3);
- sTableTypes[0] = s_sTableTypeView;
- sTableTypes[1] = s_sTableTypeTable;
- sTableTypes[2] = s_sWildcard; // just to be sure to include anything else ....
-
- if ( _rxDBMeta.is() )
- {
- sComposedName = ::rtl::OUString();
-
- Reference< XResultSet> xRes = _rxDBMeta->getTables(
- _rCatalog.getLength() ? makeAny( _rCatalog ) : Any(), _rSchema.getLength() ? _rSchema : s_sWildcard, _rTableName, sTableTypes );
-
- Reference< XRow > xCurrentRow( xRes, UNO_QUERY );
- if ( xCurrentRow.is() && xRes->next() )
- {
- ::rtl::OUString sCatalog, sSchema, sName;
-
- impl_getRowString( xCurrentRow, 1, sCatalog );
- impl_getRowString( xCurrentRow, 2, sSchema );
- impl_getRowString( xCurrentRow, 3, sName );
-
- sComposedName = ::dbtools::composeTableName(
- _rxDBMeta,
- sCatalog,
- sSchema,
- sName,
- sal_False,
- ::dbtools::eInDataManipulation
- );
- }
- }
- return sComposedName;
- }
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::impl_getQueryParameterColumns( const OSQLTable& _rQuery )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::impl_getQueryParameterColumns" );
- if ( ( m_pImpl->m_nIncludeMask & Parameters ) != Parameters )
- // parameters not to be included in the traversal
- return;
-
- ::rtl::Reference< OSQLColumns > pSubQueryParameterColumns( new OSQLColumns() );
-
- // get the command and the EscapeProcessing properties from the sub query
- ::rtl::OUString sSubQueryCommand;
- sal_Bool bEscapeProcessing = sal_False;
- try
- {
- Reference< XPropertySet > xQueryProperties( _rQuery, UNO_QUERY_THROW );
- OSL_VERIFY( xQueryProperties->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_COMMAND ) ) >>= sSubQueryCommand );
- OSL_VERIFY( xQueryProperties->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_ESCAPEPROCESSING ) ) >>= bEscapeProcessing );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- // parse the sub query
- do {
-
- if ( !bEscapeProcessing || ( sSubQueryCommand.getLength() == 0 ) )
- break;
-
- ::rtl::OUString sError;
- ::std::auto_ptr< OSQLParseNode > pSubQueryNode( const_cast< OSQLParser& >( m_rParser ).parseTree( sError, sSubQueryCommand, sal_False ) );
- if ( !pSubQueryNode.get() )
- break;
-
- OSQLParseTreeIterator aSubQueryIterator( *this, m_rParser, pSubQueryNode.get() );
- aSubQueryIterator.traverseSome( Parameters | SelectColumns );
- // SelectColumns might also contain parameters
- // #i77635# - 2007-07-23 / frank.schoenheit@sun.com
- pSubQueryParameterColumns = aSubQueryIterator.getParameters();
- aSubQueryIterator.dispose();
-
- } while ( false );
-
- // copy the parameters of the sub query to our own parameter array
- ::std::copy( pSubQueryParameterColumns->get().begin(), pSubQueryParameterColumns->get().end(),
- ::std::insert_iterator< OSQLColumns::Vector >( m_aParameters->get(), m_aParameters->get().end() ) );
-}
-
-//-----------------------------------------------------------------------------
-OSQLTable OSQLParseTreeIterator::impl_locateRecordSource( const ::rtl::OUString& _rComposedName )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::impl_locateRecordSource" );
- if ( !_rComposedName.getLength() )
- {
- OSL_FAIL( "OSQLParseTreeIterator::impl_locateRecordSource: no object name at all?" );
- return OSQLTable();
- }
-
- OSQLTable aReturn;
- ::rtl::OUString sComposedName( _rComposedName );
-
- try
- {
- ::rtl::OUString sCatalog, sSchema, sName;
- qualifiedNameComponents( m_pImpl->m_xDatabaseMetaData, sComposedName, sCatalog, sSchema, sName, ::dbtools::eInDataManipulation );
-
- // check whether there is a query with the given name
- bool bQueryDoesExist = m_pImpl->m_xQueryContainer.is() && m_pImpl->m_xQueryContainer->hasByName( sComposedName );
-
- // check whether the table container contains an object with the given name
- if ( !bQueryDoesExist && !m_pImpl->m_xTableContainer->hasByName( sComposedName ) )
- sComposedName = lcl_findTableInMetaData( m_pImpl->m_xDatabaseMetaData, sCatalog, sSchema, sName );
- bool bTableDoesExist = m_pImpl->m_xTableContainer->hasByName( sComposedName );
-
- // now obtain the object
-
- // if we're creating a table, and there already is a table or query with the same name,
- // this is worth an error
- if ( SQL_STATEMENT_CREATE_TABLE == m_eStatementType )
- {
- if ( bQueryDoesExist )
- impl_appendError( IParseContext::ERROR_INVALID_QUERY_EXIST, &sName );
- else if ( bTableDoesExist )
- impl_appendError( IParseContext::ERROR_INVALID_TABLE_EXIST, &sName );
- else
- aReturn = impl_createTableObject( sName, sCatalog, sSchema );
- }
- else
- {
- // queries win over tables, so if there's a query with this name, take this, no matter if
- // there's a table, too
- if ( bQueryDoesExist )
- {
- if ( !m_pImpl->isQueryAllowed( sComposedName ) )
- {
- impl_appendError( m_rParser.getErrorHelper().getSQLException( sdb::ErrorCondition::PARSER_CYCLIC_SUB_QUERIES, NULL ) );
- return NULL;
- }
-
- m_pImpl->m_xQueryContainer->getByName( sComposedName ) >>= aReturn;
-
- // collect the parameters from the sub query
- ForbidQueryName aForbidName( *m_pImpl, sComposedName );
- impl_getQueryParameterColumns( aReturn );
- }
- else if ( bTableDoesExist )
- m_pImpl->m_xTableContainer->getByName( sComposedName ) >>= aReturn;
- else
- {
- if ( m_pImpl->m_xQueryContainer.is() )
- // the connection on which we're working supports sub queries in from (else
- // m_xQueryContainer would not have been set), so emit a better error message
- impl_appendError( IParseContext::ERROR_INVALID_TABLE_OR_QUERY, &sName );
- else
- impl_appendError( IParseContext::ERROR_INVALID_TABLE, &sName );
- }
- }
- }
- catch(Exception&)
- {
- impl_appendError( IParseContext::ERROR_INVALID_TABLE, &sComposedName );
- }
-
- return aReturn;
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::traverseOneTableName( OSQLTables& _rTables,const OSQLParseNode * pTableName, const ::rtl::OUString & rTableRange )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseOneTableName" );
- if ( ( m_pImpl->m_nIncludeMask & TableNames ) != TableNames )
- // tables should not be included in the traversal
- return;
-
- OSL_ENSURE(pTableName != NULL,"OSQLParseTreeIterator::traverseOneTableName: pTableName == NULL");
-
- Any aCatalog;
- ::rtl::OUString aSchema,aTableName,aComposedName;
- ::rtl::OUString aTableRange(rTableRange);
-
- // Tabellenname abholen
- OSQLParseNode::getTableComponents(pTableName,aCatalog,aSchema,aTableName,m_pImpl->m_xDatabaseMetaData);
-
- // create the composed name like DOMAIN.USER.TABLE1
- aComposedName = ::dbtools::composeTableName(m_pImpl->m_xDatabaseMetaData,
- aCatalog.hasValue() ? ::comphelper::getString(aCatalog) : ::rtl::OUString(),
- aSchema,
- aTableName,
- sal_False,
- ::dbtools::eInDataManipulation);
-
- // if there is no alias for the table name assign the orignal name to it
- if ( !aTableRange.getLength() )
- aTableRange = aComposedName;
-
- // get the object representing this table/query
- OSQLTable aTable = impl_locateRecordSource( aComposedName );
- if ( aTable.is() )
- _rTables[ aTableRange ] = aTable;
-}
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::impl_fillJoinConditions(const OSQLParseNode* i_pJoinCondition)
-{
- if (i_pJoinCondition->count() == 3 && // Ausdruck is geklammert
- SQL_ISPUNCTUATION(i_pJoinCondition->getChild(0),"(") &&
- SQL_ISPUNCTUATION(i_pJoinCondition->getChild(2),")"))
- {
- impl_fillJoinConditions(i_pJoinCondition->getChild(1));
- }
- else if (SQL_ISRULEOR2(i_pJoinCondition,search_condition,boolean_term) && // AND/OR-Verknuepfung:
- i_pJoinCondition->count() == 3)
- {
- // nur AND Verknüpfung zulassen
- if ( SQL_ISTOKEN(i_pJoinCondition->getChild(1),AND) )
- {
- impl_fillJoinConditions(i_pJoinCondition->getChild(0));
- impl_fillJoinConditions(i_pJoinCondition->getChild(1));
- }
- }
- else if (SQL_ISRULE(i_pJoinCondition,comparison_predicate))
- {
- // only the comparison of columns is allowed
- OSL_ENSURE(i_pJoinCondition->count() == 3,"OQueryDesignView::InsertJoinConnection: Fehler im Parse Tree");
- if (SQL_ISRULE(i_pJoinCondition->getChild(0),column_ref) &&
- SQL_ISRULE(i_pJoinCondition->getChild(2),column_ref) &&
- i_pJoinCondition->getChild(1)->getNodeType() == SQL_NODE_EQUAL)
- {
- m_pImpl->m_aJoinConditions.push_back( TNodePair(i_pJoinCondition->getChild(0),i_pJoinCondition->getChild(2)) );
- }
- }
-}
-//-----------------------------------------------------------------------------
-::std::vector< TNodePair >& OSQLParseTreeIterator::getJoinConditions() const
-{
- return m_pImpl->m_aJoinConditions;
-}
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::getQualified_join( OSQLTables& _rTables, const OSQLParseNode *pTableRef, ::rtl::OUString& aTableRange )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getQualified_join" );
- OSL_PRECOND( SQL_ISRULE( pTableRef, cross_union ) || SQL_ISRULE( pTableRef, qualified_join ) ,
- "OSQLParseTreeIterator::getQualified_join: illegal node!" );
-
- aTableRange = ::rtl::OUString();
-
- const OSQLParseNode* pNode = getTableNode(_rTables,pTableRef->getChild(0),aTableRange);
- if ( isTableNode( pNode ) )
- traverseOneTableName( _rTables, pNode, aTableRange );
-
- sal_uInt32 nPos = 4;
- if( SQL_ISRULE(pTableRef,cross_union) || pTableRef->getChild(1)->getTokenID() != SQL_TOKEN_NATURAL)
- {
- nPos = 3;
- // join_condition,named_columns_join
- if ( SQL_ISRULE( pTableRef, qualified_join ) )
- {
- const OSQLParseNode* pJoin_spec = pTableRef->getChild(4);
- if ( SQL_ISRULE( pJoin_spec, join_condition ) )
- {
- impl_fillJoinConditions(pJoin_spec->getChild(1));
- }
- else
- {
- const OSQLParseNode* pColumnCommalist = pJoin_spec->getChild(2);
- // Alle Columns in der column_commalist ...
- for (sal_uInt32 i = 0; i < pColumnCommalist->count(); i++)
- {
- const OSQLParseNode * pCol = pColumnCommalist->getChild(i);
- // add twice because the column must exists in both tables
- m_pImpl->m_aJoinConditions.push_back( TNodePair(pCol,pCol) );
- }
- }
- }
- }
-
- pNode = getTableNode(_rTables,pTableRef->getChild(nPos),aTableRange);
- if ( isTableNode( pNode ) )
- traverseOneTableName( _rTables, pNode, aTableRange );
-}
-//-----------------------------------------------------------------------------
-const OSQLParseNode* OSQLParseTreeIterator::getTableNode( OSQLTables& _rTables, const OSQLParseNode *pTableRef,::rtl::OUString& rTableRange )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getTableNode" );
- OSL_PRECOND( SQL_ISRULE( pTableRef, table_ref ) || SQL_ISRULE( pTableRef, joined_table )
- || SQL_ISRULE( pTableRef, qualified_join ) || SQL_ISRULE( pTableRef, cross_union ),
- "OSQLParseTreeIterator::getTableNode: only to be called for table_ref nodes!" );
-
- const OSQLParseNode* pTableNameNode = NULL;
-
- if ( SQL_ISRULE( pTableRef, joined_table ) )
- {
- getQualified_join( _rTables, pTableRef->getChild(1), rTableRange );
- }
- if ( SQL_ISRULE( pTableRef, qualified_join ) || SQL_ISRULE( pTableRef, cross_union ) )
- {
- getQualified_join( _rTables, pTableRef, rTableRange );
- }
- else
- {
- rTableRange = OSQLParseNode::getTableRange(pTableRef);
- if ( ( pTableRef->count() == 4 ) // '{' SQL_TOKEN_OJ joined_table '}'
- || ( pTableRef->count() == 5 ) // '(' joined_table ')' range_variable op_column_commalist
- )
- {
- getQualified_join( _rTables, pTableRef->getChild(6 - pTableRef->count()), rTableRange );
- }
- else if ( pTableRef->count() == 3 ) // subquery range_variable op_column_commalist || '(' joined_table ')'
- {
- const OSQLParseNode* pSubQuery = pTableRef->getChild(0);
- if ( pSubQuery->isToken() )
- {
- getQualified_join( _rTables, pTableRef->getChild(1), rTableRange );
- }
- else
- {
- OSL_ENSURE( pSubQuery->count() == 3, "sub queries should have 3 children!" );
- const OSQLParseNode* pQueryExpression = pSubQuery->getChild(1);
- if ( SQL_ISRULE( pQueryExpression, select_statement ) )
- {
- getSelect_statement( *m_pImpl->m_pSubTables, pQueryExpression );
- }
- else
- {
- OSL_FAIL( "OSQLParseTreeIterator::getTableNode: subquery which is no select_statement: not yet implemented!" );
- }
- }
- }
- else if ( pTableRef->count() == 2 ) // table_node table_primary_as_range_column
- {
- pTableNameNode = pTableRef->getChild(0);
- }
- else
- OSL_FAIL( "OSQLParseTreeIterator::getTableNode: unhandled case!" );
- }
-
- return pTableNameNode;
-}
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::getSelect_statement(OSQLTables& _rTables,const OSQLParseNode* pSelect)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getSelect_statement" );
- if(SQL_ISRULE(pSelect,union_statement))
- {
- getSelect_statement(_rTables,pSelect->getChild(0));
- //getSelect_statement(pSelect->getChild(3));
- return;
- }
- OSQLParseNode * pTableRefCommalist = pSelect->getChild(3)->getChild(0)->getChild(1);
-
- OSL_ENSURE(pTableRefCommalist != NULL,"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(SQL_ISRULE(pTableRefCommalist,table_ref_commalist),"OSQLParseTreeIterator: error in parse tree!");
-
- const OSQLParseNode* pTableName = NULL;
- ::rtl::OUString aTableRange;
- for (sal_uInt32 i = 0; i < pTableRefCommalist->count(); i++)
- { // from clause durchlaufen
- aTableRange = ::rtl::OUString();
-
- const OSQLParseNode* pTableListElement = pTableRefCommalist->getChild(i);
- if ( isTableNode( pTableListElement ) )
- {
- traverseOneTableName( _rTables, pTableListElement, aTableRange );
- }
- else if ( SQL_ISRULE( pTableListElement, table_ref ) )
- {
- // Tabellenreferenz kann aus Tabellennamen, Tabellennamen (+),'('joined_table')'(+) bestehen
- pTableName = pTableListElement->getChild(0);
- if( isTableNode( pTableName ) )
- { // Tabellennamen gefunden
- aTableRange = OSQLParseNode::getTableRange(pTableListElement);
- traverseOneTableName( _rTables, pTableName, aTableRange );
- }
- else if(SQL_ISPUNCTUATION(pTableName,"{"))
- { // '{' SQL_TOKEN_OJ joined_table '}'
- getQualified_join( _rTables, pTableListElement->getChild(2), aTableRange );
- }
- else
- { // '(' joined_table ')' range_variable op_column_commalist
- getTableNode( _rTables, pTableListElement, aTableRange );
- }
- }
- else if (SQL_ISRULE( pTableListElement, qualified_join ) || SQL_ISRULE( pTableListElement, cross_union ) )
- {
- getQualified_join( _rTables, pTableListElement, aTableRange );
- }
- else if ( SQL_ISRULE( pTableListElement, joined_table ) )
- {
- getQualified_join( _rTables, pTableListElement->getChild(1), aTableRange );
- }
-
- // if (! aIteratorStatus.IsSuccessful()) break;
- }
-}
-//-----------------------------------------------------------------------------
-bool OSQLParseTreeIterator::traverseTableNames(OSQLTables& _rTables)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseTableNames" );
- if ( m_pParseTree == NULL )
- return false;
-
- OSQLParseNode* pTableName = NULL;
-
- switch ( m_eStatementType )
- {
- case SQL_STATEMENT_SELECT:
- getSelect_statement( _rTables, m_pParseTree );
- break;
-
- case SQL_STATEMENT_CREATE_TABLE:
- case SQL_STATEMENT_INSERT:
- case SQL_STATEMENT_DELETE:
- pTableName = m_pParseTree->getChild(2);
- break;
-
- case SQL_STATEMENT_UPDATE:
- pTableName = m_pParseTree->getChild(1);
- break;
- default:
- break;
- }
-
- if ( pTableName )
- {
- ::rtl::OUString sTableRange;
- traverseOneTableName( _rTables, pTableName, sTableRange );
- }
-
- return !hasErrors();
-}
-//-----------------------------------------------------------------------------
-::rtl::OUString OSQLParseTreeIterator::getColumnAlias(const OSQLParseNode* _pDerivedColumn)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getColumnAlias" );
- OSL_ENSURE(SQL_ISRULE(_pDerivedColumn,derived_column),"No derived column!");
- ::rtl::OUString sColumnAlias;
- if(_pDerivedColumn->getChild(1)->count() == 2)
- sColumnAlias = _pDerivedColumn->getChild(1)->getChild(1)->getTokenValue();
- else if(!_pDerivedColumn->getChild(1)->isRule())
- sColumnAlias = _pDerivedColumn->getChild(1)->getTokenValue();
- return sColumnAlias;
-}
-
-// -----------------------------------------------------------------------------
-namespace
-{
- void lcl_getColumnRange( const OSQLParseNode* _pColumnRef, const Reference< XConnection >& _rxConnection,
- ::rtl::OUString& _out_rColumnName, ::rtl::OUString& _out_rTableRange,
- const OSQLColumns* _pSelectColumns, ::rtl::OUString& _out_rColumnAliasIfPresent )
- {
- _out_rColumnName = _out_rTableRange = _out_rColumnAliasIfPresent = ::rtl::OUString();
- if ( SQL_ISRULE( _pColumnRef, column_ref ) )
- {
- if( _pColumnRef->count() > 1 )
- {
- for ( sal_Int32 i=0; i<((sal_Int32)_pColumnRef->count())-2; ++i )
- _pColumnRef->getChild(i)->parseNodeToStr( _out_rTableRange, _rxConnection, NULL, sal_False, sal_False );
- _out_rColumnName = _pColumnRef->getChild( _pColumnRef->count()-1 )->getChild(0)->getTokenValue();
- }
- else
- _out_rColumnName = _pColumnRef->getChild(0)->getTokenValue();
-
- // look up the column in the select column, to find an possible alias
- if ( _pSelectColumns )
- {
- for ( OSQLColumns::Vector::const_iterator lookupColumn = _pSelectColumns->get().begin();
- lookupColumn != _pSelectColumns->get().end();
- ++lookupColumn
- )
- {
- Reference< XPropertySet > xColumn( *lookupColumn );
- try
- {
- ::rtl::OUString sName, sTableName;
- xColumn->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_REALNAME ) ) >>= sName;
- xColumn->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_TABLENAME ) ) >>= sTableName;
- if ( sName == _out_rColumnName && sTableName == _out_rTableRange )
- xColumn->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_NAME ) ) >>= _out_rColumnAliasIfPresent;
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
- }
- }
- else if(SQL_ISRULE(_pColumnRef,general_set_fct) || SQL_ISRULE(_pColumnRef,set_fct_spec))
- { // Funktion
- _pColumnRef->parseNodeToStr( _out_rColumnName, _rxConnection );
- }
- else if(_pColumnRef->getNodeType() == SQL_NODE_NAME)
- _out_rColumnName = _pColumnRef->getTokenValue();
- }
-}
-
-// -----------------------------------------------------------------------------
-void OSQLParseTreeIterator::getColumnRange( const OSQLParseNode* _pColumnRef,
- ::rtl::OUString& _rColumnName,
- ::rtl::OUString& _rTableRange) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getColumnRange" );
- ::rtl::OUString sDummy;
- lcl_getColumnRange( _pColumnRef, m_pImpl->m_xConnection, _rColumnName, _rTableRange, NULL, sDummy );
-}
-
-// -----------------------------------------------------------------------------
-void OSQLParseTreeIterator::getColumnRange( const OSQLParseNode* _pColumnRef,
- ::rtl::OUString& _rColumnName,
- ::rtl::OUString& _rTableRange,
- ::rtl::OUString& _out_rColumnAliasIfPresent ) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getColumnRange" );
- lcl_getColumnRange( _pColumnRef, m_pImpl->m_xConnection, _rColumnName, _rTableRange, &*m_aSelectColumns, _out_rColumnAliasIfPresent );
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::getColumnRange( const OSQLParseNode* _pColumnRef,
- const Reference< XConnection >& _rxConnection, ::rtl::OUString& _out_rColumnName, ::rtl::OUString& _out_rTableRange )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getColumnRange" );
- ::rtl::OUString sDummy;
- lcl_getColumnRange( _pColumnRef, _rxConnection, _out_rColumnName, _out_rTableRange, NULL, sDummy );
-}
-
-//-----------------------------------------------------------------------------
-sal_Bool OSQLParseTreeIterator::getColumnTableRange(const OSQLParseNode* pNode, ::rtl::OUString &rTableRange) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getColumnTableRange" );
- // Ermitteln ob alle Spalten zu einer Tabelle gehoeren
- if (SQL_ISRULE(pNode,column_ref))
- {
- ::rtl::OUString aColName, aTableRange;
- getColumnRange(pNode, aColName, aTableRange);
- if (!aTableRange.getLength()) // keinen gefunden
- {
- // dann die Spalte in den Tabellen suchen
- for (ConstOSQLTablesIterator aIter = m_pImpl->m_pTables->begin(); aIter != m_pImpl->m_pTables->end(); ++aIter)
- {
- if (aIter->second.is())
- {
- try
- {
- Reference< XNameAccess > xColumns = aIter->second->getColumns();
- if(xColumns->hasByName(aColName))
- {
- Reference< XPropertySet > xColumn;
- if (xColumns->getByName(aColName) >>= xColumn)
- {
- OSL_ENSURE(xColumn.is(),"Column isn't a propertyset!");
- aTableRange = aIter->first;
- break;
- }
- }
- }
- catch(Exception&)
- {
- }
- }
- }
- if (!aTableRange.getLength())
- return sal_False;
- }
-
-
- if (!rTableRange.getLength())
- rTableRange = aTableRange;
- else if (rTableRange != aTableRange)
- return sal_False;
- }
- else
- {
- for (sal_uInt32 i = 0, ncount = pNode->count(); i < ncount; i++)
- {
- if (!getColumnTableRange(pNode->getChild(i), rTableRange))
- return sal_False;
- }
- }
- return sal_True;
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::traverseCreateColumns(const OSQLParseNode* pSelectNode)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseCreateColumns" );
- // aIteratorStatus.Clear();
-
- if (!pSelectNode || m_eStatementType != SQL_STATEMENT_CREATE_TABLE || m_pImpl->m_pTables->empty())
- {
- impl_appendError( IParseContext::ERROR_GENERAL );
- return;
- }
- if (!SQL_ISRULE(pSelectNode,base_table_element_commalist))
- return ;
-
- for (sal_uInt32 i = 0; i < pSelectNode->count(); i++)
- {
- OSQLParseNode *pColumnRef = pSelectNode->getChild(i);
-
- if (SQL_ISRULE(pColumnRef,column_def))
- {
- ::rtl::OUString aColumnName;
- ::rtl::OUString aTypeName;
- ::rtl::OUString aTableRange;
- sal_Int32 nType = DataType::VARCHAR;
- aColumnName = pColumnRef->getChild(0)->getTokenValue();
-
- OSQLParseNode *pDatatype = pColumnRef->getChild(1);
- if (pDatatype && SQL_ISRULE(pDatatype,character_string_type))
- {
- const OSQLParseNode *pType = pDatatype->getChild(0);
- aTypeName = pType->getTokenValue();
- if (pDatatype->count() == 2 && (pType->getTokenID() == SQL_TOKEN_CHAR || pType->getTokenID() == SQL_TOKEN_CHARACTER ))
- nType = DataType::CHAR;
-
- const OSQLParseNode *pParams = pDatatype->getChild(pDatatype->count()-1);
- if ( pParams->count() )
- {
- sal_Int32 nLen = pParams->getChild(1)->getTokenValue().toInt32();
- (void)nLen;
- }
- }
- else if(pDatatype && pDatatype->getNodeType() == SQL_NODE_KEYWORD)
- {
- aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
- }
-
- if (aTypeName.getLength())
- {
- //TODO:Create a new class for create statement to handle field length
- OParseColumn* pColumn = new OParseColumn(aColumnName,aTypeName,::rtl::OUString(),::rtl::OUString(),
- ColumnValue::NULLABLE_UNKNOWN,0,0,nType,sal_False,sal_False,isCaseSensitive());
- pColumn->setFunction(sal_False);
- pColumn->setRealName(aColumnName);
-
- Reference< XPropertySet> xCol = pColumn;
- m_aCreateColumns->get().push_back(xCol);
- }
- }
-
- }
-}
-//-----------------------------------------------------------------------------
-bool OSQLParseTreeIterator::traverseSelectColumnNames(const OSQLParseNode* pSelectNode)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseSelectColumnNames" );
- if ( ( m_pImpl->m_nIncludeMask & SelectColumns ) != SelectColumns )
- return true;
-
- if (!pSelectNode || m_eStatementType != SQL_STATEMENT_SELECT || m_pImpl->m_pTables->empty())
- {
- impl_appendError( IParseContext::ERROR_GENERAL );
- return false;
- }
-
- if(SQL_ISRULE(pSelectNode,union_statement))
- {
- return traverseSelectColumnNames( pSelectNode->getChild( 0 ) )
- /*&& traverseSelectColumnNames( pSelectNode->getChild( 3 ) )*/;
- }
-
- static ::rtl::OUString aEmptyString;
- // nyi: mehr Pruefung auf korrekte Struktur!
- if (pSelectNode->getChild(2)->isRule() && SQL_ISPUNCTUATION(pSelectNode->getChild(2)->getChild(0),"*"))
- {
- // SELECT * ...
- setSelectColumnName(m_aSelectColumns,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")), aEmptyString,aEmptyString);
- }
- else if (SQL_ISRULE(pSelectNode->getChild(2),scalar_exp_commalist))
- {
- // SELECT column[,column] oder SELECT COUNT(*) ...
- OSQLParseNode * pSelection = pSelectNode->getChild(2);
-
- for (sal_uInt32 i = 0; i < pSelection->count(); i++)
- {
- OSQLParseNode *pColumnRef = pSelection->getChild(i);
-
- //if (SQL_ISRULE(pColumnRef,select_sublist))
- if (SQL_ISRULE(pColumnRef,derived_column) &&
- SQL_ISRULE(pColumnRef->getChild(0),column_ref) &&
- pColumnRef->getChild(0)->count() == 3 &&
- SQL_ISPUNCTUATION(pColumnRef->getChild(0)->getChild(2),"*"))
- {
- // alle Spalten der Tabelle
- ::rtl::OUString aTableRange;
- pColumnRef->getChild(0)->parseNodeToStr( aTableRange, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
- setSelectColumnName(m_aSelectColumns,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")), aEmptyString,aTableRange);
- continue;
- }
- else if (SQL_ISRULE(pColumnRef,derived_column))
- {
- ::rtl::OUString aColumnAlias(getColumnAlias(pColumnRef)); // kann leer sein
- ::rtl::OUString sColumnName;
- ::rtl::OUString aTableRange;
- sal_Int32 nType = DataType::VARCHAR;
- sal_Bool bFkt(sal_False);
- pColumnRef = pColumnRef->getChild(0);
- if (
- pColumnRef->count() == 3 &&
- SQL_ISPUNCTUATION(pColumnRef->getChild(0),"(") &&
- SQL_ISPUNCTUATION(pColumnRef->getChild(2),")")
- )
- pColumnRef = pColumnRef->getChild(1);
-
- if (SQL_ISRULE(pColumnRef,column_ref))
- {
- getColumnRange(pColumnRef,sColumnName,aTableRange);
- OSL_ENSURE(sColumnName.getLength(),"Columnname darf nicht leer sein");
- }
- else /*if (SQL_ISRULE(pColumnRef,general_set_fct) || SQL_ISRULE(pColumnRef,set_fct_spec) ||
- SQL_ISRULE(pColumnRef,position_exp) || SQL_ISRULE(pColumnRef,extract_exp) ||
- SQL_ISRULE(pColumnRef,length_exp) || SQL_ISRULE(pColumnRef,char_value_fct)||
- SQL_ISRULE(pColumnRef,num_value_exp) || SQL_ISRULE(pColumnRef,term))*/
- {
- /* Funktionsaufruf vorhanden */
- pColumnRef->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_True );
- ::rtl::OUString sTableRange;
- // check if the column is also a parameter
- traverseORCriteria(pColumnRef); // num_value_exp
-
- // gehoeren alle beteiligten Spalten der Funktion zu einer Tabelle
- if (m_pImpl->m_pTables->size() == 1)
- {
- aTableRange = m_pImpl->m_pTables->begin()->first;
- }
- else
- {
- getColumnTableRange(pColumnRef,aTableRange);
- }
- if ( pColumnRef->isRule() )
- {
- bFkt = sal_True;
- nType = getFunctionReturnType(pColumnRef);
- }
- }
- /*
- else
- {
- aIteratorStatus.setStatementTooComplex();
- return;
- }
- */
- if(!aColumnAlias.getLength())
- aColumnAlias = sColumnName;
- setSelectColumnName(m_aSelectColumns,sColumnName,aColumnAlias,aTableRange,bFkt,nType,SQL_ISRULE(pColumnRef,general_set_fct) || SQL_ISRULE(pColumnRef,set_fct_spec));
- }
- }
- }
-
- return !hasErrors();
-}
-
-
-//-----------------------------------------------------------------------------
-bool OSQLParseTreeIterator::traverseOrderByColumnNames(const OSQLParseNode* pSelectNode)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseOrderByColumnNames" );
- traverseByColumnNames( pSelectNode, sal_True );
- return !hasErrors();
-}
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::traverseByColumnNames(const OSQLParseNode* pSelectNode,sal_Bool _bOrder)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseByColumnNames" );
- // aIteratorStatus.Clear();
-
- if (pSelectNode == NULL)
- {
- //aIteratorStatus.setInvalidStatement();
- return;
- }
-
- if (m_eStatementType != SQL_STATEMENT_SELECT)
- {
- //aIteratorStatus.setInvalidStatement();
- return;
- }
-
- if(SQL_ISRULE(pSelectNode,union_statement))
- {
- traverseByColumnNames(pSelectNode->getChild(0),_bOrder);
- return;
- }
-
- OSL_ENSURE(pSelectNode->count() >= 4,"OSQLParseTreeIterator: error in parse tree!");
-
- OSQLParseNode * pTableExp = pSelectNode->getChild(3);
- OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator:table_exp error in parse tree!");
- OSL_ENSURE(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
-
- sal_uInt32 nPos = ( _bOrder ? ORDER_BY_CHILD_POS : 2 );
-
- OSQLParseNode * pOptByClause = pTableExp->getChild(nPos);
- OSL_ENSURE(pOptByClause != NULL,"OSQLParseTreeIterator: error in parse tree!");
- if ( pOptByClause->count() == 0 )
- return;
-
- OSL_ENSURE(pOptByClause->count() == 3,"OSQLParseTreeIterator: error in parse tree!");
-
- OSQLParseNode * pOrderingSpecCommalist = pOptByClause->getChild(2);
- OSL_ENSURE(pOrderingSpecCommalist != NULL,"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(!_bOrder || SQL_ISRULE(pOrderingSpecCommalist,ordering_spec_commalist),"OSQLParseTreeIterator:ordering_spec_commalist error in parse tree!");
- OSL_ENSURE(pOrderingSpecCommalist->count() > 0,"OSQLParseTreeIterator: error in parse tree!");
-
- ::rtl::OUString sColumnName,aColumnAlias;
- ::rtl::OUString aTableRange;
- sal_uInt32 nCount = pOrderingSpecCommalist->count();
- for (sal_uInt32 i = 0; i < nCount; ++i)
- {
- OSQLParseNode* pColumnRef = pOrderingSpecCommalist->getChild(i);
- OSL_ENSURE(pColumnRef != NULL,"OSQLParseTreeIterator: error in parse tree!");
- if ( _bOrder )
- {
- OSL_ENSURE(SQL_ISRULE(pColumnRef,ordering_spec),"OSQLParseTreeIterator:ordering_spec error in parse tree!");
- OSL_ENSURE(pColumnRef->count() == 2,"OSQLParseTreeIterator: error in parse tree!");
-
- pColumnRef = pColumnRef->getChild(0);
- }
- aTableRange = ::rtl::OUString();
- sColumnName = ::rtl::OUString();
- if ( SQL_ISRULE(pColumnRef,column_ref) )
- {
- // Column-Name (und TableRange):
- if(SQL_ISRULE(pColumnRef,column_ref))
- getColumnRange(pColumnRef,sColumnName,aTableRange);
- else // eine Expression
- pColumnRef->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
-
- OSL_ENSURE(sColumnName.getLength(),"sColumnName darf nicht leer sein");
- }
- else
- { // here I found a predicate
- pColumnRef->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
- }
- OSL_ENSURE(pColumnRef != NULL,"OSQLParseTreeIterator: error in parse tree!");
- if ( _bOrder )
- {
- // Ascending/Descending
- OSQLParseNode * pOptAscDesc = pColumnRef->getParent()->getChild(1);
- OSL_ENSURE(pOptAscDesc != NULL,"OSQLParseTreeIterator: error in parse tree!");
-
- sal_Bool bAscending = pOptAscDesc && SQL_ISTOKEN(pOptAscDesc,ASC);
- setOrderByColumnName(sColumnName, aTableRange,bAscending);
- }
- else
- setGroupByColumnName(sColumnName, aTableRange);
- }
-}
-//-----------------------------------------------------------------------------
-bool OSQLParseTreeIterator::traverseGroupByColumnNames(const OSQLParseNode* pSelectNode)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseGroupByColumnNames" );
- traverseByColumnNames( pSelectNode, sal_False );
- return !hasErrors();
-}
-
-// -----------------------------------------------------------------------------
-namespace
-{
- ::rtl::OUString lcl_generateParameterName( const OSQLParseNode& _rParentNode, const OSQLParseNode& _rParamNode )
- {
- ::rtl::OUString sColumnName( RTL_CONSTASCII_USTRINGPARAM( "param" ) );
- const sal_Int32 nCount = (sal_Int32)_rParentNode.count();
- for ( sal_Int32 i = 0; i < nCount; ++i )
- {
- if ( _rParentNode.getChild(i) == &_rParamNode )
- {
- sColumnName += ::rtl::OUString::valueOf( i+1 );
- break;
- }
- }
- return sColumnName;
- }
-}
-
-// -----------------------------------------------------------------------------
-void OSQLParseTreeIterator::traverseParameters(const OSQLParseNode* _pNode)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseParameters" );
- if ( _pNode == NULL )
- return;
-
- ::rtl::OUString sColumnName, sTableRange, aColumnAlias;
- const OSQLParseNode* pParent = _pNode->getParent();
- if ( pParent != NULL )
- {
- if ( SQL_ISRULE(pParent,comparison_predicate) ) // x = X
- {
- sal_uInt32 nPos = 0;
- if ( pParent->getChild(nPos) == _pNode )
- nPos = 2;
- const OSQLParseNode* pOther = pParent->getChild(nPos);
- if ( SQL_ISRULE( pOther, column_ref ) )
- getColumnRange( pOther, sColumnName, sTableRange, aColumnAlias);
- else
- pOther->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
- } // if ( SQL_ISRULE(pParent,comparison_predicate) ) // x = X
- else if ( SQL_ISRULE(pParent,other_like_predicate_part_2) )
- {
- const OSQLParseNode* pOther = pParent->getParent()->getChild(0);
- if ( SQL_ISRULE( pOther, column_ref ) )
- getColumnRange( pOther, sColumnName, sTableRange, aColumnAlias);
- else
- pOther->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
- }
- else if ( SQL_ISRULE(pParent,between_predicate_part_2) )
- {
- const OSQLParseNode* pOther = pParent->getParent()->getChild(0);
- if ( SQL_ISRULE( pOther, column_ref ) )
- getColumnRange( pOther, sColumnName, sTableRange, aColumnAlias);
- else
- {
- pOther->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
- lcl_generateParameterName( *pParent, *_pNode );
- }
- }
- else if ( pParent->getNodeType() == SQL_NODE_COMMALISTRULE )
- {
- lcl_generateParameterName( *pParent, *_pNode );
- }
- }
- traverseParameter( _pNode, pParent, sColumnName, sTableRange, aColumnAlias );
- const sal_uInt32 nCount = _pNode->count();
- for (sal_uInt32 i = 0; i < nCount; ++i)
- {
- const OSQLParseNode* pChild = _pNode->getChild(i);
- traverseParameters( pChild );
- }
-}
-//-----------------------------------------------------------------------------
-bool OSQLParseTreeIterator::traverseSelectionCriteria(const OSQLParseNode* pSelectNode)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseSelectionCriteria" );
- if ( pSelectNode == NULL )
- return false;
-
-
- // Parse Tree analysieren (je nach Statement-Typ)
- // und Zeiger auf WHERE-Klausel setzen:
- OSQLParseNode * pWhereClause = NULL;
-
- if (m_eStatementType == SQL_STATEMENT_SELECT)
- {
- if(SQL_ISRULE(pSelectNode,union_statement))
- {
- return traverseSelectionCriteria( pSelectNode->getChild( 0 ) )
- && traverseSelectionCriteria( pSelectNode->getChild( 3 ) );
- }
- OSL_ENSURE(pSelectNode->count() >= 4,"OSQLParseTreeIterator: error in parse tree!");
-
- OSQLParseNode * pTableExp = pSelectNode->getChild(3);
- OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
-
- pWhereClause = pTableExp->getChild(1);
- } else if (SQL_ISRULE(pSelectNode,update_statement_searched)) {
- OSL_ENSURE(pSelectNode->count() == 5,"OSQLParseTreeIterator: error in parse tree!");
- pWhereClause = pSelectNode->getChild(4);
- } else if (SQL_ISRULE(pSelectNode,delete_statement_searched)) {
- OSL_ENSURE(pSelectNode->count() == 4,"OSQLParseTreeIterator: error in parse tree!");
- pWhereClause = pSelectNode->getChild(3);
- } else if (SQL_ISRULE(pSelectNode,delete_statement_positioned)) {
- // nyi
- OSL_FAIL("OSQLParseTreeIterator::getSelectionCriteria: positioned nyi");
- } else {
- // Anderes Statement. Keine Selektionskriterien.
- return false;
- }
-
- if (! SQL_ISRULE(pWhereClause,where_clause)) {
- // Die Where Clause ist meistens optional, d. h. es koennte sich auch
- // um "optional_where_clause" handeln.
- OSL_ENSURE(SQL_ISRULE(pWhereClause,opt_where_clause),"OSQLParseTreeIterator: error in parse tree!");
- return false;
- }
-
- // Wenn es aber eine where_clause ist, dann darf sie nicht leer sein:
- OSL_ENSURE(pWhereClause->count() == 2,"OSQLParseTreeIterator: error in parse tree!");
-
- OSQLParseNode * pComparisonPredicate = pWhereClause->getChild(1);
- OSL_ENSURE(pComparisonPredicate != NULL,"OSQLParseTreeIterator: error in parse tree!");
-
- //
- // Und nun die Vergleichskriterien abarbeiten (rekursiv, alles ist erstmal ein OR-Kriterium):
- //
-
- traverseORCriteria(pComparisonPredicate);
-
- return !hasErrors();
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::traverseORCriteria(OSQLParseNode * pSearchCondition)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseORCriteria" );
-
-
- if (
- pSearchCondition->count() == 3 &&
- SQL_ISPUNCTUATION(pSearchCondition->getChild(0),"(") &&
- SQL_ISPUNCTUATION(pSearchCondition->getChild(2),")")
- )
- {
- // Runde Klammern um den Ausdruck
- traverseORCriteria(pSearchCondition->getChild(1));
- } else if (SQL_ISRULE(pSearchCondition,search_condition) &&
- pSearchCondition->count() == 3 &&
- SQL_ISTOKEN(pSearchCondition->getChild(1),OR))
- {
- // OR-Verknuepfung:
-
- for (int i = 0; i < 3; i++) {
- if (i == 1) continue; // Schluesselwort OR ueberspringen
-
- // Ist das erste Element wieder eine OR-Verknuepfung?
- if (i == 0 &&
- SQL_ISRULE(pSearchCondition->getChild(0),search_condition) &&
- pSearchCondition->getChild(0)->count() == 3 &&
- SQL_ISTOKEN(pSearchCondition->getChild(0)->getChild(1),OR))
- {
- // Dann rekursiv absteigen ...
- traverseORCriteria(pSearchCondition->getChild(0));
-
- } else {
- // AND-Kriterien ...
- traverseANDCriteria(pSearchCondition->getChild(i));
- // if (! aIteratorStatus.IsSuccessful()) break;
- }
-
- // if (! aIteratorStatus.IsSuccessful()) break;
- }
- } else {
- // Nur *ein* Kriterium oder eine AND-Verknuepfung von Kriterien.
- // Direkt die AND-Kriterien behandeln.
- traverseANDCriteria(pSearchCondition);
- // if (! aIteratorStatus.IsSuccessful()) return;
- }
-
- // Fehler einfach weiterreichen.
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::traverseANDCriteria(OSQLParseNode * pSearchCondition)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseANDCriteria" );
-
-
- if (
- SQL_ISRULE(pSearchCondition,boolean_primary) &&
- pSearchCondition->count() == 3 &&
- SQL_ISPUNCTUATION(pSearchCondition->getChild(0),"(") &&
- SQL_ISPUNCTUATION(pSearchCondition->getChild(2),")")
- )
- {
- // Runde Klammern
- traverseANDCriteria(pSearchCondition->getChild(1));
- }
- // Das erste Element ist eine OR-Verknuepfung
- else if ( SQL_ISRULE(pSearchCondition,search_condition) && pSearchCondition->count() == 3 )
- {
- // Dann rekursiv absteigen (dieselbe Row benutzen) ...
- traverseORCriteria(pSearchCondition->getChild(0));
-// if (! aIteratorStatus.IsSuccessful())
-// return;
-
- // Und mit dem rechten Child weitermachen:
- traverseANDCriteria(pSearchCondition->getChild(2));
- }
- // Das erste Element ist (wieder) eine AND-Verknuepfung
- else if ( SQL_ISRULE(pSearchCondition,boolean_term) && pSearchCondition->count() == 3 )
- {
- // Dann rekursiv absteigen (dieselbe Row benutzen) ...
- traverseANDCriteria(pSearchCondition->getChild(0));
-// if (! aIteratorStatus.IsSuccessful())
-// return;
-
- // Und mit dem rechten Child weitermachen:
- traverseANDCriteria(pSearchCondition->getChild(2));
- }
- // Sonst einzelne Suchkriterien wie =, !=, ..., LIKE, IS NULL usw. behandeln:
- else if (SQL_ISRULE(pSearchCondition,comparison_predicate) )
- {
- ::rtl::OUString aValue;
- pSearchCondition->getChild(2)->parseNodeToStr( aValue, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
- traverseOnePredicate(pSearchCondition->getChild(0),aValue,pSearchCondition->getChild(2));
- impl_fillJoinConditions(pSearchCondition);
-// if (! aIteratorStatus.IsSuccessful())
-// return;
- }
- else if (SQL_ISRULE(pSearchCondition,like_predicate) /*&& SQL_ISRULE(pSearchCondition->getChild(0),column_ref)*/)
- {
- OSL_ENSURE(pSearchCondition->count() == 2,"OSQLParseTreeIterator: error in parse tree!");
- const OSQLParseNode* pPart2 = pSearchCondition->getChild(1);
-
- sal_Int32 nCurentPos = pPart2->count()-2;
-
- OSQLParseNode * pNum_value_exp = pPart2->getChild(nCurentPos);
- OSQLParseNode * pOptEscape = pPart2->getChild(nCurentPos+1);
-
- OSL_ENSURE(pNum_value_exp != NULL,"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(pOptEscape != NULL,"OSQLParseTreeIterator: error in parse tree!");
-
- if (pOptEscape->count() != 0)
- {
- // aIteratorStatus.setStatementTooComplex();
- return;
- }
-
- ::rtl::OUString aValue;
- OSQLParseNode * pParam = NULL;
- if (SQL_ISRULE(pNum_value_exp,parameter))
- pParam = pNum_value_exp;
- else if(pNum_value_exp->isToken())
- // Normaler Wert
- aValue = pNum_value_exp->getTokenValue();
- else
- {
- pNum_value_exp->parseNodeToStr( aValue, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
- pParam = pNum_value_exp;
- }
-
- traverseOnePredicate(pSearchCondition->getChild(0),aValue,pParam);
-// if (! aIteratorStatus.IsSuccessful())
-// return;
- }
- else if (SQL_ISRULE(pSearchCondition,in_predicate))
- {
- OSL_ENSURE(pSearchCondition->count() == 2,"OSQLParseTreeIterator: error in parse tree!");
- const OSQLParseNode* pPart2 = pSearchCondition->getChild(1);
-
- traverseORCriteria(pSearchCondition->getChild(0));
- // if (! aIteratorStatus.IsSuccessful()) return;
-
- OSQLParseNode* pChild = pPart2->getChild(2);
- if ( SQL_ISRULE(pChild->getChild(0),subquery) )
- {
- traverseTableNames( *m_pImpl->m_pSubTables );
- traverseSelectionCriteria(pChild->getChild(0)->getChild(1));
- }
- else
- { // '(' value_exp_commalist ')'
- pChild = pChild->getChild(1);
- sal_Int32 nCount = pChild->count();
- for (sal_Int32 i=0; i < nCount; ++i)
- {
- traverseANDCriteria(pChild->getChild(i));
- }
- }
- }
- else if (SQL_ISRULE(pSearchCondition,test_for_null) /*&& SQL_ISRULE(pSearchCondition->getChild(0),column_ref)*/)
- {
- OSL_ENSURE(pSearchCondition->count() == 2,"OSQLParseTreeIterator: error in parse tree!");
- const OSQLParseNode* pPart2 = pSearchCondition->getChild(1);
- (void)pPart2;
- OSL_ENSURE(SQL_ISTOKEN(pPart2->getChild(0),IS),"OSQLParseTreeIterator: error in parse tree!");
-
- ::rtl::OUString aString;
- traverseOnePredicate(pSearchCondition->getChild(0),aString,NULL);
- // if (! aIteratorStatus.IsSuccessful()) return;
- }
- else if (SQL_ISRULE(pSearchCondition,num_value_exp) || SQL_ISRULE(pSearchCondition,term))
- {
- ::rtl::OUString aString;
- traverseOnePredicate(pSearchCondition->getChild(0),aString,pSearchCondition->getChild(0));
- traverseOnePredicate(pSearchCondition->getChild(2),aString,pSearchCondition->getChild(2));
- }
- // Fehler einfach weiterreichen.
-}
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::traverseParameter(const OSQLParseNode* _pParseNode
- ,const OSQLParseNode* _pParentNode
- ,const ::rtl::OUString& _aColumnName
- ,const ::rtl::OUString& _aTableRange
- ,const ::rtl::OUString& _rColumnAlias)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseParameter" );
- if ( !SQL_ISRULE( _pParseNode, parameter ) )
- return;
-
- if ( ( m_pImpl->m_nIncludeMask & Parameters ) != Parameters )
- // parameters not to be included in the traversal
- return;
-
- OSL_ENSURE(_pParseNode->count() > 0,"OSQLParseTreeIterator: error in parse tree!");
- OSQLParseNode * pMark = _pParseNode->getChild(0);
- ::rtl::OUString sParameterName;
-
- if (SQL_ISPUNCTUATION(pMark,"?"))
- {
- sParameterName = _rColumnAlias.getLength()
- ? _rColumnAlias
- : _aColumnName.getLength()
- ? _aColumnName
- : ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("?"));
- }
- else if (SQL_ISPUNCTUATION(pMark,":"))
- {
- sParameterName = _pParseNode->getChild(1)->getTokenValue();
- }
- else if (SQL_ISPUNCTUATION(pMark,"["))
- {
- sParameterName = _pParseNode->getChild(1)->getTokenValue();
- }
- else
- {
- OSL_FAIL("OSQLParseTreeIterator: error in parse tree!");
- }
-
- // found a parameter
- if ( _pParentNode && (SQL_ISRULE(_pParentNode,general_set_fct) || SQL_ISRULE(_pParentNode,set_fct_spec)) )
- {// found a function as column_ref
- ::rtl::OUString sFunctionName;
- _pParentNode->getChild(0)->parseNodeToStr( sFunctionName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
- const sal_uInt32 nCount = _pParentNode->count();
- sal_uInt32 i = 0;
- for(; i < nCount;++i)
- {
- if ( _pParentNode->getChild(i) == _pParseNode )
- break;
- }
- sal_Int32 nType = ::connectivity::OSQLParser::getFunctionParameterType( _pParentNode->getChild(0)->getTokenID(), i-1);
-
- OParseColumn* pColumn = new OParseColumn( sParameterName,
- ::rtl::OUString(),
- ::rtl::OUString(),
- ::rtl::OUString(),
- ColumnValue::NULLABLE_UNKNOWN,
- 0,
- 0,
- nType,
- sal_False,
- sal_False,
- isCaseSensitive());
- pColumn->setFunction(sal_True);
- pColumn->setAggregateFunction(sal_True);
- pColumn->setRealName(sFunctionName);
- m_aParameters->get().push_back(pColumn);
- }
- else
- {
- sal_Bool bNotFound = sal_True;
- OSQLColumns::Vector::const_iterator aIter = ::connectivity::find(
- m_aSelectColumns->get().begin(),
- m_aSelectColumns->get().end(),
- _aColumnName,::comphelper::UStringMixEqual( isCaseSensitive() )
- );
- if(aIter != m_aSelectColumns->get().end())
- {
- OParseColumn* pNewColumn = new OParseColumn(*aIter,isCaseSensitive());
- pNewColumn->setName(sParameterName);
- pNewColumn->setRealName(_aColumnName);
- m_aParameters->get().push_back(pNewColumn);
- bNotFound = sal_False;
- }
- else if(_aColumnName.getLength())// search in the tables for the right one
- {
-
- Reference<XPropertySet> xColumn = findColumn( _aColumnName, _aTableRange, true );
-
- if ( xColumn.is() )
- {
- OParseColumn* pNewColumn = new OParseColumn(xColumn,isCaseSensitive());
- pNewColumn->setName(sParameterName);
- pNewColumn->setRealName(_aColumnName);
- m_aParameters->get().push_back(pNewColumn);
- bNotFound = sal_False;
- }
- }
- if ( bNotFound )
- {
- sal_Int32 nType = DataType::VARCHAR;
- OSQLParseNode* pParent = _pParentNode ? _pParentNode->getParent() : NULL;
- if ( pParent && (SQL_ISRULE(pParent,general_set_fct) || SQL_ISRULE(pParent,set_fct_spec)) )
- {
- const sal_uInt32 nCount = _pParentNode->count();
- sal_uInt32 i = 0;
- for(; i < nCount;++i)
- {
- if ( _pParentNode->getChild(i) == _pParseNode )
- break;
- }
- nType = ::connectivity::OSQLParser::getFunctionParameterType( pParent->getChild(0)->getTokenID(), i+1);
- }
-
- ::rtl::OUString aNewColName( getUniqueColumnName( sParameterName ) );
-
- OParseColumn* pColumn = new OParseColumn(aNewColName,
- ::rtl::OUString(),
- ::rtl::OUString(),
- ::rtl::OUString(),
- ColumnValue::NULLABLE_UNKNOWN,
- 0,
- 0,
- nType,
- sal_False,
- sal_False,
- isCaseSensitive() );
- pColumn->setName(aNewColName);
- pColumn->setRealName(sParameterName);
- m_aParameters->get().push_back(pColumn);
- }
- }
-}
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::traverseOnePredicate(
- OSQLParseNode * pColumnRef,
- ::rtl::OUString& rValue,
- OSQLParseNode * pParseNode)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseOnePredicate" );
- if ( !pParseNode )
- return;
-
- // Column-Name (und TableRange):
- ::rtl::OUString aColumnName, aTableRange, sColumnAlias;
- getColumnRange( pColumnRef, aColumnName, aTableRange, sColumnAlias);
-
- ::rtl::OUString aName;
-
- /*if (SQL_ISRULE(pParseNode,parameter))
- traverseParameter( pParseNode, pColumnRef, aColumnName, aTableRange, sColumnAlias );
- else */if (SQL_ISRULE(pParseNode,column_ref))// Column-Name (und TableRange):
- getColumnRange(pParseNode,aName,rValue);
- else
- {
- traverseORCriteria(pParseNode);
- // if (! aIteratorStatus.IsSuccessful()) return;
- }
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::traverseSome( sal_uInt32 _nIncludeMask )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseSome" );
- impl_traverse( _nIncludeMask );
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::traverseAll()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::traverseAll" );
- impl_traverse( All );
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::impl_traverse( sal_uInt32 _nIncludeMask )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::impl_traverse" );
- impl_resetErrors();
- m_pImpl->m_nIncludeMask = _nIncludeMask;
-
- if ( !traverseTableNames( *m_pImpl->m_pTables ) )
- return;
-
- switch ( m_eStatementType )
- {
- case SQL_STATEMENT_SELECT:
- {
- const OSQLParseNode* pSelectNode = m_pParseTree;
- traverseParameters( pSelectNode );
- if ( !traverseSelectColumnNames( pSelectNode )
- || !traverseOrderByColumnNames( pSelectNode )
- || !traverseGroupByColumnNames( pSelectNode )
- || !traverseSelectionCriteria( pSelectNode )
- )
- return;
- }
- break;
- case SQL_STATEMENT_CREATE_TABLE:
- {
- //0 | 1 | 2 |3| 4 |5
- //create table sc.foo ( a char(20), b char )
- const OSQLParseNode* pCreateNode = m_pParseTree->getChild(4);
- traverseCreateColumns(pCreateNode);
- }
- break;
- case SQL_STATEMENT_INSERT:
- break;
- default:
- break;
- }
-}
-
-// Dummy-Implementationen:
-
-//-----------------------------------------------------------------------------
-OSQLTable OSQLParseTreeIterator::impl_createTableObject( const ::rtl::OUString& rTableName,
- const ::rtl::OUString& rCatalogName, const ::rtl::OUString& rSchemaName )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::impl_createTableObject" );
- OSL_PRECOND( m_eStatementType == SQL_STATEMENT_CREATE_TABLE,
- "OSQLParseTreeIterator::impl_createTableObject: only to be called for CREATE TABLE statements!" );
- // (in all other cases, m_pTables is to contain the table objects as obtained from the tables
- // container of the connection (m_xTablesContainer)
-
- OSQLTable aReturnTable = new OTable(
- NULL,
- sal_False,
- rTableName,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Table")),
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("New Created Table")),
- rSchemaName,
- rCatalogName
- );
- return aReturnTable;
-}
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::appendColumns(::rtl::Reference<OSQLColumns>& _rColumns,const ::rtl::OUString& _rTableAlias,const OSQLTable& _rTable)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::appendColumns" );
-
- if (!_rTable.is())
- return;
-
- Reference<XNameAccess> xColumns = _rTable->getColumns();
- if ( !xColumns.is() )
- return;
-
- Sequence< ::rtl::OUString > aColNames = xColumns->getElementNames();
- const ::rtl::OUString* pBegin = aColNames.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + aColNames.getLength();
-
- for(;pBegin != pEnd;++pBegin)
- {
-
- ::rtl::OUString aName(getUniqueColumnName(*pBegin));
- Reference< XPropertySet > xColumn;
- if(xColumns->hasByName(*pBegin) && (xColumns->getByName(*pBegin) >>= xColumn) && xColumn.is())
- {
- OParseColumn* pColumn = new OParseColumn(aName
- , getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)))
- , getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)))
- , getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)))
- , getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)))
- , getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)))
- , getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)))
- , getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)))
- , getBOOL(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)))
- , getBOOL(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)))
- , isCaseSensitive() );
-
- pColumn->setTableName(_rTableAlias);
- pColumn->setRealName(*pBegin);
- Reference< XPropertySet> xCol = pColumn;
- _rColumns->get().push_back(xCol);
- }
- else
- impl_appendError( IParseContext::ERROR_INVALID_COLUMN, pBegin, &_rTableAlias );
- }
-}
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::setSelectColumnName(::rtl::Reference<OSQLColumns>& _rColumns,const ::rtl::OUString & rColumnName,const ::rtl::OUString & rColumnAlias, const ::rtl::OUString & rTableRange,sal_Bool bFkt,sal_Int32 _nType,sal_Bool bAggFkt)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::setSelectColumnName" );
- if(rColumnName.toChar() == '*' && !rTableRange.getLength())
- { // SELECT * ...
- OSL_ENSURE(_rColumns == m_aSelectColumns,"Invalid columns used here!");
- for(ConstOSQLTablesIterator aIter = m_pImpl->m_pTables->begin(); aIter != m_pImpl->m_pTables->end();++aIter)
- appendColumns(_rColumns,aIter->first,aIter->second);
- }
- else if( rColumnName.toChar() == '*' && rTableRange.getLength() )
- { // SELECT <table>.*
- OSL_ENSURE(_rColumns == m_aSelectColumns,"Invalid columns used here!");
- ConstOSQLTablesIterator aFind = m_pImpl->m_pTables->find(rTableRange);
-
- if(aFind != m_pImpl->m_pTables->end())
- appendColumns(_rColumns,rTableRange,aFind->second);
- }
- else if ( !rTableRange.getLength() )
- { // SELECT <something> ...
- // without table specified
- if ( !bFkt )
- {
- Reference< XPropertySet> xNewColumn;
-
- for ( OSQLTablesIterator aIter = m_pImpl->m_pTables->begin(); aIter != m_pImpl->m_pTables->end(); ++aIter )
- {
- if ( !aIter->second.is() )
- continue;
-
- Reference<XNameAccess> xColumns = aIter->second->getColumns();
- Reference< XPropertySet > xColumn;
- if ( !xColumns->hasByName( rColumnName )
- || !( xColumns->getByName( rColumnName ) >>= xColumn )
- )
- continue;
-
- ::rtl::OUString aNewColName(getUniqueColumnName(rColumnAlias));
-
- OParseColumn* pColumn = new OParseColumn(xColumn,isCaseSensitive());
- xNewColumn = pColumn;
- pColumn->setTableName(aIter->first);
- pColumn->setName(aNewColName);
- pColumn->setRealName(rColumnName);
-
- break;
- }
-
- if ( !xNewColumn.is() )
- {
- // no function (due to the above !bFkt), no existing column
- // => assume an expression
- ::rtl::OUString aNewColName( getUniqueColumnName( rColumnAlias ) );
- // did not find a column with this name in any of the tables
- OParseColumn* pColumn = new OParseColumn(
- aNewColName,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR")),
- // TODO: does this match with _nType?
- // Or should be fill this from the getTypeInfo of the connection?
- ::rtl::OUString(),
- ::rtl::OUString(),
- ColumnValue::NULLABLE_UNKNOWN,
- 0,
- 0,
- _nType,
- sal_False,
- sal_False,
- isCaseSensitive()
- );
-
- xNewColumn = pColumn;
- pColumn->setRealName( rColumnName );
- }
-
- _rColumns->get().push_back( xNewColumn );
- }
- else
- {
- ::rtl::OUString aNewColName(getUniqueColumnName(rColumnAlias));
-
- OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),
- ColumnValue::NULLABLE_UNKNOWN,0,0,_nType,sal_False,sal_False,isCaseSensitive());
- pColumn->setFunction(sal_True);
- pColumn->setAggregateFunction(bAggFkt);
- pColumn->setRealName(rColumnName);
-
- Reference< XPropertySet> xCol = pColumn;
- _rColumns->get().push_back(xCol);
- }
- }
- else // ColumnName und Tablename vorhanden
- {
- ConstOSQLTablesIterator aFind = m_pImpl->m_pTables->find(rTableRange);
-
- sal_Bool bError = sal_False;
- if (aFind != m_pImpl->m_pTables->end() && aFind->second.is())
- {
- if (bFkt)
- {
- ::rtl::OUString aNewColName(getUniqueColumnName(rColumnAlias));
-
- OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),
- ColumnValue::NULLABLE_UNKNOWN,0,0,_nType,sal_False,sal_False,isCaseSensitive());
- pColumn->setFunction(sal_True);
- pColumn->setAggregateFunction(bAggFkt);
- pColumn->setRealName(rColumnName);
- pColumn->setTableName(aFind->first);
-
- Reference< XPropertySet> xCol = pColumn;
- _rColumns->get().push_back(xCol);
- }
- else
- {
- Reference< XPropertySet > xColumn;
- if (aFind->second->getColumns()->hasByName(rColumnName) && (aFind->second->getColumns()->getByName(rColumnName) >>= xColumn))
- {
- ::rtl::OUString aNewColName(getUniqueColumnName(rColumnAlias));
-
- OParseColumn* pColumn = new OParseColumn(xColumn,isCaseSensitive());
- pColumn->setName(aNewColName);
- pColumn->setRealName(rColumnName);
- pColumn->setTableName(aFind->first);
-
- Reference< XPropertySet> xCol = pColumn;
- _rColumns->get().push_back(xCol);
- }
- else
- bError = sal_True;
- }
- }
- else
- bError = sal_True;
-
- // Tabelle existiert nicht oder Feld nicht vorhanden
- if (bError)
- {
- ::rtl::OUString aNewColName(getUniqueColumnName(rColumnAlias));
-
- OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),
- ColumnValue::NULLABLE_UNKNOWN,0,0,DataType::VARCHAR,sal_False,sal_False,isCaseSensitive());
- pColumn->setFunction(sal_True);
- pColumn->setAggregateFunction(bAggFkt);
-
- Reference< XPropertySet> xCol = pColumn;
- _rColumns->get().push_back(xCol);
- }
- }
-}
-//-----------------------------------------------------------------------------
-::rtl::OUString OSQLParseTreeIterator::getUniqueColumnName(const ::rtl::OUString & rColumnName) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getUniqueColumnName" );
- ::rtl::OUString aAlias(rColumnName);
-
- OSQLColumns::Vector::const_iterator aIter = find(
- m_aSelectColumns->get().begin(),
- m_aSelectColumns->get().end(),
- aAlias,
- ::comphelper::UStringMixEqual( isCaseSensitive() )
- );
- sal_Int32 i=1;
- while(aIter != m_aSelectColumns->get().end())
- {
- (aAlias = rColumnName) += ::rtl::OUString::valueOf(i++);
- aIter = find(
- m_aSelectColumns->get().begin(),
- m_aSelectColumns->get().end(),
- aAlias,
- ::comphelper::UStringMixEqual( isCaseSensitive() )
- );
- }
- return aAlias;
-}
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::setOrderByColumnName(const ::rtl::OUString & rColumnName, const ::rtl::OUString & rTableRange,sal_Bool bAscending)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::setOrderByColumnName" );
- Reference<XPropertySet> xColumn = findColumn( rColumnName, rTableRange, false );
- if ( xColumn.is() )
- m_aOrderColumns->get().push_back(new OOrderColumn( xColumn, rTableRange, isCaseSensitive(), bAscending ) );
- else
- {
- sal_Int32 nId = rColumnName.toInt32();
- if ( nId > 0 && nId < static_cast<sal_Int32>(m_aSelectColumns->get().size()) )
- m_aOrderColumns->get().push_back( new OOrderColumn( ( m_aSelectColumns->get() )[nId-1], isCaseSensitive(), bAscending ) );
- }
-
-#ifdef SQL_TEST_PARSETREEITERATOR
- cout << "OSQLParseTreeIterator::setOrderByColumnName: "
- << (const char *) rColumnName << ", "
- << (const char *) rTableRange << ", "
- << (bAscending ? "true" : "false")
- << "\n";
-#endif
-}
-//-----------------------------------------------------------------------------
-void OSQLParseTreeIterator::setGroupByColumnName(const ::rtl::OUString & rColumnName, const ::rtl::OUString & rTableRange)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::setGroupByColumnName" );
- Reference<XPropertySet> xColumn = findColumn( rColumnName, rTableRange, false );
- if ( xColumn.is() )
- m_aGroupColumns->get().push_back(new OParseColumn(xColumn,isCaseSensitive()));
- else
- {
- sal_Int32 nId = rColumnName.toInt32();
- if ( nId > 0 && nId < static_cast<sal_Int32>(m_aSelectColumns->get().size()) )
- m_aGroupColumns->get().push_back(new OParseColumn((m_aSelectColumns->get())[nId-1],isCaseSensitive()));
- }
-
-#ifdef SQL_TEST_PARSETREEITERATOR
- cout << "OSQLParseTreeIterator::setOrderByColumnName: "
- << (const char *) rColumnName << ", "
- << (const char *) rTableRange << ", "
- << (bAscending ? "true" : "false")
- << "\n";
-#endif
-}
-
-//-----------------------------------------------------------------------------
-const OSQLParseNode* OSQLParseTreeIterator::getWhereTree() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getWhereTree" );
-
-
- if (!m_pParseTree)
- return NULL;
-
- // Parse Tree analysieren (je nach Statement-Typ)
- // und Zeiger auf WHERE-Klausel setzen:
- OSQLParseNode * pWhereClause = NULL;
- if(getStatementType() == SQL_STATEMENT_SELECT)
- {
- OSL_ENSURE(m_pParseTree->count() >= 4,"ParseTreeIterator: error in parse tree!");
- OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
- OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
-
- pWhereClause = pTableExp->getChild(1);
- }
- else if (SQL_ISRULE(m_pParseTree,update_statement_searched) ||
- SQL_ISRULE(m_pParseTree,delete_statement_searched))
- {
- pWhereClause = m_pParseTree->getChild(m_pParseTree->count()-1);
- }
- if(pWhereClause->count() != 2)
- pWhereClause = NULL;
- return pWhereClause;
-}
-
-//-----------------------------------------------------------------------------
-const OSQLParseNode* OSQLParseTreeIterator::getOrderTree() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getOrderTree" );
-
-
- if (!m_pParseTree || getStatementType() != SQL_STATEMENT_SELECT)
- return NULL;
-
- // Parse Tree analysieren (je nach Statement-Typ)
- // und Zeiger auf ORDER-Klausel setzen:
- OSQLParseNode * pOrderClause = NULL;
- OSL_ENSURE(m_pParseTree->count() >= 4,"ParseTreeIterator: error in parse tree!");
- OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
- OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
-
- pOrderClause = pTableExp->getChild(ORDER_BY_CHILD_POS);
- // Wenn es aber eine order_by ist, dann darf sie nicht leer sein:
- if(pOrderClause->count() != 3)
- pOrderClause = NULL;
- return pOrderClause;
-}
-//-----------------------------------------------------------------------------
-const OSQLParseNode* OSQLParseTreeIterator::getGroupByTree() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getGroupByTree" );
- if (!m_pParseTree || getStatementType() != SQL_STATEMENT_SELECT)
- return NULL;
-
- // Parse Tree analysieren (je nach Statement-Typ)
- // und Zeiger auf ORDER-Klausel setzen:
- OSQLParseNode * pGroupClause = NULL;
- OSL_ENSURE(m_pParseTree->count() >= 4,"ParseTreeIterator: error in parse tree!");
- OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
- OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
-
- pGroupClause = pTableExp->getChild(2);
- // Wenn es aber eine order_by ist, dann darf sie nicht leer sein:
- if(pGroupClause->count() != 3)
- pGroupClause = NULL;
- return pGroupClause;
-}
-//-----------------------------------------------------------------------------
-const OSQLParseNode* OSQLParseTreeIterator::getHavingTree() const
-{
- if (!m_pParseTree || getStatementType() != SQL_STATEMENT_SELECT)
- return NULL;
-
- // Parse Tree analysieren (je nach Statement-Typ)
- // und Zeiger auf ORDER-Klausel setzen:
- OSQLParseNode * pHavingClause = NULL;
- OSL_ENSURE(m_pParseTree->count() >= 4,"ParseTreeIterator: error in parse tree!");
- OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
- OSL_ENSURE(pTableExp != NULL,"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: error in parse tree!");
- OSL_ENSURE(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
-
- pHavingClause = pTableExp->getChild(3);
- // Wenn es aber eine order_by ist, dann darf sie nicht leer sein:
- if(pHavingClause->count() < 1)
- pHavingClause = NULL;
- return pHavingClause;
-}
-// -----------------------------------------------------------------------------
-sal_Bool OSQLParseTreeIterator::isTableNode(const OSQLParseNode* _pTableNode) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::isTableNode" );
- return _pTableNode && (SQL_ISRULE(_pTableNode,catalog_name) ||
- SQL_ISRULE(_pTableNode,schema_name) ||
- SQL_ISRULE(_pTableNode,table_name));
-}
-// -----------------------------------------------------------------------------
-const OSQLParseNode* OSQLParseTreeIterator::getSimpleWhereTree() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getSimpleWhereTree" );
- const OSQLParseNode* pNode = getWhereTree();
- return pNode ? pNode->getChild(1) : NULL;
-}
-// -----------------------------------------------------------------------------
-const OSQLParseNode* OSQLParseTreeIterator::getSimpleOrderTree() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getSimpleOrderTree" );
- const OSQLParseNode* pNode = getOrderTree();
- return pNode ? pNode->getChild(2) : NULL;
-}
-// -----------------------------------------------------------------------------
-const OSQLParseNode* OSQLParseTreeIterator::getSimpleGroupByTree() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getSimpleGroupByTree" );
- const OSQLParseNode* pNode = getGroupByTree();
- return pNode ? pNode->getChild(2) : NULL;
-}
-// -----------------------------------------------------------------------------
-const OSQLParseNode* OSQLParseTreeIterator::getSimpleHavingTree() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::getSimpleHavingTree" );
- const OSQLParseNode* pNode = getHavingTree();
- return pNode ? pNode->getChild(1) : NULL;
-}
-
-// -----------------------------------------------------------------------------
-Reference< XPropertySet > OSQLParseTreeIterator::findColumn( const ::rtl::OUString & rColumnName, const ::rtl::OUString & rTableRange, bool _bLookInSubTables )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::findColumn" );
- Reference< XPropertySet > xColumn = findColumn( *m_pImpl->m_pTables, rColumnName, rTableRange );
- if ( !xColumn.is() && _bLookInSubTables )
- xColumn = findColumn( *m_pImpl->m_pSubTables, rColumnName, rTableRange );
- return xColumn;
-}
-
-// -----------------------------------------------------------------------------
-Reference< XPropertySet > OSQLParseTreeIterator::findColumn(const OSQLTables& _rTables,const ::rtl::OUString & rColumnName, const ::rtl::OUString & rTableRange)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::findColumn" );
- Reference< XPropertySet > xColumn;
- if ( rTableRange.getLength() )
- {
- ConstOSQLTablesIterator aFind = _rTables.find(rTableRange);
-
- if ( aFind != _rTables.end()
- && aFind->second.is()
- && aFind->second->getColumns().is()
- && aFind->second->getColumns()->hasByName(rColumnName) )
- aFind->second->getColumns()->getByName(rColumnName) >>= xColumn;
- }
- if ( !xColumn.is() )
- {
- OSQLTables::const_iterator aEnd = _rTables.end();
- for(OSQLTables::const_iterator aIter = _rTables.begin(); aIter != aEnd; ++aIter)
- {
- if ( aIter->second.is() )
- {
- Reference<XNameAccess> xColumns = aIter->second->getColumns();
- if( xColumns.is() && xColumns->hasByName(rColumnName) && (xColumns->getByName(rColumnName) >>= xColumn) )
- {
- OSL_ENSURE(xColumn.is(),"Column isn't a propertyset!");
- break; // diese Column darf nur einmal vorkommen
- }
- }
- }
- }
- return xColumn;
-}
-
-// -----------------------------------------------------------------------------
-void OSQLParseTreeIterator::impl_appendError( IParseContext::ErrorCode _eError, const ::rtl::OUString* _pReplaceToken1, const ::rtl::OUString* _pReplaceToken2 )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::impl_appendError" );
- ::rtl::OUString sErrorMessage = m_rParser.getContext().getErrorMessage( _eError );
- if ( _pReplaceToken1 )
- {
- bool bTwoTokens = ( _pReplaceToken2 != NULL );
- const sal_Char* pPlaceHolder1 = bTwoTokens ? "#1" : "#";
- const ::rtl::OUString sPlaceHolder1 = ::rtl::OUString::createFromAscii( pPlaceHolder1 );
-
- sErrorMessage = sErrorMessage.replaceAt( sErrorMessage.indexOf( sPlaceHolder1 ), sPlaceHolder1.getLength(), *_pReplaceToken1 );
- if ( _pReplaceToken2 )
- sErrorMessage = sErrorMessage.replaceAt( sErrorMessage.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#2")) ), 2, *_pReplaceToken2 );
- }
-
- impl_appendError( SQLException(
- sErrorMessage, NULL, getStandardSQLState( SQL_GENERAL_ERROR ), 1000, Any() ) );
-}
-
-// -----------------------------------------------------------------------------
-void OSQLParseTreeIterator::impl_appendError( const SQLException& _rError )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::impl_appendError" );
- if ( m_aErrors.Message.getLength() )
- {
- SQLException* pErrorChain = &m_aErrors;
- while ( pErrorChain->NextException.hasValue() )
- pErrorChain = static_cast< SQLException* >( pErrorChain->NextException.pData );
- pErrorChain->NextException <<= _rError;
- }
- else
- m_aErrors = _rError;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 OSQLParseTreeIterator::getFunctionReturnType(const OSQLParseNode* _pNode )
-{
- sal_Int32 nType = DataType::OTHER;
- ::rtl::OUString sFunctionName;
- if ( SQL_ISRULE(_pNode,length_exp) )
- {
- _pNode->getChild(0)->getChild(0)->parseNodeToStr(sFunctionName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
- nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, &m_rParser.getContext() );
- }
- else if ( SQL_ISRULE(_pNode,num_value_exp) || SQL_ISRULE(_pNode,term) || SQL_ISRULE(_pNode,factor) )
- {
- nType = DataType::DOUBLE;
- }
- else
- {
- _pNode->getChild(0)->parseNodeToStr(sFunctionName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
-
- // MIN and MAX have another return type, we have to check the expression itself.
- // @see http://qa.openoffice.org/issues/show_bug.cgi?id=99566
- if ( SQL_ISRULE(_pNode,general_set_fct) && (SQL_ISTOKEN(_pNode->getChild(0),MIN) || SQL_ISTOKEN(_pNode->getChild(0),MAX) ))
- {
- const OSQLParseNode* pValueExp = _pNode->getChild(3);
- if (SQL_ISRULE(pValueExp,column_ref))
- {
- ::rtl::OUString sColumnName;
- ::rtl::OUString aTableRange;
- getColumnRange(pValueExp,sColumnName,aTableRange);
- OSL_ENSURE(sColumnName.getLength(),"Columnname darf nicht leer sein");
- Reference<XPropertySet> xColumn = findColumn( sColumnName, aTableRange, true );
-
- if ( xColumn.is() )
- {
- xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_TYPE)) >>= nType;
- }
- }
- else
- {
- if ( SQL_ISRULE(pValueExp,num_value_exp) || SQL_ISRULE(pValueExp,term) || SQL_ISRULE(pValueExp,factor) )
- {
- nType = DataType::DOUBLE;
- }
- else if ( SQL_ISRULE(pValueExp,datetime_primary) )
- {
- switch(pValueExp->getChild(0)->getTokenID() )
- {
- case SQL_TOKEN_CURRENT_DATE:
- nType = DataType::DATE;
- break;
- case SQL_TOKEN_CURRENT_TIME:
- nType = DataType::TIME;
- break;
- case SQL_TOKEN_CURRENT_TIMESTAMP:
- nType = DataType::TIMESTAMP;
- break;
- }
- }
- else if ( SQL_ISRULE(pValueExp,value_exp_primary) )
- {
- nType = getFunctionReturnType(pValueExp->getChild(1));
- }
- else if ( SQL_ISRULE(pValueExp,concatenation)
- || SQL_ISRULE(pValueExp,char_factor)
- || SQL_ISRULE(pValueExp,bit_value_fct)
- || SQL_ISRULE(pValueExp,char_value_fct)
- || SQL_ISRULE(pValueExp,char_substring_fct)
- || SQL_ISRULE(pValueExp,fold)
- || SQL_ISTOKEN(pValueExp,STRING) )
- {
- nType = DataType::VARCHAR;
- }
- }
- if ( nType == DataType::OTHER )
- nType = DataType::DOUBLE;
- }
- else
- nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, &m_rParser.getContext() );
- }
-
- return nType;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
deleted file mode 100644
index 0f9170b0ed..0000000000
--- a/connectivity/source/parse/sqlnode.cxx
+++ /dev/null
@@ -1,2838 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include <sal/macros.h>
-#include <connectivity/sqlnode.hxx>
-#include <connectivity/sqlerror.hxx>
-#include <internalnode.hxx>
-#define YYBISON 1
-#ifndef BISON_INCLUDED
-#define BISON_INCLUDED
-#include <sqlbison.hxx>
-#endif
-#include <connectivity/sqlparse.hxx>
-#include <com/sun/star/lang/Locale.hpp>
-#include <com/sun/star/util/XNumberFormatter.hpp>
-#include <com/sun/star/util/XNumberFormatTypes.hpp>
-#include <com/sun/star/i18n/NumberFormatIndex.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdb/XQueriesSupplier.hpp>
-#include <com/sun/star/sdb/ErrorCondition.hpp>
-#include <com/sun/star/util/XNumberFormatter.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include <com/sun/star/util/XNumberFormats.hpp>
-#include <com/sun/star/util/NumberFormat.hpp>
-#include <com/sun/star/util/XNumberFormatTypes.hpp>
-#include <com/sun/star/lang/Locale.hpp>
-#include <com/sun/star/i18n/KParseType.hpp>
-#include <com/sun/star/i18n/KParseTokens.hpp>
-#include "connectivity/dbconversion.hxx"
-#include <com/sun/star/util/DateTime.hpp>
-#include <com/sun/star/util/Time.hpp>
-#include <com/sun/star/util/Date.hpp>
-#include "TConnection.hxx"
-#include "sqlscan.hxx"
-#include <comphelper/numbers.hxx>
-#include <comphelper/processfactory.hxx>
-#include <comphelper/stl_types.hxx>
-#include "connectivity/dbtools.hxx"
-#include "connectivity/dbmetadata.hxx"
-#include "connectivity/sqlerror.hxx"
-#include <tools/diagnose_ex.h>
-#include <string.h>
-#include <boost/bind.hpp>
-#include <algorithm>
-#include <functional>
-#include <rtl/logfile.hxx>
-#include <rtl/ustrbuf.hxx>
-
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdb;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::i18n;
-using namespace ::com::sun::star;
-using namespace ::osl;
-using namespace ::dbtools;
-using namespace ::comphelper;
-
-
-extern int SQLyyparse (void);
-extern ::rtl::OUString ConvertLikeToken(const ::connectivity::OSQLParseNode* pTokenNode, const ::connectivity::OSQLParseNode* pEscapeNode, sal_Bool bInternational);
-extern void setParser( ::connectivity::OSQLParser* );
-
-namespace
-{
- // -----------------------------------------------------------------------------
- sal_Bool lcl_saveConvertToNumber(const Reference< XNumberFormatter > & _xFormatter,sal_Int32 _nKey,const ::rtl::OUString& _sValue,double& _nrValue)
- {
- sal_Bool bRet = sal_False;
- try
- {
- _nrValue = _xFormatter->convertStringToNumber(_nKey, _sValue);
- bRet = sal_True;
- }
- catch(Exception&)
- {
- }
- return bRet;
- }
- // -----------------------------------------------------------------------------
- void replaceAndReset(connectivity::OSQLParseNode*& _pResetNode,connectivity::OSQLParseNode* _pNewNode)
- {
- _pResetNode->getParent()->replace(_pResetNode, _pNewNode);
- delete _pResetNode;
- _pResetNode = _pNewNode;
- }
- // -----------------------------------------------------------------------------
- /** quotes a string and search for quotes inside the string and replace them with the new quote
- @param rValue
- The value to be quoted.
- @param rQuot
- The quote
- @param rQuotToReplace
- The quote to replace with
- @return
- The quoted string.
- */
- ::rtl::OUString SetQuotation(const ::rtl::OUString& rValue, const ::rtl::OUString& rQuot, const ::rtl::OUString& rQuotToReplace)
- {
- ::rtl::OUString rNewValue = rQuot;
- rNewValue += rValue;
- sal_Int32 nIndex = (sal_Int32)-1; // Quotes durch zweifache Quotes ersetzen, sonst kriegt der Parser Probleme
-
- if (rQuot.getLength())
- {
- do
- {
- nIndex += 2;
- nIndex = rNewValue.indexOf(rQuot,nIndex);
- if(nIndex != -1)
- rNewValue = rNewValue.replaceAt(nIndex,rQuot.getLength(),rQuotToReplace);
- } while (nIndex != -1);
- }
-
- rNewValue += rQuot;
- return rNewValue;
- }
-}
-
-namespace connectivity
-{
-
-//=============================================================================
-struct OSQLParser_Data
-{
- ::com::sun::star::lang::Locale aLocale;
- ::connectivity::SQLError aErrors;
-
- OSQLParser_Data( const Reference< XMultiServiceFactory >& _xServiceFactory )
- :aErrors( _xServiceFactory )
- {
- }
-};
-
-//=============================================================================
-//= SQLParseNodeParameter
-//=============================================================================
-//-----------------------------------------------------------------------------
-SQLParseNodeParameter::SQLParseNodeParameter( const Reference< XConnection >& _rxConnection,
- const Reference< XNumberFormatter >& _xFormatter, const Reference< XPropertySet >& _xField,
- const Locale& _rLocale, const IParseContext* _pContext,
- bool _bIntl, bool _bQuote, sal_Char _cDecSep, bool _bPredicate, bool _bParseToSDBC )
- :rLocale(_rLocale)
- ,aMetaData( _rxConnection )
- ,pParser( NULL )
- ,pSubQueryHistory( new QueryNameSet )
- ,xFormatter(_xFormatter)
- ,xField(_xField)
- ,m_rContext( _pContext ? (const IParseContext&)(*_pContext) : (const IParseContext&)OSQLParser::s_aDefaultContext )
- ,cDecSep(_cDecSep)
- ,bQuote(_bQuote)
- ,bInternational(_bIntl)
- ,bPredicate(_bPredicate)
- ,bParseToSDBCLevel( _bParseToSDBC )
-{
-}
-
-//-----------------------------------------------------------------------------
-SQLParseNodeParameter::~SQLParseNodeParameter()
-{
-}
-
-//=============================================================================
-//= OSQLParseNode
-//=============================================================================
-//-----------------------------------------------------------------------------
-::rtl::OUString OSQLParseNode::convertDateString(const SQLParseNodeParameter& rParam, const ::rtl::OUString& rString) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::convertDateString" );
- Date aDate = DBTypeConversion::toDate(rString);
- Reference< XNumberFormatsSupplier > xSupplier(rParam.xFormatter->getNumberFormatsSupplier());
- Reference< XNumberFormatTypes > xTypes(xSupplier->getNumberFormats(), UNO_QUERY);
-
- double fDate = DBTypeConversion::toDouble(aDate,DBTypeConversion::getNULLDate(xSupplier));
- sal_Int32 nKey = xTypes->getStandardIndex(rParam.rLocale) + 36; // XXX hack
- return rParam.xFormatter->convertNumberToString(nKey, fDate);
-}
-
-//-----------------------------------------------------------------------------
-::rtl::OUString OSQLParseNode::convertDateTimeString(const SQLParseNodeParameter& rParam, const ::rtl::OUString& rString) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::convertDateTimeString" );
- DateTime aDate = DBTypeConversion::toDateTime(rString);
- Reference< XNumberFormatsSupplier > xSupplier(rParam.xFormatter->getNumberFormatsSupplier());
- Reference< XNumberFormatTypes > xTypes(xSupplier->getNumberFormats(), UNO_QUERY);
-
- double fDateTime = DBTypeConversion::toDouble(aDate,DBTypeConversion::getNULLDate(xSupplier));
- sal_Int32 nKey = xTypes->getStandardIndex(rParam.rLocale) + 51; // XXX hack
- return rParam.xFormatter->convertNumberToString(nKey, fDateTime);
-}
-
-//-----------------------------------------------------------------------------
-::rtl::OUString OSQLParseNode::convertTimeString(const SQLParseNodeParameter& rParam, const ::rtl::OUString& rString) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::convertTimeString" );
- Time aTime = DBTypeConversion::toTime(rString);
- Reference< XNumberFormatsSupplier > xSupplier(rParam.xFormatter->getNumberFormatsSupplier());
-
- Reference< XNumberFormatTypes > xTypes(xSupplier->getNumberFormats(), UNO_QUERY);
-
- double fTime = DBTypeConversion::toDouble(aTime);
- sal_Int32 nKey = xTypes->getStandardIndex(rParam.rLocale) + 41; // XXX hack
- return rParam.xFormatter->convertNumberToString(nKey, fTime);
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseNode::parseNodeToStr(::rtl::OUString& rString,
- const Reference< XConnection >& _rxConnection,
- const IParseContext* pContext,
- sal_Bool _bIntl,
- sal_Bool _bQuote) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::parseNodeToStr" );
-
- parseNodeToStr(
- rString, _rxConnection, NULL, NULL,
- pContext ? pContext->getPreferredLocale() : OParseContext::getDefaultLocale(),
- pContext, _bIntl, _bQuote, '.', false, false );
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseNode::parseNodeToPredicateStr(::rtl::OUString& rString,
- const Reference< XConnection >& _rxConnection,
- const Reference< XNumberFormatter > & xFormatter,
- const ::com::sun::star::lang::Locale& rIntl,
- sal_Char _cDec,
- const IParseContext* pContext ) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::parseNodeToPredicateStr" );
-
- OSL_ENSURE(xFormatter.is(), "OSQLParseNode::parseNodeToPredicateStr:: no formatter!");
-
- if (xFormatter.is())
- parseNodeToStr(rString, _rxConnection, xFormatter, NULL, rIntl, pContext, sal_True, sal_True, _cDec, true, false);
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseNode::parseNodeToPredicateStr(::rtl::OUString& rString,
- const Reference< XConnection > & _rxConnection,
- const Reference< XNumberFormatter > & xFormatter,
- const Reference< XPropertySet > & _xField,
- const ::com::sun::star::lang::Locale& rIntl,
- sal_Char _cDec,
- const IParseContext* pContext ) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::parseNodeToPredicateStr" );
-
- OSL_ENSURE(xFormatter.is(), "OSQLParseNode::parseNodeToPredicateStr:: no formatter!");
-
- if (xFormatter.is())
- parseNodeToStr( rString, _rxConnection, xFormatter, _xField, rIntl, pContext, true, true, _cDec, true, false );
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseNode::parseNodeToStr(::rtl::OUString& rString,
- const Reference< XConnection > & _rxConnection,
- const Reference< XNumberFormatter > & xFormatter,
- const Reference< XPropertySet > & _xField,
- const ::com::sun::star::lang::Locale& rIntl,
- const IParseContext* pContext,
- bool _bIntl,
- bool _bQuote,
- sal_Char _cDecSep,
- bool _bPredicate,
- bool _bSubstitute) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::parseNodeToStr" );
-
- OSL_ENSURE( _rxConnection.is(), "OSQLParseNode::parseNodeToStr: invalid connection!" );
-
- if ( _rxConnection.is() )
- {
- ::rtl::OUStringBuffer sBuffer = rString;
- try
- {
- OSQLParseNode::impl_parseNodeToString_throw( sBuffer,
- SQLParseNodeParameter(
- _rxConnection, xFormatter, _xField, rIntl, pContext,
- _bIntl, _bQuote, _cDecSep, _bPredicate, _bSubstitute
- ) );
- }
- catch( const SQLException& )
- {
- OSL_FAIL( "OSQLParseNode::parseNodeToStr: this should not throw!" );
- // our callers don't expect this method to throw anything. The only known situation
- // where impl_parseNodeToString_throw can throw is when there is a cyclic reference
- // in the sub queries, but this cannot be the case here, as we do not parse to
- // SDBC level.
- }
- rString = sBuffer.makeStringAndClear();
- }
-}
-//-----------------------------------------------------------------------------
-bool OSQLParseNode::parseNodeToExecutableStatement( ::rtl::OUString& _out_rString, const Reference< XConnection >& _rxConnection,
- OSQLParser& _rParser, ::com::sun::star::sdbc::SQLException* _pErrorHolder ) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::parseNodeToExecutableStatement" );
- OSL_PRECOND( _rxConnection.is(), "OSQLParseNode::parseNodeToExecutableStatement: invalid connection!" );
- SQLParseNodeParameter aParseParam( _rxConnection,
- NULL, NULL, OParseContext::getDefaultLocale(), NULL, false, true, '.', false, true );
-
- if ( aParseParam.aMetaData.supportsSubqueriesInFrom() )
- {
- Reference< XQueriesSupplier > xSuppQueries( _rxConnection, UNO_QUERY );
- OSL_ENSURE( xSuppQueries.is(), "OSQLParseNode::parseNodeToExecutableStatement: cannot substitute everything without a QueriesSupplier!" );
- if ( xSuppQueries.is() )
- aParseParam.xQueries = xSuppQueries->getQueries();
- }
-
- aParseParam.pParser = &_rParser;
-
- _out_rString = ::rtl::OUString();
- ::rtl::OUStringBuffer sBuffer;
- bool bSuccess = false;
- try
- {
- impl_parseNodeToString_throw( sBuffer, aParseParam );
- bSuccess = true;
- }
- catch( const SQLException& e )
- {
- if ( _pErrorHolder )
- *_pErrorHolder = e;
- }
- _out_rString = sBuffer.makeStringAndClear();
- return bSuccess;
-}
-
-//-----------------------------------------------------------------------------
-namespace
-{
- bool lcl_isAliasNamePresent( const OSQLParseNode& _rTableNameNode )
- {
- return OSQLParseNode::getTableRange(_rTableNameNode.getParent()).getLength() != 0;
- }
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::getTableRange" );
- if ( isToken() )
- {
- parseLeaf(rString,rParam);
- return;
- }
-
- // einmal auswerten wieviel Subtrees dieser Knoten besitzt
- sal_uInt32 nCount = count();
-
- bool bHandled = false;
- switch ( getKnownRuleID() )
- {
- // special handling for parameters
- case parameter:
- {
- if(rString.getLength())
- rString.appendAscii(" ");
- if (nCount == 1) // ?
- m_aChildren[0]->impl_parseNodeToString_throw( rString, rParam );
- else if (nCount == 2) // :Name
- {
- m_aChildren[0]->impl_parseNodeToString_throw( rString, rParam );
- rString.append(m_aChildren[1]->m_aNodeValue);
- } // [Name]
- else
- {
- m_aChildren[0]->impl_parseNodeToString_throw( rString, rParam );
- rString.append(m_aChildren[1]->m_aNodeValue);
- rString.append(m_aChildren[2]->m_aNodeValue);
- }
- bHandled = true;
- }
- break;
-
- // table refs
- case table_ref:
- if ( ( nCount == 2 ) || ( nCount == 3 ) || ( nCount == 5 ) )
- {
- impl_parseTableRangeNodeToString_throw( rString, rParam );
- bHandled = true;
- }
- break;
-
- // table name - might be a query name
- case table_name:
- bHandled = impl_parseTableNameNodeToString_throw( rString, rParam );
- break;
-
- case as:
- if ( rParam.aMetaData.generateASBeforeCorrelationName() )
- rString.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" AS")));
- bHandled = true;
- break;
-
- case like_predicate:
- // je nachdem ob international angegeben wird oder nicht wird like anders behandelt
- // interanational: *, ? sind Platzhalter
- // sonst SQL92 konform: %, _
- impl_parseLikeNodeToString_throw( rString, rParam );
- bHandled = true;
- break;
-
- case general_set_fct:
- case set_fct_spec:
- case position_exp:
- case extract_exp:
- case length_exp:
- case char_value_fct:
- {
- if (!addDateValue(rString, rParam))
- {
- // Funktionsname nicht quoten
- SQLParseNodeParameter aNewParam(rParam);
- aNewParam.bQuote = ( SQL_ISRULE(this,length_exp) || SQL_ISRULE(this,char_value_fct) );
-
- m_aChildren[0]->impl_parseNodeToString_throw( rString, aNewParam );
- aNewParam.bQuote = rParam.bQuote;
- //aNewParam.bPredicate = sal_False; // disable [ ] around names // look at i73215
- ::rtl::OUStringBuffer aStringPara;
- for (sal_uInt32 i=1; i<nCount; i++)
- {
- const OSQLParseNode * pSubTree = m_aChildren[i];
- if (pSubTree)
- {
- pSubTree->impl_parseNodeToString_throw( aStringPara, aNewParam );
-
- // bei den CommaListen zwischen alle Subtrees Commas setzen
- if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i < (nCount - 1)))
- aStringPara.appendAscii(",");
- }
- else
- i++;
- }
- rString.append(aStringPara.makeStringAndClear());
- }
- bHandled = true;
- }
- break;
- default:
- break;
- } // switch ( getKnownRuleID() )
-
- if ( !bHandled )
- {
- for (OSQLParseNodes::const_iterator i = m_aChildren.begin();
- i != m_aChildren.end();)
- {
- const OSQLParseNode* pSubTree = *i;
- if ( !pSubTree )
- {
- ++i;
- continue;
- }
-
- SQLParseNodeParameter aNewParam(rParam);
-
- // don't replace the field for subqueries
- if (rParam.xField.is() && SQL_ISRULE(pSubTree,subquery))
- aNewParam.xField = NULL;
-
- // if there is a field given we don't display the fieldname, if there is any
- if (rParam.xField.is() && SQL_ISRULE(pSubTree,column_ref))
- {
- sal_Bool bFilter = sal_False;
- // retrieve the fields name
- ::rtl::OUString aFieldName;
- try
- {
- sal_Int32 nNamePropertyId = PROPERTY_ID_NAME;
- if ( rParam.xField->getPropertySetInfo()->hasPropertyByName( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_REALNAME ) ) )
- nNamePropertyId = PROPERTY_ID_REALNAME;
- rParam.xField->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( nNamePropertyId ) ) >>= aFieldName;
- }
- catch ( Exception& )
- {
- }
-
- if(pSubTree->count())
- {
- const OSQLParseNode* pCol = pSubTree->m_aChildren[pSubTree->count()-1];
- if ( ( SQL_ISRULE(pCol,column_val)
- && pCol->getChild(0)->getTokenValue().equalsIgnoreAsciiCase(aFieldName)
- )
- || pCol->getTokenValue().equalsIgnoreAsciiCase(aFieldName)
- )
- bFilter = sal_True;
- }
-
- // ok we found the field, if the following node is the
- // comparision operator '=' we filter it as well
- if (bFilter)
- {
- if (SQL_ISRULE(this, comparison_predicate))
- {
- ++i;
- if(i != m_aChildren.end())
- {
- pSubTree = *i;
- if (pSubTree && pSubTree->getNodeType() == SQL_NODE_EQUAL)
- ++i;
- }
- }
- else
- ++i;
- }
- else
- {
- pSubTree->impl_parseNodeToString_throw( rString, aNewParam );
- ++i;
-
- // bei den CommaListen zwischen alle Subtrees Commas setzen
- if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i != m_aChildren.end()))
- rString.appendAscii(",");
- }
- }
- else
- {
- pSubTree->impl_parseNodeToString_throw( rString, aNewParam );
- ++i;
-
- // bei den CommaListen zwischen alle Subtrees Commas setzen
- if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i != m_aChildren.end()))
- {
- if (SQL_ISRULE(this,value_exp_commalist) && rParam.bPredicate)
- rString.appendAscii(";");
- else
- rString.appendAscii(",");
- }
- }
- }
- }
-}
-
-//-----------------------------------------------------------------------------
-bool OSQLParseNode::impl_parseTableNameNodeToString_throw( ::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam ) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::impl_parseTableNameNodeToString_throw" );
- // is the table_name part of a table_ref?
- OSL_ENSURE( getParent(), "OSQLParseNode::impl_parseTableNameNodeToString_throw: table_name without parent?" );
- if ( !getParent() || ( getParent()->getKnownRuleID() != table_ref ) )
- return false;
-
- // if it's a query, maybe we need to substitute the SQL statement ...
- if ( !rParam.bParseToSDBCLevel )
- return false;
-
- if ( !rParam.xQueries.is() )
- // connection does not support queries in queries, or was no query supplier
- return false;
-
- try
- {
- ::rtl::OUString sTableOrQueryName( getChild(0)->getTokenValue() );
- bool bIsQuery = rParam.xQueries->hasByName( sTableOrQueryName );
- if ( !bIsQuery )
- return false;
-
- // avoid recursion (e.g. "foo" defined as "SELECT * FROM bar" and "bar" defined as "SELECT * FROM foo".
- if ( rParam.pSubQueryHistory->find( sTableOrQueryName ) != rParam.pSubQueryHistory->end() )
- {
- ::rtl::OUString sMessage( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cyclic sub queries" ) ) );
- OSL_ENSURE( rParam.pParser, "OSQLParseNode::impl_parseTableNameNodeToString_throw: no parser?" );
- if ( rParam.pParser )
- {
- const SQLError& rErrors( rParam.pParser->getErrorHelper() );
- rErrors.raiseException( sdb::ErrorCondition::PARSER_CYCLIC_SUB_QUERIES );
- }
- else
- {
- SQLError aErrors( ::comphelper::getProcessServiceFactory() );
- aErrors.raiseException( sdb::ErrorCondition::PARSER_CYCLIC_SUB_QUERIES );
- }
- }
- rParam.pSubQueryHistory->insert( sTableOrQueryName );
-
- Reference< XPropertySet > xQuery( rParam.xQueries->getByName( sTableOrQueryName ), UNO_QUERY_THROW );
-
- // substitute the query name with the constituting command
- ::rtl::OUString sCommand;
- OSL_VERIFY( xQuery->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_COMMAND ) ) >>= sCommand );
-
- sal_Bool bEscapeProcessing = sal_False;
- OSL_VERIFY( xQuery->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_ESCAPEPROCESSING ) ) >>= bEscapeProcessing );
-
- // the query we found here might itself be based on another query, so parse it recursively
- OSL_ENSURE( rParam.pParser, "OSQLParseNode::impl_parseTableNameNodeToString_throw: cannot analyze sub queries without a parser!" );
- if ( bEscapeProcessing && rParam.pParser )
- {
- ::rtl::OUString sError;
- ::std::auto_ptr< OSQLParseNode > pSubQueryNode( rParam.pParser->parseTree( sError, sCommand, sal_False ) );
- if ( pSubQueryNode.get() )
- {
- // parse the sub-select to SDBC level, too
- ::rtl::OUStringBuffer sSubSelect;
- pSubQueryNode->impl_parseNodeToString_throw( sSubSelect, rParam );
- if ( sSubSelect.getLength() )
- sCommand = sSubSelect.makeStringAndClear();
- }
- }
-
- rString.appendAscii( " ( " );
- rString.append(sCommand);
- rString.appendAscii( " )" );
-
- // append the query name as table alias, since it might be referenced in other
- // parts of the statement - but only if there's no other alias name present
- if ( !lcl_isAliasNamePresent( *this ) )
- {
- rString.appendAscii( " AS " );
- if ( rParam.bQuote )
- rString.append(SetQuotation( sTableOrQueryName,
- rParam.aMetaData.getIdentifierQuoteString(), rParam.aMetaData.getIdentifierQuoteString() ));
- }
-
- // don't forget to remove the query name from the history, else multiple inclusions
- // won't work
- // #i69227# / 2006-10-10 / frank.schoenheit@sun.com
- rParam.pSubQueryHistory->erase( sTableOrQueryName );
-
- return true;
- }
- catch( const SQLException& )
- {
- throw;
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return false;
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseNode::impl_parseTableRangeNodeToString_throw(::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::impl_parseTableRangeNodeToString_throw" );
- OSL_PRECOND( ( count() == 2 ) || ( count() == 3 ) || ( count() == 5 ) ,"Illegal count");
-
- // rString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
- ::std::for_each(m_aChildren.begin(),m_aChildren.end(),
- boost::bind( &OSQLParseNode::impl_parseNodeToString_throw, _1, boost::ref( rString ), boost::cref( rParam ) ));
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam ) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::impl_parseLikeNodeToString_throw" );
- OSL_ENSURE(count() == 2,"count != 2: Prepare for GPF");
-
- const OSQLParseNode* pEscNode = NULL;
- const OSQLParseNode* pParaNode = NULL;
-
- SQLParseNodeParameter aNewParam(rParam);
- //aNewParam.bQuote = sal_True; // why setting this to true? @see http://www.openoffice.org/issues/show_bug.cgi?id=75557
-
- // if there is a field given we don't display the fieldname, if there are any
- sal_Bool bAddName = sal_True;
- if (rParam.xField.is())
- {
- // retrieve the fields name
- ::rtl::OUString aFieldName;
- try
- {
- // retrieve the fields name
- rtl::OUString aString;
- rParam.xField->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aString;
- aFieldName = aString.getStr();
- }
- catch ( Exception& )
- {
- OSL_FAIL( "OSQLParseNode::impl_parseLikeNodeToString_throw Exception occurred!" );
- }
- if ( !m_aChildren[0]->isLeaf() )
- {
- const OSQLParseNode* pCol = m_aChildren[0]->getChild(m_aChildren[0]->count()-1);
- if ((SQL_ISRULE(pCol,column_val) && pCol->getChild(0)->getTokenValue().equalsIgnoreAsciiCase(aFieldName)) ||
- pCol->getTokenValue().equalsIgnoreAsciiCase(aFieldName) )
- bAddName = sal_False;
- }
- }
-
- if (bAddName)
- m_aChildren[0]->impl_parseNodeToString_throw( rString, aNewParam );
-
- const OSQLParseNode* pPart2 = m_aChildren[1];
- pPart2->getChild(0)->impl_parseNodeToString_throw( rString, aNewParam );
- pPart2->getChild(1)->impl_parseNodeToString_throw( rString, aNewParam );
- pParaNode = pPart2->getChild(2);
- pEscNode = pPart2->getChild(3);
-
- if (pParaNode->isToken())
- {
- ::rtl::OUString aStr = ConvertLikeToken(pParaNode, pEscNode, rParam.bInternational);
- rString.appendAscii(" ");
- rString.append(SetQuotation(aStr,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\'")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\'\'"))));
- }
- else
- pParaNode->impl_parseNodeToString_throw( rString, aNewParam );
-
- pEscNode->impl_parseNodeToString_throw( rString, aNewParam );
-}
-
-
-// -----------------------------------------------------------------------------
-sal_Bool OSQLParseNode::getTableComponents(const OSQLParseNode* _pTableNode,
- ::com::sun::star::uno::Any &_rCatalog,
- ::rtl::OUString &_rSchema,
- ::rtl::OUString &_rTable,
- const Reference< XDatabaseMetaData >& _xMetaData)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::getTableComponents" );
- OSL_ENSURE(_pTableNode,"Wrong use of getTableComponents! _pTableNode is not allowed to be null!");
- if(_pTableNode)
- {
- const sal_Bool bSupportsCatalog = _xMetaData.is() && _xMetaData->supportsCatalogsInDataManipulation();
- const sal_Bool bSupportsSchema = _xMetaData.is() && _xMetaData->supportsSchemasInDataManipulation();
- const OSQLParseNode* pTableNode = _pTableNode;
- // clear the parameter given
- _rCatalog = Any();
- _rSchema = _rTable = ::rtl::OUString();
- // see rule catalog_name: in sqlbison.y
- if (SQL_ISRULE(pTableNode,catalog_name))
- {
- OSL_ENSURE(pTableNode->getChild(0) && pTableNode->getChild(0)->isToken(),"Invalid parsenode!");
- _rCatalog <<= pTableNode->getChild(0)->getTokenValue();
- pTableNode = pTableNode->getChild(2);
- }
- // check if we have schema_name rule
- if(SQL_ISRULE(pTableNode,schema_name))
- {
- if ( bSupportsCatalog && !bSupportsSchema )
- _rCatalog <<= pTableNode->getChild(0)->getTokenValue();
- else
- _rSchema = pTableNode->getChild(0)->getTokenValue();
- pTableNode = pTableNode->getChild(2);
- }
- // check if we have table_name rule
- if(SQL_ISRULE(pTableNode,table_name))
- {
- _rTable = pTableNode->getChild(0)->getTokenValue();
- }
- else
- {
- OSL_FAIL("Error in parse tree!");
- }
- }
- return _rTable.getLength() != 0;
-}
-// -----------------------------------------------------------------------------
-void OSQLParser::killThousandSeparator(OSQLParseNode* pLiteral)
-{
- if ( pLiteral )
- {
- if ( s_xLocaleData->getLocaleItem( m_pData->aLocale ).decimalSeparator.toChar() == ',' )
- {
- pLiteral->m_aNodeValue = pLiteral->m_aNodeValue.replace('.', sal_Unicode());
- // and replace decimal
- pLiteral->m_aNodeValue = pLiteral->m_aNodeValue.replace(',', '.');
- }
- else
- pLiteral->m_aNodeValue = pLiteral->m_aNodeValue.replace(',', sal_Unicode());
- }
-}
-// -----------------------------------------------------------------------------
-OSQLParseNode* OSQLParser::convertNode(sal_Int32 nType,OSQLParseNode*& pLiteral)
-{
- if ( !pLiteral )
- return NULL;
-
- OSQLParseNode* pReturn = pLiteral;
-
- if ( ( pLiteral->isRule() && !SQL_ISRULE(pLiteral,value_exp) ) || SQL_ISTOKEN(pLiteral,FALSE) || SQL_ISTOKEN(pLiteral,TRUE) )
- {
- switch(nType)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- if ( !SQL_ISRULE(pReturn,char_value_exp) && !buildStringNodes(pReturn) )
- pReturn = NULL;
- default:
- break;
- }
- }
- else
- {
- switch(pLiteral->getNodeType())
- {
- case SQL_NODE_STRING:
- switch(nType)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- break;
- case DataType::DATE:
- case DataType::TIME:
- case DataType::TIMESTAMP:
- if (m_xFormatter.is())
- pReturn = buildDate( nType, pReturn);
- break;
- default:
- m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_INVALID_COMPARE);
- break;
- }
- break;
- case SQL_NODE_ACCESS_DATE:
- switch(nType)
- {
- case DataType::DATE:
- case DataType::TIME:
- case DataType::TIMESTAMP:
- if ( m_xFormatter.is() )
- pReturn = buildDate( nType, pReturn);
- else
- m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_INVALID_DATE_COMPARE);
- break;
- default:
- m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_INVALID_COMPARE);
- break;
- }
- break;
- case SQL_NODE_INTNUM:
- switch(nType)
- {
- case DataType::BIT:
- case DataType::BOOLEAN:
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::TINYINT:
- case DataType::SMALLINT:
- case DataType::INTEGER:
- case DataType::BIGINT:
- case DataType::FLOAT:
- case DataType::REAL:
- case DataType::DOUBLE:
- // kill thousand seperators if any
- killThousandSeparator(pReturn);
- break;
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- pReturn = buildNode_STR_NUM(pReturn);
- break;
- default:
- m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_INVALID_INT_COMPARE);
- break;
- }
- break;
- case SQL_NODE_APPROXNUM:
- switch(nType)
- {
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::FLOAT:
- case DataType::REAL:
- case DataType::DOUBLE:
- // kill thousand seperators if any
- killThousandSeparator(pReturn);
- break;
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- pReturn = buildNode_STR_NUM(pReturn);
- break;
- case DataType::INTEGER:
- default:
- m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_INVALID_REAL_COMPARE);
- break;
- }
- break;
- default:
- ;
- }
- }
- return pReturn;
-}
-// -----------------------------------------------------------------------------
-sal_Int16 OSQLParser::buildPredicateRule(OSQLParseNode*& pAppend,OSQLParseNode* pLiteral,OSQLParseNode*& pCompare,OSQLParseNode* pLiteral2)
-{
- OSL_ENSURE(inPredicateCheck(),"Only in predicate check allowed!");
- sal_Int16 nErg = 0;
- if ( m_xField.is() )
- {
- sal_Int32 nType = 0;
- try
- {
- m_xField->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
- }
- catch( Exception& )
- {
- return nErg;
- }
-
- OSQLParseNode* pNode1 = convertNode(nType,pLiteral);
- if ( pNode1 )
- {
- OSQLParseNode* pNode2 = convertNode(nType,pLiteral2);
- if ( !m_sErrorMessage.getLength() )
- nErg = buildNode(pAppend,pCompare,pNode1,pNode2);
- }
- }
- if (!pCompare->getParent()) // I have no parent so I was not used and I must die :-)
- delete pCompare;
- return nErg;
-}
-// -----------------------------------------------------------------------------
-sal_Int16 OSQLParser::buildLikeRule(OSQLParseNode*& pAppend, OSQLParseNode*& pLiteral, const OSQLParseNode* pEscape)
-{
- sal_Int16 nErg = 0;
- sal_Int32 nType = 0;
-
- if (!m_xField.is())
- return nErg;
- try
- {
- Any aValue;
- {
- aValue = m_xField->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE));
- aValue >>= nType;
- }
- }
- catch( Exception& )
- {
- return nErg;
- }
-
- switch (nType)
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- if(pLiteral->isRule())
- {
- pAppend->append(pLiteral);
- nErg = 1;
- }
- else
- {
- switch(pLiteral->getNodeType())
- {
- case SQL_NODE_STRING:
- pLiteral->m_aNodeValue = ConvertLikeToken(pLiteral, pEscape, sal_False);
- pAppend->append(pLiteral);
- nErg = 1;
- break;
- case SQL_NODE_APPROXNUM:
- if (m_xFormatter.is() && m_nFormatKey)
- {
- sal_Int16 nScale = 0;
- try
- {
- Any aValue = getNumberFormatProperty( m_xFormatter, m_nFormatKey, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Decimals")) );
- aValue >>= nScale;
- }
- catch( Exception& )
- {
- }
-
- pAppend->append(new OSQLInternalNode(stringToDouble(pLiteral->getTokenValue(),nScale),SQL_NODE_STRING));
- }
- else
- pAppend->append(new OSQLInternalNode(pLiteral->getTokenValue(),SQL_NODE_STRING));
-
- delete pLiteral;
- nErg = 1;
- break;
- default:
- m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_VALUE_NO_LIKE);
- m_sErrorMessage = m_sErrorMessage.replaceAt(m_sErrorMessage.indexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#1"))),2,pLiteral->getTokenValue());
- break;
- }
- }
- break;
- default:
- m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_FIELD_NO_LIKE);
- break;
- }
- return nErg;
-}
-//-----------------------------------------------------------------------------
-OSQLParseNode* OSQLParser::buildNode_Date(const double& fValue, sal_Int32 nType)
-{
- ::rtl::OUString aEmptyString;
- OSQLParseNode* pNewNode = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::set_fct_spec));
- pNewNode->append(new OSQLInternalNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("{")), SQL_NODE_PUNCTUATION));
- OSQLParseNode* pDateNode = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::odbc_fct_spec));
- pNewNode->append(pDateNode);
- pNewNode->append(new OSQLInternalNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("}")), SQL_NODE_PUNCTUATION));
-
- switch (nType)
- {
- case DataType::DATE:
- {
- Date aDate = DBTypeConversion::toDate(fValue,DBTypeConversion::getNULLDate(m_xFormatter->getNumberFormatsSupplier()));
- ::rtl::OUString aString = DBTypeConversion::toDateString(aDate);
- pDateNode->append(new OSQLInternalNode(aEmptyString, SQL_NODE_KEYWORD, SQL_TOKEN_D));
- pDateNode->append(new OSQLInternalNode(aString, SQL_NODE_STRING));
- break;
- }
- case DataType::TIME:
- {
- Time aTime = DBTypeConversion::toTime(fValue);
- ::rtl::OUString aString = DBTypeConversion::toTimeString(aTime);
- pDateNode->append(new OSQLInternalNode(aEmptyString, SQL_NODE_KEYWORD, SQL_TOKEN_T));
- pDateNode->append(new OSQLInternalNode(aString, SQL_NODE_STRING));
- break;
- }
- case DataType::TIMESTAMP:
- {
- DateTime aDateTime = DBTypeConversion::toDateTime(fValue,DBTypeConversion::getNULLDate(m_xFormatter->getNumberFormatsSupplier()));
- if (aDateTime.Seconds || aDateTime.Minutes || aDateTime.Hours)
- {
- ::rtl::OUString aString = DBTypeConversion::toDateTimeString(aDateTime);
- pDateNode->append(new OSQLInternalNode(aEmptyString, SQL_NODE_KEYWORD, SQL_TOKEN_TS));
- pDateNode->append(new OSQLInternalNode(aString, SQL_NODE_STRING));
- }
- else
- {
- Date aDate(aDateTime.Day,aDateTime.Month,aDateTime.Year);
- pDateNode->append(new OSQLInternalNode(aEmptyString, SQL_NODE_KEYWORD, SQL_TOKEN_D));
- pDateNode->append(new OSQLInternalNode(DBTypeConversion::toDateString(aDate), SQL_NODE_STRING));
- }
- break;
- }
- }
-
- return pNewNode;
-}
-// -----------------------------------------------------------------------------
-OSQLParseNode* OSQLParser::buildNode_STR_NUM(OSQLParseNode*& _pLiteral)
-{
- OSQLParseNode* pReturn = NULL;
- if ( _pLiteral )
- {
- if (m_nFormatKey)
- {
- sal_Int16 nScale = 0;
- ::rtl::OUString aDec;
- try
- {
- Any aValue = getNumberFormatProperty( m_xFormatter, m_nFormatKey, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Decimals")) );
- aValue >>= nScale;
- }
- catch( Exception& )
- {
- }
-
- pReturn = new OSQLInternalNode(stringToDouble(_pLiteral->getTokenValue(),nScale),SQL_NODE_STRING);
- }
- else
- pReturn = new OSQLInternalNode(_pLiteral->getTokenValue(),SQL_NODE_STRING);
-
- delete _pLiteral;
- _pLiteral = NULL;
- }
- return pReturn;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OSQLParser::stringToDouble(const ::rtl::OUString& _rValue,sal_Int16 _nScale)
-{
- ::rtl::OUString aValue;
- if(!m_xCharClass.is())
- m_xCharClass = Reference<XCharacterClassification>(m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.CharacterClassification"))),UNO_QUERY);
- if(m_xCharClass.is() && s_xLocaleData.is())
- {
- try
- {
- ParseResult aResult = m_xCharClass->parsePredefinedToken(KParseType::ANY_NUMBER,_rValue,0,m_pData->aLocale,0,::rtl::OUString(),KParseType::ANY_NUMBER,::rtl::OUString());
- if((aResult.TokenType & KParseType::IDENTNAME) && aResult.EndPos == _rValue.getLength())
- {
- aValue = ::rtl::OUString::valueOf(aResult.Value);
- sal_Int32 nPos = aValue.lastIndexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".")));
- if((nPos+_nScale) < aValue.getLength())
- aValue = aValue.replaceAt(nPos+_nScale,aValue.getLength()-nPos-_nScale,::rtl::OUString());
- aValue = aValue.replaceAt(aValue.lastIndexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."))),1,s_xLocaleData->getLocaleItem(m_pData->aLocale).decimalSeparator);
- return aValue;
- }
- }
- catch(Exception&)
- {
- }
- }
- return aValue;
-}
-// -----------------------------------------------------------------------------
-
-::osl::Mutex& OSQLParser::getMutex()
-{
- static ::osl::Mutex aMutex;
- return aMutex;
-}
-
-//-----------------------------------------------------------------------------
-OSQLParseNode* OSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const ::rtl::OUString& rStatement,
- const Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter,
- const Reference< XPropertySet > & xField)
-{
-
-
- // mutex for parsing
- static ::osl::Mutex aMutex;
-
- // Guard the parsing
- ::osl::MutexGuard aGuard(getMutex());
- // must be reset
- setParser(this);
-
-
- // reset the parser
- m_xField = xField;
- m_xFormatter = xFormatter;
-
- if (m_xField.is())
- {
- sal_Int32 nType=0;
- try
- {
- // get the field name
- rtl::OUString aString;
-
- // retrieve the fields name
- // #75243# use the RealName of the column if there is any otherwise the name which could be the alias
- // of the field
- Reference< XPropertySetInfo> xInfo = m_xField->getPropertySetInfo();
- if ( xInfo->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME)))
- m_xField->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME)) >>= aString;
- else
- m_xField->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aString;
-
- m_sFieldName = aString;
-
- // get the field format key
- if ( xInfo->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FORMATKEY)))
- m_xField->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FORMATKEY)) >>= m_nFormatKey;
- else
- m_nFormatKey = 0;
-
- // get the field type
- m_xField->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
- }
- catch ( Exception& )
- {
- OSL_ASSERT(0);
- }
-
- if (m_nFormatKey && m_xFormatter.is())
- {
- Any aValue = getNumberFormatProperty( m_xFormatter, m_nFormatKey, OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_LOCALE) );
- OSL_ENSURE(aValue.getValueType() == ::getCppuType((const ::com::sun::star::lang::Locale*)0), "OSQLParser::PredicateTree : invalid language property !");
-
- if (aValue.getValueType() == ::getCppuType((const ::com::sun::star::lang::Locale*)0))
- aValue >>= m_pData->aLocale;
- }
- else
- m_pData->aLocale = m_pContext->getPreferredLocale();
-
- if ( m_xFormatter.is() )
- {
- try
- {
- Reference< ::com::sun::star::util::XNumberFormatsSupplier > xFormatSup = m_xFormatter->getNumberFormatsSupplier();
- if ( xFormatSup.is() )
- {
- Reference< ::com::sun::star::util::XNumberFormats > xFormats = xFormatSup->getNumberFormats();
- if ( xFormats.is() )
- {
- ::com::sun::star::lang::Locale aLocale;
- aLocale.Language = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en"));
- aLocale.Country = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US"));
- ::rtl::OUString sFormat(RTL_CONSTASCII_USTRINGPARAM("YYYY-MM-DD"));
- m_nDateFormatKey = xFormats->queryKey(sFormat,aLocale,sal_False);
- if ( m_nDateFormatKey == sal_Int32(-1) )
- m_nDateFormatKey = xFormats->addNew(sFormat, aLocale);
- }
- }
- }
- catch ( Exception& )
- {
- OSL_FAIL("DateFormatKey");
- }
- }
-
- switch (nType)
- {
- case DataType::DATE:
- case DataType::TIME:
- case DataType::TIMESTAMP:
- s_pScanner->SetRule(s_pScanner->GetDATERule());
- break;
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- case DataType::CLOB:
- s_pScanner->SetRule(s_pScanner->GetSTRINGRule());
- break;
- default:
- if ( s_xLocaleData->getLocaleItem( m_pData->aLocale ).decimalSeparator.toChar() == ',' )
- s_pScanner->SetRule(s_pScanner->GetGERRule());
- else
- s_pScanner->SetRule(s_pScanner->GetENGRule());
- }
-
- }
- else
- s_pScanner->SetRule(s_pScanner->GetSQLRule());
-
- s_pScanner->prepareScan(rStatement, m_pContext, sal_True);
-
- SQLyylval.pParseNode = NULL;
- // SQLyypvt = NULL;
- m_pParseTree = NULL;
- m_sErrorMessage= ::rtl::OUString();
-
- // ... und den Parser anwerfen ...
- if (SQLyyparse() != 0)
- {
- m_sFieldName= ::rtl::OUString();
- m_xField.clear();
- m_xFormatter.clear();
- m_nFormatKey = 0;
- m_nDateFormatKey = 0;
-
- if (!m_sErrorMessage.getLength())
- m_sErrorMessage = s_pScanner->getErrorMessage();
- if (!m_sErrorMessage.getLength())
- m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_GENERAL);
-
- rErrorMessage = m_sErrorMessage;
-
- // clear the garbage collector
- (*s_pGarbageCollector)->clearAndDelete();
- return NULL;
- }
- else
- {
- (*s_pGarbageCollector)->clear();
-
- m_sFieldName= ::rtl::OUString();
- m_xField.clear();
- m_xFormatter.clear();
- m_nFormatKey = 0;
- m_nDateFormatKey = 0;
-
- // Das Ergebnis liefern (den Root Parse Node):
-
- // Stattdessen setzt die Parse-Routine jetzt den Member pParseTree
- // - einfach diesen zurueckliefern:
- OSL_ENSURE(m_pParseTree != NULL,"OSQLParser: Parser hat keinen ParseTree geliefert");
- return m_pParseTree;
- }
-}
-
-//=============================================================================
-//-----------------------------------------------------------------------------
-OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceFactory,const IParseContext* _pContext)
- :m_pContext(_pContext)
- ,m_pParseTree(NULL)
- ,m_pData( new OSQLParser_Data( _xServiceFactory ) )
- ,m_nFormatKey(0)
- ,m_nDateFormatKey(0)
- ,m_xServiceFactory(_xServiceFactory)
-{
-
-
- setParser(this);
-
-#ifdef SQLYYDEBUG
-#ifdef SQLYYDEBUG_ON
- SQLyydebug = 1;
-#endif
-#endif
-
- ::osl::MutexGuard aGuard(getMutex());
- // do we have to initialize the data
- if (s_nRefCount == 0)
- {
- s_pScanner = new OSQLScanner();
- s_pScanner->setScanner();
- s_pGarbageCollector = new OSQLParseNodesGarbageCollector();
-
- if(!s_xLocaleData.is())
- s_xLocaleData = Reference<XLocaleData>(m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.LocaleData"))),UNO_QUERY);
-
- // auf 0 zuruecksetzen
- memset(OSQLParser::s_nRuleIDs,0,sizeof(OSQLParser::s_nRuleIDs[0]) * (OSQLParseNode::rule_count+1));
-
- struct
- {
- OSQLParseNode::Rule eRule; // the parse node's ID for the rule
- ::rtl::OString sRuleName; // the name of the rule ("select_statement")
- } aRuleDescriptions[] =
- {
- { OSQLParseNode::select_statement, "select_statement" },
- { OSQLParseNode::table_exp, "table_exp" },
- { OSQLParseNode::table_ref_commalist, "table_ref_commalist" },
- { OSQLParseNode::table_ref, "table_ref" },
- { OSQLParseNode::catalog_name, "catalog_name" },
- { OSQLParseNode::schema_name, "schema_name" },
- { OSQLParseNode::table_name, "table_name" },
- { OSQLParseNode::opt_column_commalist, "opt_column_commalist" },
- { OSQLParseNode::column_commalist, "column_commalist" },
- { OSQLParseNode::column_ref_commalist, "column_ref_commalist" },
- { OSQLParseNode::column_ref, "column_ref" },
- { OSQLParseNode::opt_order_by_clause, "opt_order_by_clause" },
- { OSQLParseNode::ordering_spec_commalist, "ordering_spec_commalist" },
- { OSQLParseNode::ordering_spec, "ordering_spec" },
- { OSQLParseNode::opt_asc_desc, "opt_asc_desc" },
- { OSQLParseNode::where_clause, "where_clause" },
- { OSQLParseNode::opt_where_clause, "opt_where_clause" },
- { OSQLParseNode::search_condition, "search_condition" },
- { OSQLParseNode::comparison_predicate, "comparison_predicate" },
- { OSQLParseNode::between_predicate, "between_predicate" },
- { OSQLParseNode::like_predicate, "like_predicate" },
- { OSQLParseNode::opt_escape, "opt_escape" },
- { OSQLParseNode::test_for_null, "test_for_null" },
- { OSQLParseNode::scalar_exp_commalist, "scalar_exp_commalist" },
- { OSQLParseNode::scalar_exp, "scalar_exp" },
- { OSQLParseNode::parameter_ref, "parameter_ref" },
- { OSQLParseNode::parameter, "parameter" },
- { OSQLParseNode::general_set_fct, "general_set_fct" },
- { OSQLParseNode::range_variable, "range_variable" },
- { OSQLParseNode::column, "column" },
- { OSQLParseNode::delete_statement_positioned, "delete_statement_positioned" },
- { OSQLParseNode::delete_statement_searched, "delete_statement_searched" },
- { OSQLParseNode::update_statement_positioned, "update_statement_positioned" },
- { OSQLParseNode::update_statement_searched, "update_statement_searched" },
- { OSQLParseNode::assignment_commalist, "assignment_commalist" },
- { OSQLParseNode::assignment, "assignment" },
- { OSQLParseNode::values_or_query_spec, "values_or_query_spec" },
- { OSQLParseNode::insert_statement, "insert_statement" },
- { OSQLParseNode::insert_atom_commalist, "insert_atom_commalist" },
- { OSQLParseNode::insert_atom, "insert_atom" },
- { OSQLParseNode::predicate_check, "predicate_check" },
- { OSQLParseNode::from_clause, "from_clause" },
- { OSQLParseNode::qualified_join, "qualified_join" },
- { OSQLParseNode::cross_union, "cross_union" },
- { OSQLParseNode::select_sublist, "select_sublist" },
- { OSQLParseNode::derived_column, "derived_column" },
- { OSQLParseNode::column_val, "column_val" },
- { OSQLParseNode::set_fct_spec, "set_fct_spec" },
- { OSQLParseNode::boolean_term, "boolean_term" },
- { OSQLParseNode::boolean_primary, "boolean_primary" },
- { OSQLParseNode::num_value_exp, "num_value_exp" },
- { OSQLParseNode::join_type, "join_type" },
- { OSQLParseNode::position_exp, "position_exp" },
- { OSQLParseNode::extract_exp, "extract_exp" },
- { OSQLParseNode::length_exp, "length_exp" },
- { OSQLParseNode::char_value_fct, "char_value_fct" },
- { OSQLParseNode::odbc_call_spec, "odbc_call_spec" },
- { OSQLParseNode::in_predicate, "in_predicate" },
- { OSQLParseNode::existence_test, "existence_test" },
- { OSQLParseNode::unique_test, "unique_test" },
- { OSQLParseNode::all_or_any_predicate, "all_or_any_predicate" },
- { OSQLParseNode::named_columns_join, "named_columns_join" },
- { OSQLParseNode::join_condition, "join_condition" },
- { OSQLParseNode::joined_table, "joined_table" },
- { OSQLParseNode::boolean_factor, "boolean_factor" },
- { OSQLParseNode::sql_not, "sql_not" },
- { OSQLParseNode::boolean_test, "boolean_test" },
- { OSQLParseNode::manipulative_statement, "manipulative_statement" },
- { OSQLParseNode::subquery, "subquery" },
- { OSQLParseNode::value_exp_commalist, "value_exp_commalist" },
- { OSQLParseNode::odbc_fct_spec, "odbc_fct_spec" },
- { OSQLParseNode::union_statement, "union_statement" },
- { OSQLParseNode::outer_join_type, "outer_join_type" },
- { OSQLParseNode::char_value_exp, "char_value_exp" },
- { OSQLParseNode::term, "term" },
- { OSQLParseNode::value_exp_primary, "value_exp_primary" },
- { OSQLParseNode::value_exp, "value_exp" },
- { OSQLParseNode::selection, "selection" },
- { OSQLParseNode::fold, "fold" },
- { OSQLParseNode::char_substring_fct, "char_substring_fct" },
- { OSQLParseNode::factor, "factor" },
- { OSQLParseNode::base_table_def, "base_table_def" },
- { OSQLParseNode::base_table_element_commalist, "base_table_element_commalist" },
- { OSQLParseNode::data_type, "data_type" },
- { OSQLParseNode::column_def, "column_def" },
- { OSQLParseNode::table_node, "table_node" },
- { OSQLParseNode::as, "as" },
- { OSQLParseNode::op_column_commalist, "op_column_commalist" },
- { OSQLParseNode::table_primary_as_range_column, "table_primary_as_range_column" },
- { OSQLParseNode::datetime_primary, "datetime_primary" },
- { OSQLParseNode::concatenation, "concatenation" },
- { OSQLParseNode::char_factor, "char_factor" },
- { OSQLParseNode::bit_value_fct, "bit_value_fct" },
- { OSQLParseNode::comparison_predicate_part_2, "comparison_predicate_part_2" },
- { OSQLParseNode::parenthesized_boolean_value_expression, "parenthesized_boolean_value_expression" },
- { OSQLParseNode::character_string_type, "character_string_type" },
- { OSQLParseNode::other_like_predicate_part_2, "other_like_predicate_part_2" },
- { OSQLParseNode::between_predicate_part_2, "between_predicate_part_2" },
- { OSQLParseNode::cast_spec, "cast_spec" }
- };
- size_t nRuleMapCount = SAL_N_ELEMENTS( aRuleDescriptions );
- OSL_ENSURE( nRuleMapCount == size_t( OSQLParseNode::rule_count ), "OSQLParser::OSQLParser: added a new rule? Adjust this map!" );
-
- for ( size_t mapEntry = 0; mapEntry < nRuleMapCount; ++mapEntry )
- {
- // look up the rule description in the our identifier map
- sal_uInt32 nParserRuleID = StrToRuleID( aRuleDescriptions[ mapEntry ].sRuleName );
- // map the parser's rule ID to the OSQLParseNode::Rule
- s_aReverseRuleIDLookup[ nParserRuleID ] = aRuleDescriptions[ mapEntry ].eRule;
- // and map the OSQLParseNode::Rule to the parser's rule ID
- s_nRuleIDs[ aRuleDescriptions[ mapEntry ].eRule ] = nParserRuleID;
- }
- }
- ++s_nRefCount;
-
- if (m_pContext == NULL)
- // take the default context
- m_pContext = &s_aDefaultContext;
-
- m_pData->aLocale = m_pContext->getPreferredLocale();
-}
-
-//-----------------------------------------------------------------------------
-OSQLParser::~OSQLParser()
-{
- {
- ::osl::MutexGuard aGuard(getMutex());
- OSL_ENSURE(s_nRefCount > 0, "OSQLParser::~OSQLParser() : suspicious call : have a refcount of 0 !");
- if (!--s_nRefCount)
- {
- s_pScanner->setScanner(sal_True);
- delete s_pScanner;
- s_pScanner = NULL;
-
- delete s_pGarbageCollector;
- s_pGarbageCollector = NULL;
- // is only set the first time so we should delete it only when there no more instances
- s_xLocaleData = NULL;
-
- RuleIDMap aEmpty;
- s_aReverseRuleIDLookup.swap( aEmpty );
- }
- m_pParseTree = NULL;
- }
-}
-// -----------------------------------------------------------------------------
-void OSQLParseNode::substituteParameterNames(OSQLParseNode* _pNode)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::substituteParameterNames" );
- sal_Int32 nCount = _pNode->count();
- for(sal_Int32 i=0;i < nCount;++i)
- {
- OSQLParseNode* pChildNode = _pNode->getChild(i);
- if(SQL_ISRULE(pChildNode,parameter) && pChildNode->count() > 1)
- {
- OSQLParseNode* pNewNode = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("?")) ,SQL_NODE_PUNCTUATION,0);
- delete pChildNode->replace(pChildNode->getChild(0),pNewNode);
- sal_Int32 nChildCount = pChildNode->count();
- for(sal_Int32 j=1;j < nChildCount;++j)
- delete pChildNode->removeAt(1);
- }
- else
- substituteParameterNames(pChildNode);
-
- }
-}
-// -----------------------------------------------------------------------------
-bool OSQLParser::extractDate(OSQLParseNode* pLiteral,double& _rfValue)
-{
- Reference< XNumberFormatsSupplier > xFormatSup = m_xFormatter->getNumberFormatsSupplier();
- Reference< XNumberFormatTypes > xFormatTypes;
- if ( xFormatSup.is() )
- xFormatTypes = xFormatTypes.query( xFormatSup->getNumberFormats() );
-
- // if there is no format key, yet, make sure we have a feasible one for our locale
- try
- {
- if ( !m_nFormatKey && xFormatTypes.is() )
- m_nFormatKey = ::dbtools::getDefaultNumberFormat( m_xField, xFormatTypes, m_pData->aLocale );
- }
- catch( Exception& ) { }
- ::rtl::OUString sValue = pLiteral->getTokenValue();
- sal_Int32 nTryFormat = m_nFormatKey;
- bool bSuccess = lcl_saveConvertToNumber( m_xFormatter, nTryFormat, sValue, _rfValue );
-
- // If our format key didn't do, try the default date format for our locale.
- if ( !bSuccess && xFormatTypes.is() )
- {
- try
- {
- nTryFormat = xFormatTypes->getStandardFormat( NumberFormat::DATE, m_pData->aLocale );
- }
- catch( Exception& ) { }
- bSuccess = lcl_saveConvertToNumber( m_xFormatter, nTryFormat, sValue, _rfValue );
- }
-
- // if this also didn't do, try ISO format
- if ( !bSuccess && xFormatTypes.is() )
- {
- try
- {
- nTryFormat = xFormatTypes->getFormatIndex( NumberFormatIndex::DATE_DIN_YYYYMMDD, m_pData->aLocale );
- }
- catch( Exception& ) { }
- bSuccess = lcl_saveConvertToNumber( m_xFormatter, nTryFormat, sValue, _rfValue );
- }
-
- // if this also didn't do, try fallback date format (en-US)
- if ( !bSuccess )
- {
- nTryFormat = m_nDateFormatKey;
- bSuccess = lcl_saveConvertToNumber( m_xFormatter, nTryFormat, sValue, _rfValue );
- }
- return bSuccess;
-}
-// -----------------------------------------------------------------------------
-OSQLParseNode* OSQLParser::buildDate(sal_Int32 _nType,OSQLParseNode*& pLiteral)
-{
- // try converting the string into a date, according to our format key
- double fValue = 0.0;
- OSQLParseNode* pFCTNode = NULL;
-
- if ( extractDate(pLiteral,fValue) )
- pFCTNode = buildNode_Date( fValue, _nType);
-
- delete pLiteral;
- pLiteral = NULL;
-
- if ( !pFCTNode )
- m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_INVALID_DATE_COMPARE);
-
- return pFCTNode;
-}
-// -----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-OSQLParseNode::OSQLParseNode(const sal_Char * pNewValue,
- SQLNodeType eNewNodeType,
- sal_uInt32 nNewNodeID)
- :m_pParent(NULL)
- ,m_aNodeValue(pNewValue,strlen(pNewValue),RTL_TEXTENCODING_UTF8)
- ,m_eNodeType(eNewNodeType)
- ,m_nNodeID(nNewNodeID)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::OSQLParseNode" );
-
- OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= SQL_NODE_CONCAT,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
-}
-//-----------------------------------------------------------------------------
-OSQLParseNode::OSQLParseNode(const ::rtl::OString &_rNewValue,
- SQLNodeType eNewNodeType,
- sal_uInt32 nNewNodeID)
- :m_pParent(NULL)
- ,m_aNodeValue(rtl::OStringToOUString(_rNewValue,RTL_TEXTENCODING_UTF8))
- ,m_eNodeType(eNewNodeType)
- ,m_nNodeID(nNewNodeID)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::OSQLParseNode" );
-
- OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= SQL_NODE_CONCAT,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
-}
-//-----------------------------------------------------------------------------
-OSQLParseNode::OSQLParseNode(const sal_Unicode * pNewValue,
- SQLNodeType eNewNodeType,
- sal_uInt32 nNewNodeID)
- :m_pParent(NULL)
- ,m_aNodeValue(pNewValue)
- ,m_eNodeType(eNewNodeType)
- ,m_nNodeID(nNewNodeID)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::OSQLParseNode" );
-
- OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= SQL_NODE_CONCAT,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
-}
-//-----------------------------------------------------------------------------
-OSQLParseNode::OSQLParseNode(const ::rtl::OUString &_rNewValue,
- SQLNodeType eNewNodeType,
- sal_uInt32 nNewNodeID)
- :m_pParent(NULL)
- ,m_aNodeValue(_rNewValue)
- ,m_eNodeType(eNewNodeType)
- ,m_nNodeID(nNewNodeID)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::OSQLParseNode" );
-
- OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= SQL_NODE_CONCAT,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
-}
-//-----------------------------------------------------------------------------
-OSQLParseNode::OSQLParseNode(const OSQLParseNode& rParseNode)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::OSQLParseNode" );
-
- // klemm den getParent auf NULL
- m_pParent = NULL;
-
- // kopiere die member
- m_aNodeValue = rParseNode.m_aNodeValue;
- m_eNodeType = rParseNode.m_eNodeType;
- m_nNodeID = rParseNode.m_nNodeID;
-
-
- // denk dran, dass von Container abgeleitet wurde, laut SV-Help erzeugt
- // copy-Constructor des Containers einen neuen Container mit den gleichen
- // Zeigern als Inhalt -> d.h. nach dem Kopieren des Container wird fuer
- // alle Zeiger ungleich NULL eine Kopie hergestellt und anstelle des alten
- // Zeigers wieder eingehangen.
-
- // wenn kein Blatt, dann SubTrees bearbeiten
- for (OSQLParseNodes::const_iterator i = rParseNode.m_aChildren.begin();
- i != rParseNode.m_aChildren.end(); ++i)
- append(new OSQLParseNode(**i));
-}
-// -----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-OSQLParseNode& OSQLParseNode::operator=(const OSQLParseNode& rParseNode)
-{
- if (this != &rParseNode)
- {
- // kopiere die member - pParent bleibt der alte
- m_aNodeValue = rParseNode.m_aNodeValue;
- m_eNodeType = rParseNode.m_eNodeType;
- m_nNodeID = rParseNode.m_nNodeID;
-
- for (OSQLParseNodes::const_iterator i = m_aChildren.begin();
- i != m_aChildren.end(); ++i)
- delete *i;
-
- m_aChildren.clear();
-
- for (OSQLParseNodes::const_iterator j = rParseNode.m_aChildren.begin();
- j != rParseNode.m_aChildren.end(); ++j)
- append(new OSQLParseNode(**j));
- }
- return *this;
-}
-
-//-----------------------------------------------------------------------------
-sal_Bool OSQLParseNode::operator==(OSQLParseNode& rParseNode) const
-{
- // die member muessen gleich sein
- sal_Bool bResult = (m_nNodeID == rParseNode.m_nNodeID) &&
- (m_eNodeType == rParseNode.m_eNodeType) &&
- (m_aNodeValue == rParseNode.m_aNodeValue) &&
- count() == rParseNode.count();
-
- // Parameters are not equal!
- bResult = bResult && !SQL_ISRULE(this, parameter);
-
- // compare childs
- for (sal_uInt32 i=0; bResult && i < count(); i++)
- bResult = *getChild(i) == *rParseNode.getChild(i);
-
- return bResult;
-}
-
-//-----------------------------------------------------------------------------
-OSQLParseNode::~OSQLParseNode()
-{
- for (OSQLParseNodes::const_iterator i = m_aChildren.begin();
- i != m_aChildren.end(); ++i)
- delete *i;
- m_aChildren.clear();
-}
-
-//-----------------------------------------------------------------------------
-void OSQLParseNode::append(OSQLParseNode* pNewNode)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::append" );
-
- OSL_ENSURE(pNewNode != NULL, "OSQLParseNode: ungueltiger NewSubTree");
- OSL_ENSURE(pNewNode->getParent() == NULL, "OSQLParseNode: Knoten ist kein Waise");
- OSL_ENSURE(::std::find(m_aChildren.begin(), m_aChildren.end(), pNewNode) == m_aChildren.end(),
- "OSQLParseNode::append() Node already element of parent");
-
- // stelle Verbindung zum getParent her:
- pNewNode->setParent( this );
- // und haenge den SubTree hinten an
- m_aChildren.push_back(pNewNode);
-}
-// -----------------------------------------------------------------------------
-sal_Bool OSQLParseNode::addDateValue(::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::addDateValue" );
- // special display for date/time values
- if (SQL_ISRULE(this,set_fct_spec) && SQL_ISPUNCTUATION(m_aChildren[0],"{"))
- {
- const OSQLParseNode* pODBCNode = m_aChildren[1];
- const OSQLParseNode* pODBCNodeChild = pODBCNode->m_aChildren[0];
-
- if (pODBCNodeChild->getNodeType() == SQL_NODE_KEYWORD && (
- SQL_ISTOKEN(pODBCNodeChild, D) ||
- SQL_ISTOKEN(pODBCNodeChild, T) ||
- SQL_ISTOKEN(pODBCNodeChild, TS) ))
- {
- ::rtl::OUString suQuote(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'")));
- if (rParam.bPredicate)
- {
- if (rParam.aMetaData.shouldEscapeDateTime())
- {
- suQuote = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#"));
- }
- }
- else
- {
- if (rParam.aMetaData.shouldEscapeDateTime())
- {
- // suQuote = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- return sal_False;
- }
- }
-
- if (rString.getLength())
- rString.appendAscii(" ");
- rString.append(suQuote);
- const ::rtl::OUString sTokenValue = pODBCNode->m_aChildren[1]->getTokenValue();
- if (SQL_ISTOKEN(pODBCNodeChild, D))
- {
- rString.append(rParam.bPredicate ? convertDateString(rParam, sTokenValue) : sTokenValue);
- }
- else if (SQL_ISTOKEN(pODBCNodeChild, T))
- {
- rString.append(rParam.bPredicate ? convertTimeString(rParam, sTokenValue) : sTokenValue);
- }
- else
- {
- rString.append(rParam.bPredicate ? convertDateTimeString(rParam, sTokenValue) : sTokenValue);
- }
- rString.append(suQuote);
- return sal_True;
- }
- }
- return sal_False;
-}
-// -----------------------------------------------------------------------------
-void OSQLParseNode::replaceNodeValue(const ::rtl::OUString& rTableAlias,const ::rtl::OUString& rColumnName)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::replaceNodeValue" );
- for (sal_uInt32 i=0;i<count();++i)
- {
- if (SQL_ISRULE(this,column_ref) && count() == 1 && getChild(0)->getTokenValue() == rColumnName)
- {
- OSQLParseNode * pCol = removeAt((sal_uInt32)0);
- append(new OSQLParseNode(rTableAlias,SQL_NODE_NAME));
- append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".")),SQL_NODE_PUNCTUATION));
- append(pCol);
- }
- else
- getChild(i)->replaceNodeValue(rTableAlias,rColumnName);
- }
-}
-//-----------------------------------------------------------------------------
-OSQLParseNode* OSQLParseNode::getByRule(OSQLParseNode::Rule eRule) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::getByRule" );
- OSQLParseNode* pRetNode = 0;
- if (isRule() && OSQLParser::RuleID(eRule) == getRuleID())
- pRetNode = (OSQLParseNode*)this;
- else
- {
- for (OSQLParseNodes::const_iterator i = m_aChildren.begin();
- !pRetNode && i != m_aChildren.end(); ++i)
- pRetNode = (*i)->getByRule(eRule);
- }
- return pRetNode;
-}
-//-----------------------------------------------------------------------------
-OSQLParseNode* MakeANDNode(OSQLParseNode *pLeftLeaf,OSQLParseNode *pRightLeaf)
-{
- OSQLParseNode* pNewNode = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_term));
- pNewNode->append(pLeftLeaf);
- pNewNode->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AND")),SQL_NODE_KEYWORD,SQL_TOKEN_AND));
- pNewNode->append(pRightLeaf);
- return pNewNode;
-}
-//-----------------------------------------------------------------------------
-OSQLParseNode* MakeORNode(OSQLParseNode *pLeftLeaf,OSQLParseNode *pRightLeaf)
-{
- OSQLParseNode* pNewNode = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::search_condition));
- pNewNode->append(pLeftLeaf);
- pNewNode->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OR")),SQL_NODE_KEYWORD,SQL_TOKEN_OR));
- pNewNode->append(pRightLeaf);
- return pNewNode;
-}
-//-----------------------------------------------------------------------------
-void OSQLParseNode::disjunctiveNormalForm(OSQLParseNode*& pSearchCondition)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::disjunctiveNormalForm" );
- if(!pSearchCondition) // no where condition at entry point
- return;
-
- OSQLParseNode::absorptions(pSearchCondition);
- // '(' search_condition ')'
- if (SQL_ISRULE(pSearchCondition,boolean_primary))
- {
- OSQLParseNode* pLeft = pSearchCondition->getChild(1);
- disjunctiveNormalForm(pLeft);
- }
- // search_condition SQL_TOKEN_OR boolean_term
- else if (SQL_ISRULE(pSearchCondition,search_condition))
- {
- OSQLParseNode* pLeft = pSearchCondition->getChild(0);
- disjunctiveNormalForm(pLeft);
-
- OSQLParseNode* pRight = pSearchCondition->getChild(2);
- disjunctiveNormalForm(pRight);
- }
- // boolean_term SQL_TOKEN_AND boolean_factor
- else if (SQL_ISRULE(pSearchCondition,boolean_term))
- {
- OSQLParseNode* pLeft = pSearchCondition->getChild(0);
- disjunctiveNormalForm(pLeft);
-
- OSQLParseNode* pRight = pSearchCondition->getChild(2);
- disjunctiveNormalForm(pRight);
-
- OSQLParseNode* pNewNode = NULL;
- // '(' search_condition ')' on left side
- if(pLeft->count() == 3 && SQL_ISRULE(pLeft,boolean_primary) && SQL_ISRULE(pLeft->getChild(1),search_condition))
- {
- // and-or tree on left side
- OSQLParseNode* pOr = pLeft->getChild(1);
- OSQLParseNode* pNewLeft = NULL;
- OSQLParseNode* pNewRight = NULL;
-
- // cut right from parent
- pSearchCondition->removeAt(2);
-
- pNewRight = MakeANDNode(pOr->removeAt(2) ,pRight);
- pNewLeft = MakeANDNode(pOr->removeAt((sal_uInt32)0) ,new OSQLParseNode(*pRight));
- pNewNode = MakeORNode(pNewLeft,pNewRight);
- // and append new Node
- replaceAndReset(pSearchCondition,pNewNode);
-
- disjunctiveNormalForm(pSearchCondition);
- }
- else if(pRight->count() == 3 && SQL_ISRULE(pRight,boolean_primary) && SQL_ISRULE(pRight->getChild(1),search_condition))
- { // '(' search_condition ')' on right side
- // and-or tree on right side
- // a and (b or c)
- OSQLParseNode* pOr = pRight->getChild(1);
- OSQLParseNode* pNewLeft = NULL;
- OSQLParseNode* pNewRight = NULL;
-
- // cut left from parent
- pSearchCondition->removeAt((sal_uInt32)0);
-
- pNewRight = MakeANDNode(pLeft,pOr->removeAt(2));
- pNewLeft = MakeANDNode(new OSQLParseNode(*pLeft),pOr->removeAt((sal_uInt32)0));
- pNewNode = MakeORNode(pNewLeft,pNewRight);
-
- // and append new Node
- replaceAndReset(pSearchCondition,pNewNode);
- disjunctiveNormalForm(pSearchCondition);
- }
- else if(SQL_ISRULE(pLeft,boolean_primary) && (!SQL_ISRULE(pLeft->getChild(1),search_condition) || !SQL_ISRULE(pLeft->getChild(1),boolean_term)))
- pSearchCondition->replace(pLeft, pLeft->removeAt(1));
- else if(SQL_ISRULE(pRight,boolean_primary) && (!SQL_ISRULE(pRight->getChild(1),search_condition) || !SQL_ISRULE(pRight->getChild(1),boolean_term)))
- pSearchCondition->replace(pRight, pRight->removeAt(1));
- }
-}
-//-----------------------------------------------------------------------------
-void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_Bool bNegate)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::negateSearchCondition" );
- if(!pSearchCondition) // no where condition at entry point
- return;
- // '(' search_condition ')'
- if (pSearchCondition->count() == 3 && SQL_ISRULE(pSearchCondition,boolean_primary))
- {
- OSQLParseNode* pRight = pSearchCondition->getChild(1);
- negateSearchCondition(pRight,bNegate);
- }
- // search_condition SQL_TOKEN_OR boolean_term
- else if (SQL_ISRULE(pSearchCondition,search_condition))
- {
- OSQLParseNode* pLeft = pSearchCondition->getChild(0);
- OSQLParseNode* pRight = pSearchCondition->getChild(2);
- if(bNegate)
- {
- OSQLParseNode* pNewNode = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_term));
- pNewNode->append(pSearchCondition->removeAt((sal_uInt32)0));
- pNewNode->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AND")),SQL_NODE_KEYWORD,SQL_TOKEN_AND));
- pNewNode->append(pSearchCondition->removeAt((sal_uInt32)1));
- replaceAndReset(pSearchCondition,pNewNode);
-
- pLeft = pNewNode->getChild(0);
- pRight = pNewNode->getChild(2);
- }
-
- negateSearchCondition(pLeft,bNegate);
- negateSearchCondition(pRight,bNegate);
- }
- // boolean_term SQL_TOKEN_AND boolean_factor
- else if (SQL_ISRULE(pSearchCondition,boolean_term))
- {
- OSQLParseNode* pLeft = pSearchCondition->getChild(0);
- OSQLParseNode* pRight = pSearchCondition->getChild(2);
- if(bNegate)
- {
- OSQLParseNode* pNewNode = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::search_condition));
- pNewNode->append(pSearchCondition->removeAt((sal_uInt32)0));
- pNewNode->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OR")),SQL_NODE_KEYWORD,SQL_TOKEN_OR));
- pNewNode->append(pSearchCondition->removeAt((sal_uInt32)1));
- replaceAndReset(pSearchCondition,pNewNode);
-
- pLeft = pNewNode->getChild(0);
- pRight = pNewNode->getChild(2);
- }
-
- negateSearchCondition(pLeft,bNegate);
- negateSearchCondition(pRight,bNegate);
- }
- // SQL_TOKEN_NOT ( boolean_test )
- else if (SQL_ISRULE(pSearchCondition,boolean_factor))
- {
- OSQLParseNode *pNot = pSearchCondition->removeAt((sal_uInt32)0);
- delete pNot;
- OSQLParseNode *pBooleanTest = pSearchCondition->removeAt((sal_uInt32)0);
- // TODO is this needed // pBooleanTest->setParent(NULL);
- replaceAndReset(pSearchCondition,pBooleanTest);
-
- if (!bNegate)
- negateSearchCondition(pSearchCondition,sal_True); // negate all deeper values
- }
- // row_value_constructor comparison row_value_constructor
- // row_value_constructor comparison any_all_some subquery
- else if(bNegate && (SQL_ISRULE(pSearchCondition,comparison_predicate) || SQL_ISRULE(pSearchCondition,all_or_any_predicate)))
- {
- OSQLParseNode* pComparison = pSearchCondition->getChild(1);
- OSQLParseNode* pNewComparison = NULL;
- switch(pComparison->getNodeType())
- {
- case SQL_NODE_EQUAL:
- pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<>")),SQL_NODE_NOTEQUAL,SQL_NOTEQUAL);
- break;
- case SQL_NODE_LESS:
- pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(">=")),SQL_NODE_GREATEQ,SQL_GREATEQ);
- break;
- case SQL_NODE_GREAT:
- pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<=")),SQL_NODE_LESSEQ,SQL_LESSEQ);
- break;
- case SQL_NODE_LESSEQ:
- pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(">")),SQL_NODE_GREAT,SQL_GREAT);
- break;
- case SQL_NODE_GREATEQ:
- pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<")),SQL_NODE_LESS,SQL_LESS);
- break;
- case SQL_NODE_NOTEQUAL:
- pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("=")),SQL_NODE_EQUAL,SQL_EQUAL);
- break;
- default:
- OSL_FAIL( "OSQLParseNode::negateSearchCondition: unexpected node type!" );
- break;
- }
- pSearchCondition->replace(pComparison, pNewComparison);
- delete pComparison;
- }
-
- else if(bNegate && (SQL_ISRULE(pSearchCondition,test_for_null) || SQL_ISRULE(pSearchCondition,in_predicate) ||
- SQL_ISRULE(pSearchCondition,between_predicate) || SQL_ISRULE(pSearchCondition,boolean_test) ))
- {
- OSQLParseNode* pPart2 = pSearchCondition;
- if ( !SQL_ISRULE(pSearchCondition,boolean_test) )
- pPart2 = pSearchCondition->getChild(1);
- sal_uInt32 nNotPos = 0;
- if ( SQL_ISRULE( pSearchCondition, test_for_null ) )
- nNotPos = 1;
- else if ( SQL_ISRULE( pSearchCondition, boolean_test ) )
- nNotPos = 2;
-
- OSQLParseNode* pNot = pPart2->getChild(nNotPos);
- OSQLParseNode* pNotNot = NULL;
- if(pNot->isRule())
- pNotNot = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NOT")),SQL_NODE_KEYWORD,SQL_TOKEN_NOT);
- else
- pNotNot = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::sql_not));
- pPart2->replace(pNot, pNotNot);
- delete pNot;
- }
- else if(bNegate && (SQL_ISRULE(pSearchCondition,like_predicate)))
- {
- OSQLParseNode* pNot = pSearchCondition->getChild( 1 )->getChild( 0 );
- OSQLParseNode* pNotNot = NULL;
- if(pNot->isRule())
- pNotNot = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NOT")),SQL_NODE_KEYWORD,SQL_TOKEN_NOT);
- else
- pNotNot = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::sql_not));
- pSearchCondition->getChild( 1 )->replace(pNot, pNotNot);
- delete pNot;
- }
-}
-//-----------------------------------------------------------------------------
-void OSQLParseNode::eraseBraces(OSQLParseNode*& pSearchCondition)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::eraseBraces" );
- if (pSearchCondition && (SQL_ISRULE(pSearchCondition,boolean_primary) || (pSearchCondition->count() == 3 && SQL_ISPUNCTUATION(pSearchCondition->getChild(0),"(") &&
- SQL_ISPUNCTUATION(pSearchCondition->getChild(2),")"))))
- {
- OSQLParseNode* pRight = pSearchCondition->getChild(1);
- absorptions(pRight);
- // if child is not a or or and tree then delete () around child
- if(!(SQL_ISRULE(pSearchCondition->getChild(1),boolean_term) || SQL_ISRULE(pSearchCondition->getChild(1),search_condition)) ||
- SQL_ISRULE(pSearchCondition->getChild(1),boolean_term) || // and can always stand without ()
- (SQL_ISRULE(pSearchCondition->getChild(1),search_condition) && SQL_ISRULE(pSearchCondition->getParent(),search_condition)))
- {
- OSQLParseNode* pNode = pSearchCondition->removeAt(1);
- replaceAndReset(pSearchCondition,pNode);
- }
- }
-}
-//-----------------------------------------------------------------------------
-void OSQLParseNode::absorptions(OSQLParseNode*& pSearchCondition)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::absorptions" );
- if(!pSearchCondition) // no where condition at entry point
- return;
-
- eraseBraces(pSearchCondition);
-
- if(SQL_ISRULE(pSearchCondition,boolean_term) || SQL_ISRULE(pSearchCondition,search_condition))
- {
- OSQLParseNode* pLeft = pSearchCondition->getChild(0);
- absorptions(pLeft);
- OSQLParseNode* pRight = pSearchCondition->getChild(2);
- absorptions(pRight);
- }
-
- sal_uInt32 nPos = 0;
- // a and a || a or a
- OSQLParseNode* pNewNode = NULL;
- if(( SQL_ISRULE(pSearchCondition,boolean_term) || SQL_ISRULE(pSearchCondition,search_condition))
- && *pSearchCondition->getChild(0) == *pSearchCondition->getChild(2))
- {
- pNewNode = pSearchCondition->removeAt((sal_uInt32)0);
- replaceAndReset(pSearchCondition,pNewNode);
- }
- // (a or b) and a || ( b or c ) and a
- // a and ( a or b) || a and ( b or c )
- else if ( SQL_ISRULE(pSearchCondition,boolean_term)
- && (
- ( SQL_ISRULE(pSearchCondition->getChild(nPos = 0),boolean_primary)
- || SQL_ISRULE(pSearchCondition->getChild(nPos),search_condition)
- )
- || ( SQL_ISRULE(pSearchCondition->getChild(nPos = 2),boolean_primary)
- || SQL_ISRULE(pSearchCondition->getChild(nPos),search_condition)
- )
- )
- )
- {
- OSQLParseNode* p2ndSearch = pSearchCondition->getChild(nPos);
- if ( SQL_ISRULE(p2ndSearch,boolean_primary) )
- p2ndSearch = p2ndSearch->getChild(1);
-
- if ( *p2ndSearch->getChild(0) == *pSearchCondition->getChild(2-nPos) ) // a and ( a or b) -> a or b
- {
- pNewNode = pSearchCondition->removeAt((sal_uInt32)0);
- replaceAndReset(pSearchCondition,pNewNode);
-
- }
- else if ( *p2ndSearch->getChild(2) == *pSearchCondition->getChild(2-nPos) ) // a and ( b or a) -> a or b
- {
- pNewNode = pSearchCondition->removeAt((sal_uInt32)2);
- replaceAndReset(pSearchCondition,pNewNode);
- }
- else if ( p2ndSearch->getByRule(OSQLParseNode::search_condition) )
- {
- // a and ( b or c ) -> ( a and b ) or ( a and c )
- // ( b or c ) and a -> ( a and b ) or ( a and c )
- OSQLParseNode* pC = p2ndSearch->removeAt((sal_uInt32)2);
- OSQLParseNode* pB = p2ndSearch->removeAt((sal_uInt32)0);
- OSQLParseNode* pA = pSearchCondition->removeAt((sal_uInt32)2-nPos);
-
- OSQLParseNode* p1stAnd = MakeANDNode(pA,pB);
- OSQLParseNode* p2ndAnd = MakeANDNode(new OSQLParseNode(*pA),pC);
- pNewNode = MakeORNode(p1stAnd,p2ndAnd);
- OSQLParseNode* pNode = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_primary));
- pNode->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(")),SQL_NODE_PUNCTUATION));
- pNode->append(pNewNode);
- pNode->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")),SQL_NODE_PUNCTUATION));
- OSQLParseNode::eraseBraces(p1stAnd);
- OSQLParseNode::eraseBraces(p2ndAnd);
- replaceAndReset(pSearchCondition,pNode);
- }
- }
- // a or a and b || a or b and a
- else if(SQL_ISRULE(pSearchCondition,search_condition) && SQL_ISRULE(pSearchCondition->getChild(2),boolean_term))
- {
- if(*pSearchCondition->getChild(2)->getChild(0) == *pSearchCondition->getChild(0))
- {
- pNewNode = pSearchCondition->removeAt((sal_uInt32)0);
- replaceAndReset(pSearchCondition,pNewNode);
- }
- else if(*pSearchCondition->getChild(2)->getChild(2) == *pSearchCondition->getChild(0))
- {
- pNewNode = pSearchCondition->removeAt((sal_uInt32)0);
- replaceAndReset(pSearchCondition,pNewNode);
- }
- }
- // a and b or a || b and a or a
- else if(SQL_ISRULE(pSearchCondition,search_condition) && SQL_ISRULE(pSearchCondition->getChild(0),boolean_term))
- {
- if(*pSearchCondition->getChild(0)->getChild(0) == *pSearchCondition->getChild(2))
- {
- pNewNode = pSearchCondition->removeAt((sal_uInt32)2);
- replaceAndReset(pSearchCondition,pNewNode);
- }
- else if(*pSearchCondition->getChild(0)->getChild(2) == *pSearchCondition->getChild(2))
- {
- pNewNode = pSearchCondition->removeAt((sal_uInt32)2);
- replaceAndReset(pSearchCondition,pNewNode);
- }
- }
- eraseBraces(pSearchCondition);
-}
-//-----------------------------------------------------------------------------
-void OSQLParseNode::compress(OSQLParseNode *&pSearchCondition)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::compress" );
- if(!pSearchCondition) // no where condition at entry point
- return;
-
- OSQLParseNode::eraseBraces(pSearchCondition);
-
- if(SQL_ISRULE(pSearchCondition,boolean_term) || SQL_ISRULE(pSearchCondition,search_condition))
- {
- OSQLParseNode* pLeft = pSearchCondition->getChild(0);
- compress(pLeft);
-
- OSQLParseNode* pRight = pSearchCondition->getChild(2);
- compress(pRight);
- }
- else if( SQL_ISRULE(pSearchCondition,boolean_primary) || (pSearchCondition->count() == 3 && SQL_ISPUNCTUATION(pSearchCondition->getChild(0),"(") &&
- SQL_ISPUNCTUATION(pSearchCondition->getChild(2),")")))
- {
- OSQLParseNode* pRight = pSearchCondition->getChild(1);
- compress(pRight);
- // if child is not a or or and tree then delete () around child
- if(!(SQL_ISRULE(pSearchCondition->getChild(1),boolean_term) || SQL_ISRULE(pSearchCondition->getChild(1),search_condition)) ||
- (SQL_ISRULE(pSearchCondition->getChild(1),boolean_term) && SQL_ISRULE(pSearchCondition->getParent(),boolean_term)) ||
- (SQL_ISRULE(pSearchCondition->getChild(1),search_condition) && SQL_ISRULE(pSearchCondition->getParent(),search_condition)))
- {
- OSQLParseNode* pNode = pSearchCondition->removeAt(1);
- replaceAndReset(pSearchCondition,pNode);
- }
- }
-
- // or with two and trees where one element of the and trees are equal
- if(SQL_ISRULE(pSearchCondition,search_condition) && SQL_ISRULE(pSearchCondition->getChild(0),boolean_term) && SQL_ISRULE(pSearchCondition->getChild(2),boolean_term))
- {
- if(*pSearchCondition->getChild(0)->getChild(0) == *pSearchCondition->getChild(2)->getChild(0))
- {
- OSQLParseNode* pLeft = pSearchCondition->getChild(0)->removeAt(2);
- OSQLParseNode* pRight = pSearchCondition->getChild(2)->removeAt(2);
- OSQLParseNode* pNode = MakeORNode(pLeft,pRight);
-
- OSQLParseNode* pNewRule = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_primary));
- pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(")),SQL_NODE_PUNCTUATION));
- pNewRule->append(pNode);
- pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")),SQL_NODE_PUNCTUATION));
-
- OSQLParseNode::eraseBraces(pLeft);
- OSQLParseNode::eraseBraces(pRight);
-
- pNode = MakeANDNode(pSearchCondition->getChild(0)->removeAt((sal_uInt32)0),pNewRule);
- replaceAndReset(pSearchCondition,pNode);
- }
- else if(*pSearchCondition->getChild(0)->getChild(2) == *pSearchCondition->getChild(2)->getChild(0))
- {
- OSQLParseNode* pLeft = pSearchCondition->getChild(0)->removeAt((sal_uInt32)0);
- OSQLParseNode* pRight = pSearchCondition->getChild(2)->removeAt(2);
- OSQLParseNode* pNode = MakeORNode(pLeft,pRight);
-
- OSQLParseNode* pNewRule = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_primary));
- pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(")),SQL_NODE_PUNCTUATION));
- pNewRule->append(pNode);
- pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")),SQL_NODE_PUNCTUATION));
-
- OSQLParseNode::eraseBraces(pLeft);
- OSQLParseNode::eraseBraces(pRight);
-
- pNode = MakeANDNode(pSearchCondition->getChild(0)->removeAt(1),pNewRule);
- replaceAndReset(pSearchCondition,pNode);
- }
- else if(*pSearchCondition->getChild(0)->getChild(0) == *pSearchCondition->getChild(2)->getChild(2))
- {
- OSQLParseNode* pLeft = pSearchCondition->getChild(0)->removeAt(2);
- OSQLParseNode* pRight = pSearchCondition->getChild(2)->removeAt((sal_uInt32)0);
- OSQLParseNode* pNode = MakeORNode(pLeft,pRight);
-
- OSQLParseNode* pNewRule = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_primary));
- pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(")),SQL_NODE_PUNCTUATION));
- pNewRule->append(pNode);
- pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")),SQL_NODE_PUNCTUATION));
-
- OSQLParseNode::eraseBraces(pLeft);
- OSQLParseNode::eraseBraces(pRight);
-
- pNode = MakeANDNode(pSearchCondition->getChild(0)->removeAt((sal_uInt32)0),pNewRule);
- replaceAndReset(pSearchCondition,pNode);
- }
- else if(*pSearchCondition->getChild(0)->getChild(2) == *pSearchCondition->getChild(2)->getChild(2))
- {
- OSQLParseNode* pLeft = pSearchCondition->getChild(0)->removeAt((sal_uInt32)0);
- OSQLParseNode* pRight = pSearchCondition->getChild(2)->removeAt((sal_uInt32)0);
- OSQLParseNode* pNode = MakeORNode(pLeft,pRight);
-
- OSQLParseNode* pNewRule = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_primary));
- pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(")),SQL_NODE_PUNCTUATION));
- pNewRule->append(pNode);
- pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")),SQL_NODE_PUNCTUATION));
-
- OSQLParseNode::eraseBraces(pLeft);
- OSQLParseNode::eraseBraces(pRight);
-
- pNode = MakeANDNode(pSearchCondition->getChild(0)->removeAt(1),pNewRule);
- replaceAndReset(pSearchCondition,pNode);
- }
- }
-}
-#if OSL_DEBUG_LEVEL > 0
-// -----------------------------------------------------------------------------
-void OSQLParseNode::showParseTree( ::rtl::OUString& rString ) const
-{
- ::rtl::OUStringBuffer aBuf;
- showParseTree( aBuf, 0 );
- rString = aBuf.makeStringAndClear();
-}
-
-// -----------------------------------------------------------------------------
-void OSQLParseNode::showParseTree( ::rtl::OUStringBuffer& _inout_rBuffer, sal_uInt32 nLevel ) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::showParseTree" );
-
- for ( sal_uInt32 j=0; j<nLevel; ++j)
- _inout_rBuffer.appendAscii( " " );
-
- if ( !isToken() )
- {
- // Regelnamen als rule: ...
- _inout_rBuffer.appendAscii( "RULE_ID: " );
- _inout_rBuffer.append( (sal_Int32)getRuleID() );
- _inout_rBuffer.append( sal_Unicode( '(' ) );
- _inout_rBuffer.append( OSQLParser::RuleIDToStr( getRuleID() ) );
- _inout_rBuffer.append( sal_Unicode( ')' ) );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
-
- // hol dir den ersten Subtree
- for ( OSQLParseNodes::const_iterator i = m_aChildren.begin();
- i != m_aChildren.end();
- ++i
- )
- (*i)->showParseTree( _inout_rBuffer, nLevel+1 );
- }
- else
- {
- // ein Token gefunden
- switch (m_eNodeType)
- {
-
- case SQL_NODE_KEYWORD:
- _inout_rBuffer.appendAscii( "SQL_KEYWORD: " );
- _inout_rBuffer.append( ::rtl::OStringToOUString( OSQLParser::TokenIDToStr( getTokenID() ), RTL_TEXTENCODING_UTF8 ) );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
- break;
-
- case SQL_NODE_COMPARISON:
- _inout_rBuffer.appendAscii( "SQL_COMPARISON: " );
- _inout_rBuffer.append( m_aNodeValue );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
- break;
-
- case SQL_NODE_NAME:
- _inout_rBuffer.appendAscii( "SQL_NAME: " );
- _inout_rBuffer.append( sal_Unicode( '"' ) );
- _inout_rBuffer.append( m_aNodeValue );
- _inout_rBuffer.append( sal_Unicode( '"' ) );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
- break;
-
- case SQL_NODE_STRING:
- _inout_rBuffer.appendAscii( "SQL_STRING: " );
- _inout_rBuffer.append( sal_Unicode( '\'' ) );
- _inout_rBuffer.append( m_aNodeValue );
- _inout_rBuffer.append( sal_Unicode( '\'' ) );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
- break;
-
- case SQL_NODE_INTNUM:
- _inout_rBuffer.appendAscii( "SQL_INTNUM: " );
- _inout_rBuffer.append( m_aNodeValue );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
- break;
-
- case SQL_NODE_APPROXNUM:
- _inout_rBuffer.appendAscii( "SQL_APPROXNUM: " );
- _inout_rBuffer.append( m_aNodeValue );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
- break;
-
- case SQL_NODE_PUNCTUATION:
- _inout_rBuffer.appendAscii( "SQL_PUNCTUATION: " );
- _inout_rBuffer.append( m_aNodeValue );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
- break;
-
- case SQL_NODE_AMMSC:
- _inout_rBuffer.appendAscii( "SQL_AMMSC: " );
- _inout_rBuffer.append( m_aNodeValue );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
- break;
-
- case SQL_NODE_EQUAL:
- case SQL_NODE_LESS:
- case SQL_NODE_GREAT:
- case SQL_NODE_LESSEQ:
- case SQL_NODE_GREATEQ:
- case SQL_NODE_NOTEQUAL:
- _inout_rBuffer.append( m_aNodeValue );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
- break;
-
- case SQL_NODE_ACCESS_DATE:
- _inout_rBuffer.appendAscii( "SQL_ACCESS_DATE: " );
- _inout_rBuffer.append( m_aNodeValue );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
- break;
-
- case SQL_NODE_DATE:
- _inout_rBuffer.appendAscii( "SQL_DATE: " );
- _inout_rBuffer.append( m_aNodeValue );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
- break;
-
- case SQL_NODE_CONCAT:
- _inout_rBuffer.appendAscii( "||" );
- _inout_rBuffer.append( sal_Unicode( '\n' ) );
- break;
-
- default:
- OSL_TRACE( "-- %i", int( m_eNodeType ) );
- OSL_FAIL( "OSQLParser::ShowParseTree: unzulaessiger NodeType" );
- }
- }
-}
-#endif // OSL_DEBUG_LEVEL > 0
-// -----------------------------------------------------------------------------
-// Insert-Methoden
-//-----------------------------------------------------------------------------
-void OSQLParseNode::insert(sal_uInt32 nPos, OSQLParseNode* pNewSubTree)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::insert" );
- OSL_ENSURE(pNewSubTree != NULL, "OSQLParseNode: ungueltiger NewSubTree");
- OSL_ENSURE(pNewSubTree->getParent() == NULL, "OSQLParseNode: Knoten ist kein Waise");
-
- // stelle Verbindung zum getParent her:
- pNewSubTree->setParent( this );
- m_aChildren.insert(m_aChildren.begin() + nPos, pNewSubTree);
-}
-
-// removeAt-Methoden
-//-----------------------------------------------------------------------------
-OSQLParseNode* OSQLParseNode::removeAt(sal_uInt32 nPos)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::removeAt" );
- OSL_ENSURE(nPos < m_aChildren.size(),"Illegal position for removeAt");
- OSQLParseNodes::iterator aPos(m_aChildren.begin() + nPos);
- OSQLParseNode* pNode = *aPos;
-
- // setze den getParent des removeten auf NULL
- pNode->setParent( NULL );
-
- m_aChildren.erase(aPos);
- return pNode;
-}
-//-----------------------------------------------------------------------------
-OSQLParseNode* OSQLParseNode::remove(OSQLParseNode* pSubTree)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::remove" );
- OSL_ENSURE(pSubTree != NULL, "OSQLParseNode: ungueltiger SubTree");
- OSQLParseNodes::iterator aPos = ::std::find(m_aChildren.begin(), m_aChildren.end(), pSubTree);
- if (aPos != m_aChildren.end())
- {
- // setze den getParent des removeten auf NULL
- pSubTree->setParent( NULL );
- m_aChildren.erase(aPos);
- return pSubTree;
- }
- else
- return NULL;
-}
-
-// Replace-Methoden
-//-----------------------------------------------------------------------------
-OSQLParseNode* OSQLParseNode::replaceAt(sal_uInt32 nPos, OSQLParseNode* pNewSubNode)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::replaceAt" );
- OSL_ENSURE(pNewSubNode != NULL, "OSQLParseNode: invalid nodes");
- OSL_ENSURE(pNewSubNode->getParent() == NULL, "OSQLParseNode: node already has getParent");
- OSL_ENSURE(nPos < m_aChildren.size(), "OSQLParseNode: invalid position");
- OSL_ENSURE(::std::find(m_aChildren.begin(), m_aChildren.end(), pNewSubNode) == m_aChildren.end(),
- "OSQLParseNode::Replace() Node already element of parent");
-
- OSQLParseNode* pOldSubNode = m_aChildren[nPos];
-
- // stelle Verbindung zum getParent her:
- pNewSubNode->setParent( this );
- pOldSubNode->setParent( NULL );
-
- m_aChildren[nPos] = pNewSubNode;
- return pOldSubNode;
-}
-
-//-----------------------------------------------------------------------------
-OSQLParseNode* OSQLParseNode::replace (OSQLParseNode* pOldSubNode, OSQLParseNode* pNewSubNode )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::replace " );
- OSL_ENSURE(pOldSubNode != NULL && pNewSubNode != NULL, "OSQLParseNode: invalid nodes");
- OSL_ENSURE(pNewSubNode->getParent() == NULL, "OSQLParseNode: node already has getParent");
- OSL_ENSURE(::std::find(m_aChildren.begin(), m_aChildren.end(), pOldSubNode) != m_aChildren.end(),
- "OSQLParseNode::Replace() Node not element of parent");
- OSL_ENSURE(::std::find(m_aChildren.begin(), m_aChildren.end(), pNewSubNode) == m_aChildren.end(),
- "OSQLParseNode::Replace() Node already element of parent");
-
- pOldSubNode->setParent( NULL );
- pNewSubNode->setParent( this );
- ::std::replace(m_aChildren.begin(), m_aChildren.end(), pOldSubNode, pNewSubNode);
- return pOldSubNode;
-}
-// -----------------------------------------------------------------------------
-void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::parseLeaf" );
- // ein Blatt ist gefunden
- // Inhalt dem Ausgabestring anfuegen
- switch (m_eNodeType)
- {
- case SQL_NODE_KEYWORD:
- {
- if (rString.getLength())
- rString.appendAscii(" ");
-
- const ::rtl::OString sT = OSQLParser::TokenIDToStr(m_nNodeID, rParam.bInternational ? &rParam.m_rContext : NULL);
- rString.append(::rtl::OStringToOUString(sT,RTL_TEXTENCODING_UTF8));
- } break;
- case SQL_NODE_STRING:
- if (rString.getLength())
- rString.appendAscii(" ");
- rString.append(SetQuotation(m_aNodeValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\'")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\'\'"))));
- break;
- case SQL_NODE_NAME:
- if (rString.getLength())
- {
- switch(rString.charAt(rString.getLength()-1) )
- {
- case ' ' :
- case '.' : break;
- default :
- if ( !rParam.aMetaData.getCatalogSeparator().getLength()
- || rString.charAt( rString.getLength()-1 ) != rParam.aMetaData.getCatalogSeparator().toChar()
- )
- rString.appendAscii(" "); break;
- }
- }
- if (rParam.bQuote)
- {
- if (rParam.bPredicate)
- {
- rString.appendAscii("[");
- rString.append(m_aNodeValue);
- rString.appendAscii("]");
- }
- else
- rString.append(SetQuotation(m_aNodeValue,
- rParam.aMetaData.getIdentifierQuoteString(), rParam.aMetaData.getIdentifierQuoteString() ));
- }
- else
- rString.append(m_aNodeValue);
- break;
- case SQL_NODE_ACCESS_DATE:
- if (rString.getLength())
- rString.appendAscii(" ");
- rString.appendAscii("#");
- rString.append(m_aNodeValue);
- rString.appendAscii("#");
- break;
-
- case SQL_NODE_INTNUM:
- case SQL_NODE_APPROXNUM:
- {
- ::rtl::OUString aTmp = m_aNodeValue;
- if (rParam.bInternational && rParam.bPredicate && rParam.cDecSep != '.')
- aTmp = aTmp.replace('.', rParam.cDecSep);
-
- if (rString.getLength())
- rString.appendAscii(" ");
- rString.append(aTmp);
-
- } break;
- case SQL_NODE_PUNCTUATION:
- if ( getParent() && SQL_ISRULE(getParent(),cast_spec) && m_aNodeValue.toChar() == '(' ) // no spaces in front of '('
- {
- rString.append(m_aNodeValue);
- break;
- }
- // fall through
- default:
- if (rString.getLength() && m_aNodeValue.toChar() != '.' && m_aNodeValue.toChar() != ':' )
- {
- switch( rString.charAt(rString.getLength()-1) )
- {
- case ' ' :
- case '.' : break;
- default :
- if ( !rParam.aMetaData.getCatalogSeparator().getLength()
- || rString.charAt( rString.getLength()-1 ) != rParam.aMetaData.getCatalogSeparator().toChar()
- )
- rString.appendAscii(" "); break;
- }
- }
- rString.append(m_aNodeValue);
- }
-}
-
-// -----------------------------------------------------------------------------
-sal_Int32 OSQLParser::getFunctionReturnType(const ::rtl::OUString& _sFunctionName, const IParseContext* pContext)
-{
- sal_Int32 nType = DataType::VARCHAR;
- ::rtl::OString sFunctionName(::rtl::OUStringToOString(_sFunctionName,RTL_TEXTENCODING_UTF8));
-
- if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ASCII,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_BIT_LENGTH,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CHAR,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CHAR_LENGTH,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CONCAT,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DIFFERENCE,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_INSERT,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_LCASE,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_LEFT,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_LENGTH,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_LOCATE,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_LOCATE_2,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_LTRIM,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_OCTET_LENGTH,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_POSITION,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_REPEAT,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_REPLACE,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_RIGHT,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_RTRIM,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_SOUNDEX,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_SPACE,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_SUBSTRING,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_UCASE,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CURRENT_DATE,pContext))) nType = DataType::DATE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CURRENT_TIME,pContext))) nType = DataType::TIME;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CURRENT_TIMESTAMP,pContext))) nType = DataType::TIMESTAMP;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CURDATE,pContext))) nType = DataType::DATE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DATEDIFF,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DATEVALUE,pContext))) nType = DataType::DATE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CURTIME,pContext))) nType = DataType::TIME;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DAYNAME,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DAYOFMONTH,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DAYOFWEEK,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DAYOFYEAR,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_EXTRACT,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_HOUR,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_MINUTE,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_MONTH,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_MONTHNAME,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_NOW,pContext))) nType = DataType::TIMESTAMP;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_QUARTER,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_SECOND,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_TIMESTAMPADD,pContext))) nType = DataType::TIMESTAMP;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_TIMESTAMPDIFF,pContext))) nType = DataType::TIMESTAMP;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_TIMEVALUE,pContext))) nType = DataType::TIMESTAMP;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_WEEK,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_YEAR,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ABS,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ACOS,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ASIN,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ATAN,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ATAN2,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CEILING,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_COS,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_COT,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DEGREES,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_EXP,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_FLOOR,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_LOGF,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_LOG,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_LOG10,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_LN,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_MOD,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_PI,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_POWER,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_RADIANS,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_RAND,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ROUND,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ROUNDMAGIC,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_SIGN,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_SIN,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_SQRT,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_TAN,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_TRUNCATE,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_COUNT,pContext))) nType = DataType::INTEGER;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_MAX,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_MIN,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_AVG,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_SUM,pContext))) nType = DataType::DOUBLE;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_LOWER,pContext))) nType = DataType::VARCHAR;
- else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_UPPER,pContext))) nType = DataType::VARCHAR;
-
- return nType;
-}
-// -----------------------------------------------------------------------------
-sal_Int32 OSQLParser::getFunctionParameterType(sal_uInt32 _nTokenId, sal_uInt32 _nPos)
-{
- sal_Int32 nType = DataType::VARCHAR;
-
- if(_nTokenId == SQL_TOKEN_CHAR) nType = DataType::INTEGER;
- else if(_nTokenId == SQL_TOKEN_INSERT)
- {
- if ( _nPos == 2 || _nPos == 3 )
- nType = DataType::INTEGER;
- }
- else if(_nTokenId == SQL_TOKEN_LEFT)
- {
- if ( _nPos == 2 )
- nType = DataType::INTEGER;
- }
- else if(_nTokenId == SQL_TOKEN_LOCATE)
- {
- if ( _nPos == 3 )
- nType = DataType::INTEGER;
- }
- else if(_nTokenId == SQL_TOKEN_LOCATE_2)
- {
- if ( _nPos == 3 )
- nType = DataType::INTEGER;
- }
- else if( _nTokenId == SQL_TOKEN_REPEAT || _nTokenId == SQL_TOKEN_RIGHT )
- {
- if ( _nPos == 2 )
- nType = DataType::INTEGER;
- }
- else if(_nTokenId == SQL_TOKEN_SPACE )
- {
- nType = DataType::INTEGER;
- }
- else if(_nTokenId == SQL_TOKEN_SUBSTRING)
- {
- if ( _nPos != 1 )
- nType = DataType::INTEGER;
- }
- else if(_nTokenId == SQL_TOKEN_DATEDIFF)
- {
- if ( _nPos != 1 )
- nType = DataType::TIMESTAMP;
- }
- else if(_nTokenId == SQL_TOKEN_DATEVALUE)
- nType = DataType::DATE;
- else if(_nTokenId == SQL_TOKEN_DAYNAME)
- nType = DataType::DATE;
- else if(_nTokenId == SQL_TOKEN_DAYOFMONTH)
- nType = DataType::DATE;
- else if(_nTokenId == SQL_TOKEN_DAYOFWEEK)
- nType = DataType::DATE;
- else if(_nTokenId == SQL_TOKEN_DAYOFYEAR)
- nType = DataType::DATE;
- else if(_nTokenId == SQL_TOKEN_EXTRACT) nType = DataType::VARCHAR;
- else if(_nTokenId == SQL_TOKEN_HOUR) nType = DataType::TIME;
- else if(_nTokenId == SQL_TOKEN_MINUTE) nType = DataType::TIME;
- else if(_nTokenId == SQL_TOKEN_MONTH) nType = DataType::DATE;
- else if(_nTokenId == SQL_TOKEN_MONTHNAME) nType = DataType::DATE;
- else if(_nTokenId == SQL_TOKEN_NOW) nType = DataType::TIMESTAMP;
- else if(_nTokenId == SQL_TOKEN_QUARTER) nType = DataType::DATE;
- else if(_nTokenId == SQL_TOKEN_SECOND) nType = DataType::TIME;
- else if(_nTokenId == SQL_TOKEN_TIMESTAMPADD) nType = DataType::TIMESTAMP;
- else if(_nTokenId == SQL_TOKEN_TIMESTAMPDIFF) nType = DataType::TIMESTAMP;
- else if(_nTokenId == SQL_TOKEN_TIMEVALUE) nType = DataType::TIMESTAMP;
- else if(_nTokenId == SQL_TOKEN_WEEK) nType = DataType::DATE;
- else if(_nTokenId == SQL_TOKEN_YEAR) nType = DataType::DATE;
-
- else if(_nTokenId == SQL_TOKEN_ABS) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_ACOS) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_ASIN) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_ATAN) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_ATAN2) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_CEILING) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_COS) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_COT) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_DEGREES) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_EXP) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_FLOOR) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_LOGF) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_LOG) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_LOG10) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_LN) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_MOD) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_PI) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_POWER) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_RADIANS) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_RAND) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_ROUND) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_ROUNDMAGIC) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_SIGN) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_SIN) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_SQRT) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_TAN) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_TRUNCATE) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_COUNT) nType = DataType::INTEGER;
- else if(_nTokenId == SQL_TOKEN_MAX) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_MIN) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_AVG) nType = DataType::DOUBLE;
- else if(_nTokenId == SQL_TOKEN_SUM) nType = DataType::DOUBLE;
-
- else if(_nTokenId == SQL_TOKEN_LOWER) nType = DataType::VARCHAR;
- else if(_nTokenId == SQL_TOKEN_UPPER) nType = DataType::VARCHAR;
-
- return nType;
-}
-
-// -----------------------------------------------------------------------------
-const SQLError& OSQLParser::getErrorHelper() const
-{
- return m_pData->aErrors;
-}
-
-// -----------------------------------------------------------------------------
-OSQLParseNode::Rule OSQLParseNode::getKnownRuleID() const
-{
- if ( !isRule() )
- return UNKNOWN_RULE;
- return OSQLParser::RuleIDToRule( getRuleID() );
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OSQLParseNode::getTableRange(const OSQLParseNode* _pTableRef)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::getTableRange" );
- OSL_ENSURE(_pTableRef && _pTableRef->count() > 1 && _pTableRef->getKnownRuleID() == OSQLParseNode::table_ref,"Invalid node give, only table ref is allowed!");
- const sal_uInt32 nCount = _pTableRef->count();
- ::rtl::OUString sTableRange;
- if ( nCount == 2 || (nCount == 3 && !_pTableRef->getChild(0)->isToken()) || nCount == 5 )
- {
- const OSQLParseNode* pNode = _pTableRef->getChild(nCount - (nCount == 2 ? 1 : 2));
- OSL_ENSURE(pNode && (pNode->getKnownRuleID() == OSQLParseNode::table_primary_as_range_column
- || pNode->getKnownRuleID() == OSQLParseNode::range_variable)
- ,"SQL grammar changed!");
- if ( !pNode->isLeaf() )
- sTableRange = pNode->getChild(1)->getTokenValue();
- } // if ( nCount == 2 || nCount == 3 || nCount == 5)
-
- return sTableRange;
-}
-// -----------------------------------------------------------------------------
-OSQLParseNodesContainer::OSQLParseNodesContainer()
-{
-}
-// -----------------------------------------------------------------------------
-OSQLParseNodesContainer::~OSQLParseNodesContainer()
-{
-}
-// -----------------------------------------------------------------------------
-void OSQLParseNodesContainer::push_back(OSQLParseNode* _pNode)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- m_aNodes.push_back(_pNode);
-}
-// -----------------------------------------------------------------------------
-void OSQLParseNodesContainer::erase(OSQLParseNode* _pNode)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- if ( !m_aNodes.empty() )
- {
- ::std::vector< OSQLParseNode* >::iterator aFind = ::std::find(m_aNodes.begin(), m_aNodes.end(),_pNode);
- if ( aFind != m_aNodes.end() )
- m_aNodes.erase(aFind);
- }
-}
-// -----------------------------------------------------------------------------
-bool OSQLParseNodesContainer::empty() const
-{
- return m_aNodes.empty();
-}
-// -----------------------------------------------------------------------------
-void OSQLParseNodesContainer::clear()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- m_aNodes.clear();
-}
-// -----------------------------------------------------------------------------
-void OSQLParseNodesContainer::clearAndDelete()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- // clear the garbage collector
- while ( !m_aNodes.empty() )
- {
- OSQLParseNode* pNode = m_aNodes[0];
- while ( pNode->getParent() )
- {
- pNode = pNode->getParent();
- }
- delete pNode;
- }
-}
-} // namespace connectivity
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/parse/wrap_sqlbison.cxx b/connectivity/source/parse/wrap_sqlbison.cxx
deleted file mode 100644
index 932f74fa86..0000000000
--- a/connectivity/source/parse/wrap_sqlbison.cxx
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "sqlbison.cxx"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/parse/wrap_sqlflex.cxx b/connectivity/source/parse/wrap_sqlflex.cxx
deleted file mode 100644
index 31007e1fce..0000000000
--- a/connectivity/source/parse/wrap_sqlflex.cxx
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#if defined _MSC_VER
- #pragma warning(disable:4505)
-#endif
-
-#include "sqlflex.cxx"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/resource/conn_error_message.src b/connectivity/source/resource/conn_error_message.src
deleted file mode 100644
index ed1211d897..0000000000
--- a/connectivity/source/resource/conn_error_message.src
+++ /dev/null
@@ -1,99 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// note: the resource IDs of the strings herein *must* correspond to the
-// com::sun::star::sdb::ErrorCondition values.
-//
-// For a given error condition value n, the message string must have ID
-// <code>256 + 2*n</code>, and the SQL state string (if applicable) must
-// have ID <code>256 + 2*n + 1</code>.
-//
-// The messages must be localized, the SQL states must *not*.
-
-// ROW_SET_OPERATION_VETOED = 100
-String 256 + 2*100 + 0
-{
- Text [ en-US ] = "The record operation has been vetoed.";
-};
-
-// PARSER_CYCLIC_SUB_QUERIES = 200
-String 256 + 2*200 + 0
-{
- Text [ en-US ] = "The statement contains a cyclic reference to one or more sub queries.";
-};
-
-// DB_OBJECT_NAME_WITH_SLASHES = 300
-String 256 + 2*300 + 0
-{
- Text [ en-US ] = "The name must not contain any slashes ('/').";
-};
-
-// DB_INVALID_SQL_NAME = 301
-String 256 + 2*301 + 0
-{
- Text [ en-US ] = "$1$ is no SQL conform identifier.";
-};
-
-// DB_QUERY_NAME_WITH_QUOTES = 302
-String 256 + 2*302 + 0
-{
- Text [ en-US ] = "Query names must not contain quote characters.";
-};
-
-// DB_OBJECT_NAME_IS_USED = 303
-String 256 + 2*303 + 0
-{
- Text [ en-US ] = "The name '$1$' is already in use in the database.";
-};
-
-// DB_NOT_CONNECTED = 304
-String 256 + 2*304 + 0
-{
- Text [ en-US ] = "No connection to the database exists.";
-};
-
-String 256 + 2*304 + 1
-{
- Text = "08003";
-};
-
-String 256 + 2*500 + 0
-{
- Text [ en-US ] = "No $1$ exists.";
-};
-
-// DATA_CANNOT_SELECT_UNFILTERED = 550
-String 256 + 2*550 + 0
-{
- Text [ en-US ] = "Unable to display the complete table content. Please apply a filter.";
-};
-
-String 256 + 2*550 + 1
-{
- Text = "IM001";
-};
-
diff --git a/connectivity/source/resource/conn_log_res.src b/connectivity/source/resource/conn_log_res.src
deleted file mode 100644
index 5c380c880e..0000000000
--- a/connectivity/source/resource/conn_log_res.src
+++ /dev/null
@@ -1,312 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "resource/jdbc_log.hrc"
-
-// ============================================================================
-// = log messages for the JDBC driver
-// ============================================================================
-
-String STR_LOG_DRIVER_CONNECTING_URL
-{
- Text = "jdbcBridge: connecting to URL '$1$'";
-};
-
-String STR_LOG_DRIVER_SUCCESS
-{
- Text = "jdbcBridge: success";
-};
-
-String STR_LOG_CREATE_STATEMENT
-{
- Text = "c$1$: creating statement";
-};
-
-String STR_LOG_CREATED_STATEMENT_ID
-{
- Text = "c$1$: created statement, statement id: s$2$";
-};
-
-String STR_LOG_PREPARE_STATEMENT
-{
- Text = "c$1$: preparing statement: $2$";
-};
-
-String STR_LOG_PREPARED_STATEMENT_ID
-{
- Text = "c$1$: prepared statement, statement id: s$2$";
-};
-
-String STR_LOG_PREPARE_CALL
-{
- Text = "c$1$: preparing call: $2$";
-};
-
-String STR_LOG_PREPARED_CALL_ID
-{
- Text = "c$1$: prepared call, statement id: s$2$";
-};
-
-String STR_LOG_NATIVE_SQL
-{
- Text = "c$1$: native SQL: $2$ -> $3$";
-};
-
-String STR_LOG_LOADING_DRIVER
-{
- Text = "c$1$: attempting to load driver class $2$";
-};
-
-String STR_LOG_NO_DRIVER_CLASS
-{
- Text = "c$1$: no Java Driver Class was provided";
-};
-
-String STR_LOG_CONN_SUCCESS
-{
- Text = "c$1$: success";
-};
-
-String STR_LOG_NO_SYSTEM_CONNECTION
-{
- Text = "c$1$: JDBC driver did not provide a JDBC connection";
-};
-
-String STR_LOG_GOT_JDBC_CONNECTION
-{
- Text = "c$1$: obtained a JDBC connection for $2$";
-};
-
-String STR_LOG_SHUTDOWN_CONNECTION
-{
- Text = "c$1$: shutting down connection";
-};
-
-String STR_LOG_GENERATED_VALUES
-{
- Text = "s$1$: retrieving generated values";
-};
-
-String STR_LOG_GENERATED_VALUES_FALLBACK
-{
- Text = "s$1$: getGeneratedValues: falling back to statement: $2$";
-};
-
-String STR_LOG_EXECUTE_STATEMENT
-{
- Text = "s$1$: going to execute: $2$";
-};
-
-String STR_LOG_EXECUTE_QUERY
-{
- Text = "s$1$: going to execute query: $2$";
-};
-
-String STR_LOG_CLOSING_STATEMENT
-{
- Text = "s$1$: closing/disposing statement";
-};
-
-String STR_LOG_EXECUTE_UPDATE
-{
- Text = "s$1$: going to execute update: $2$";
-};
-
-String STR_LOG_UPDATE_COUNT
-{
- Text = "s$1$: update count: $2$";
-};
-
-String STR_LOG_RESULT_SET_CONCURRENCY
-{
- Text = "s$1$: going to set result set concurrency: $2$";
-};
-
-String STR_LOG_RESULT_SET_TYPE
-{
- Text = "s$1$: going to set result set type: $2$";
-};
-
-String STR_LOG_FETCH_DIRECTION
-{
- Text = "s$1$: fetch direction: $2$";
-};
-
-String STR_LOG_FETCH_SIZE
-{
- Text = "s$1$: fetch size: $2$";
-};
-
-String STR_LOG_SET_ESCAPE_PROCESSING
-{
- Text = "s$1$: going to set escape processing: $2$";
-};
-
-String STR_LOG_EXECUTING_PREPARED
-{
- Text = "s$1$: executing previously prepared statement";
-};
-
-String STR_LOG_EXECUTING_PREPARED_UPDATE
-{
- Text = "s$1$: executing previously prepared update statement";
-};
-
-String STR_LOG_EXECUTING_PREPARED_QUERY
-{
- Text = "s$1$: executing previously prepared query";
-};
-
-String STR_LOG_STRING_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: string; value: $3$";
-};
-
-String STR_LOG_BOOLEAN_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: boolean; value: $3$";
-};
-
-String STR_LOG_BYTE_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: byte; value: $3$";
-};
-
-String STR_LOG_DATE_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: date; value: $3$";
-};
-
-String STR_LOG_TIME_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: time; value: $3$";
-};
-
-String STR_LOG_TIMESTAMP_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: timestamp; value: $3$";
-};
-
-String STR_LOG_DOUBLE_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: double; value: $3$";
-};
-
-String STR_LOG_FLOAT_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: float; value: $3$";
-};
-
-String STR_LOG_INT_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: int; value: $3$";
-};
-
-String STR_LOG_LONG_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: long; value: $3$";
-};
-
-String STR_LOG_NULL_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: sql-type: $3$; value: null";
-};
-
-String STR_LOG_OBJECT_NULL_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: setting to null";
-};
-
-String STR_LOG_SHORT_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: short; value: $3$";
-};
-
-String STR_LOG_BYTES_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: byte[]";
-};
-
-String STR_LOG_CHARSTREAM_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: character stream";
-};
-
-String STR_LOG_BINARYSTREAM_PARAMETER
-{
- Text = "s$1$: parameter no. $2$: type: binary stream";
-};
-
-String STR_LOG_CLEAR_PARAMETERS
-{
- Text = "s$1$: clearing all parameters";
-};
-
-String STR_LOG_META_DATA_METHOD
-{
- Text = "c$1$: entering XDatabaseMetaData::$2$";
-};
-
-String STR_LOG_META_DATA_METHOD_ARG1
-{
- Text = "c$1$: entering XDatabaseMetaData::$2$( '$3$' )";
-};
-
-String STR_LOG_META_DATA_METHOD_ARG2
-{
- Text = "c$1$: entering XDatabaseMetaData::$2$( '$3$', '$4$' )";
-};
-
-String STR_LOG_META_DATA_METHOD_ARG3
-{
- Text = "c$1$: entering XDatabaseMetaData::$2$( '$3$', '$4$', '$5$' )";
-};
-
-String STR_LOG_META_DATA_METHOD_ARG4
-{
- Text = "c$1$: entering XDatabaseMetaData::$2$( '$3$', '$4$', '$5$', '$6$' )";
-};
-
-String STR_LOG_META_DATA_RESULT
-{
- Text = "c$1$: leaving XDatabaseMetaData::$2$: success-with-result: $3$";
-};
-
-String STR_LOG_META_DATA_SUCCESS
-{
- Text = "c$1$: leaving XDatabaseMetaData::$2$: success";
-};
-
-String STR_LOG_THROWING_EXCEPTION
-{
- Text = "SQLException to be thrown: message: '$1$', SQLState: $2$, ErrorCode: $3$";
-};
-
-String STR_LOG_SETTING_SYSTEM_PROPERTY
-{
- Text = "setting system property \"$1$\" to value \"$2$\"";
-}; \ No newline at end of file
diff --git a/connectivity/source/resource/conn_shared_res.src b/connectivity/source/resource/conn_shared_res.src
deleted file mode 100644
index fb0d80fbf4..0000000000
--- a/connectivity/source/resource/conn_shared_res.src
+++ /dev/null
@@ -1,649 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "resource/mozab_res.hrc"
-#include "resource/macab_res.hrc"
-#include "resource/calc_res.hrc"
-#include "resource/ado_res.hrc"
-#include "resource/dbase_res.hrc"
-#include "resource/file_res.hrc"
-#include "resource/evoab2_res.hrc"
-#include "resource/kab_res.hrc"
-#include "resource/adabas_res.hrc"
-#include "resource/hsqldb_res.hrc"
-
-// ============================================================================
-// = the mozab driver's resource strings
-// ============================================================================
-
-String STR_MOZILLA_ADDRESSBOOKS
-{
- Text [ en-US ] = "Mozilla/Seamonkey Addressbook Directory";
- Text [ x-comment ] = "This must be the term referring to address books in the user's "
- "Mozilla/Seamonkey profile in the system.";
-};
-
-String STR_THUNDERBIRD_ADDRESSBOOKS
-{
- Text [ en-US ] = "Thunderbird Addressbook Directory";
- Text [ x-comment ] = "This must be the term referring to address books in the user's "
- "Thunderbird profile in the system.";
-};
-
-String STR_OE_ADDRESSBOOK
-{
- Text [ en-US ] = "Outlook Express Addressbook";
-};
-
-String STR_OUTLOOK_MAPI_ADDRESSBOOK
-{
- Text [ en-US ] = "Outlook (MAPI) Addressbook";
-};
-
-String STR_NO_TABLE_CREATION_SUPPORT
-{
- Text [ en-US ] = "Creating tables is not supported for this kind of address books.";
-};
-
-String STR_MOZILLA_IS_RUNNING
-{
- Text [ en-US ] = "Cannot create new address books while Mozilla is running.";
-};
-
-String STR_COULD_NOT_RETRIEVE_AB_ENTRY
-{
- Text [ en-US ] = "An address book entry could not be retrieved, an unknown error occurred.";
-};
-
-String STR_COULD_NOT_GET_DIRECTORY_NAME
-{
- Text [ en-US ] = "An address book directory name could not be retrieved, an unknown error occurred.";
-};
-
-String STR_TIMEOUT_WAITING
-{
- Text [ en-US ] = "Timed out while waiting for the result.";
-};
-
-String STR_ERR_EXECUTING_QUERY
-{
- Text [ en-US ] = "An error occurred while executing the query.";
-};
-
-String STR_MOZILLA_IS_RUNNIG_NO_CHANGES
-{
- Text [ en-US ] = "You can't make any changes to mozilla address book when mozilla is running.";
-};
-
-String STR_FOREIGN_PROCESS_CHANGED_AB
-{
- Text [ en-US ] = "Mozilla Address Book has been changed out of this process, we can't modify it in this condition.";
-};
-
-String STR_CANT_FIND_ROW
-{
- Text [ en-US ] = "Can't find the requested row.";
-};
-
-String STR_CANT_FIND_CARD_FOR_ROW
-{
- Text [ en-US ] = "Can't find the card for the requested row.";
-};
-
-String STR_QUERY_AT_LEAST_ONE_TABLES
-{
- Text [ en-US ] = "The query can not be executed. It needs at least one table.";
-};
-
-String STR_NO_COUNT_SUPPORT
-{
- Text [ en-US ] = "The driver does not support the 'COUNT' function.";
-};
-
-String STR_STMT_TYPE_NOT_SUPPORTED
-{
- Text [ en-US ] = "This statement type not supported by this database driver.";
-};
-
-String STR_UNSPECIFIED_ERROR
-{
- Text [ en-US ] = "An unknown error occurred.";
-};
-
-String STR_COULD_NOT_CREATE_ADDRESSBOOK
-{
- Text [ en-US ] = "Could not create a new address book. Mozilla error code is $1$.";
-};
-
-String STR_COULD_NOT_LOAD_LIB
-{
- Text [ en-US ] = "The library '$libname$' could not be loaded.";
-};
-
-String STR_ERROR_REFRESH_ROW
-{
- Text [ en-US ] = "An error occurred while refreshing the current row.";
-};
-
-String STR_ERROR_GET_ROW
-{
- Text [ en-US ] = "An error occurred while getting the current row.";
-};
-
-String STR_CAN_NOT_CANCEL_ROW_UPDATE
-{
- Text [ en-US ] = "The row update can not be canceled.";
-};
-
-String STR_CAN_NOT_CREATE_ROW
-{
- Text [ en-US ] = "A new row can not be created.";
-};
-
-String STR_QUERY_INVALID_IS_NULL_COLUMN
-{
- Text [ en-US ] = "The query can not be executed. The 'IS NULL' can only be used with a column name.";
-};
-
-String STR_ILLEGAL_MOVEMENT
-{
- Text [ en-US ] = "Illegal cursor movement occurred.";
-};
-
-String STR_COMMIT_ROW
-{
- Text [ en-US ] = "Please commit row '$position$' before update rows or insert new rows.";
-};
-
-String STR_INVALID_ROW_UPDATE
-{
- Text [ en-US ] = "The update call can not be executed. The row is invalid.";
-};
-
-String STR_ROW_CAN_NOT_SAVE
-{
- Text [ en-US ] = "The current row can not be saved.";
-};
-
-String STR_NO_HOSTNAME
-{
- Text [ en-US ] = "No hostname was provided.";
-};
-
-String STR_NO_BASEDN
-{
- Text [ en-US ] = "No Base DN was provided.";
-};
-
-String STR_COULD_NOT_CONNECT_LDAP
-{
- Text [ en-US ] = "The connection to the LDAP server could not be established.";
-};
-
-// ============================================================================
-// = common strings
-// ============================================================================
-String STR_NO_CONNECTION_GIVEN
-{
- Text [ en-US ] = "It doesn't exist a connection to the database.";
-};
-String STR_WRONG_PARAM_INDEX
-{
- Text [ en-US ] = "You tried to set a parameter at position '$pos$' but there is/are only '$count$' parameter(s) allowed. One reason may be that the property \"ParameterNameSubstitution\" is not set to TRUE in the data source.";
-};
-String STR_INPUTSTREAM_WRONG_LEN
-{
- Text [ en-US ] = "End of InputStream reached before satisfying length specified when InputStream was set.";
-};
-String STR_NO_INPUTSTREAM
-{
- Text [ en-US ] = "The input stream was not set.";
-};
-String STR_NO_ELEMENT_NAME
-{
- Text [ en-US ] = "There is no element named '$name$'.";
-};
-String STR_INVALID_BOOKMARK
-{
- Text [ en-US ] = "Invalid bookmark value";
-};
-String STR_PRIVILEGE_NOT_GRANTED
-{
- Text [ en-US ] = "Privilege not granted: Only table privileges can be granted.";
-};
-String STR_PRIVILEGE_NOT_REVOKED
-{
- Text [ en-US ] = "Privilege not revoked: Only table privileges can be revoked.";
-};
-
-String STR_UNKNOWN_COLUMN_NAME
-{
- Text [ en-US ] = "The column name '$columnname$' is unknown.";
-};
-String STR_ERRORMSG_SEQUENCE
-{
- Text [ en-US ] = "Function sequence error.";
-};
-String STR_INVALID_INDEX
-{
- Text [ en-US ] = "Invalid descriptor index.";
-};
-String STR_UNSUPPORTED_FUNCTION
-{
- Text [ en-US ] = "The driver does not support the function '$functionname$'.";
-};
-String STR_UNSUPPORTED_FEATURE
-{
- Text [ en-US ] = "The driver does not support the functionality for '$featurename$'. It is not implemented.";
-};
-String STR_FORMULA_WRONG
-{
- Text [ en-US ] = "The formula for TypeInfoSettings is wrong!";
-};
-String STR_STRING_LENGTH_EXCEEDED
-{
- Text [ en-US ] = "The string '$string$' exceeds the maximum length of $maxlen$ characters when converted to the target character set '$charset$'.";
-};
-
-String STR_CANNOT_CONVERT_STRING
-{
- Text [ en-US ] = "The string '$string$' cannot be converted using the encoding '$charset$'.";
-};
-
-String STR_URI_SYNTAX_ERROR
-{
- Text [ en-US ] = "The connection URL is invalid.";
-};
-
-String STR_QUERY_TOO_COMPLEX
-{
- Text [ en-US ] = "The query can not be executed. It is too complex.";
-};
-String STR_OPERATOR_TOO_COMPLEX
-{
- Text [ en-US ] = "The query can not be executed. The operator is too complex.";
-};
-String STR_QUERY_INVALID_LIKE_COLUMN
-{
- Text [ en-US ] = "The query can not be executed. You cannot use 'LIKE' with columns of this type.";
-};
-String STR_QUERY_INVALID_LIKE_STRING
-{
- Text [ en-US ] = "The query can not be executed. 'LIKE' can be used with a string argument only.";
-};
-String STR_QUERY_NOT_LIKE_TOO_COMPLEX
-{
- Text [ en-US ] = "The query can not be executed. The 'NOT LIKE' condition is too complex.";
-};
-String STR_QUERY_LIKE_WILDCARD
-{
- Text [ en-US ] = "The query can not be executed. The 'LIKE' condition contains wildcard in the middle.";
-};
-String STR_QUERY_LIKE_WILDCARD_MANY
-{
- Text [ en-US ] = "The query can not be executed. The 'LIKE' condition contains too many wildcards.";
-};
-String STR_INVALID_COLUMNNAME
-{
- Text [ en-US ] = "The column name '$columnname$' is not valid.";
-};
-String STR_INVALID_COLUMN_SELECTION
-{
- Text [ en-US ] = "The statement contains an invalid selection of columns.";
-};
-String STR_COLUMN_NOT_UPDATEABLE
-{
- Text [ en-US ] = "The column at position '$position$' could not be updated.";
-};
-
-String STR_COULD_NOT_LOAD_FILE
-{
- Text [ en-US ] = "The file $filename$ could not be loaded.";
-};
-
-String STR_LOAD_FILE_ERROR_MESSAGE
-{
- Text [ en-US ] = "The attempt to load the file resulted in the following error message ($exception_type$):\n\n$error_message$";
-};
-
-// ============================================================================
-// = the ado driver's resource strings
-// ============================================================================
-String STR_TYPE_NOT_CONVERT
-{
- Text [ en-US ] = "The type could not be converted.";
-};
-String STR_INVALID_COLUMN_DESCRIPTOR_ERROR
-{
- Text [ en-US ] = "Could not append column: invalid column descriptor.";
-};
-
-String STR_INVALID_GROUP_DESCRIPTOR_ERROR
-{
- Text [ en-US ] = "Could not create group: invalid object descriptor.";
-};
-String STR_INVALID_INDEX_DESCRIPTOR_ERROR
-{
- Text [ en-US ] = "Could not create index: invalid object descriptor.";
-};
-String STR_INVALID_KEY_DESCRIPTOR_ERROR
-{
- Text [ en-US ] = "Could not create key: invalid object descriptor.";
-};
-
-String STR_INVALID_TABLE_DESCRIPTOR_ERROR
-{
- Text [ en-US ] = "Could not create table: invalid object descriptor.";
-};
-
-String STR_INVALID_USER_DESCRIPTOR_ERROR
-{
- Text [ en-US ] = "Could not create user: invalid object descriptor.";
-};
-
-String STR_INVALID_VIEW_DESCRIPTOR_ERROR
-{
- Text [ en-US ] = "Could not create view: invalid object descriptor.";
-};
-
-String STR_VIEW_NO_COMMAND_ERROR
-{
- Text [ en-US ] = "Could not create view: no command object.";
-};
-
-String STR_NO_CONNECTION
-{
- Text [ en-US ] = "The connection could not be created. May be the necessary data provider is not installed.";
-};
-
-// dbase
-String STR_COULD_NOT_DELETE_INDEX
-{
- Text [ en-US ] = "The index could not be deleted. An unknown error while accessing the file system occurred.";
-};
-String STR_ONL_ONE_COLUMN_PER_INDEX
-{
- Text [ en-US ] = "The index could not be created. Only one column per index is allowed.";
-};
-String STR_COULD_NOT_CREATE_INDEX_NOT_UNIQUE
-{
- Text [ en-US ] = "The index could not be created. The values are not unique.";
-};
-
-String STR_COULD_NOT_CREATE_INDEX
-{
- Text [ en-US ] = "The index could not be created. An unknown error appeared.";
-};
-String STR_COULD_NOT_CREATE_INDEX_NAME
-{
- Text [ en-US ] = "The index could not be created. The file '$filename$' is used by an other index.";
-};
-String STR_COULD_NOT_CREATE_INDEX_KEYSIZE
-{
- Text [ en-US ] = "The index could not be created. The size of the chosen column is to big.";
-};
-
-String STR_SQL_NAME_ERROR
-{
- Text [ en-US ] = "The name '$name$' doesn't match SQL naming constraints.";
-};
-String STR_COULD_NOT_DELETE_FILE
-{
- Text [ en-US ] = "The file $filename$ could not be deleted.";
-};
-
-String STR_INVALID_COLUMN_TYPE
-{
- Text [ en-US ] = "Invalid column type for column '$columnname$'.";
-};
-String STR_INVALID_COLUMN_PRECISION
-{
- Text [ en-US ] = "Invalid precision for column '$columnname$'.";
-};
-
-String STR_INVALID_PRECISION_SCALE
-{
- Text [ en-US ] = "Precision is less than scale for column '$columnname$'.";
-};
-
-String STR_INVALID_COLUMN_NAME_LENGTH
-{
- Text [ en-US ] = "Invalid column name length for column '$columnname$'.";
-};
-
-String STR_DUPLICATE_VALUE_IN_COLUMN
-{
- Text [ en-US ] = "Duplicate value found in column '$columnname$'.";
-};
-
-String STR_INVALID_COLUMN_DECIMAL_VALUE
-{
- Text [ en-US ] = "The '$columnname$' column has been defined as a \"Decimal\" type, the max. length is $precision$ characters (with $scale$ decimal places).\n\nThe specified value \"$value$ is longer than the number of digits allowed.";
-};
-
-String STR_COLUMN_NOT_ALTERABLE
-{
- Text [ en-US ] = "The column '$columnname$' could not be altered. May be the file system is write protected.";
-};
-String STR_INVALID_COLUMN_VALUE
-{
- Text [ en-US ] = "The column '$columnname$' could not be updated. The value is invalid for that column.";
-};
-String STR_COLUMN_NOT_ADDABLE
-{
- Text [ en-US ] = "The column '$columnname$' could not be added. May be the file system is write protected.";
-};
-String STR_COLUMN_NOT_DROP
-{
- Text [ en-US ] = "The column at position '$position$' could not be dropped. May be the file system is write protected.";
-};
-String STR_TABLE_NOT_DROP
-{
- Text [ en-US ] = "The table '$tablename$' could not be dropped. May be the file system is write protected.";
-};
-String STR_COULD_NOT_ALTER_TABLE
-{
- Text [ en-US ] = "The table could not be altered.";
-};
-
-String STR_INVALID_DBASE_FILE
-{
- Text [ en-US ] = "The file '$filename$' is an invalid (or unrecognized) dBase file.";
-};
-
-// Evoab2
-
-String STR_CANNOT_OPEN_BOOK
-{
- Text [ en-US ] = "Cannot open Evolution address book.";
-};
-
-String STR_SORT_BY_COL_ONLY
-{
- Text [ en-US ] = "Can only sort by table columns.";
-};
-
-// File
-String STR_QUERY_COMPLEX_COUNT
-{
- Text [ en-US ] = "The query can not be executed. It is too complex. Only \"COUNT(*)\" is supported.";
-};
-String STR_QUERY_INVALID_BETWEEN
-{
- Text [ en-US ] = "The query can not be executed. The 'BETWEEN' arguments are not correct.";
-};
-String STR_QUERY_FUNCTION_NOT_SUPPORTED
-{
- Text [ en-US ] = "The query can not be executed. The function is not supported.";
-};
-String STR_TABLE_READONLY
-{
- Text [ en-US ] = "The table can not be changed. It is read only.";
-};
-String STR_DELETE_ROW
-{
- Text [ en-US ] = "The row could not be deleted. The option \"Display inactive records\" is set.";
-};
-String STR_ROW_ALREADY_DELETED
-{
- Text [ en-US ] = "The row could not be deleted. It is already deleted.";
-};
-String STR_QUERY_MORE_TABLES
-{
- Text [ en-US ] = "The query can not be executed. It contains more than one table.";
-};
-String STR_QUERY_NO_TABLE
-{
- Text [ en-US ] = "The query can not be executed. It contains no valid table.";
-};
-String STR_QUERY_NO_COLUMN
-{
- Text [ en-US ] = "The query can not be executed. It contains no valid columns.";
-};
-String STR_INVALID_PARA_COUNT
-{
- Text [ en-US ] = "The count of the given parameter values doesn't match the parameters.";
-};
-String STR_NO_VALID_FILE_URL
-{
- Text [ en-US ] = "The URL '$URL$' is not valid. A connection can not be created.";
-};
-
-
-String STR_NO_CLASSNAME
-{
- Text [ en-US ] = "The driver class '$classname$' could not be loaded.";
-};
-String STR_NO_JAVA
-{
- Text [ en-US ] = "No Java installation could be found. Please check your installation.";
-};
-String STR_NO_RESULTSET
-{
- Text [ en-US ] = "The execution of the query doesn't return a valid result set.";
-};
-String STR_NO_ROWCOUNT
-{
- Text [ en-US ] = "The execution of the update statement doesn't effect any rows.";
-};
-
-String STR_NO_CLASSNAME_PATH
-{
- Text [ en-US ] = "The additional driver class path is '$classpath$'.";
-};
-String STR_UNKNOWN_PARA_TYPE
-{
- Text [ en-US ] = "The type of parameter at position '$position$' is unknown.";
-};
-String STR_UNKNOWN_COLUMN_TYPE
-{
- Text [ en-US ] = "The type of column at position '$position$' is unknown.";
-};
-
-// KAB
-
-String STR_NO_KDE_INST
-{
- Text [ en-US ] = "No suitable KDE installation was found.";
-};
-
-String STR_KDE_VERSION_TOO_OLD
-{
- Text [ en-US ] = "KDE version $major$.$minor$ or higher is required to access the KDE Address Book.";
-};
-String STR_KDE_VERSION_TOO_NEW
-{
- Text [ en-US ] = "The found KDE version is too new. Only KDE up to version $major$.$minor$ is known to work with this product.\n";
-};
-String STR_KDE_VERSION_TOO_NEW_WORK_AROUND
-{
- Text [ en-US ] = "If you are sure that your KDE version works, you might execute the following Basic macro to disable this version check:\n\n";
-};
-String STR_PARA_ONLY_PREPARED
-{
- Text [ en-US ] = "Parameters can appear only in prepared statements.";
-};
-
-// MACAB
-String STR_NO_TABLE
-{
- Text [ en-US ] = "No such table!";
-};
-
-String STR_NO_MAC_OS_FOUND
-{
- Text [ en-US ] = "No suitable Mac OS installation was found.";
-};
-
-// ADABAS D
-String STR_NO_DISK_SPACE
-{
- Text [ en-US ] = "The database file '$filename$' could not be created. Please check your disk space.";
-};
-
-String STR_COMMAND_NOT_FOUND
-{
- Text [ en-US ] = "The database '$databasename$' could not be started because the command '$progname$' could not be executed.";
-};
-String STR_DATABASE_NEEDS_CONVERTING
-{
- Text [ en-US ] = "The current database need to be converted. Please insert control user and password.";
-};
-String STR_USER_NO_DELETE
-{
- Text [ en-US ] = "This user couldn't be deleted. Otherwise the database stays in a inconsistent state.";
-};
-// hsqldb
-String STR_NO_STROAGE
-{
- Text [ en-US ] = "The connection can not be established. No storage or URL was given.";
-};
-String STR_INVALID_FILE_URL
-{
- Text [ en-US ] = "The given URL contains no valid local file system path. Please check the location of your database file.";
-};
-String STR_NO_TABLE_CONTAINER
-{
- Text [ en-US ] = "An error occurred while obtaining the connection's table container.";
-};
-String STR_NO_TABLE_EDITOR_DIALOG
-{
- Text [ en-US ] = "An error occurred while creating the table editor dialog.";
-};
-String STR_NO_TABLENAME
-{
- Text [ en-US ] = "There is no table named '$tablename$'.";
-};
-String STR_NO_DOCUMENTUI
-{
- Text [ en-US ] = "The provided DocumentUI is not allowed to be NULL.";
-};
-String STR_ERROR_NEW_VERSION
-{
- Text = "The connection could not be established. The database was created by a newer version of %PRODUCTNAME.";
-};
-
diff --git a/connectivity/source/resource/makefile.mk b/connectivity/source/resource/makefile.mk
deleted file mode 100755
index b4944187dc..0000000000
--- a/connectivity/source/resource/makefile.mk
+++ /dev/null
@@ -1,107 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=..
-PRJNAME=connectivity
-# common resources in connectivity
-TARGET=cnr
-# resources used for logging in the various SDBC drivers
-TARGET2=sdbcl
-# resources used for ::com::sun::star::sdb::ErrorCondition messages
-TARGET3=sdberr
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/dbtools.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-CDEFS+=-DCONN_SHARED_RESOURCE_FILE=$(TARGET)
-
-# --- Files -------------------------------------
-
-EXCEPTIONSFILES=\
- $(SLO)$/sharedresources.obj
-
-SLOFILES=\
- $(EXCEPTIONSFILES)
-
-# ...............................................
-
-SRS1NAME=conn_shared_res
-SRC1FILES= \
- $(SRS1NAME).src
-
-# ...............................................
-
-SRS2NAME=conn_log_res
-SRC2FILES= \
- $(SRS2NAME).src
-
-# ...............................................
-
-SRS3NAME=conn_error_message
-SRC3FILES= \
- $(SRS3NAME).src
-
-# === .res file ==========================================================
-
-# ...............................................
-
-RES1FILELIST=\
- $(SRS)$/$(SRS1NAME).srs \
-
-RESLIB1NAME=$(TARGET)
-RESLIB1SRSFILES=$(RES1FILELIST)
-
-# ...............................................
-
-RES2FILELIST=\
- $(SRS)$/$(SRS2NAME).srs \
-
-RESLIB2NAME=$(TARGET2)
-RESLIB2SRSFILES=$(RES2FILELIST)
-
-# ...............................................
-
-RES3FILELIST=\
- $(SRS)$/$(SRS3NAME).srs \
-
-RESLIB3NAME=$(TARGET3)
-RESLIB3SRSFILES=$(RES3FILELIST)
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
-
diff --git a/connectivity/source/resource/sharedresources.cxx b/connectivity/source/resource/sharedresources.cxx
deleted file mode 100644
index 4910b8c78e..0000000000
--- a/connectivity/source/resource/sharedresources.cxx
+++ /dev/null
@@ -1,244 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "resource/sharedresources.hxx"
-
-#include <comphelper/processfactory.hxx>
-#include <comphelper/officeresourcebundle.hxx>
-
-/** === begin UNO includes === **/
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-/** === end UNO includes === **/
-
-#include <tools/diagnose_ex.h>
-#include <osl/diagnose.h>
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- /** === begin UNO using === **/
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::beans::XPropertySet;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
- using ::com::sun::star::uno::XComponentContext;
- using ::com::sun::star::uno::Exception;
- /** === end UNO using === **/
-
- //====================================================================
- //= SharedResources_Impl
- //====================================================================
- class SharedResources_Impl
- {
- private:
- static SharedResources_Impl* s_pInstance;
- static oslInterlockedCount s_nClients;
-
- private:
- ::std::auto_ptr< ::comphelper::OfficeResourceBundle >
- m_pResourceBundle;
-
- public:
- static void registerClient();
- static void revokeClient();
-
- static SharedResources_Impl&
- getInstance();
-
- ::rtl::OUString getResourceString( ResourceId _nId );
-
- private:
- SharedResources_Impl();
-
- static ::osl::Mutex& getMutex()
- {
- static ::osl::Mutex s_aMutex;
- return s_aMutex;
- }
- };
-
- //--------------------------------------------------------------------
- SharedResources_Impl* SharedResources_Impl::s_pInstance( NULL );
- oslInterlockedCount SharedResources_Impl::s_nClients( 0 );
-
- //--------------------------------------------------------------------
- SharedResources_Impl::SharedResources_Impl()
- {
- try
- {
- Reference< XPropertySet > xFactoryProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
- Reference< XComponentContext > xContext(
- xFactoryProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ),
- UNO_QUERY_THROW
- );
- m_pResourceBundle.reset( new ::comphelper::OfficeResourceBundle( xContext, "cnr" ) );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString SharedResources_Impl::getResourceString( ResourceId _nId )
- {
- if ( m_pResourceBundle.get() == NULL )
- // this should never happen, but we gracefully ignore it. It has been reported
- // in the constructor in non-product builds.
- return ::rtl::OUString();
-
- return m_pResourceBundle->loadString( _nId );
- }
-
- //--------------------------------------------------------------------
- void SharedResources_Impl::registerClient()
- {
- osl_incrementInterlockedCount( &s_nClients );
- }
-
- //--------------------------------------------------------------------
- void SharedResources_Impl::revokeClient()
- {
- ::osl::MutexGuard aGuard( getMutex() );
- if ( 0 == osl_decrementInterlockedCount( &s_nClients ) )
- {
- delete s_pInstance;
- s_pInstance = NULL;
- }
- }
-
- //--------------------------------------------------------------------
- SharedResources_Impl& SharedResources_Impl::getInstance()
- {
- ::osl::MutexGuard aGuard( getMutex() );
- OSL_ENSURE( s_nClients > 0, "SharedResources_Impl::getInstance: no active clients!" );
-
- if ( !s_pInstance )
- s_pInstance = new SharedResources_Impl;
-
- return *s_pInstance;
- }
-
- //====================================================================
- //= helpers
- //====================================================================
- namespace
- {
- size_t lcl_substitute( ::rtl::OUString& _inout_rString,
- const sal_Char* _pAsciiPattern, const ::rtl::OUString& _rReplace )
- {
- size_t nOccurrences = 0;
-
- ::rtl::OUString sPattern( ::rtl::OUString::createFromAscii( _pAsciiPattern ) );
- sal_Int32 nIndex = 0;
- while ( ( nIndex = _inout_rString.indexOf( sPattern ) ) > -1 )
- {
- ++nOccurrences;
- _inout_rString = _inout_rString.replaceAt( nIndex, sPattern.getLength(), _rReplace );
- }
-
- return nOccurrences;
- }
- }
-
- //====================================================================
- //= SharedResources
- //====================================================================
- //--------------------------------------------------------------------
- SharedResources::SharedResources()
- {
- SharedResources_Impl::registerClient();
- }
-
- //--------------------------------------------------------------------
- SharedResources::~SharedResources()
- {
- SharedResources_Impl::revokeClient();
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString SharedResources::getResourceString( ResourceId _nResId ) const
- {
- return SharedResources_Impl::getInstance().getResourceString( _nResId );
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString SharedResources::getResourceStringWithSubstitution( ResourceId _nResId,
- const sal_Char* _pAsciiPatternToReplace, const ::rtl::OUString& _rStringToSubstitute ) const
- {
- ::rtl::OUString sString( SharedResources_Impl::getInstance().getResourceString( _nResId ) );
- OSL_VERIFY( lcl_substitute( sString, _pAsciiPatternToReplace, _rStringToSubstitute ) );
- return sString;
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString SharedResources::getResourceStringWithSubstitution( ResourceId _nResId,
- const sal_Char* _pAsciiPatternToReplace1, const ::rtl::OUString& _rStringToSubstitute1,
- const sal_Char* _pAsciiPatternToReplace2, const ::rtl::OUString& _rStringToSubstitute2 ) const
- {
- ::rtl::OUString sString( SharedResources_Impl::getInstance().getResourceString( _nResId ) );
- OSL_VERIFY( lcl_substitute( sString, _pAsciiPatternToReplace1, _rStringToSubstitute1 ) );
- OSL_VERIFY( lcl_substitute( sString, _pAsciiPatternToReplace2, _rStringToSubstitute2 ) );
- return sString;
- }
-
- //--------------------------------------------------------------------
- ::rtl::OUString SharedResources::getResourceStringWithSubstitution( ResourceId _nResId,
- const sal_Char* _pAsciiPatternToReplace1, const ::rtl::OUString& _rStringToSubstitute1,
- const sal_Char* _pAsciiPatternToReplace2, const ::rtl::OUString& _rStringToSubstitute2,
- const sal_Char* _pAsciiPatternToReplace3, const ::rtl::OUString& _rStringToSubstitute3 ) const
- {
- ::rtl::OUString sString( SharedResources_Impl::getInstance().getResourceString( _nResId ) );
- OSL_VERIFY( lcl_substitute( sString, _pAsciiPatternToReplace1, _rStringToSubstitute1 ) );
- OSL_VERIFY( lcl_substitute( sString, _pAsciiPatternToReplace2, _rStringToSubstitute2 ) );
- OSL_VERIFY( lcl_substitute( sString, _pAsciiPatternToReplace3, _rStringToSubstitute3 ) );
- return sString;
- }
- //--------------------------------------------------------------------
- ::rtl::OUString SharedResources::getResourceStringWithSubstitution( ResourceId _nResId,
- const ::std::list< ::std::pair<const sal_Char* , ::rtl::OUString > > _aStringToSubstitutes) const
- {
- ::rtl::OUString sString( SharedResources_Impl::getInstance().getResourceString( _nResId ) );
- ::std::list< ::std::pair<const sal_Char* , ::rtl::OUString > >::const_iterator aIter = _aStringToSubstitutes.begin();
- ::std::list< ::std::pair<const sal_Char* , ::rtl::OUString > >::const_iterator aEnd = _aStringToSubstitutes.end();
- for(;aIter != aEnd; ++aIter)
- OSL_VERIFY( lcl_substitute( sString, aIter->first, aIter->second ) );
-
- return sString;
- }
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/VCatalog.cxx b/connectivity/source/sdbcx/VCatalog.cxx
deleted file mode 100644
index 645a6b6726..0000000000
--- a/connectivity/source/sdbcx/VCatalog.cxx
+++ /dev/null
@@ -1,243 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/sdbcx/VCatalog.hxx"
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "connectivity/sdbcx/VDescriptor.hxx"
-#include "TConnection.hxx"
-#include <comphelper/uno3.hxx>
-#include "connectivity/dbtools.hxx"
-
-using namespace connectivity;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-//------------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OCatalog,"com.sun.star.comp.connectivity.OCatalog","com.sun.star.sdbcx.DatabaseDefinition")
-//------------------------------------------------------------------------------
-OCatalog::OCatalog(const Reference< XConnection> &_xConnection) : OCatalog_BASE(m_aMutex)
- ,connectivity::OSubComponent<OCatalog, OCatalog_BASE>(_xConnection, this)
- ,m_pTables(NULL)
- ,m_pViews(NULL)
- ,m_pGroups(NULL)
- ,m_pUsers(NULL)
-{
- try
- {
- m_xMetaData = _xConnection->getMetaData();
- }
- catch(const Exception&)
- {
- OSL_FAIL("No Metadata available!");
- }
-}
-//-----------------------------------------------------------------------------
-OCatalog::~OCatalog()
-{
- delete m_pTables;
- delete m_pViews;
- delete m_pGroups;
- delete m_pUsers;
-}
-//-----------------------------------------------------------------------------
-void SAL_CALL OCatalog::acquire() throw()
-{
- OCatalog_BASE::acquire();
-}
-//------------------------------------------------------------------------------
-void SAL_CALL OCatalog::release() throw()
-{
- relase_ChildImpl();
-}
-
-//------------------------------------------------------------------------------
-void SAL_CALL OCatalog::disposing()
-{
- ::osl::MutexGuard aGuard(m_aMutex);
-
- if(m_pTables)
- m_pTables->disposing();
- if(m_pViews)
- m_pViews->disposing();
- if(m_pGroups)
- m_pGroups->disposing();
- if(m_pUsers)
- m_pUsers->disposing();
-
- dispose_ChildImpl();
- OCatalog_BASE::disposing();
-}
-//------------------------------------------------------------------------------
-// XTablesSupplier
-Reference< XNameAccess > SAL_CALL OCatalog::getTables( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OCatalog_BASE::rBHelper.bDisposed);
-
- try
- {
- if(!m_pTables)
- refreshTables();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return const_cast<OCatalog*>(this)->m_pTables;
-}
-// -------------------------------------------------------------------------
-// XViewsSupplier
-Reference< XNameAccess > SAL_CALL OCatalog::getViews( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OCatalog_BASE::rBHelper.bDisposed);
-
- try
- {
- if(!m_pViews)
- refreshViews();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return const_cast<OCatalog*>(this)->m_pViews;
-}
-// -------------------------------------------------------------------------
-// XUsersSupplier
-Reference< XNameAccess > SAL_CALL OCatalog::getUsers( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OCatalog_BASE::rBHelper.bDisposed);
-
- try
- {
- if(!m_pUsers)
- refreshUsers();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return const_cast<OCatalog*>(this)->m_pUsers;
-}
-// -------------------------------------------------------------------------
-// XGroupsSupplier
-Reference< XNameAccess > SAL_CALL OCatalog::getGroups( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OCatalog_BASE::rBHelper.bDisposed);
-
- try
- {
- if(!m_pGroups)
- refreshGroups();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return const_cast<OCatalog*>(this)->m_pGroups;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OCatalog::buildName(const Reference< XRow >& _xRow)
-{
- ::rtl::OUString sCatalog = _xRow->getString(1);
- if ( _xRow->wasNull() )
- sCatalog = ::rtl::OUString();
- ::rtl::OUString sSchema = _xRow->getString(2);
- if ( _xRow->wasNull() )
- sSchema = ::rtl::OUString();
- ::rtl::OUString sTable = _xRow->getString(3);
- if ( _xRow->wasNull() )
- sTable = ::rtl::OUString();
-
- ::rtl::OUString sComposedName(
- ::dbtools::composeTableName( m_xMetaData, sCatalog, sSchema, sTable, sal_False, ::dbtools::eInDataManipulation ) );
- return sComposedName;
-}
-// -----------------------------------------------------------------------------
-void OCatalog::fillNames(Reference< XResultSet >& _xResult,TStringVector& _rNames)
-{
- if ( _xResult.is() )
- {
- _rNames.reserve(20);
- Reference< XRow > xRow(_xResult,UNO_QUERY);
- while ( _xResult->next() )
- {
- _rNames.push_back( buildName(xRow) );
- }
- xRow.clear();
- ::comphelper::disposeComponent(_xResult);
- }
-}
-// -------------------------------------------------------------------------
-void ODescriptor::construct()
-{
- sal_Int32 nAttrib = isNew() ? 0 : ::com::sun::star::beans::PropertyAttribute::READONLY;
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME), PROPERTY_ID_NAME ,nAttrib,&m_Name,::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
-}
-// -------------------------------------------------------------------------
-ODescriptor::~ODescriptor()
-{
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/VCollection.cxx b/connectivity/source/sdbcx/VCollection.cxx
deleted file mode 100644
index 52b3fa9bb0..0000000000
--- a/connectivity/source/sdbcx/VCollection.cxx
+++ /dev/null
@@ -1,605 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <algorithm>
-#include <stdio.h>
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "connectivity/sdbcx/VDescriptor.hxx"
-#include "connectivity/dbexception.hxx"
-#include <comphelper/enumhelper.hxx>
-#include <comphelper/container.hxx>
-#include <comphelper/types.hxx>
-#include <comphelper/property.hxx>
-#include "TConnection.hxx"
-#include <rtl/ustrbuf.hxx>
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-
-using namespace connectivity::sdbcx;
-using namespace connectivity;
-using namespace comphelper;
-using namespace ::cppu;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
-
-namespace
-{
- template < typename T> class OHardRefMap : public connectivity::sdbcx::IObjectCollection
- {
- typedef ::std::multimap< ::rtl::OUString, T , ::comphelper::UStringMixLess> ObjectMap;
- typedef typename ObjectMap::iterator ObjectIter;
- typedef typename ObjectMap::value_type ObjectEntry;
-
- // private:
- // this combination of map and vector is used to have a fast name and index access
- ::std::vector< ObjectIter > m_aElements; // hold the iterators which point to map
- ObjectMap m_aNameMap; // hold the elements and a name
- public:
- OHardRefMap(sal_Bool _bCase)
- : m_aNameMap(_bCase ? true : false)
- {
- }
- virtual ~OHardRefMap()
- {
- }
-
- virtual void reserve(size_t nLength)
- {
- m_aElements.reserve(nLength);
- }
- // -----------------------------------------------------------------------------
- virtual bool exists(const ::rtl::OUString& _sName )
- {
- return m_aNameMap.find(_sName) != m_aNameMap.end();
- }
- // -----------------------------------------------------------------------------
- virtual bool empty()
- {
- return m_aNameMap.empty();
- }
- // -----------------------------------------------------------------------------
- virtual void swapAll()
- {
- ::std::vector< ObjectIter >(m_aElements).swap(m_aElements);
- ObjectMap(m_aNameMap).swap(m_aNameMap);
- }
- // -----------------------------------------------------------------------------
- virtual void swap()
- {
- ::std::vector< ObjectIter >().swap(m_aElements);
-
- OSL_ENSURE( m_aNameMap.empty(), "swap: what did disposeElements do?" );
- ObjectMap( m_aNameMap ).swap( m_aNameMap );
- // Note that it's /important/ to construct the new ObjectMap from m_aNameMap before
- // swapping. This way, it's ensured that the compare object held by these maps is preserved
- // during the swap. If we would not do this, the UStringMixLess instance which is used would be
- // default constructed (instead of being constructed from the same instance in m_aNameMap), and
- // it's case-sensitive flag would have an unpredictable value.
- }
- // -----------------------------------------------------------------------------
- virtual void clear()
- {
- m_aElements.clear();
- m_aNameMap.clear();
- }
- // -----------------------------------------------------------------------------
- virtual void insert(const ::rtl::OUString& _sName,const ObjectType& _xObject)
- {
- m_aElements.push_back(m_aNameMap.insert(m_aNameMap.begin(), ObjectEntry(_sName,_xObject)));
- }
- // -----------------------------------------------------------------------------
- virtual void reFill(const TStringVector &_rVector)
- {
- OSL_ENSURE(!m_aNameMap.size(),"OCollection::reFill: collection isn't empty");
- m_aElements.reserve(_rVector.size());
-
- for(TStringVector::const_iterator i=_rVector.begin(); i != _rVector.end();++i)
- m_aElements.push_back(m_aNameMap.insert(m_aNameMap.begin(), ObjectEntry(*i,ObjectType())));
- }
- // -----------------------------------------------------------------------------
- virtual bool rename(const ::rtl::OUString _sOldName,const ::rtl::OUString _sNewName)
- {
- bool bRet = false;
- ObjectIter aIter = m_aNameMap.find(_sOldName);
- if ( aIter != m_aNameMap.end() )
- {
- typename ::std::vector< ObjectIter >::iterator aFind = ::std::find(m_aElements.begin(),m_aElements.end(),aIter);
- if(m_aElements.end() != aFind)
- {
- (*aFind) = m_aNameMap.insert(m_aNameMap.begin(), ObjectEntry(_sNewName,(*aFind)->second));
- m_aNameMap.erase(aIter);
-
- bRet = true;
- }
- }
- return bRet;
- }
- // -----------------------------------------------------------------------------
- virtual sal_Int32 size()
- {
- return static_cast<sal_Int32>(m_aNameMap.size());
- }
- // -----------------------------------------------------------------------------
- virtual Sequence< ::rtl::OUString > getElementNames()
- {
- Sequence< ::rtl::OUString > aNameList(m_aElements.size());
-
- ::rtl::OUString* pStringArray = aNameList.getArray();
- typename ::std::vector< ObjectIter >::const_iterator aEnd = m_aElements.end();
- for(typename ::std::vector< ObjectIter >::const_iterator aIter = m_aElements.begin(); aIter != aEnd;++aIter,++pStringArray)
- *pStringArray = (*aIter)->first;
-
- return aNameList;
- }
- // -----------------------------------------------------------------------------
- virtual ::rtl::OUString getName(sal_Int32 _nIndex)
- {
- return m_aElements[_nIndex]->first;
- }
- // -----------------------------------------------------------------------------
- virtual void disposeAndErase(sal_Int32 _nIndex)
- {
- OSL_ENSURE(_nIndex >= 0 && _nIndex < static_cast<sal_Int32>(m_aElements.size()),"Illegal argument!");
- Reference<XComponent> xComp(m_aElements[_nIndex]->second.get(),UNO_QUERY);
- ::comphelper::disposeComponent(xComp);
- m_aElements[_nIndex]->second = T();
-
- ::rtl::OUString sName = m_aElements[_nIndex]->first;
- m_aElements.erase(m_aElements.begin()+_nIndex);
- m_aNameMap.erase(sName);
- }
- // -----------------------------------------------------------------------------
- virtual void disposeElements()
- {
- for( ObjectIter aIter = m_aNameMap.begin(); aIter != m_aNameMap.end(); ++aIter)
- {
- Reference<XComponent> xComp(aIter->second.get(),UNO_QUERY);
- if ( xComp.is() )
- {
- ::comphelper::disposeComponent(xComp);
- (*aIter).second = T();
- }
- }
- m_aElements.clear();
- m_aNameMap.clear();
- }
- // -----------------------------------------------------------------------------
- virtual sal_Int32 findColumn( const ::rtl::OUString& columnName )
- {
- ObjectIter aIter = m_aNameMap.find(columnName);
- OSL_ENSURE(aIter != m_aNameMap.end(),"findColumn:: Illegal name!");
- return m_aElements.size() - (m_aElements.end() - ::std::find(m_aElements.begin(),m_aElements.end(),aIter));
- }
- // -----------------------------------------------------------------------------
- virtual ::rtl::OUString findColumnAtIndex( sal_Int32 _nIndex)
- {
- OSL_ENSURE(_nIndex >= 0 && _nIndex < static_cast<sal_Int32>(m_aElements.size()),"Illegal argument!");
- return m_aElements[_nIndex]->first;
- }
- // -----------------------------------------------------------------------------
- virtual ObjectType getObject(sal_Int32 _nIndex)
- {
- OSL_ENSURE(_nIndex >= 0 && _nIndex < static_cast<sal_Int32>(m_aElements.size()),"Illegal argument!");
- return m_aElements[_nIndex]->second;
- }
- // -----------------------------------------------------------------------------
- virtual ObjectType getObject(const ::rtl::OUString& columnName)
- {
- return m_aNameMap.find(columnName)->second;
- }
- // -----------------------------------------------------------------------------
- virtual void setObject(sal_Int32 _nIndex,const ObjectType& _xObject)
- {
- OSL_ENSURE(_nIndex >= 0 && _nIndex < static_cast<sal_Int32>(m_aElements.size()),"Illegal argument!");
- m_aElements[_nIndex]->second = _xObject;
- }
- // -----------------------------------------------------------------------------
- sal_Bool isCaseSensitive() const
- {
- return m_aNameMap.key_comp().isCaseSensitive();
- }
- // -----------------------------------------------------------------------------
- };
-}
-// -----------------------------------------------------------------------------
-
-IMPLEMENT_SERVICE_INFO(OCollection,"com.sun.star.sdbcx.VContainer" , "com.sun.star.sdbcx.Container")
-
-OCollection::OCollection(::cppu::OWeakObject& _rParent
- , sal_Bool _bCase
- , ::osl::Mutex& _rMutex
- , const TStringVector &_rVector
- , sal_Bool _bUseIndexOnly
- , sal_Bool _bUseHardRef)
- :m_aContainerListeners(_rMutex)
- ,m_aRefreshListeners(_rMutex)
- ,m_rParent(_rParent)
- ,m_rMutex(_rMutex)
- ,m_bUseIndexOnly(_bUseIndexOnly)
-{
- if ( _bUseHardRef )
- {
- m_pElements.reset(new OHardRefMap< ObjectType >(_bCase));
- }
- else
- {
- m_pElements.reset(new OHardRefMap< WeakReference< XPropertySet> >(_bCase));
- }
- m_pElements->reFill(_rVector);
-}
-// -------------------------------------------------------------------------
-OCollection::~OCollection()
-{
-}
-// -----------------------------------------------------------------------------
-Any SAL_CALL OCollection::queryInterface( const Type & rType ) throw (RuntimeException)
-{
- if ( m_bUseIndexOnly && rType == ::getCppuType(static_cast< Reference< XNameAccess > *> (NULL)) )
- {
- return Any();
- }
- return OCollectionBase::queryInterface( rType );
-}
-// -----------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OCollection::getTypes() throw (RuntimeException)
-{
- if ( m_bUseIndexOnly )
- {
- Sequence< Type > aTypes(OCollectionBase::getTypes());
- Type* pBegin = aTypes.getArray();
- Type* pEnd = pBegin + aTypes.getLength();
-
- ::std::vector<Type> aOwnTypes;
- aOwnTypes.reserve(aTypes.getLength());
- Type aType = ::getCppuType(static_cast< Reference<XNameAccess> *>(NULL));
- for(;pBegin != pEnd; ++pBegin)
- {
- if ( *pBegin != aType )
- aOwnTypes.push_back(*pBegin);
- }
- Type* pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes,aOwnTypes.size());
- }
- return OCollectionBase::getTypes( );
-}
-// -------------------------------------------------------------------------
-void OCollection::clear_NoDispose()
-{
- ::osl::MutexGuard aGuard(m_rMutex);
-
- m_pElements->clear();
- m_pElements->swapAll();
-}
-
-// -------------------------------------------------------------------------
-void OCollection::disposing(void)
-{
- m_aContainerListeners.disposeAndClear(EventObject(static_cast<XTypeProvider*>(this)));
- m_aRefreshListeners.disposeAndClear(EventObject(static_cast<XTypeProvider*>(this)));
-
- ::osl::MutexGuard aGuard(m_rMutex);
-
- disposeElements();
-
- m_pElements->swap();
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OCollection::getByIndex( sal_Int32 Index ) throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_rMutex);
- if (Index < 0 || Index >= m_pElements->size() )
- throw IndexOutOfBoundsException(::rtl::OUString::valueOf(Index),static_cast<XTypeProvider*>(this));
-
- return makeAny(getObject(Index));
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OCollection::getByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_rMutex);
-
- if ( !m_pElements->exists(aName) )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_NO_ELEMENT_NAME,
- "$name$", aName
- ) );
- throw NoSuchElementException( sError, static_cast< XTypeProvider* >( this ) );
- }
-
- return makeAny(getObject(m_pElements->findColumn(aName)));
-}
-// -------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL OCollection::getElementNames( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_rMutex);
- return m_pElements->getElementNames();
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OCollection::refresh( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_rMutex);
-
- disposeElements();
-
- impl_refresh();
- EventObject aEvt(static_cast<XTypeProvider*>(this));
- m_aRefreshListeners.notifyEach( &XRefreshListener::refreshed, aEvt );
-}
-// -----------------------------------------------------------------------------
-void OCollection::reFill(const TStringVector &_rVector)
-{
- m_pElements->reFill(_rVector);
-}
-// -------------------------------------------------------------------------
-// XDataDescriptorFactory
-Reference< XPropertySet > SAL_CALL OCollection::createDataDescriptor( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_rMutex);
-
- return createDescriptor();
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString OCollection::getNameForObject(const ObjectType& _xObject)
-{
- OSL_ENSURE(_xObject.is(),"OCollection::getNameForObject: Object is NULL!");
- ::rtl::OUString sName;
- _xObject->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sName;
- return sName;
-}
-// -------------------------------------------------------------------------
-// XAppend
-void SAL_CALL OCollection::appendByDescriptor( const Reference< XPropertySet >& descriptor ) throw(SQLException, ElementExistException, RuntimeException)
-{
- ::osl::ClearableMutexGuard aGuard(m_rMutex);
-
- ::rtl::OUString sName = getNameForObject( descriptor );
-
- if ( m_pElements->exists(sName) )
- throw ElementExistException(sName,static_cast<XTypeProvider*>(this));
-
- ObjectType xNewlyCreated = appendObject( sName, descriptor );
- if ( !xNewlyCreated.is() )
- throw RuntimeException();
-
- ODescriptor* pDescriptor = ODescriptor::getImplementation( xNewlyCreated );
- if ( pDescriptor )
- pDescriptor->setNew( sal_False );
-
- sName = getNameForObject( xNewlyCreated );
- if ( !m_pElements->exists( sName ) ) // this may happen when the drived class included it itself
- m_pElements->insert( sName, xNewlyCreated );
-
- // notify our container listeners
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(sName), makeAny(xNewlyCreated), Any());
- aGuard.clear();
- m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvent );
-}
-// -------------------------------------------------------------------------
-// XDrop
-void SAL_CALL OCollection::dropByName( const ::rtl::OUString& elementName ) throw(SQLException, NoSuchElementException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_rMutex);
-
- if ( !m_pElements->exists(elementName) )
- throw NoSuchElementException(elementName,static_cast<XTypeProvider*>(this));
-
- dropImpl(m_pElements->findColumn(elementName));
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OCollection::dropByIndex( sal_Int32 index ) throw(SQLException, IndexOutOfBoundsException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_rMutex);
- if(index <0 || index >= getCount())
- throw IndexOutOfBoundsException(::rtl::OUString::valueOf(index),static_cast<XTypeProvider*>(this));
-
- dropImpl(index);
-}
-// -----------------------------------------------------------------------------
-void OCollection::dropImpl(sal_Int32 _nIndex,sal_Bool _bReallyDrop)
-{
- ::rtl::OUString elementName = m_pElements->getName(_nIndex);
-
- if ( _bReallyDrop )
- dropObject(_nIndex,elementName);
-
- m_pElements->disposeAndErase(_nIndex);
-
- // notify our container listeners
- notifyElementRemoved(elementName);
-}
-// -----------------------------------------------------------------------------
-void OCollection::notifyElementRemoved(const ::rtl::OUString& _sName)
-{
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_sName), Any(), Any());
- // note that xExistent may be empty, in case somebody removed the data source while it is not alive at this moment
- OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
- while (aListenerLoop.hasMoreElements())
- static_cast<XContainerListener*>(aListenerLoop.next())->elementRemoved(aEvent);
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OCollection::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
-{
- if ( !m_pElements->exists(columnName) )
- {
- ::connectivity::SharedResources aResources;
- const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
- STR_UNKNOWN_COLUMN_NAME,
- "$columnname$", columnName
- ) );
- ::dbtools::throwGenericSQLException(sError,static_cast< XIndexAccess*>(this));
- }
-
- return m_pElements->findColumn(columnName) + 1; // because columns start at one
-}
-// -------------------------------------------------------------------------
-Reference< XEnumeration > SAL_CALL OCollection::createEnumeration( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_rMutex);
- return new OEnumerationByIndex( static_cast< XIndexAccess*>(this));
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OCollection::addContainerListener( const Reference< XContainerListener >& _rxListener ) throw(RuntimeException)
-{
- m_aContainerListeners.addInterface(_rxListener);
-}
-
-//------------------------------------------------------------------------------
-void SAL_CALL OCollection::removeContainerListener( const Reference< XContainerListener >& _rxListener ) throw(RuntimeException)
-{
- m_aContainerListeners.removeInterface(_rxListener);
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OCollection::acquire() throw()
-{
- m_rParent.acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OCollection::release() throw()
-{
- m_rParent.release();
-}
-// -----------------------------------------------------------------------------
-Type SAL_CALL OCollection::getElementType( ) throw(RuntimeException)
-{
- return::getCppuType(static_cast< Reference< XPropertySet>*>(NULL));
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OCollection::hasElements( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_rMutex);
- return !m_pElements->empty();
-}
-// -----------------------------------------------------------------------------
-sal_Int32 SAL_CALL OCollection::getCount( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_rMutex);
- return m_pElements->size();
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OCollection::hasByName( const ::rtl::OUString& aName ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_rMutex);
- return m_pElements->exists(aName);
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OCollection::addRefreshListener( const Reference< XRefreshListener >& l ) throw(RuntimeException)
-{
- m_aRefreshListeners.addInterface(l);
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OCollection::removeRefreshListener( const Reference< XRefreshListener >& l ) throw(RuntimeException)
-{
- m_aRefreshListeners.removeInterface(l);
-}
-// -----------------------------------------------------------------------------
-void OCollection::insertElement(const ::rtl::OUString& _sElementName,const ObjectType& _xElement)
-{
- OSL_ENSURE(!m_pElements->exists(_sElementName),"Element already exists");
- if ( !m_pElements->exists(_sElementName) )
- m_pElements->insert(_sElementName,_xElement);
-}
-// -----------------------------------------------------------------------------
-void OCollection::renameObject(const ::rtl::OUString _sOldName,const ::rtl::OUString _sNewName)
-{
- OSL_ENSURE(m_pElements->exists(_sOldName),"Element doesn't exist");
- OSL_ENSURE(!m_pElements->exists(_sNewName),"Element already exists");
- OSL_ENSURE(_sNewName.getLength(),"New name must not be empty!");
- OSL_ENSURE(_sOldName.getLength(),"New name must not be empty!");
-
- if ( m_pElements->rename(_sOldName,_sNewName) )
- {
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_sNewName), makeAny(m_pElements->getObject(_sNewName)),makeAny(_sOldName));
- // note that xExistent may be empty, in case somebody removed the data source while it is not alive at this moment
- OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
- while (aListenerLoop.hasMoreElements())
- static_cast<XContainerListener*>(aListenerLoop.next())->elementReplaced(aEvent);
- }
-}
-// -----------------------------------------------------------------------------
-ObjectType OCollection::getObject(sal_Int32 _nIndex)
-{
- ObjectType xName = m_pElements->getObject(_nIndex);
- if ( !xName.is() )
- {
- try
- {
- xName = createObject(m_pElements->getName(_nIndex));
- }
- catch(const SQLException& e)
- {
- try
- {
- dropImpl(_nIndex,sal_False);
- }
- catch(const Exception& )
- {
- }
- throw WrappedTargetException(e.Message,static_cast<XTypeProvider*>(this),makeAny(e));
- }
- m_pElements->setObject(_nIndex,xName);
- }
- return xName;
-}
-// -----------------------------------------------------------------------------
-void OCollection::disposeElements()
-{
- m_pElements->disposeElements();
-}
-// -----------------------------------------------------------------------------
-Reference< XPropertySet > OCollection::createDescriptor()
-{
- OSL_ASSERT(!"Need to be overloaded when used!");
- throw SQLException();
-}
-// -----------------------------------------------------------------------------
-ObjectType OCollection::cloneDescriptor( const ObjectType& _descriptor )
-{
- ObjectType xNewDescriptor( createDescriptor() );
- ::comphelper::copyProperties( _descriptor, xNewDescriptor );
- return xNewDescriptor;
-}
-// -----------------------------------------------------------------------------
-ObjectType OCollection::appendObject( const ::rtl::OUString& /*_rForName*/, const Reference< XPropertySet >& descriptor )
-{
- return cloneDescriptor( descriptor );
-}
-// -----------------------------------------------------------------------------
-void OCollection::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString /*_sElementName*/)
-{
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/VColumn.cxx b/connectivity/source/sdbcx/VColumn.cxx
deleted file mode 100644
index f040832cbf..0000000000
--- a/connectivity/source/sdbcx/VColumn.cxx
+++ /dev/null
@@ -1,231 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/sequence.hxx>
-#include "TConnection.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-// -------------------------------------------------------------------------
-using namespace connectivity;
-using namespace connectivity::sdbcx;
-using namespace cppu;
-using namespace connectivity;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sdbc;
-
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OColumn::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException)
-{
- if(isNew())
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.VColumnDescription"));
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.VColumn"));
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OColumn::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1);
- if(isNew())
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.ColumnDescription"));
- else
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Column"));
-
- return aSupported;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OColumn::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-// -------------------------------------------------------------------------
-OColumn::OColumn(sal_Bool _bCase)
- :OColumnDescriptor_BASE(m_aMutex)
- ,ODescriptor(OColumnDescriptor_BASE::rBHelper,_bCase,sal_True)
- ,m_IsNullable(ColumnValue::NULLABLE)
- ,m_Precision(0)
- ,m_Scale(0)
- ,m_Type(0)
- ,m_IsAutoIncrement(sal_False)
- ,m_IsRowVersion(sal_False)
- ,m_IsCurrency(sal_False)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-OColumn::OColumn( const ::rtl::OUString& _Name,
- const ::rtl::OUString& _TypeName,
- const ::rtl::OUString& _DefaultValue,
- const ::rtl::OUString& _Description,
- sal_Int32 _IsNullable,
- sal_Int32 _Precision,
- sal_Int32 _Scale,
- sal_Int32 _Type,
- sal_Bool _IsAutoIncrement,
- sal_Bool _IsRowVersion,
- sal_Bool _IsCurrency,
- sal_Bool _bCase)
- :OColumnDescriptor_BASE(m_aMutex)
- ,ODescriptor(OColumnDescriptor_BASE::rBHelper,_bCase)
- ,m_TypeName(_TypeName)
- ,m_Description(_Description)
- ,m_DefaultValue(_DefaultValue)
- ,m_IsNullable(_IsNullable)
- ,m_Precision(_Precision)
- ,m_Scale(_Scale)
- ,m_Type(_Type)
- ,m_IsAutoIncrement(_IsAutoIncrement)
- ,m_IsRowVersion(_IsRowVersion)
- ,m_IsCurrency(_IsCurrency)
-{
- m_Name = _Name;
-
- construct();
-}
-// -------------------------------------------------------------------------
-OColumn::~OColumn()
-{
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OColumn::createArrayHelper( sal_Int32 /*_nId*/ ) const
-{
- return doCreateArrayHelper();
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper& SAL_CALL OColumn::getInfoHelper()
-{
- return *OColumn_PROP::getArrayHelper(isNew() ? 1 : 0);
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OColumn::acquire() throw()
-{
- OColumnDescriptor_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OColumn::release() throw()
-{
- OColumnDescriptor_BASE::release();
-}
-// -----------------------------------------------------------------------------
-Any SAL_CALL OColumn::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ODescriptor::queryInterface( rType);
- if(!aRet.hasValue())
- {
- if(!isNew())
- aRet = OColumn_BASE::queryInterface(rType);
- if(!aRet.hasValue())
- aRet = OColumnDescriptor_BASE::queryInterface( rType);
- }
- return aRet;
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OColumn::getTypes( ) throw(RuntimeException)
-{
- if(isNew())
- return ::comphelper::concatSequences(ODescriptor::getTypes(),OColumnDescriptor_BASE::getTypes());
-
- return ::comphelper::concatSequences(ODescriptor::getTypes(),OColumn_BASE::getTypes(),OColumnDescriptor_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-void OColumn::construct()
-{
- ODescriptor::construct();
-
- sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY;
-
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME), PROPERTY_ID_TYPENAME, nAttrib,&m_TypeName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION), PROPERTY_ID_DESCRIPTION, nAttrib,&m_Description, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE), PROPERTY_ID_DEFAULTVALUE, nAttrib,&m_DefaultValue, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION), PROPERTY_ID_PRECISION, nAttrib,&m_Precision, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE), PROPERTY_ID_TYPE, nAttrib,&m_Type, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE), PROPERTY_ID_SCALE, nAttrib,&m_Scale, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE), PROPERTY_ID_ISNULLABLE, nAttrib,&m_IsNullable, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT), PROPERTY_ID_ISAUTOINCREMENT, nAttrib,&m_IsAutoIncrement, ::getBooleanCppuType());
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISROWVERSION), PROPERTY_ID_ISROWVERSION, nAttrib,&m_IsRowVersion, ::getBooleanCppuType());
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY), PROPERTY_ID_ISCURRENCY, nAttrib,&m_IsCurrency, ::getBooleanCppuType());
-}
-// -------------------------------------------------------------------------
-void OColumn::disposing(void)
-{
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OColumnDescriptor_BASE::rBHelper.bDisposed);
-
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > SAL_CALL OColumn::createDataDescriptor( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OColumnDescriptor_BASE::rBHelper.bDisposed);
-
-
- OColumn* pNewColumn = new OColumn( m_Name,
- m_TypeName,
- m_DefaultValue,
- m_Description,
- m_IsNullable,
- m_Precision,
- m_Scale,
- m_Type,
- m_IsAutoIncrement,
- m_IsRowVersion,
- m_IsCurrency,
- isCaseSensitive());
- pNewColumn->setNew(sal_True);
- return pNewColumn;
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OColumn::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-// XNamed
-::rtl::OUString SAL_CALL OColumn::getName( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return m_Name;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OColumn::setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException)
-{
- m_Name = aName;
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/VDescriptor.cxx b/connectivity/source/sdbcx/VDescriptor.cxx
deleted file mode 100644
index 4f4b29bfae..0000000000
--- a/connectivity/source/sdbcx/VDescriptor.cxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <connectivity/sdbcx/VDescriptor.hxx>
-#include <cppuhelper/queryinterface.hxx>
-
-#include <functional>
-#include <algorithm>
-
-namespace connectivity
-{
- namespace sdbcx
- {
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::beans;
-
- // =========================================================================
- // = ODescriptor
- // =========================================================================
- // -------------------------------------------------------------------------
- ODescriptor::ODescriptor(::cppu::OBroadcastHelper& _rBHelper,sal_Bool _bCase, sal_Bool _bNew)
- :ODescriptor_PBASE(_rBHelper)
- ,m_aCase(_bCase)
- ,m_bNew(_bNew)
- {
- }
-
- // -------------------------------------------------------------------------
- // com::sun::star::lang::XUnoTunnel
- sal_Int64 SAL_CALL ODescriptor::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException)
- {
- return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- ? reinterpret_cast< sal_Int64 >( this )
- : 0;
- }
-
- // -----------------------------------------------------------------------------
- ODescriptor* ODescriptor::getImplementation( const Reference< XInterface >& _rxSomeComp )
- {
- Reference< XUnoTunnel > xTunnel( _rxSomeComp, UNO_QUERY );
- if ( xTunnel.is() )
- return reinterpret_cast< ODescriptor* >( xTunnel->getSomething( getUnoTunnelImplementationId() ) );
- return NULL;
- }
-
- // -----------------------------------------------------------------------------
- namespace
- {
- struct ResetROAttribute : public ::std::unary_function< Property, void >
- {
- void operator ()( Property& _rProperty ) const
- {
- _rProperty.Attributes &= ~PropertyAttribute::READONLY;
- }
- };
- struct SetROAttribute : public ::std::unary_function< Property, void >
- {
- void operator ()( Property& _rProperty ) const
- {
- _rProperty.Attributes |= PropertyAttribute::READONLY;
- }
- };
- }
-
- // -----------------------------------------------------------------------------
- ::cppu::IPropertyArrayHelper* ODescriptor::doCreateArrayHelper() const
- {
- Sequence< Property > aProperties;
- describeProperties( aProperties );
-
- if ( isNew() )
- ::std::for_each( aProperties.getArray(), aProperties.getArray() + aProperties.getLength(), ResetROAttribute() );
- else
- ::std::for_each( aProperties.getArray(), aProperties.getArray() + aProperties.getLength(), SetROAttribute() );
-
- return new ::cppu::OPropertyArrayHelper( aProperties );
- }
-
- // -----------------------------------------------------------------------------
- sal_Bool ODescriptor::isNew( const Reference< XInterface >& _rxDescriptor )
- {
- ODescriptor* pImplementation = getImplementation( _rxDescriptor );
- return pImplementation != NULL ? pImplementation->isNew() : sal_False;
- }
-
- // -----------------------------------------------------------------------------
- Sequence< sal_Int8 > ODescriptor::getUnoTunnelImplementationId()
- {
- static ::cppu::OImplementationId * pId = 0;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
- }
-
- // -----------------------------------------------------------------------------
- Any SAL_CALL ODescriptor::queryInterface( const Type & rType ) throw(RuntimeException)
- {
- Any aRet = ::cppu::queryInterface(rType,static_cast< XUnoTunnel*> (this));
- return aRet.hasValue() ? aRet : ODescriptor_PBASE::queryInterface(rType);
- }
-
- // -----------------------------------------------------------------------------
- void ODescriptor::setNew(sal_Bool _bNew)
- {
- m_bNew = _bNew;
- }
-
- // -----------------------------------------------------------------------------
- Sequence< Type > SAL_CALL ODescriptor::getTypes( ) throw(RuntimeException)
- {
- ::cppu::OTypeCollection aTypes( ::getCppuType( (const Reference< XMultiPropertySet > *)0 ),
- ::getCppuType( (const Reference< XFastPropertySet > *)0 ),
- ::getCppuType( (const Reference< XPropertySet > *)0 ),
- ::getCppuType( (const Reference< XUnoTunnel > *)0 ));
- return aTypes.getTypes();
- }
-
- }
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/VGroup.cxx b/connectivity/source/sdbcx/VGroup.cxx
deleted file mode 100644
index 6ed9588ca9..0000000000
--- a/connectivity/source/sdbcx/VGroup.cxx
+++ /dev/null
@@ -1,185 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include "connectivity/sdbcx/VGroup.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbcx/PrivilegeObject.hpp>
-#include <comphelper/sequence.hxx>
-#include <connectivity/dbexception.hxx>
-
-// -------------------------------------------------------------------------
-using namespace ::connectivity::sdbcx;
-using namespace ::connectivity;
-using namespace ::dbtools;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-
-IMPLEMENT_SERVICE_INFO(OGroup,"com.sun.star.sdbcx.VGroup","com.sun.star.sdbcx.Group");
-// -------------------------------------------------------------------------
-OGroup::OGroup(sal_Bool _bCase) : OGroup_BASE(m_aMutex)
- , ODescriptor(OGroup_BASE::rBHelper,_bCase)
- , m_pUsers(NULL)
-{
-}
-// -------------------------------------------------------------------------
-OGroup::OGroup(const ::rtl::OUString& _Name,sal_Bool _bCase) : OGroup_BASE(m_aMutex)
- ,ODescriptor(OGroup_BASE::rBHelper,_bCase)
- ,m_pUsers(NULL)
-{
- m_Name = _Name;
-}
-// -------------------------------------------------------------------------
-OGroup::~OGroup()
-{
- delete m_pUsers;
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OGroup::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ODescriptor::queryInterface( rType);
- return aRet.hasValue() ? aRet : OGroup_BASE::queryInterface( rType);
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OGroup::getTypes( ) throw(RuntimeException)
-{
- return ::comphelper::concatSequences(ODescriptor::getTypes(),OGroup_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-void OGroup::disposing(void)
-{
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
-
- if(m_pUsers)
- m_pUsers->disposing();
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OGroup::createArrayHelper( ) const
-{
- Sequence< Property > aProps;
- describeProperties(aProps);
- return new ::cppu::OPropertyArrayHelper(aProps);
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OGroup::getInfoHelper()
-{
- return *const_cast<OGroup*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-Reference< XNameAccess > SAL_CALL OGroup::getUsers( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OGroup_BASE::rBHelper.bDisposed);
-
- try
- {
- if ( !m_pUsers )
- refreshUsers();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return const_cast<OGroup*>(this)->m_pUsers;
-}
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OGroup::getPrivileges( const ::rtl::OUString& /*objName*/, sal_Int32 /*objType*/ ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OGroup_BASE::rBHelper.bDisposed);
-
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OGroup::getGrantablePrivileges( const ::rtl::OUString& /*objName*/, sal_Int32 /*objType*/ ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OGroup_BASE::rBHelper.bDisposed);
-
- return 0;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OGroup::grantPrivileges( const ::rtl::OUString& /*objName*/, sal_Int32 /*objType*/, sal_Int32 /*objPrivileges*/ ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OGroup_BASE::rBHelper.bDisposed);
- throwFeatureNotImplementedException( "XAuthorizable::grantPrivileges", *this );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OGroup::revokePrivileges( const ::rtl::OUString& /*objName*/, sal_Int32 /*objType*/, sal_Int32 /*objPrivileges*/ ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OGroup_BASE::rBHelper.bDisposed);
- throwFeatureNotImplementedException( "XAuthorizable::revokePrivileges", *this );
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OGroup::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OGroup::getName( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return m_Name;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OGroup::setName( const ::rtl::OUString& /*aName*/ ) throw(::com::sun::star::uno::RuntimeException)
-{
- throwFeatureNotImplementedException( "XNamed::setName", *this );
-}
-// -----------------------------------------------------------------------------
-// XInterface
-void SAL_CALL OGroup::acquire() throw()
-{
- OGroup_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OGroup::release() throw()
-{
- OGroup_BASE::release();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/VIndex.cxx b/connectivity/source/sdbcx/VIndex.cxx
deleted file mode 100644
index 18e3b78a77..0000000000
--- a/connectivity/source/sdbcx/VIndex.cxx
+++ /dev/null
@@ -1,225 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/sdbcx/VIndex.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/sdbcx/VColumn.hxx"
-#include <connectivity/dbexception.hxx>
-#include <comphelper/sequence.hxx>
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "TConnection.hxx"
-// -------------------------------------------------------------------------
-using namespace ::connectivity;
-using namespace ::connectivity;
-using namespace ::dbtools;
-using namespace ::connectivity::sdbcx;
-using namespace ::cppu;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OIndex::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException)
-{
- if(isNew())
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.VIndexDescriptor"));
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.VIndex"));
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OIndex::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1);
- if(isNew())
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.IndexDescriptor"));
- else
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Index"));
-
- return aSupported;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OIndex::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-// -------------------------------------------------------------------------
-OIndex::OIndex(sal_Bool _bCase) : ODescriptor_BASE(m_aMutex)
- , ODescriptor(ODescriptor_BASE::rBHelper,_bCase,sal_True)
- ,m_IsUnique(sal_False)
- ,m_IsPrimaryKeyIndex(sal_False)
- ,m_IsClustered(sal_False)
- ,m_pColumns(NULL)
-{
-}
-// -------------------------------------------------------------------------
-OIndex::OIndex( const ::rtl::OUString& _Name,
- const ::rtl::OUString& _Catalog,
- sal_Bool _isUnique,
- sal_Bool _isPrimaryKeyIndex,
- sal_Bool _isClustered,
- sal_Bool _bCase) : ODescriptor_BASE(m_aMutex)
- ,ODescriptor(ODescriptor_BASE::rBHelper,_bCase)
- ,m_Catalog(_Catalog)
- ,m_IsUnique(_isUnique)
- ,m_IsPrimaryKeyIndex(_isPrimaryKeyIndex)
- ,m_IsClustered(_isClustered)
- ,m_pColumns(NULL)
-{
- m_Name = _Name;
-}
-// -------------------------------------------------------------------------
-OIndex::~OIndex( )
-{
- delete m_pColumns;
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OIndex::createArrayHelper( sal_Int32 /*_nId*/ ) const
-{
- return doCreateArrayHelper();
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper& SAL_CALL OIndex::getInfoHelper()
-{
- return *OIndex_PROP::getArrayHelper(isNew() ? 1 : 0);
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OIndex::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ODescriptor::queryInterface( rType);
- if(!aRet.hasValue())
- {
- if(!isNew())
- aRet = OIndex_BASE::queryInterface(rType);
- if(!aRet.hasValue())
- aRet = ODescriptor_BASE::queryInterface( rType);
- }
- return aRet;
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OIndex::getTypes( ) throw(RuntimeException)
-{
- if(isNew())
- return ::comphelper::concatSequences(ODescriptor::getTypes(),ODescriptor_BASE::getTypes());
- return ::comphelper::concatSequences(ODescriptor::getTypes(),ODescriptor_BASE::getTypes(),OIndex_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-void OIndex::construct()
-{
- ODescriptor::construct();
-
- sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY;
-
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_CATALOG), PROPERTY_ID_CATALOG, nAttrib,&m_Catalog, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE), PROPERTY_ID_ISUNIQUE, nAttrib,&m_IsUnique, ::getBooleanCppuType());
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISPRIMARYKEYINDEX),PROPERTY_ID_ISPRIMARYKEYINDEX, nAttrib,&m_IsPrimaryKeyIndex, ::getBooleanCppuType());
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCLUSTERED), PROPERTY_ID_ISCLUSTERED, nAttrib,&m_IsClustered, ::getBooleanCppuType());
-}
-// -------------------------------------------------------------------------
-void OIndex::disposing(void)
-{
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
-
- if(m_pColumns)
- m_pColumns->disposing();
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OIndex::getColumns( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(ODescriptor_BASE::rBHelper.bDisposed);
-
- try
- {
- if ( !m_pColumns )
- refreshColumns();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- OSL_FAIL( "OIndex::getColumns: caught an exception!" );
- }
-
- return const_cast<OIndex*>(this)->m_pColumns;
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > SAL_CALL OIndex::createDataDescriptor( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(ODescriptor_BASE::rBHelper.bDisposed);
-
-
- return this;
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OIndex::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OIndex::getName( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return m_Name;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OIndex::setName( const ::rtl::OUString& /*aName*/ ) throw(::com::sun::star::uno::RuntimeException)
-{
-}
-// -----------------------------------------------------------------------------
-// XInterface
-void SAL_CALL OIndex::acquire() throw()
-{
- ODescriptor_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OIndex::release() throw()
-{
- ODescriptor_BASE::release();
-}
-// -----------------------------------------------------------------------------
-void OIndex::refreshColumns()
-{
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/VIndexColumn.cxx b/connectivity/source/sdbcx/VIndexColumn.cxx
deleted file mode 100644
index bc5859c8bc..0000000000
--- a/connectivity/source/sdbcx/VIndexColumn.cxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/sdbcx/VIndexColumn.hxx"
-#include "TConnection.hxx"
-
-using namespace connectivity;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OIndexColumn::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException)
-{
- if(isNew())
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.VIndexColumnDescription"));
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.VIndex"));
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OIndexColumn::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1);
- if(isNew())
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.IndexDescription"));
- else
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Index"));
-
- return aSupported;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OIndexColumn::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-// -----------------------------------------------------------------------------
-OIndexColumn::OIndexColumn(sal_Bool _bCase) : OColumn(_bCase), m_IsAscending(sal_True)
-{
- construct();
-}
-
-// -------------------------------------------------------------------------
-OIndexColumn::OIndexColumn( sal_Bool _IsAscending,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _TypeName,
- const ::rtl::OUString& _DefaultValue,
- sal_Int32 _IsNullable,
- sal_Int32 _Precision,
- sal_Int32 _Scale,
- sal_Int32 _Type,
- sal_Bool _IsAutoIncrement,
- sal_Bool _IsRowVersion,
- sal_Bool _IsCurrency,
- sal_Bool _bCase
- ) : OColumn(_Name,
- _TypeName,
- _DefaultValue,
- ::rtl::OUString(),
- _IsNullable,
- _Precision,
- _Scale,
- _Type,
- _IsAutoIncrement,
- _IsRowVersion,
- _IsCurrency,
- _bCase)
- , m_IsAscending(_IsAscending)
-{
- construct();
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OIndexColumn::createArrayHelper( sal_Int32 /*_nId*/ ) const
-{
- return doCreateArrayHelper();
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper& SAL_CALL OIndexColumn::getInfoHelper()
-{
- return *OIndexColumn_PROP::getArrayHelper(isNew() ? 1 : 0);
-}
-// -------------------------------------------------------------------------
-void OIndexColumn::construct()
-{
- sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY;
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISASCENDING), PROPERTY_ID_ISASCENDING, nAttrib,&m_IsAscending, ::getBooleanCppuType());
-}
-// -----------------------------------------------------------------------------
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/VKey.cxx b/connectivity/source/sdbcx/VKey.cxx
deleted file mode 100644
index 7b3cba8d4f..0000000000
--- a/connectivity/source/sdbcx/VKey.cxx
+++ /dev/null
@@ -1,230 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include "connectivity/sdbcx/VKey.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <comphelper/sequence.hxx>
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "TConnection.hxx"
-// -------------------------------------------------------------------------
-using namespace connectivity;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OKey::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException)
-{
- if(isNew())
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.VKeyDescription"));
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.VKey"));
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OKey::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1);
- if(isNew())
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.KeyDescription"));
- else
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Key"));
-
- return aSupported;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OKey::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-// -------------------------------------------------------------------------
-OKey::OKey(sal_Bool _bCase) : ODescriptor_BASE(m_aMutex)
- , ODescriptor(ODescriptor_BASE::rBHelper,_bCase,sal_True)
- , m_aProps(new KeyProperties())
- , m_pColumns(NULL)
-{
-}
-// -------------------------------------------------------------------------
-OKey::OKey(const ::rtl::OUString& _Name,const TKeyProperties& _rProps,sal_Bool _bCase)
-: ODescriptor_BASE(m_aMutex)
- ,ODescriptor(ODescriptor_BASE::rBHelper,_bCase)
- ,m_aProps(_rProps)
- ,m_pColumns(NULL)
-{
- m_Name = _Name;
-}
-//OKey::OKey( const ::rtl::OUString& _Name,
-// const ::rtl::OUString& _ReferencedTable,
-// sal_Int32 _Type,
-// sal_Int32 _UpdateRule,
-// sal_Int32 _DeleteRule,
-// sal_Bool _bCase) : ODescriptor_BASE(m_aMutex)
-// ,ODescriptor(ODescriptor_BASE::rBHelper,_bCase)
-// ,m_ReferencedTable(_ReferencedTable)
-// ,m_Type(_Type)
-// ,m_UpdateRule(_UpdateRule)
-// ,m_DeleteRule(_DeleteRule)
-// ,m_pColumns(NULL)
-//{
-// m_Name = _Name;
-//}
-// -------------------------------------------------------------------------
-OKey::~OKey( )
-{
- delete m_pColumns;
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OKey::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ODescriptor::queryInterface( rType);
- if(!aRet.hasValue())
- {
- if(!isNew())
- aRet = OKey_BASE::queryInterface(rType);
- if(!aRet.hasValue())
- aRet = ODescriptor_BASE::queryInterface( rType);
- }
-
- return aRet;
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OKey::getTypes( ) throw(RuntimeException)
-{
- if(isNew())
- return ::comphelper::concatSequences(ODescriptor::getTypes(),ODescriptor_BASE::getTypes());
-
- return ::comphelper::concatSequences(ODescriptor::getTypes(),ODescriptor_BASE::getTypes(),OKey_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-void OKey::construct()
-{
- ODescriptor::construct();
-
- sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY;
-
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REFERENCEDTABLE), PROPERTY_ID_REFERENCEDTABLE, nAttrib,&m_aProps->m_ReferencedTable, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE), PROPERTY_ID_TYPE, nAttrib,&m_aProps->m_Type, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_UPDATERULE), PROPERTY_ID_UPDATERULE, nAttrib,&m_aProps->m_UpdateRule, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELETERULE), PROPERTY_ID_DELETERULE, nAttrib,&m_aProps->m_DeleteRule, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL)));
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OKey::disposing()
-{
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
-
- if(m_pColumns)
- m_pColumns->disposing();
-
- ODescriptor_BASE::disposing();
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OKey::createArrayHelper( sal_Int32 /*_nId*/ ) const
-{
- return doCreateArrayHelper();
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OKey::getInfoHelper()
-{
- return *const_cast<OKey*>(this)->getArrayHelper(isNew() ? 1 : 0);
-}
-// -------------------------------------------------------------------------
-Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OKey::getColumns( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(ODescriptor_BASE::rBHelper.bDisposed);
-
- try
- {
- if ( !m_pColumns )
- refreshColumns();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return const_cast<OKey*>(this)->m_pColumns;
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > SAL_CALL OKey::createDataDescriptor( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(ODescriptor_BASE::rBHelper.bDisposed);
-
-
- return this;
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OKey::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OKey::getName( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return m_Name;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OKey::setName( const ::rtl::OUString& /*aName*/ ) throw(::com::sun::star::uno::RuntimeException)
-{
-}
-// -----------------------------------------------------------------------------
-// XInterface
-void SAL_CALL OKey::acquire() throw()
-{
- ODescriptor_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OKey::release() throw()
-{
- ODescriptor_BASE::release();
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/VKeyColumn.cxx b/connectivity/source/sdbcx/VKeyColumn.cxx
deleted file mode 100644
index 89d079a0b5..0000000000
--- a/connectivity/source/sdbcx/VKeyColumn.cxx
+++ /dev/null
@@ -1,127 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/sdbcx/VKeyColumn.hxx"
-#include "TConnection.hxx"
-
-using namespace connectivity;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace cppu;
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OKeyColumn::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException)
-{
- if(isNew())
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.VKeyColumnDescription"));
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.VKeyColumn"));
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OKeyColumn::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1);
- if(isNew())
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.KeyColumnDescription"));
- else
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.KeyColumn"));
-
- return aSupported;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OKeyColumn::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-// -------------------------------------------------------------------------
-OKeyColumn::OKeyColumn(sal_Bool _bCase) : OColumn(_bCase)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-OKeyColumn::OKeyColumn( const ::rtl::OUString& _ReferencedColumn,
- const ::rtl::OUString& _Name,
- const ::rtl::OUString& _TypeName,
- const ::rtl::OUString& _DefaultValue,
- sal_Int32 _IsNullable,
- sal_Int32 _Precision,
- sal_Int32 _Scale,
- sal_Int32 _Type,
- sal_Bool _IsAutoIncrement,
- sal_Bool _IsRowVersion,
- sal_Bool _IsCurrency,
- sal_Bool _bCase
- ) : OColumn(_Name,
- _TypeName,
- _DefaultValue,
- ::rtl::OUString(),
- _IsNullable,
- _Precision,
- _Scale,
- _Type,
- _IsAutoIncrement,
- _IsRowVersion,
- _IsCurrency,
- _bCase)
- , m_ReferencedColumn(_ReferencedColumn)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-OKeyColumn::~OKeyColumn()
-{
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OKeyColumn::createArrayHelper( sal_Int32 /*_nId*/ ) const
-{
- return doCreateArrayHelper();
-}
-// -----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper& SAL_CALL OKeyColumn::getInfoHelper()
-{
- return *OKeyColumn_PROP::getArrayHelper(isNew() ? 1 : 0);
-}
-// -------------------------------------------------------------------------
-void OKeyColumn::construct()
-{
- sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY;
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RELATEDCOLUMN), PROPERTY_ID_RELATEDCOLUMN, nAttrib,&m_ReferencedColumn, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
-}
-// -----------------------------------------------------------------------------
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/VTable.cxx b/connectivity/source/sdbcx/VTable.cxx
deleted file mode 100644
index 315e21b517..0000000000
--- a/connectivity/source/sdbcx/VTable.cxx
+++ /dev/null
@@ -1,339 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/sdbcx/VTable.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/sdbcx/VIndex.hxx"
-#include <comphelper/sequence.hxx>
-#include "connectivity/sdbcx/VCollection.hxx"
-#include "TConnection.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-#include "connectivity/sdbcx/VKey.hxx"
-#include "connectivity/dbtools.hxx"
-#include <connectivity/dbexception.hxx>
-
-// -------------------------------------------------------------------------
-using namespace ::connectivity;
-using namespace ::connectivity::sdbcx;
-using namespace ::dbtools;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OTable::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException)
-{
- if(isNew())
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.VTableDescriptor"));
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Table"));
-}
-
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OTable::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1);
- if(isNew())
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.TableDescriptor"));
- else
- aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbcx.Table"));
-
- return aSupported;
-}
-// -----------------------------------------------------------------------------
-sal_Bool SAL_CALL OTable::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException)
-{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
-}
-// -------------------------------------------------------------------------
-OTable::OTable(OCollection* _pTables,
- sal_Bool _bCase)
- : OTableDescriptor_BASE(m_aMutex)
- ,ODescriptor(OTableDescriptor_BASE::rBHelper,_bCase,sal_True)
- ,m_pKeys(NULL)
- ,m_pColumns(NULL)
- ,m_pIndexes(NULL)
- ,m_pTables(_pTables)
-{
-}
-// -----------------------------------------------------------------------------
-OTable::OTable( OCollection* _pTables,
- sal_Bool _bCase,
- const ::rtl::OUString& _Name, const ::rtl::OUString& _Type,
- const ::rtl::OUString& _Description,const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName) : OTableDescriptor_BASE(m_aMutex)
- ,ODescriptor(OTableDescriptor_BASE::rBHelper,_bCase)
- ,m_CatalogName(_CatalogName)
- ,m_SchemaName(_SchemaName)
- ,m_Description(_Description)
- ,m_Type(_Type)
- ,m_pKeys(NULL)
- ,m_pColumns(NULL)
- ,m_pIndexes(NULL)
- ,m_pTables(_pTables)
-{
- m_Name = _Name;
-}
-// -------------------------------------------------------------------------
-OTable::~OTable()
-{
- delete m_pKeys;
- delete m_pColumns;
- delete m_pIndexes;
-}
-// -------------------------------------------------------------------------
-void OTable::construct()
-{
- ODescriptor::construct();
-
- sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY;
-
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_CATALOGNAME), PROPERTY_ID_CATALOGNAME,nAttrib,&m_CatalogName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCHEMANAME), PROPERTY_ID_SCHEMANAME, nAttrib,&m_SchemaName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION), PROPERTY_ID_DESCRIPTION,nAttrib,&m_Description, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE), PROPERTY_ID_TYPE, nAttrib,&m_Type, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OTable::acquire() throw()
-{
- OTableDescriptor_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OTable::release() throw()
-{
- OTableDescriptor_BASE::release();
-}
-
-// -------------------------------------------------------------------------
-Any SAL_CALL OTable::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ODescriptor::queryInterface( rType);
- if(!aRet.hasValue())
- {
- if(!isNew())
- aRet = OTable_BASE::queryInterface( rType);
- if(isNew() && (rType == getCppuType( (Reference<XIndexesSupplier>*)0)))
- return Any();
- if(!aRet.hasValue())
- aRet = OTableDescriptor_BASE::queryInterface( rType);
- }
- return aRet;
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OTable::getTypes( ) throw(RuntimeException)
-{
- if(isNew())
- return ::comphelper::concatSequences(ODescriptor::getTypes(),OTableDescriptor_BASE::getTypes());
- return ::comphelper::concatSequences(ODescriptor::getTypes(),OTableDescriptor_BASE::getTypes(),OTable_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OTable::disposing(void)
-{
- ODescriptor::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
-
- if(m_pKeys)
- m_pKeys->disposing();
- if(m_pColumns)
- m_pColumns->disposing();
- if(m_pIndexes)
- m_pIndexes->disposing();
-
- m_pTables = NULL;
-}
-// -----------------------------------------------------------------------------
-// XColumnsSupplier
-Reference< XNameAccess > SAL_CALL OTable::getColumns( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
-
- try
- {
- if ( !m_pColumns )
- refreshColumns();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return m_pColumns;
-}
-
-// -------------------------------------------------------------------------
-// XKeysSupplier
-Reference< XIndexAccess > SAL_CALL OTable::getKeys( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
-
- Reference< XIndexAccess > xKeys;
-
- try
- {
- if ( !m_pKeys )
- refreshKeys();
- xKeys = m_pKeys;
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return xKeys;
-}
-// -----------------------------------------------------------------------------
-cppu::IPropertyArrayHelper* OTable::createArrayHelper( sal_Int32 /*_nId*/ ) const
-{
- return doCreateArrayHelper();
-}
-// -------------------------------------------------------------------------
-cppu::IPropertyArrayHelper & OTable::getInfoHelper()
-{
- return *const_cast<OTable*>(this)->getArrayHelper(isNew() ? 1 : 0);
-}
-// -------------------------------------------------------------------------
-Reference< XPropertySet > SAL_CALL OTable::createDataDescriptor( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
-
- OTable* pTable = new OTable(m_pTables,isCaseSensitive(),m_Name,m_Type,m_Description,m_SchemaName,m_CatalogName);
- pTable->setNew(sal_True);
- return pTable;
-}
-// -------------------------------------------------------------------------
-// XIndexesSupplier
-Reference< XNameAccess > SAL_CALL OTable::getIndexes( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
-
- try
- {
- if ( !m_pIndexes )
- refreshIndexes();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return m_pIndexes;
-}
-// -------------------------------------------------------------------------
-// XRename
-void SAL_CALL OTable::rename( const ::rtl::OUString& newName ) throw(SQLException, ElementExistException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
-
- const ::rtl::OUString sOldComposedName = getName();
- const Reference< XDatabaseMetaData> xMetaData = getMetaData();
- if ( xMetaData.is() )
- ::dbtools::qualifiedNameComponents(xMetaData,newName,m_CatalogName,m_SchemaName,m_Name,::dbtools::eInDataManipulation);
- else
- m_Name = newName;
-
- m_pTables->renameObject(sOldComposedName,newName);
-}
-// -----------------------------------------------------------------------------
-Reference< XDatabaseMetaData> OTable::getMetaData() const
-{
- return NULL;
-}
-// -------------------------------------------------------------------------
-// XAlterTable
-void SAL_CALL OTable::alterColumnByName( const ::rtl::OUString& /*colName*/, const Reference< XPropertySet >& /*descriptor*/ ) throw(SQLException, NoSuchElementException, RuntimeException)
-{
- throwFeatureNotImplementedException( "XAlterTable::alterColumnByName", *this );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OTable::alterColumnByIndex( sal_Int32 /*index*/, const Reference< XPropertySet >& /*descriptor*/ ) throw(SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, RuntimeException)
-{
- throwFeatureNotImplementedException( "XAlterTable::alterColumnByIndex", *this );
-}
-// -------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OTable::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OTable::getName() throw(::com::sun::star::uno::RuntimeException)
-{
- // this is only correct for tables who haven't a schema or catalog name
- OSL_ENSURE(!m_CatalogName.getLength(),"getName(): forgot to overload getName()!");
- OSL_ENSURE(!m_SchemaName.getLength(),"getName(): forgot to overload getName()!");
- return m_Name;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OTable::setName( const ::rtl::OUString& /*aName*/ ) throw(::com::sun::star::uno::RuntimeException)
-{
-}
-// -----------------------------------------------------------------------------
-void OTable::refreshColumns()
-{
-}
-// -----------------------------------------------------------------------------
-void OTable::refreshKeys()
-{
-}
-// -----------------------------------------------------------------------------
-void OTable::refreshIndexes()
-{
-}
-// -----------------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/VUser.cxx b/connectivity/source/sdbcx/VUser.cxx
deleted file mode 100644
index 0724d36b98..0000000000
--- a/connectivity/source/sdbcx/VUser.cxx
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <stdio.h>
-#include "connectivity/sdbcx/VUser.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbcx/PrivilegeObject.hpp>
-#include "TConnection.hxx"
-#include "connectivity/sdbcx/VCollection.hxx"
-#include <connectivity/dbexception.hxx>
-#include <comphelper/sequence.hxx>
-
-// -------------------------------------------------------------------------
-using namespace connectivity;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-IMPLEMENT_SERVICE_INFO(OUser,"com.sun.star.sdbcx.VUser","com.sun.star.sdbcx.User");
-// -------------------------------------------------------------------------
-OUser::OUser(sal_Bool _bCase) : OUser_BASE(m_aMutex)
- , ODescriptor(OUser_BASE::rBHelper,_bCase,sal_True)
- , m_pGroups(NULL)
-{
-}
-// -------------------------------------------------------------------------
-OUser::OUser(const ::rtl::OUString& _Name,sal_Bool _bCase) : OUser_BASE(m_aMutex)
- ,ODescriptor(OUser_BASE::rBHelper,_bCase)
- ,m_pGroups(NULL)
-{
- m_Name = _Name;
-}
-// -------------------------------------------------------------------------
-OUser::~OUser( )
-{
- delete m_pGroups;
-}
-// -------------------------------------------------------------------------
-void OUser::disposing(void)
-{
- OPropertySetHelper::disposing();
- ::osl::MutexGuard aGuard(m_aMutex);
- if(m_pGroups)
- m_pGroups->disposing();
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OUser::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = ODescriptor::queryInterface( rType);
- return aRet.hasValue() ? aRet : OUser_BASE::queryInterface( rType);
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OUser::getTypes( ) throw(RuntimeException)
-{
- return ::comphelper::concatSequences(ODescriptor::getTypes(),OUser_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OUser::createArrayHelper( ) const
-{
- Sequence< Property > aProps;
- describeProperties(aProps);
- return new ::cppu::OPropertyArrayHelper(aProps);
-
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OUser::getInfoHelper()
-{
- return *const_cast<OUser*>(this)->getArrayHelper();
-}
-// -------------------------------------------------------------------------
-// XUser
-void SAL_CALL OUser::changePassword( const ::rtl::OUString& /*objPassword*/, const ::rtl::OUString& /*newPassword*/ ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedException( "XUser::changePassword", *this );
-}
-// -------------------------------------------------------------------------
-// XGroupsSupplier
-Reference< XNameAccess > SAL_CALL OUser::getGroups( ) throw(RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE::rBHelper.bDisposed);
-
- try
- {
- if ( !m_pGroups )
- refreshGroups();
- }
- catch( const RuntimeException& )
- {
- // allowed to leave this method
- throw;
- }
- catch( const Exception& )
- {
- // allowed
- }
-
- return const_cast<OUser*>(this)->m_pGroups;
-}
-// -------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-
-sal_Int32 SAL_CALL OUser::getPrivileges( const ::rtl::OUString& /*objName*/, sal_Int32 /*objType*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedException( "XAuthorizable::changePassword", *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OUser::getGrantablePrivileges( const ::rtl::OUString& /*objName*/, sal_Int32 /*objType*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedException( "XAuthorizable::getGrantablePrivileges", *this );
- return 0;
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OUser::grantPrivileges( const ::rtl::OUString& /*objName*/, sal_Int32 /*objType*/, sal_Int32 /*objPrivileges*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedException( "XAuthorizable::grantPrivileges", *this );
-}
-// -------------------------------------------------------------------------
-void SAL_CALL OUser::revokePrivileges( const ::rtl::OUString& /*objName*/, sal_Int32 /*objType*/, sal_Int32 /*objPrivileges*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OUser_BASE::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedException( "XAuthorizable::revokePrivileges", *this );
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OUser::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OUser::getName( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return m_Name;
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OUser::setName( const ::rtl::OUString& /*aName*/ ) throw(::com::sun::star::uno::RuntimeException)
-{
- OSL_FAIL( "OUser::setName: not implemented!" );
- // not allowed to throw an SQLException here ...
-}
-// -----------------------------------------------------------------------------
-// XInterface
-void SAL_CALL OUser::acquire() throw()
-{
- OUser_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OUser::release() throw()
-{
- OUser_BASE::release();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/VView.cxx b/connectivity/source/sdbcx/VView.cxx
deleted file mode 100644
index e9ffec7c92..0000000000
--- a/connectivity/source/sdbcx/VView.cxx
+++ /dev/null
@@ -1,152 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "connectivity/sdbcx/VView.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/sequence.hxx>
-#include "connectivity/dbtools.hxx"
-#include "TConnection.hxx"
-
-// -------------------------------------------------------------------------
-using namespace connectivity;
-using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-IMPLEMENT_SERVICE_INFO(OView,"com.sun.star.sdbcx.VView","com.sun.star.sdbcx.View");
-// -------------------------------------------------------------------------
-OView::OView(sal_Bool _bCase,
- const ::rtl::OUString& _Name,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData,
- sal_Int32 _CheckOption,
- const ::rtl::OUString& _Command,
- const ::rtl::OUString& _SchemaName,
- const ::rtl::OUString& _CatalogName) : ODescriptor(::comphelper::OMutexAndBroadcastHelper::m_aBHelper,_bCase)
- ,m_CatalogName(_CatalogName)
- ,m_SchemaName(_SchemaName)
- ,m_Command(_Command)
- ,m_CheckOption(_CheckOption)
- ,m_xMetaData(_xMetaData)
-
-{
- m_Name = _Name;
- construct();
-}
-// -------------------------------------------------------------------------
-OView::OView(sal_Bool _bCase,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData)
- : ODescriptor(::comphelper::OMutexAndBroadcastHelper::m_aBHelper,_bCase,sal_True)
- ,m_xMetaData(_xMetaData)
-{
- construct();
-}
-// -------------------------------------------------------------------------
-OView::~OView()
-{
-}
-// -------------------------------------------------------------------------
-void OView::construct()
-{
- ODescriptor::construct();
-
- sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY;
-
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_CATALOGNAME), PROPERTY_ID_CATALOGNAME,nAttrib,&m_CatalogName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCHEMANAME), PROPERTY_ID_SCHEMANAME, nAttrib,&m_SchemaName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_COMMAND), PROPERTY_ID_COMMAND, nAttrib,&m_Command, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_CHECKOPTION), PROPERTY_ID_CHECKOPTION,nAttrib,&m_CheckOption, ::getCppuType(reinterpret_cast< sal_Int32*>(NULL)));
-}
-// -------------------------------------------------------------------------
-void OView::disposing(void)
-{
- OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
-}
-// -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OView::getTypes( ) throw(RuntimeException)
-{
- return ::comphelper::concatSequences(ODescriptor::getTypes(),OView_BASE::getTypes());
-}
-// -------------------------------------------------------------------------
-Any SAL_CALL OView::queryInterface( const Type & rType ) throw(RuntimeException)
-{
- Any aRet = OView_BASE::queryInterface( rType);
- return aRet.hasValue() ? aRet : ODescriptor::queryInterface( rType);
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OView::createArrayHelper( sal_Int32 /*_nId*/ ) const
-{
- return doCreateArrayHelper();
-}
-// -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OView::getInfoHelper()
-{
- return *const_cast<OView*>(this)->getArrayHelper(isNew() ? 1 : 0);
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OView::getName() throw(::com::sun::star::uno::RuntimeException)
-{
- ::rtl::OUString sComposedName;
- if(m_xMetaData.is())
- sComposedName = ::dbtools::composeTableName( m_xMetaData, m_CatalogName, m_SchemaName, m_Name, sal_False, ::dbtools::eInDataManipulation );
- else
- {
- Any aValue;
- getFastPropertyValue(aValue,PROPERTY_ID_NAME);
- aValue >>= sComposedName;
- }
- return sComposedName;
-}
-// -----------------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OView::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OView::setName( const ::rtl::OUString& ) throw(::com::sun::star::uno::RuntimeException)
-{
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OView::acquire() throw()
-{
- OView_BASE::acquire();
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL OView::release() throw()
-{
- OView_BASE::release();
-}
-// -----------------------------------------------------------------------------
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/sdbcx/makefile.mk b/connectivity/source/sdbcx/makefile.mk
deleted file mode 100755
index c036e83db5..0000000000
--- a/connectivity/source/sdbcx/makefile.mk
+++ /dev/null
@@ -1,63 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=..
-PRJNAME=connectivity
-TARGET=sdbcx
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/dbtools.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/VDescriptor.obj \
- $(SLO)$/VCollection.obj \
- $(SLO)$/VColumn.obj \
- $(SLO)$/VIndexColumn.obj \
- $(SLO)$/VKeyColumn.obj \
- $(SLO)$/VUser.obj \
- $(SLO)$/VGroup.obj \
- $(SLO)$/VTable.obj \
- $(SLO)$/VKey.obj \
- $(SLO)$/VIndex.obj \
- $(SLO)$/VCatalog.obj \
- $(SLO)$/VView.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
-
diff --git a/connectivity/source/simpledbt/charset_s.cxx b/connectivity/source/simpledbt/charset_s.cxx
deleted file mode 100644
index c428fbb9db..0000000000
--- a/connectivity/source/simpledbt/charset_s.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "charset_s.hxx"
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- using namespace ::dbtools;
-
- //====================================================================
- //= ODataAccessCharSet
- //====================================================================
- //----------------------------------------------------------------
- oslInterlockedCount SAL_CALL ODataAccessCharSet::acquire()
- {
- return ORefBase::acquire();
- }
-
- //----------------------------------------------------------------
- oslInterlockedCount SAL_CALL ODataAccessCharSet::release()
- {
- return ORefBase::release();
- }
-
- //--------------------------------------------------------------------
- sal_Int32 ODataAccessCharSet::getSupportedTextEncodings( ::std::vector< rtl_TextEncoding >& _rEncs ) const
- {
- _rEncs.clear();
-
- OCharsetMap::const_iterator aLoop = m_aCharsetInfo.begin();
- OCharsetMap::const_iterator aLoopEnd = m_aCharsetInfo.end();
- while (aLoop != aLoopEnd)
- {
- _rEncs.push_back( (*aLoop).getEncoding() );
- ++aLoop;
- }
-
- return _rEncs.size();
- }
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/simpledbt/charset_s.hxx b/connectivity/source/simpledbt/charset_s.hxx
deleted file mode 100644
index ee243f116a..0000000000
--- a/connectivity/source/simpledbt/charset_s.hxx
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_DBTOOLS_CHARSET_S_HXX
-#define CONNECTIVITY_DBTOOLS_CHARSET_S_HXX
-
-#include <connectivity/virtualdbtools.hxx>
-#include "refbase.hxx"
-#include <connectivity/dbcharset.hxx>
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- //====================================================================
- //= ODataAccessCharSet
- //====================================================================
- class ODataAccessCharSet
- :public simple::IDataAccessCharSet
- ,public ORefBase
- {
- protected:
- ::dbtools::OCharsetMap m_aCharsetInfo;
-
- public:
- ODataAccessCharSet() { }
-
- // IDataAccessCharSet
- sal_Int32 getSupportedTextEncodings(
- ::std::vector< rtl_TextEncoding >& /* [out] */ _rEncs
- ) const;
-
- // disambiguate IReference
- virtual oslInterlockedCount SAL_CALL acquire();
- virtual oslInterlockedCount SAL_CALL release();
- };
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-#endif // CONNECTIVITY_DBTOOLS_CHARSET_S_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/simpledbt/dbtfactory.cxx b/connectivity/source/simpledbt/dbtfactory.cxx
deleted file mode 100644
index bbf11f8dd0..0000000000
--- a/connectivity/source/simpledbt/dbtfactory.cxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include <connectivity/virtualdbtools.hxx>
-#include <connectivity/formattedcolumnvalue.hxx>
-#include "dbtfactory.hxx"
-#include "parser_s.hxx"
-#include "staticdbtools_s.hxx"
-#include "charset_s.hxx"
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-
-//================================================================
-// the entry point for load-on-call usage of the DBTOOLS lib
-extern "C" void* SAL_CALL createDataAccessToolsFactory()
-{
- ::connectivity::ODataAccessToolsFactory* pFactory = new ::connectivity::ODataAccessToolsFactory;
- pFactory->acquire();
- return pFactory;
-}
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- //================================================================
- //= ODataAccessToolsFactory
- //================================================================
- //----------------------------------------------------------------
- ODataAccessToolsFactory::ODataAccessToolsFactory()
- {
- ODataAccessStaticTools* pStaticTools = new ODataAccessStaticTools;
- m_xTypeConversionHelper = pStaticTools;
- m_xToolsHelper = pStaticTools;
- }
-
- //----------------------------------------------------------------
- oslInterlockedCount SAL_CALL ODataAccessToolsFactory::acquire()
- {
- return ORefBase::acquire();
- }
-
- //----------------------------------------------------------------
- oslInterlockedCount SAL_CALL ODataAccessToolsFactory::release()
- {
- return ORefBase::release();
- }
-
- //----------------------------------------------------------------
- ::rtl::Reference< simple::IDataAccessTypeConversion > ODataAccessToolsFactory::getTypeConversionHelper()
- {
- return m_xTypeConversionHelper;
- }
-
- //----------------------------------------------------------------
- ::rtl::Reference< simple::IDataAccessCharSet > ODataAccessToolsFactory::createCharsetHelper( ) const
- {
- return new ODataAccessCharSet;
- }
-
- //----------------------------------------------------------------
- ::rtl::Reference< simple::IDataAccessTools > ODataAccessToolsFactory::getDataAccessTools()
- {
- return m_xToolsHelper;
- }
-
- //----------------------------------------------------------------
- ::std::auto_ptr< ::dbtools::FormattedColumnValue > ODataAccessToolsFactory::createFormattedColumnValue( const ::comphelper::ComponentContext& _rContext,
- const Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet, const Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn )
- {
- ::std::auto_ptr< ::dbtools::FormattedColumnValue > pValue( new ::dbtools::FormattedColumnValue( _rContext, _rxRowSet, _rxColumn ) );
- return pValue;
- }
-
- //----------------------------------------------------------------
- ::rtl::Reference< simple::ISQLParser > ODataAccessToolsFactory::createSQLParser(const Reference< XMultiServiceFactory >& _rxServiceFactory,const IParseContext* _pContext) const
- {
- return new OSimpleSQLParser(_rxServiceFactory,_pContext);
- }
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/simpledbt/dbtfactory.hxx b/connectivity/source/simpledbt/dbtfactory.hxx
deleted file mode 100644
index 1f49192a52..0000000000
--- a/connectivity/source/simpledbt/dbtfactory.hxx
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_DBTOOLS_DBTFACTORY_HXX
-#define CONNECTIVITY_DBTOOLS_DBTFACTORY_HXX
-
-#include <connectivity/virtualdbtools.hxx>
-#include "refbase.hxx"
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- //================================================================
- //= ODataAccessToolsFactory
- //================================================================
- class ODataAccessToolsFactory
- :public simple::IDataAccessToolsFactory
- ,public ORefBase
- {
- protected:
- ::rtl::Reference< simple::IDataAccessTypeConversion > m_xTypeConversionHelper;
- ::rtl::Reference< simple::IDataAccessTools > m_xToolsHelper;
-
- public:
- ODataAccessToolsFactory();
-
- // IDataAccessToolsFactory
- virtual ::rtl::Reference< simple::ISQLParser > createSQLParser(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceFactory,
- const IParseContext* _pContext
- ) const;
-
- virtual ::rtl::Reference< simple::IDataAccessCharSet > createCharsetHelper( ) const;
-
- virtual ::rtl::Reference< simple::IDataAccessTypeConversion > getTypeConversionHelper();
-
- virtual ::rtl::Reference< simple::IDataAccessTools > getDataAccessTools();
-
- virtual ::std::auto_ptr< ::dbtools::FormattedColumnValue > createFormattedColumnValue(
- const ::comphelper::ComponentContext& _rContext,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn
- );
-
- // IReference
- virtual oslInterlockedCount SAL_CALL acquire();
- virtual oslInterlockedCount SAL_CALL release();
- };
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-#endif // CONNECTIVITY_DBTOOLS_DBTFACTORY_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/simpledbt/makefile.mk b/connectivity/source/simpledbt/makefile.mk
deleted file mode 100755
index 96bce967d3..0000000000
--- a/connectivity/source/simpledbt/makefile.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=connectivity
-TARGET=simpledbt
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/dbtools.pmk
-
-# --- Files --------------------------------------------------------
-
-EXCEPTIONSFILES=\
- $(SLO)$/charset_s.obj \
- $(SLO)$/dbtfactory.obj \
- $(SLO)$/parsenode_s.obj \
- $(SLO)$/parser_s.obj \
- $(SLO)$/staticdbtools_s.obj
-
-SLOFILES=\
- $(EXCEPTIONSFILES) \
- $(SLO)$/refbase.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-
diff --git a/connectivity/source/simpledbt/parsenode_s.cxx b/connectivity/source/simpledbt/parsenode_s.cxx
deleted file mode 100644
index ba73172ad1..0000000000
--- a/connectivity/source/simpledbt/parsenode_s.cxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <connectivity/virtualdbtools.hxx>
-#include "parsenode_s.hxx"
-#include <connectivity/sqlnode.hxx>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sdbc;
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- //================================================================
- //= OSimpleParseNode
- //================================================================
- //----------------------------------------------------------------
- OSimpleParseNode::OSimpleParseNode(const OSQLParseNode* _pNode, sal_Bool _bTakeOwnership)
- :m_pFullNode(_pNode)
- ,m_bOwner(_bTakeOwnership)
- {
- OSL_ENSURE(m_pFullNode, "OSimpleParseNode::OSimpleParseNode: invalid node given!");
- }
-
- //----------------------------------------------------------------
- OSimpleParseNode::~OSimpleParseNode()
- {
- if (m_bOwner)
- delete m_pFullNode;
- }
-
- //----------------------------------------------------------------
- oslInterlockedCount SAL_CALL OSimpleParseNode::acquire()
- {
- return ORefBase::acquire();
- }
-
- //----------------------------------------------------------------
- oslInterlockedCount SAL_CALL OSimpleParseNode::release()
- {
- return ORefBase::release();
- }
-
- //----------------------------------------------------------------
- void OSimpleParseNode::parseNodeToStr(::rtl::OUString& _rString, const Reference< XConnection >& _rxConnection,const IParseContext* _pContext) const
- {
- m_pFullNode->parseNodeToStr( _rString, _rxConnection, _pContext );
- }
-
- //----------------------------------------------------------------
- void OSimpleParseNode::parseNodeToPredicateStr(::rtl::OUString& _rString, const Reference< XConnection >& _rxConnection,
- const Reference< XNumberFormatter >& _rxFormatter, const Reference< XPropertySet >& _rxField,
- const Locale& _rIntl, const sal_Char _cDecSeparator,const IParseContext* _pContext) const
- {
- m_pFullNode->parseNodeToPredicateStr( _rString, _rxConnection, _rxFormatter, _rxField, _rIntl, _cDecSeparator, _pContext );
- }
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/simpledbt/parsenode_s.hxx b/connectivity/source/simpledbt/parsenode_s.hxx
deleted file mode 100644
index a72244a8d5..0000000000
--- a/connectivity/source/simpledbt/parsenode_s.hxx
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_PARSENODE_SIMPLE_HXX
-#define CONNECTIVITY_PARSENODE_SIMPLE_HXX
-
-#include <connectivity/virtualdbtools.hxx>
-#include "refbase.hxx"
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- class OSQLParseNode;
- //================================================================
- //= OSimpleParseNode
- //================================================================
- class OSimpleParseNode
- :public simple::ISQLParseNode
- ,public ORefBase
- {
- protected:
- const OSQLParseNode* m_pFullNode;
- sal_Bool m_bOwner;
-
- public:
- OSimpleParseNode(const OSQLParseNode* _pNode, sal_Bool _bTakeOwnership = sal_True);
- ~OSimpleParseNode();
-
- // ISQLParseNode
- virtual void parseNodeToStr(::rtl::OUString& _rString,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
- const IParseContext* _pContext
- ) const;
-
- virtual void parseNodeToPredicateStr(::rtl::OUString& _rString,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField,
- const ::com::sun::star::lang::Locale& _rIntl,
- const sal_Char _cDecSeparator,
- const IParseContext* _pContext
- ) const;
-
- // disambiguate IReference
- virtual oslInterlockedCount SAL_CALL acquire();
- virtual oslInterlockedCount SAL_CALL release();
- };
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-#endif // CONNECTIVITY_PARSENODE_SIMPLE_HXX
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/simpledbt/parser_s.cxx b/connectivity/source/simpledbt/parser_s.cxx
deleted file mode 100644
index f722e8d775..0000000000
--- a/connectivity/source/simpledbt/parser_s.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <connectivity/virtualdbtools.hxx>
-#include "parser_s.hxx"
-#include "parsenode_s.hxx"
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- //================================================================
- //= OSimpleSQLParser
- //================================================================
- //----------------------------------------------------------------
- OSimpleSQLParser::OSimpleSQLParser(const Reference< XMultiServiceFactory >& _rxServiceFactory,const IParseContext* _pContext)
- :m_aFullParser(_rxServiceFactory,_pContext)
- {
- }
-
- //----------------------------------------------------------------
- oslInterlockedCount SAL_CALL OSimpleSQLParser::acquire()
- {
- return ORefBase::acquire();
- }
-
- //----------------------------------------------------------------
- oslInterlockedCount SAL_CALL OSimpleSQLParser::release()
- {
- return ORefBase::release();
- }
-
- //----------------------------------------------------------------
- const IParseContext& OSimpleSQLParser::getContext() const
- {
- return m_aFullParser.getContext();
- }
-
- //----------------------------------------------------------------
- ::rtl::Reference< simple::ISQLParseNode > OSimpleSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const ::rtl::OUString& rStatement,
- const Reference< XNumberFormatter >& _rxFormatter, const Reference< XPropertySet >& _rxField) const
- {
- OSimpleParseNode* pReturn = NULL;
- OSQLParseNode* pFullNode = const_cast<OSimpleSQLParser*>(this)->m_aFullParser.predicateTree(rErrorMessage, rStatement, _rxFormatter, _rxField);
- if (pFullNode)
- pReturn = new OSimpleParseNode(pFullNode, sal_True);
- return pReturn;
- }
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/simpledbt/parser_s.hxx b/connectivity/source/simpledbt/parser_s.hxx
deleted file mode 100644
index d5edd28ddf..0000000000
--- a/connectivity/source/simpledbt/parser_s.hxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_DBTOOLS_PARSER_SIMPLE_HXX
-#define CONNECTIVITY_DBTOOLS_PARSER_SIMPLE_HXX
-
-#include <connectivity/virtualdbtools.hxx>
-#include "refbase.hxx"
-#include <connectivity/sqlparse.hxx>
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- //================================================================
- //= OSimpleSQLParser
- //================================================================
- class OSimpleSQLParser
- :public simple::ISQLParser
- ,public ORefBase
- {
- protected:
- OSQLParser m_aFullParser;
-
- public:
- OSimpleSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceFactory,const IParseContext* _pContext);
-
- // ISQLParser
- virtual ::rtl::Reference< simple::ISQLParseNode > predicateTree(
- ::rtl::OUString& rErrorMessage,
- const ::rtl::OUString& rStatement,
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField
- ) const;
-
- virtual const IParseContext& getContext() const;
-
- // disambiguate IReference
- virtual oslInterlockedCount SAL_CALL acquire();
- virtual oslInterlockedCount SAL_CALL release();
- };
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-#endif // CONNECTIVITY_DBTOOLS_PARSER_SIMPLE_HXX
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/simpledbt/refbase.cxx b/connectivity/source/simpledbt/refbase.cxx
deleted file mode 100644
index 6bb2a5bae2..0000000000
--- a/connectivity/source/simpledbt/refbase.cxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "refbase.hxx"
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- //================================================================
- //= ORefBase
- //================================================================
- //----------------------------------------------------------------
- ORefBase::~ORefBase()
- {
- }
-
- //----------------------------------------------------------------
- oslInterlockedCount SAL_CALL ORefBase::acquire()
- {
- return osl_incrementInterlockedCount(&m_refCount);
- }
-
- //----------------------------------------------------------------
- oslInterlockedCount SAL_CALL ORefBase::release()
- {
- oslInterlockedCount nNewRefCount = osl_decrementInterlockedCount(&m_refCount);
- if (0 == nNewRefCount)
- delete this;
-
- return nNewRefCount;
- }
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/simpledbt/refbase.hxx b/connectivity/source/simpledbt/refbase.hxx
deleted file mode 100644
index 41b937c5a5..0000000000
--- a/connectivity/source/simpledbt/refbase.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_DBTOOLS_REFBASE_HXX
-#define CONNECTIVITY_DBTOOLS_REFBASE_HXX
-
-#include <rtl/ref.hxx>
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- //================================================================
- //= ORefBase
- //================================================================
- /// base class for all objects implementing the ::rtl::IReference interface
- class ORefBase : public ::rtl::IReference
- {
- protected:
- oslInterlockedCount m_refCount;
-
- protected:
- ORefBase() : m_refCount(0) { }
- virtual ~ORefBase();
-
- virtual oslInterlockedCount SAL_CALL acquire();
- virtual oslInterlockedCount SAL_CALL release();
- };
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-#endif // CONNECTIVITY_DBTOOLS_REFBASE_HXX
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/simpledbt/staticdbtools_s.cxx b/connectivity/source/simpledbt/staticdbtools_s.cxx
deleted file mode 100644
index fae81d824e..0000000000
--- a/connectivity/source/simpledbt/staticdbtools_s.cxx
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include <connectivity/virtualdbtools.hxx>
-#include "staticdbtools_s.hxx"
-#include "connectivity/dbconversion.hxx"
-#include <connectivity/dbtools.hxx>
-#include <com/sun/star/sdb/SQLContext.hpp>
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- using namespace ::com::sun::star::util;
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::sdb;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::sdbc;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::container;
-
- //================================================================
- //= ODataAccessStaticTools
- //================================================================
- //----------------------------------------------------------------
- ODataAccessStaticTools::ODataAccessStaticTools()
- {
- }
-
- //----------------------------------------------------------------
- Date ODataAccessStaticTools::getStandardDate() const
- {
- return ::dbtools::DBTypeConversion::getStandardDate();
- }
-
- //----------------------------------------------------------------
- double ODataAccessStaticTools::getValue(const Reference< XColumn>& _rxVariant, const Date& rNullDate ) const
- {
- return ::dbtools::DBTypeConversion::getValue( _rxVariant, rNullDate );
- }
-
- //----------------------------------------------------------------
- ::rtl::OUString ODataAccessStaticTools::getFormattedValue(const Reference< XColumn >& _rxColumn, const Reference< XNumberFormatter >& _rxFormatter,
- const Date& _rNullDate, sal_Int32 _nKey, sal_Int16 _nKeyType) const
- {
- return ::dbtools::DBTypeConversion::getFormattedValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType);
- }
-
- //----------------------------------------------------------------
- ::rtl::OUString ODataAccessStaticTools::getFormattedValue( const Reference< XPropertySet>& _rxColumn, const Reference< XNumberFormatter>& _rxFormatter,
- const Locale& _rLocale, const Date& _rNullDate ) const
- {
- return ::dbtools::DBTypeConversion::getFormattedValue( _rxColumn, _rxFormatter, _rLocale, _rNullDate );
- }
-
- //----------------------------------------------------------------
- oslInterlockedCount SAL_CALL ODataAccessStaticTools::acquire()
- {
- return ORefBase::acquire();
- }
-
- //----------------------------------------------------------------
- oslInterlockedCount SAL_CALL ODataAccessStaticTools::release()
- {
- return ORefBase::release();
- }
-
- //----------------------------------------------------------------
- Reference< XConnection> ODataAccessStaticTools::getConnection_withFeedback(const ::rtl::OUString& _rDataSourceName, const ::rtl::OUString& _rUser,
- const ::rtl::OUString& _rPwd, const Reference< XMultiServiceFactory>& _rxFactory) const SAL_THROW ( (SQLException) )
- {
- return ::dbtools::getConnection_withFeedback(_rDataSourceName, _rUser, _rPwd, _rxFactory);
- }
-
- //----------------------------------------------------------------
- Reference< XConnection> ODataAccessStaticTools::connectRowset(const Reference< XRowSet>& _rxRowSet, const Reference< XMultiServiceFactory>& _rxFactory, sal_Bool _bSetAsActiveConnection) const
- SAL_THROW ( (SQLException, WrappedTargetException, RuntimeException) )
- {
- return ::dbtools::connectRowset( _rxRowSet, _rxFactory, _bSetAsActiveConnection);
- }
-
- // ------------------------------------------------
- Reference< XConnection> ODataAccessStaticTools::getRowSetConnection(
- const Reference< XRowSet>& _rxRowSet)
- const SAL_THROW ( (RuntimeException) )
- {
- return ::dbtools::getConnection(_rxRowSet);
- }
-
- //----------------------------------------------------------------
- Reference< XNumberFormatsSupplier> ODataAccessStaticTools::getNumberFormats(const Reference< XConnection>& _rxConn, sal_Bool _bAllowDefault) const
- {
- return ::dbtools::getNumberFormats(_rxConn, _bAllowDefault);
- }
-
- //----------------------------------------------------------------
- sal_Int32 ODataAccessStaticTools::getDefaultNumberFormat( const Reference< XPropertySet >& _rxColumn, const Reference< XNumberFormatTypes >& _rxTypes,
- const Locale& _rLocale ) const
- {
- return ::dbtools::getDefaultNumberFormat( _rxColumn, _rxTypes, _rLocale );
- }
-
- //----------------------------------------------------------------
- void ODataAccessStaticTools::TransferFormComponentProperties(const Reference< XPropertySet>& _rxOld, const Reference< XPropertySet>& _rxNew, const Locale& _rLocale) const
- {
- ::dbtools::TransferFormComponentProperties(_rxOld, _rxNew, _rLocale);
- }
-
- //----------------------------------------------------------------
- ::rtl::OUString ODataAccessStaticTools::quoteName(const ::rtl::OUString& _rQuote, const ::rtl::OUString& _rName) const
- {
- return ::dbtools::quoteName(_rQuote, _rName);
- }
-
- //----------------------------------------------------------------
- ::rtl::OUString ODataAccessStaticTools::composeTableNameForSelect( const Reference< XConnection >& _rxConnection, const ::rtl::OUString& _rCatalog, const ::rtl::OUString& _rSchema, const ::rtl::OUString& _rName ) const
- {
- return ::dbtools::composeTableNameForSelect( _rxConnection, _rCatalog, _rSchema, _rName );
- }
-
- //----------------------------------------------------------------
- ::rtl::OUString ODataAccessStaticTools::composeTableNameForSelect( const Reference< XConnection >& _rxConnection, const Reference< XPropertySet>& _xTable ) const
- {
- return ::dbtools::composeTableNameForSelect( _rxConnection, _xTable );
- }
-
- //----------------------------------------------------------------
- SQLContext ODataAccessStaticTools::prependContextInfo(SQLException& _rException, const Reference< XInterface >& _rxContext,
- const ::rtl::OUString& _rContextDescription, const ::rtl::OUString& _rContextDetails) const
- {
- return ::dbtools::prependContextInfo(_rException, _rxContext, _rContextDescription, _rContextDetails);
- }
-
- //----------------------------------------------------------------
- Reference< XDataSource > ODataAccessStaticTools::getDataSource( const ::rtl::OUString& _rsRegisteredName, const Reference< XMultiServiceFactory>& _rxFactory ) const
- {
- return ::dbtools::getDataSource( _rsRegisteredName, _rxFactory );
- }
-
- //----------------------------------------------------------------
- sal_Bool ODataAccessStaticTools::canInsert(const Reference< XPropertySet>& _rxCursorSet) const
- {
- return ::dbtools::canInsert( _rxCursorSet );
- }
-
- //----------------------------------------------------------------
- sal_Bool ODataAccessStaticTools::canUpdate(const Reference< XPropertySet>& _rxCursorSet) const
- {
- return ::dbtools::canUpdate( _rxCursorSet );
- }
-
- //----------------------------------------------------------------
- sal_Bool ODataAccessStaticTools::canDelete(const Reference< XPropertySet>& _rxCursorSet) const
- {
- return ::dbtools::canDelete( _rxCursorSet );
- }
-
- //----------------------------------------------------------------
- Reference< XNameAccess > ODataAccessStaticTools::getFieldsByCommandDescriptor( const Reference< XConnection >& _rxConnection,
- const sal_Int32 _nCommandType, const ::rtl::OUString& _rCommand,
- Reference< XComponent >& _rxKeepFieldsAlive, ::dbtools::SQLExceptionInfo* _pErrorInfo ) SAL_THROW( ( ) )
- {
- return ::dbtools::getFieldsByCommandDescriptor( _rxConnection, _nCommandType, _rCommand,
- _rxKeepFieldsAlive, _pErrorInfo );
- }
-
- //----------------------------------------------------------------
- Sequence< ::rtl::OUString > ODataAccessStaticTools::getFieldNamesByCommandDescriptor(
- const Reference< XConnection >& _rxConnection, const sal_Int32 _nCommandType,
- const ::rtl::OUString& _rCommand, ::dbtools::SQLExceptionInfo* _pErrorInfo ) SAL_THROW( ( ) )
- {
- return ::dbtools::getFieldNamesByCommandDescriptor( _rxConnection, _nCommandType,
- _rCommand, _pErrorInfo );
- }
-
- // ------------------------------------------------
- bool ODataAccessStaticTools::isEmbeddedInDatabase( const Reference< XInterface >& _rxComponent, Reference< XConnection >& _rxActualConnection )
- {
- return ::dbtools::isEmbeddedInDatabase( _rxComponent, _rxActualConnection );
- }
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/simpledbt/staticdbtools_s.hxx b/connectivity/source/simpledbt/staticdbtools_s.hxx
deleted file mode 100644
index 7949312fcf..0000000000
--- a/connectivity/source/simpledbt/staticdbtools_s.hxx
+++ /dev/null
@@ -1,208 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_STATIC_DBTOOLS_SIMPLE_HXX
-#define CONNECTIVITY_STATIC_DBTOOLS_SIMPLE_HXX
-
-#include <connectivity/virtualdbtools.hxx>
-#include "refbase.hxx"
-
-//........................................................................
-namespace connectivity
-{
-//........................................................................
-
- //================================================================
- //= ODataAccessStaticTools
- //================================================================
- class ODataAccessStaticTools
- :public simple::IDataAccessTypeConversion
- ,public simple::IDataAccessTools
- ,public ORefBase
- {
- public:
- ODataAccessStaticTools();
-
- // IDataAccessTypeConversion
- // ------------------------------------------------
- virtual ::com::sun::star::util::Date getStandardDate() const;
-
- // ------------------------------------------------
- virtual double getValue(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _rxVariant,
- const ::com::sun::star::util::Date& rNullDate ) const;
-
- // ------------------------------------------------
- virtual ::rtl::OUString getFormattedValue(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn,
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter,
- const ::com::sun::star::util::Date& _rNullDate,
- sal_Int32 _nKey,
- sal_Int16 _nKeyType) const;
-
- // ------------------------------------------------
- virtual ::rtl::OUString getFormattedValue(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn,
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& _rxFormatter,
- const ::com::sun::star::lang::Locale& _rLocale,
- const ::com::sun::star::util::Date& _rNullDate
- ) const;
-
- // IDataAccessTools
- // ------------------------------------------------
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection_withFeedback(
- const ::rtl::OUString& _rDataSourceName,
- const ::rtl::OUString& _rUser,
- const ::rtl::OUString& _rPwd,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory
- ) const SAL_THROW ( (::com::sun::star::sdbc::SQLException) );
-
- // ------------------------------------------------
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> connectRowset(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory,
- sal_Bool _bSetAsActiveConnection
- ) const SAL_THROW ( ( ::com::sun::star::sdbc::SQLException
- , ::com::sun::star::lang::WrappedTargetException
- , ::com::sun::star::uno::RuntimeException ) );
-
- // ------------------------------------------------
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getRowSetConnection(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet)
- const SAL_THROW ( (::com::sun::star::uno::RuntimeException) );
-
- // ------------------------------------------------
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> getNumberFormats(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConn,
- sal_Bool _bAllowDefault
- ) const;
-
- // ------------------------------------------------
- virtual sal_Int32 getDefaultNumberFormat(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn,
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes >& _rxTypes,
- const ::com::sun::star::lang::Locale& _rLocale
- ) const;
-
- // ------------------------------------------------
- virtual void TransferFormComponentProperties(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxOld,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxNew,
- const ::com::sun::star::lang::Locale& _rLocale
- ) const;
-
- // ------------------------------------------------
- virtual ::rtl::OUString quoteName(
- const ::rtl::OUString& _rQuote,
- const ::rtl::OUString& _rName
- ) const;
-
- // ------------------------------------------------
- virtual ::rtl::OUString composeTableNameForSelect(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
- const ::rtl::OUString& _rCatalog,
- const ::rtl::OUString& _rSchema,
- const ::rtl::OUString& _rName
- ) const;
-
- // ------------------------------------------------
- virtual ::rtl::OUString composeTableNameForSelect(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable
- ) const;
-
- // ------------------------------------------------
- virtual ::com::sun::star::sdb::SQLContext prependContextInfo(
- ::com::sun::star::sdbc::SQLException& _rException,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
- const ::rtl::OUString& _rContextDescription,
- const ::rtl::OUString& _rContextDetails
- ) const;
-
- // ------------------------------------------------
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > getDataSource(
- const ::rtl::OUString& _rsRegisteredName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory
- ) const;
-
- // ------------------------------------------------
- /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::INSERT
- @param _rxCursorSet the property set
- */
- virtual sal_Bool canInsert(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const;
-
- // ------------------------------------------------
- /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::UPDATE
- @param _rxCursorSet the property set
- */
- virtual sal_Bool canUpdate(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const;
-
- // ------------------------------------------------
- /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::DELETE
- @param _rxCursorSet the property set
- */
- virtual sal_Bool canDelete(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const;
-
- // ------------------------------------------------
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
- getFieldsByCommandDescriptor(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
- const sal_Int32 _nCommandType,
- const ::rtl::OUString& _rCommand,
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxKeepFieldsAlive,
- ::dbtools::SQLExceptionInfo* _pErrorInfo = NULL
- ) SAL_THROW( ( ) );
-
- // ------------------------------------------------
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
- getFieldNamesByCommandDescriptor(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
- const sal_Int32 _nCommandType,
- const ::rtl::OUString& _rCommand,
- ::dbtools::SQLExceptionInfo* _pErrorInfo = NULL
- ) SAL_THROW( ( ) );
-
- // ------------------------------------------------
- virtual bool isEmbeddedInDatabase(
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent,
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxActualConnection
- );
-
- // disambiguate IReference
- // ------------------------------------------------
- virtual oslInterlockedCount SAL_CALL acquire();
- virtual oslInterlockedCount SAL_CALL release();
- };
-
-//........................................................................
-} // namespace connectivity
-//........................................................................
-
-#endif // CONNECTIVITY_STATIC_DBTOOLS_SIMPLE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */